This How To will show how you can install Debian Etch and basically any Debian based distribution from a chroot environment. This way you don't need to download the (net)install CD, neither to burn it.
This is as well a good training in order to understand how a debian system works.
1.Introduction
It's a long time since I ran debian on my system, I'm kind of missing it and decided to use the 5G I got left on my hard disk to install Debian Etch.
I wanted to install it directly from my Ubuntu Dapper environment. It used to be quite easy in the past as you could use the base-config which would guide you through the installation process, but recently (2 month actually), Debian Installer Etch beta 2 was released, here is an excerpt of Debian News March 15th, 2006:
March 15th, 2006
The Debian Installer team is proud to announce the second beta release of the installer for Debian GNU/Linux Etch.
Improvements in this release of the installer include:
Well, the debian installer is now run while on the install cd and base-config was removed from the repository, this means that I will have to do the job done by base-config, basically, setting up locale, console-data, timezone, network and fstab.
2. Preparing your system
The first thing you need to do is to prepare a partition to host your new system. Your filesystem might be more or less complex (having separate /boot, /usr, /var ...), in my case, as I don't have much space left, I will create a / partition on sda11 of type ext3 and a separate /home partition (the one I'm already using on my Ubuntu Dapper system) which is located on partition /dev/sda5 and is of type reiserfs. The swap partition will be the one I use on my running system, namely: sda9.
So here we go, we have to format /, mount / on our file system and prepare our future debian filesystem using debootstrap which is a tool to bootstraps a basic Debian system.
Let's go to it, open a terminal and type:
now, the filesystem is prepare and we have mounted our system on /mnt/debian, now, we install a basic system with debootstrap:
Done! Now we are going to chroot (a tool provided by the package coreutils), chroot runs command or interactive shell with a special root directory, in order to let our new system being informed of what is in the system, we need to mount /proc filesystem:
Let's carry on with the configuration.
Carry on with page 2.
3. Installing utils package and Configuring your new system
Now, we need to install some more packages (such as the kernel :D), configure the timezone, partition, your hostname create your main user, define a new password for root ...
Enter the appropriate value for your system. Install the kernel:
Linux headers might not be required for most users, but because I will need to compile a kernel module in order to use my wireless network card, I do need the kernel headers.
You might need a set of usefull packages, here is a good set:
Now we are going to configure the system. We start with the file /etc/hosts, edit it and write:
, set the hostname in /etc/hostname and add your host name. You might want to configure /etc/network/interfaces, to get automatic configuration of your network interfaces, here in a sample:
We are done with the network bit, let's configure the time zone:
and the file system, edit /etc/fstab and add:
Replace sdaX with the appropriate value for your system.
Important Notice: You need to set a default root password or you won't be able to login, type:
and define your new password.
4. Installing the boot loader (GRUB)
In my case, I'm going to use the bootloader from my running system. Edit /boot/grub/menu.lst and add at the end of the file:
Same here, change sdaX according to your system.
You can now exit your chrooted environment reboot on your new system and boot it. We still require to install and configure Xorg.
End of the installation on page 3.
5. Install and Configure Xorg
During your system reboot, you should watch out for any errors and warning message, they might turn out to be usefull :).
Let's install xserver and xclient:
plus whichever package you might want.
Open /etc/X11/xorg.conf and check that the driver is appropriate to your video card, verify the keyboard layout setting and try X.
If this goes wrong, google will be your best friend :).
Suppose X is working fine, you need to create your normal user's account. On my /home partition, the uid and gid is 1000, therefore I need to create my group user and user with uid and gid 1000:
start gdm, and login with your normal user account ;).
That's it, you will still need to install loads of other package (xmms, mplayer, gaim...), but your system is running.
Hope you liked the trip.