Thursday, February 17, 2005
Installing Debian on a secondary hard disk
The recommended way of installing Debian from an already running system is debootstrap (that I personally use most of the time). FAI is also a good option. However, if you need a quick way to launch full setup from a blank drive and you have a running Linux system, the following steps are the way to go:
Assumptions: /dev/hdc is the empty drive.
Assumptions: /dev/hdc is the empty drive.
- fdisk /dev/hdc and create a throw-away Linux partition (say, 100MB), don't forget to make the partition active
- mke2fs /dev/hdc1
- mount /dev/hdc1 /mnt
- cd /mnt
- copy the kernel and inital ram disk from a Debian archive:
wget ftp://ftp.ee.debian.org/debian/dists/stable/main/disks-i386/current/{bf2.4/linux.bin,images-1.44/bf2.4/root.bin} - for grub:
- grub-install --root-directory=/mnt /dev/hdc
- echo "(hd0) /dev/hdc" > /mnt/boot/grub/device.map
- echo "title Woody install
root (hd0,0)
kernel /linux.bin
initrd /root.bin
boot" > /mnt/boot/grub/menu.lst - grub-install --root-directory=/mnt /dev/hdc # reinstall grub with right settings
- if grub fails, but you get the grub shell at boot time, enter the lines from step 6.3. manually from grub shell (you don't obviously need title).
- for lilo:
- cp /boot/{map,boot.b} /mnt/boot/
- echo "
disk=/dev/hdc bios=0x80
boot=/dev/hdc
map=/mnt/boot/map
install=/mnt/boot/boot.b
image=/mnt/linux.bin
label=woodysetup
initrd=/mnt/root.bin
" > /mnt/boot/lilo.conf - lilo -C /mnt/boot/lilo.conf
- put hdb into a new box (as hda), Debian stable install will start upon boot
- note that you can safely erase/remove the partition that contains the boot files