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.
  1. fdisk /dev/hdc and create a throw-away Linux partition (say, 100MB), don't forget to make the partition active
  2. mke2fs /dev/hdc1
  3. mount /dev/hdc1 /mnt
  4. cd /mnt
  5. 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}
  6. for grub:
    1. grub-install --root-directory=/mnt /dev/hdc
    2. echo "(hd0) /dev/hdc" > /mnt/boot/grub/device.map
    3. echo "title Woody install
      root (hd0,0)
      kernel /linux.bin
      initrd /root.bin
      boot" > /mnt/boot/grub/menu.lst
    4. grub-install --root-directory=/mnt /dev/hdc # reinstall grub with right settings
    5. 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).
  7. for lilo:
    1. cp /boot/{map,boot.b} /mnt/boot/
    2. 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
    3. lilo -C /mnt/boot/lilo.conf
  8. put hdb into a new box (as hda), Debian stable install will start upon boot
  9. note that you can safely erase/remove the partition that contains the boot files
Good luck, and leave me comments.
Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?