|Deletions are marked like this.||Additions are marked like this.|
|Line 9:||Line 9:|
|== Booting a flash drive with an image file written to it ==||= Booting a flash drive with an image file written to it =|
|Line 26:||Line 26:|
|== Booting an iso image stored on the flash drive in a directory ==||= Booting an iso image stored on the flash drive in a directory =|
|Line 28:||Line 28:|
|=== Debian Live image ===||== Debian Live image ==|
|Line 40:||Line 40:|
|=== Debian Installer image ===||== Debian Installer image ==|
|Line 44:||Line 44:|
|==== hd-media installer ====||=== hd-media installer ===|
|Line 52:||Line 52:|
|==== mini.iso ====||=== mini.iso ===|
|Line 58:||Line 58:|
|== See also ==||= See also =|
On an older BIOS system that doesn't support booting from a USB flash drive,1 one option may be to boot Grub from a rescue disk, then use Grub's USB modules to boot a flash drive. The drive can have a Debian Installer or Debian Live image written to it as in https://www.debian.org/CD/faq/#write-usb, or it can have one or more image files stored on it in a directory.
Booting a flash drive with an image file written to it
On a running system, install the package grub-rescue-pc,2 and write one of the included disk images to a CD or floppy. (Or if the system to boot has Grub on an internal drive or network boot server, one of those may also work.)
- On the system to boot, boot into Grub with the rescue disk (or internal drive or network boot), and type 'c' to go to the command line.
Use the nativedisk command to tell Grub to load its native disk and USB drivers.3 You can use set pager=1 and lsmod to see which modules are currently loaded.
Plug the flash drive into a USB port, then type ls to list all connected devices. The first USB device is called (usb0), the second is (usb1), and so on.
Type ls (usb0 (no closing parenthesis), then press the tab key for a list of partitions on the first USB device. Type ls (usb1 and tab for partitions on the second device, ls (usb2 and tab for the third device, and so on. Find which device is the flash drive written with the Debian Installer or Live image - with filesystem type iso9660, and a label like 'Debian 9.6.0 i386 n' (for Debian netinst) or 'd-live 9.6.0 gn i386' (for Debian Live Gnome Desktop). Note the name of the device, of the form (usbX).
Type set root=(usbX), replacing (usbX) with the device name found in the previous step. Type set pager=1 and cat /boot/grub/grub.cfg to see the Grub config file on the drive with menu entries and commands for booting.
Choose the menu entry for the type of boot you want to perform, then type the linux and initrd commands listed to load the kernel and initrd into memory. For example, for the menu entry called 'Graphical install' on the netinst image, type
linux /install.386/vmlinuz vga=788 --- quiet initrd /install.386/gtk/initrd.gz
and for the menu entry 'Debian GNU/Linux Live (kernel 4.9.0-8-686)' on the Live Gnome Desktop image, type
linux /live/vmlinuz-4.9.0-8-686 boot=live components initrd /live/initrd.img-4.9.0-8-686
Type boot and press return to start booting the kernel and initrd. For Debian Installer, the installer will find its other files on the flash drive later in the process. For Debian Live, the live boot process will find the file /live/filesystem.squashfs on the flash drive.
Booting an iso image stored on the flash drive in a directory
Debian Live image
Follow steps 1-4 above, then continue with the following:
Type ls (usb0 and the tab key for the first USB device's partitions, ls (usb1 and tab for the second device's partitions, and so on. Find the device and partition where the iso file(s) are stored - maybe with an expected filesystem and label like 'fat' and 'Untitled Volume'. Note the name in parentheses, of the form (usbX[,partname]).
Type loopback myloop (usbX[,partname])/path/to/filename.iso, replacing (usbX[,partname]) with the device and partition name from the previous step, and adding the path and filename for the iso image to boot. Then type set root=(myloop), set pager=1, and cat /boot/grub/grub.cfg to see the Grub config file inside the iso image, with menu entries and commands for booting.
Choose the menu entry for the type of boot you want to perform, then type the linux and initrd commands listed to load the kernel and initrd into memory. Add the boot parameter findiso=/path/to/filename.iso to the kernel command line in the linux command (again adding the path and filename for the image to boot). For example, for the menu entry 'Debian GNU/Linux Live (kernel 4.9.0-8-686)' on the Live Gnome Desktop image, type
linux /live/vmlinuz-4.9.0-8-686 boot=live components findiso=/path/to/filename.iso initrd /live/initrd.img-4.9.0-8-686
Type boot and press return to start booting the kernel and initrd. The live boot process will find the file /live/filesystem.squashfs inside the iso image.
Debian Installer image
You can either put an hd-media installer (kernel and initrd) on the flash drive along with a netinst or full CD iso image (as in 188.8.131.52 Adding the installer image and A.2. Booting the installer), or you can put a mini.iso image (found under Tiny CDs) on the flash drive and use the kernel and initrd contained in it.4
To boot the hd-media kernel and initrd, follow steps 1-5 as for a Debian Live image, then continue as follows:
Type set root=(usbX[,partname]), replacing (usbX[,partname]) with the device and partition name found in the previous step.
Type linux /vmlinuz or linux /path/to/vmlinuz, with the path to the hd-media kernel on the partition, and add any kernel parameters as in 184.108.40.206 Adding the installer image, such as vga=788 for the graphical installer. Type initrd /initrd.gz or initrd /path/to/initrd.gz, with the path to the hd-media initrd.
Type boot and press return.
To boot a mini.iso image, follow the same steps as for a Debian Live image, but do not add the findiso boot parameter in step 7. (So for example, type linux /linux vga=788 and initrd /initrd.gz for the menu entry called 'Install'.)
example: a laptop with USB-FDD but no other USB boot options in the BIOS (1)
Native drivers are needed because loading the USB drivers disables the BIOS-based disk drivers to avoid possible conflicts. See http://lists.gnu.org/archive/html/help-grub/2015-02/msg00043.html (3)
The hd-media installer scans for the iso and installs from it. The mini.iso installer installs from the network. The kernel and initrd inside the netinst or full CD image are for installing from CD or USB and do not support installing from an iso. See 2.1 Installation methods, #724931, #759744, #694247 (4)