Installing Debian on an External Drive

If you want to install Debian on an external drive, you can follow these instructions. THis has the advantage of being portable and persistent, and works for hard drives and flash drives.

  1. Download a Debian CD from debian.org. I recommend a torrent as it will be much faster (I used a lenny CD and switched to sid repos later).
  2. Boot it up and proceed with the installation. Set up the partitions on your external drive however you like, but be sure to make the Debian partition at least 2-3GB. (I have made a customized one that was only about 1.3GB, which used a cut-down KDE desktop, but lacked many of the things you would expect from a full distro.) You should have a FAT32 partition that takes up the remaining space if you want to be able to use the drive in Windows as well.
  3. Do not install a bootloader (press “Go back” on the screen where you would install GRUB and select the next step). If you installed one, you can always overwrite it later.
  4. Finish up the installation, shut down, remove the USB drive and reboot into your normal Linux.
  5. Install extlinux (typically comes with syslinux), RTFM, then mount and run it on the partition that Debian is in.
  6. Write an extlinux.conf, using the UUID of the partition (you can use blkid to find it). The extlinux.conf file could look like this:
    default boot
    prompt 0
    timeout 10
    label boot
    menu label ^Install
    menu default
    kernel /vmlinuz
    append initrd=/initrd.img root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

    You can set up a menu if you would like, but it is not necessary. With this config, the system will boot with no user intervention.

  7. Locate syslinux/extlinux’s “mbr.bin” file and copy it onto the block device (cat /usr/lib/syslinux/mbr.bin > /dev/sdX)
  8. The drive should now boot fine.

After this, I recommend adding the sid repos for the latest software and upgrading the kernel to get up-to-date drivers. You may also want to install NDISwrapper and collect some common Broadcom drivers so your installation will support a wider range of wifi cards.

Tags: ,

Leave a Reply