At the GRUB menu, hit the C key to enter command mode. To check if your BIOS is able to detect the USB drive and hand it over to GRUB, just run GRUB from your hard drive if it already installed, or from a GRUB boot floppy or CD. The easiest way to boot from a USB Drive is to boot via GRUB. In this case the GRUB bootloader can do the job directly, without the need of an initial Linux system. Note: If the computer was made between 20, it may contain USB drivers, but not an option to boot from USB.
#GRUB ON USB DRIVERS#
A minimal Linux system contains the necessary USB drivers to continue the boot process.
#GRUB ON USB FULL#
They may not recognize USB drives initially, and may require operating system drivers to accomplish this.Īn alternative for older machines is to let the BIOS start a minimal Linux system on a BIOS supported drive such as a floppy disk, CD, or HD, and then transfer control to the USB drive to continue booting the full operating system.They may lack a BIOS setting to allow booting from USB.A modern BIOS (written after 2002) usually contains USB drivers and a boot from USB option but older computers often don't have these features. Nano /mnt/boot/grub/grub.PCs use a system called the BIOS (Basic Input/Output System) to start the machine. Wget -directory-prefix=/mnt/isos Edit grub.cfg : Note: make sure there is enough space on the usb drive. Mkdir /mnt/isos Download an Ubuntu cd image (for example: Xubuntu 18.04 32-bit) : (skip this if you already have a working grub.cfg for the usb drive) Create a folder for cd images : Touch /mnt/boot/grub/grub.cfg Example grub.cfg with Xubuntu 18.04 Live Sudo grub-install -removable -boot-directory=/mnt/boot -efi-directory=/mnt -target=i386-efi /dev/sdX Create a grub.cfg file :
#GRUB ON USB INSTALL#
Sudo grub-install -removable -boot-directory=/mnt/boot -efi-directory=/mnt -target=x86_64-efi /dev/sdX Install /EFI/BOOT/BOOTIA32.EFI and other grub files required for 32-bit UEFI : Sudo grub-install -no-floppy -boot-directory=/mnt/boot -target=i386-pc /dev/sdX Install /EFI/BOOT/BOOTX64.EFI and other grub files required to load grub from a 64-bit UEFI firmware : Sudo mount -o umask=000 /dev/sdX1 /mnt Write the MBR and install the grub files required for legacy BIOS boot on the drive : Sudo mkfs.fat -F32 /dev/sdX1 Mount the filesystem : W # Write the partition table Create a fresh filesystem in the newly created partition : # Set partition end to the last possible sector (default)Į f # Set partition type to EFI (FAT-12/16/32)Ī # Enable the bootable flag on partition 1 # Start partition at the first possible sector (default) O # Create a new empty DOS partition table
Sudo fdisk /dev/sdX Press the following keys (THIS WILL ERASE ALL DATA FROM THE SELECTED DRIVE!) : Make sure it's the right drive! (check the capacity and the partitions) : Replace X with the appropriate lower case letter(s) in the commands. Now, find the device file for your usb drive. Sudo apt install grub-pc-bin grub-efi-ia32-bin grub-efi-amd64-bin Install them using the package manager, for instance on Ubuntu : The x86_64-efi, i386-pc and i386-efi folders need to be present in order to install the corresponding bootloader on the usb drive.
If it is empty or does not exist, make sure the package grub-common (or equivalent for your distribution) version 2 or higher is installed.ĭepending on the system, /usr/lib/grub/ will contain one or more of the following folders: x86_64-efi, x86_64-efi-signed, i386-pc, i386-efi.
Warning: the usb drive will be formatted, save your data before proceeding!įirst of all, on you current installation, check if the folder /usr/lib/grub/ exists and is not empty.
#GRUB ON USB HOW TO#
How to create a 3-in-1 bootable usb drive on Linux.Ī usb drive with only 1 partition to load grub2 on usb-bootable machines with Legacy BIOS, 64bit UEFI or 32bit UEFI.