#language en ~-[[DebianWiki/EditorGuide#translation|Translation(s)]]: none-~ ---- On an older BIOS system that doesn't support booting from a USB flash drive,<> 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. ## If your page gets really long, uncomment this Table of Contents <> = Booting a flash drive with an image file written to it = 1. On a running host system, install the package `grub-rescue-pc`<>. This will place several grub rescue images within /usr/lib/grub-rescue. Write one of these disk images onto appropriate media such as a CD or floppy (or if the target device has Grub installed on an internal drive or network boot server, one of those may also work.) 1. On the target device, boot into Grub with the rescue disk (or internal drive or network boot), and type 'c' to go to the command line. 1. Use the `nativedisk` command to tell Grub to load its native disk and USB drivers.<> You can use `set pager=1` and `lsmod` to see which modules are currently loaded. 1. 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. 1. 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)`. 1. 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. 1. 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 }}} 1. 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 [[#Booting_a_flash_drive_with_an_image_file_written_to_it|above]], then continue with the following: 5.#5 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])`. 5. 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. 5. 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 }}} 5. 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 [[https://www.debian.org/releases/stable/i386/ch04s03.html.en#usb-copy-flexible|4.3.3.2 Adding the installer image]] and [[https://www.debian.org/releases/stable/i386/apas02.html.en|A.2. Booting the installer]]), or you can put a mini.iso image (found under [[https://www.debian.org/distrib/netinst#verysmall|Tiny CDs]]) on the flash drive and use the kernel and initrd contained in it.<> === hd-media installer === To boot the hd-media kernel and initrd, follow steps 1-5 as for a [[#Booting_an_iso_image_stored_on_the_flash_drive_in_a_directory|Debian Live image]], then continue as follows: 6.#6 Type `set root=(usbX[,partname])`, replacing `(usbX[,partname])` with the device and partition name found in the previous step. 6. 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 [[https://www.debian.org/releases/stable/i386/ch04s03.html.en#usb-copy-flexible|4.3.3.2 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. 6. Type `boot` and press return. === mini.iso === To boot a mini.iso image, follow the same steps as for a [[#Booting_an_iso_image_stored_on_the_flash_drive_in_a_directory|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'.) ---- ## You can add other _helpful_ links here. = See also = *[[http://www.gnu.org/software/grub/manual/grub/]] *[[http://lists.gnu.org/archive/html/help-grub/2012-03/msg00074.html]] *[[DebianLive/MultibootISO]] *[[DebianMan:grub-mkrescue]] *[[DebianMan:live-boot]] ##---- ## If this page belongs to an existing Category, add it below. ## CategorySomething | CategoryAnother ----