admin August 3rd, 2008

Well, I’m a Distro crazy… my mind always keeps thinking of trying new distros especially those which has some distinguishing feature. This craziness or the interest to put it in a formal way, resulted in me trying various Linux distributions, major being Debian, Ubuntu, Fedora, SuSe, Mandrake (now Mandriva), Crux, ForeSight Linux, PCLinux OS, and my own customized version of Crux (which I experimented for sometime and called it unofficially as Prodix :-)). I can’t remember few other distros which I must have tried since, my inception in to the Linux world from 2001. Of course, I even tried FreeBSD, and its variants for short period.
The major difference I found among these distributions is the package management system provided with them. Personally I was not very happy with YUM until rpm based distros started using apt. SuSE’s YasT is good so is Mandrake’s urpmi. The Conary package management system from rPath which is being used in ForeSight Linux is definitely worth giving a try because of its radical package management approach and using PackageKit as the default front-end to add/remove packages. But, personally APT still stood out for me, reason being several.
1. Debian and its derived Distros are my longest used ones so far and APT always was a boon.
2. It made me not care for dependency tracking while installing a package.
3. The number of packages it provides in its repositories is really large to cater to various needs.
I was using Ubuntu since, Breezy release. There is no complain about it at least from my side since, it worked just fine for me including its LiveCDs. But, this weekend I had a strong feeling to try the good old Debian again and I never waited. I downloaded the Lenny net-install CDs and booted the system. Though I could boot the system, it could not detect my ATAPI DVD/RW from LiteOn!!! I even tried downloading and trying with various builds of net-install CDs but unfortunately, none of them could able to detect my DVD/RW drive:-(
I was bit disappointed at this time.. but suddenly an idea flashed in my mind… hurry I can try the longer route. The route is none other than downloading a Debian LiveCD image, booting the system with it and then bootstrapping the system with debootstrap. Cool isn’t it!! well… may not be really cool for a newbie.
Following are the steps I followed to get a Debian system out of a minimal (non-GUI version) Debian LiveCD. Of course, you should have a working internet connection.
1. Download Debian LiveCD image from http://live.debian.net/cdimage/lenny-builds/current/i386/debian-live-lenny-i386-standard.iso
2. Burn the image on to a CD. You may even use a Business card sized CD since, the image is just ~123MB!
3. Boot the system with this CD. My system booted properly and put me into a shell, with auto-login. User name being ‘user’. This user will have sudo permissions. You know what I said right:-)
4. Now I did ‘sudo bash‘ to get in as root.
5. I used cfdisk command to partition my hard-drive and mounted the root filesystem into /mnt. You may have to mount additional partitions as sub-directories inside /mnt. For example, if you have a separate /home you should mount that partitioned drive into /mnt/home after creating /mnt/home directory.
6. Then, I used ‘debootstrap lenny /mnt‘ to bootstrap the minimal Debian Lenny flavour into my root filesystem.
7. It took sometime to download and strip the minimal package set into my root filesystem.
8. Then, I mounted dev, proc, sys filesystems and did chmod into /mnt
mount -t proc proc /mnt/proc;
mount –bind /sys /mnt/sys;
mount –bind /dev /mnt/dev;
chroot /mnt
9. Then, you need to install grub, the linux kernel and upgrade the entire system using apt-get commands.
apt-get update;
apt-get install grub linux-image-i686;
apt-get -f dist-upgrade;
dpkg –configure -a
10. Finally, edit the files /boot/grub/menu.lst, /etc/fstab, /etc/resolv.conf and put proper entries as needed.
11. Remember to run grub-install to install grub boot-loader in MBR (Master Boot Record). You may have to manually enter root filesystem mount details in /etc/mtab in order for grub-install to work correctly. For example, make sure you have something like ‘/dev/sda2 / ext3 defaults 0 0′ as an entry in /etc/mtab.
12. That’s about it.. now you exit from chroot environment unmount proc, sys, dev filesystems under /mnt and reboot the system. Take the LiveCD out of the drive and the system should boot to your new Debian installation:-)
Then, you can start tweaking other things like /etc/apt/sources.list as needed and install Desktop environment of choice and so on. Anyway, I’m happy that my good old Debian is back with testing branch, with full action!!