GRUB2 USB Boot Ubuntu ISO issue

jardows

2[H]4U
Joined
Jun 10, 2015
Messages
2,308
I am working on creating a multi-boot USB drive with various OS environments. I'm using GRUB2 from Ubuntu as my base, to get the UEFI and Secure Boot capabilities. I want to have a dedicated EFI partition, and a separate partition on the USB drive to store ISO files. I am having problems getting an Ubuntu ISO to load, and would appreciate any help!

My primary partition is an EFI FAT 32 partition. I created a second partition with type ms-basic-data and formatted it with FAT32 as well. From the GRUB command line, it shows up as hd0,gpt2.

I have a Clonezilla ISO working. Here is my GRUB menu entry for it:
Code:
menuentry "Clonezilla Live" {
loopback loop (hd0,gpt2)/clonezilla.iso
linux (loop)/live/vmlinuz boot=live live-config noswap nolocales edd=on nomodeset ocs_live_run=\"ocs-live-general\" ocs_live_extra_param=\"\" keyboard-layouts=\"\ ocs_livebatch=\"no\" locales=\"\ ip=frommedia nosplash toram=filesystem.squashfs findiso=/clonezilla.iso
initrd (loop)/live/initrd.img
}
This works

Now, my Ubuntu menu entry is thus, taken from https://help.ubuntu.com/community/Grub2/ISOBoot:
Code:
menuentry "Ubuntu 20.04" {
loopback loop (hd0,gpt2)/ubuntu.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/ubuntu.iso noprompt noeject
initrd (loop)/casper/initrd.lz
}
When I boot from this, the screen just hangs. The computer is not locked up, as I get keyboard response.
I've tried going into the GRUB console and manually performing
Code:
 loopback loop (hd0,gpt2)/ubuntu.iso
but the system just hangs. Doing the same thing with the clonezilla.iso file, no problem.
I can boot a dedicated USB created from the same ISO file on this machine no problem, and I can use a partition imaged with the ubuntu ISO with the rEFInd boot manager without issue, so it is something with this particular configuration, not the ISO or the computer.
What am I doing wrong here, and how can I get this to boot up?

edit: fix some typos in the code to reflect what my grub.cfg entries are
 
Last edited:
Do you have the correct ISO on the root of hd0 that's gpt format? If not, the boot hangs as it can't find the image you refer to. If you hold the ISO on the usb stick you need to modify the path to look similar to the Clonezilla one.
 
Do you have the correct ISO on the root of hd0 that's gpt format? If not, the boot hangs as it can't find the image you refer to. If you hold the ISO on the usb stick you need to modify the path to look similar to the Clonezilla one.
Yikes! I made some serious typos inputting my code into my post! Amazing what some sleep will do to clear the mind. I've updated the code sections above to accurately reflect the Clonezilla entry.
Both ISO files are on the same gpt partition, in the root of the partition (the partition is for only the iso files).
 
Yikes! I made some serious typos inputting my code into my post! Amazing what some sleep will do to clear the mind. I've updated the code sections above to accurately reflect the Clonezilla entry.
Both ISO files are on the same gpt partition, in the root of the partition (the partition is for only the iso files).

I have only fiddled with grub a few times, but the below line doesn't match both?

(loop)/casper/initrd.lz

Particularly the file extension. One is IMG, the other is LZ or 1z.
 
I have only fiddled with grub a few times, but the below line doesn't match both?

(loop)/casper/initrd.lz

Particularly the file extension. One is IMG, the other is LZ or 1z.
It is what is in the ISO file for loading. The GRUB entry has to match what the distribution makes. The distribution could name this file anything they want, as long as the boot loader knows which file to load. The only real difference is the loop. I suspect there may be some issue with the file size of the Ubuntu ISO - it's about 2.5 GB, while the Clonezilla less than 400 MB, but there is no documentation for dealing with larger ISO's that I can find.
 
It is what is in the ISO file for loading. The GRUB entry has to match what the distribution makes. The distribution could name this file anything they want, as long as the boot loader knows which file to load. The only real difference is the loop. I suspect there may be some issue with the file size of the Ubuntu ISO - it's about 2.5 GB, while the Clonezilla less than 400 MB, but there is no documentation for dealing with larger ISO's that I can find.
I figured it was, but I don't have a Linux iso to pop open to verify. The size does make a lot of sense, especially from a usb drive. It would need to unpack it first to access the files inside.

How long have you waited for it?
 
I figured it was, but I don't have a Linux iso to pop open to verify. The size does make a lot of sense, especially from a usb drive. It would need to unpack it first to access the files inside.

How long have you waited for it?
Hours. Way longer than it should take.
 
Back
Top