Differences between revisions 2 and 6 (spanning 4 versions)
Revision 2 as of 2019-01-19 08:05:20
Size: 7770
Editor: ?edf
Comment:
Revision 6 as of 2021-03-06 00:55:11
Size: 7936
Editor: jcstaudt
Comment: Clarify location of grub-rescue-pc images once the package is installed
Deletions are marked like this. Additions are marked like this.
Line 9: Line 9:
<<Anchor(image-written)>>
=
= Booting a flash drive with an image file written to it ==
= Booting a flash drive with an image file written to it =
Line 12: Line 11:
 1. On a running system, install the package `grub-rescue-pc`,<<FootNote(using [[PackageManagement|package management tools]], the [[https://packages.debian.org/|web interface]], or from a [[https://www.debian.org/CD/faq/#search-for-package|CD set]])>> 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.)
 1. 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.
 1. On a running host system, install the package `grub-rescue-pc`<<FootNote(using [[PackageManagement|package management tools]], the [[https://packages.debian.org/|web interface]], or from a [[https://www.debian.org/CD/faq/#search-for-package|CD set]])>>. 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.
Line 27: Line 26:
<<Anchor(directory-live)>>
=
= 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 30: Line 28:
=== Debian Live image === == Debian Live image ==
Line 32: Line 30:
Follow steps 1-4 [[#image-written|above]], then continue with the following: Follow steps 1-4 [[#Booting_a_flash_drive_with_an_image_file_written_to_it|above]], then continue with the following:
Line 42: Line 40:
=== Debian Installer image === == Debian Installer image ==
Line 46: Line 44:
==== hd-media installer ==== === hd-media installer ===
Line 48: Line 46:
To boot the hd-media kernel and initrd, follow steps 1-5 as for a [[#directory-live|Debian Live image]], then continue as follows: 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:
Line 54: Line 52:
==== mini.iso ==== === mini.iso ===
Line 56: Line 54:
To boot a mini.iso image, follow the same steps as for a [[#directory-live|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'.) 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'.)
Line 60: Line 58:
== See also == = See also =

Translation(s): none


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

  1. On a running host system, install the package grub-rescue-pc2. 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.)

  2. 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.
  3. 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.

  4. 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.

  5. 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).

  6. 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.

  7. 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
  8. 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:

  1. 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]).

  2. 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.

  3. 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
  4. 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 4.3.3.2 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

hd-media installer

To boot the hd-media kernel and initrd, follow steps 1-5 as for a Debian Live image, then continue as follows:

  1. Type set root=(usbX[,partname]), replacing (usbX[,partname]) with the device and partition name found in the previous step.

  2. 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 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.

  3. Type boot and press return.

mini.iso

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'.)


See also


  1. example: a laptop with USB-FDD but no other USB boot options in the BIOS (1)

  2. using package management tools, the web interface, or from a CD set (2)

  3. 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)

  4. 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)