GRUB 2 USB LiveCD Multiboot

Posted by zbrom on June 26, 2021 · 1 min read

This tutorial is has been tested on an Arch Linux system. If you are not an Arch user, it should still work for your distro; the main difference is that you will need to use your distro’s package manager instead of pacman.


If you currently do not have this package installed, download it

pacman -S grub-bios

Install grub to your USB device MBR (replace sdX, with your device, eg: sda, sdb, … etc.)

grub-install --recheck /dev/sdX

Then generate your grub.cfg file with this command (You may or may not need to initially create the boot folder on your USB device).

grub-mkconfig -o /[path to your device]/boot/grub/grub.cfg

Download your favorite LiveCD ISO (eg: Ubuntu 12.04 LTS).

Extract the ISO to a folder (e.g. name it ubuntu (inside there should be boot, casper, dists, … etc.))

Copy the ubuntu folder to the root of your flash drive (do NOT put it inside the boot folder on the USB).

cp ubuntu /[path to your device]/ubuntu

Navigate to /[path to your device]/boot/grub to edit your grub.cfg with a text editor.

nano /[path to your device]/boot/grub/grub.cfg

Modify the grub.cfg file accordingly (for Ubuntu it should look exactly like this example; feel free to generate additional enteries manually.

Code:

set timeout=10
set default=0

#Ubuntu 12.04
menuentry “Ubuntu 12.04 LTS” {
linux /ubuntu/casper/vmlinuz file=/cdrom/ubuntu/preseed/ubuntu.seed rw ignore_uuid root=UUID=0777-0924 rootfstype=ntfs boot=casper live-media-path=/ubuntu/casper noprompt quickreboot quiet splash —
initrd /ubuntu/casper/initrd.lz

}