Biboroku

Installing Debian Squeeze from Hard Disk

Written by Taro Sato on . Tagged: sysadmin Linux

Unfortunately the Debian installer does not work on my Dell desktop box. I still wanted to do a fresh install of Squeeze, and the only sensible option for me was to install off hard disk. I have been having the same issue for several months and I have not been able to solve it myself, and nobody responds to my bug report; however, this hard drive method may work well even if I have a working install USB stick/CD media.

I assume that a working Linux installation exists on the system already; it will only be used to launch the installer. (In practice, I used an existing Lenny installation to go through this procedure, only to wipe it over with Squeeze.) For this note I use the Debian installer beta 2 for Squeeze (AMD64).

Create a partition large enough to hold a netinst .iso image (~ 170 MB) plus maybe 20 MB for kernel image and whatnot. For illustration, I assume it is at /dev/sda11. Move to a temporary working directory, download some files, mount the partition, and copy files to the install partition:

$ wget http://ftp.nl.debian.org/debian/dists/testing/main/installer-amd64/current/images/hd-media/initrd.gz
$ wget http://ftp.nl.debian.org/debian/dists/testing/main/installer-amd64/current/images/hd-media/vmlinuz
$ wget http://cdimage.debian.org/cdimage/squeeze_di_beta2/amd64/iso-cd/debian-squeeze-di-beta2-amd64-netinst.iso
$ mkdir mnt
$ sudo mount /dev/sda11 mnt
$ sudo cp initrd.gz mnt
$ sudo cp vmlinuz mnt
$ sudo cp debian-squeeze-di-beta2-amd64-netinst.iso mnt/netinst.iso
$ sudo umount /dev/sda11

Now I need to modify the GRUB menu to add an entry for the installer that I just made.

For the new GRUB version 2, an entry in /boot/grub/grub.cfg looks a bit complicated:

menuentry 'Squeeze Installer Beta 2' --class debian --class gnu-linux --class os {
  insmod part_msdos
  insmod ext2
  set root='<em>(hd0,msdos11)</em>'
  search --no-floppy --fs-uuid --set <em>SOMELENGTHYHASH</em>
  echo 'Loading Squeeze installer'
  linux /vmlinuz root=UUID=<em>SOMELENGTHYHASH</em>
  echo 'Loading init ramdisk'
  initrd /initrd.gz
}

Here, the root in which the install partition is the eleventh partition of the first hard drive (hence hd0, msdos11). With the lengthy UUID hash for the hard drive, I’d just copy one of the GRUB entries for working installations.

For an old version of GRUB, an entry in /boot/grub/menu.lst would look like this:

title  Squeeze Installer Beta 2
root   (hd0,10)
kernel /vmlinuz
initrd /initrd.gz

This means the install partition is located at the 11th partition of the first hard drive, and the paths to the kernel and initrd images are located at the topmost level of the partition. This is the sort of entry I copy and paste from other entries in /boot/grub/menu.lst.

After reboot, select the menu entry just added and I will be starting the installer right away!

IMPORTANT: When I partition the drive during the installation process, do not mount the install partition. If I do, the partitioning and the subsequent installation will fail.

comments powered by Disqus