USB Stick Debian Install


Preparing the stick

For preparing the USB stick you will need a system where Linux is already running and where USB is supported. You should assure that the usb-storage kernel module is loaded (modprobe usb-storage) and try to find out which SCSI device the USB stick has been mapped to (in this example /dev/sda is used). To write to your stick, you will probably have to turn off its write protection switch.

In order to start the kernel after booting from the USB stick, we will put a boot loader on the stick. Although any boot loader (e.g. LILO) should work, it’s convenient to use SYSLINUX, since it uses a FAT16 partition and can be reconfigured by just editing a text file. Any operating system which supports the FAT file system can be used to make changes to the configuration of the boot loader. Since most USB sticks come pre-configured with a single FAT16 partition, you probably won’t have to repartition or reformat the stick. If you have to repartition it anyway, start cfdisk or any other partitioning tool and create a FAT16 partition.
Copying the files – the easy way

There is an all-in-one file which contains all the installer files (including the kernel) as well as SYSLINUX and its configuration file. It resides in the hd-media subdirectory of the Debian installer images directory and is called boot.img.gz. You only have to extract it to the FAT partition on your USB stick:

zcat boot.img.gz >/dev/sda1

Again, take care that you use the correct device name for your USB stick.

After that, mount the partition on your USB memory stick (mount /dev/sda1 /mnt) and copy a Debian netinst or businesscard ISO image to it (please note that the file name must end in .ISO).

Partitionless installation: Instead of /dev/sda1 you may also use /dev/sda as your target. This leaves your stick without a partition table so that it will contain only the file system. The advantage of this method is that you don’t have to rely on the existing (and possibly buggy) master boot record (MBR) of your USB stick. But be aware that you won’t be able to access your stick using some third-party operating systems.

Leave a Reply