Iso booting not working with grub

colt

New Member
Joined
Sep 3, 2020
Messages
18
Reaction score
0
Credits
214
Trying to boot several Linux distros directly from grub, none works. I am receiving:
Error: File not found
Error: No such disk
Error: You need to load the kernel first
Here is my /etc/grub.d/40_custom file:

Code:
menuentry "Lubuntu 16.04 ISO" {
set isofile="/media/34GB/videos/lubuntu-16.04.6-desktop-amd64.iso"
loopback loop (hd0,6)$isofile
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noprompt noeject
initrd (loop)/casper/initrd
}

Code:
menuentry "Ubuntu 16.04.5 ISO" {
set isofile="/media/34GB/videos/ubuntu-mate-16.04.6-desktop-amd64.iso"
loopback loop (hd0,6)$isofile
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noprompt noeject
initrd (loop)/casper/initrd
}

Code:
 menuentry "Ubuntu 10.04 Lucid Lynx ISO" {
set isofile="/media/7.0GB/ubuntu-10.04-desktop-amd64.iso"
loopback loop (hd1,1)$isofile
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noprompt noeject
initrd (loop)/casper/initrd
}

I did copy the full path to the isofiles from the command line, to be sure no type would happen. I also remembered to update-grub. Open to suggestions.
 


Those mountpoints don't exist until after the computer is booted. Grub has no way of knowing about them.
 
@colt ,
Since the error messages indicate that grub cannot see the kernels or the disk, then it's probably wise to check all of the configurations however certain one is. Some of what follows may seem obvious, but I think it's worth a check.

For example:
Does the existing installation have all the specified isofiles existing under the /media directory in exactly the locations mentioned?

In the case of the first two menuentries, is that /media directory sitting in the 6th partition of the first drive, as specified by the config: (hd0,6)?

In the case of the third entry, a similar query, does the /media directory and those contents under it sit on the 1st partition of the second drive: (hd1,1)?

On mounting the lubuntu isofile here, the location of the kernel and initrd do indeed appear to be correct, so I can't see a problem there.

I'm not sure which "mountpoints" are being referred to in post #3.

EDIT: I would install the latest grub. Early grubs were known to flip out sometimes on this.
 
Last edited:
I'm not sure which "mountpoints" are being referred to in post #3.
"/media/34GB/videos/lubuntu-16.04.6-desktop-amd64.iso"
"/media/34GB/videos/ubuntu-mate-16.04.6-desktop-amd64.iso"
"/media/7.0GB/ubuntu-10.04-desktop-amd64.iso"

Unless I'm misunderstanding what the OP is trying to do. Boot from within a running system?
 
You can try this, let's see whether it works or not.
Code:
menuentry "Lubuntu 16.04.6 Desktop" {
    
    search --no-floppy --set=root -f /videos/lubuntu-16.04.6-desktop-amd64.iso

    set isofile="/videos/lubuntu-16.04.6-desktop-amd64.iso"
    loopback loop $isofile

    linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile quiet splash noprompt noeject --
    initrd (loop)/casper/initrd.lz
}
 
menuentry "Lubuntu 16.04 ISO" {
set isofile="/media/34GB/videos/lubuntu-16.04.6-desktop-amd64.iso"
loopback loop (hdX,Y)$isofile
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile quiet splash
initrd (loop)/casper/initrd.lz
}

The only difference between mine and @tpkuser is the path to the loopback iso.
If his version doesn't work, you may need the path.
 
I don't have any experience using the files under /etc/grub.d as I hand configure /EFI/BOOT/grub/grub.cfg so I may be missing something that's implicit in your system but, in my grub.cfg, I have a line that explicitly determines what is considered (by grub) to be the "root". It does this by searching for a filesystem with a specified UUID

Code:
# set BOOTUUID to the UUID of your boot filesystem
set BOOTUUID=b4568e00-cdf2-4675-abca-4cb16cc24661

# this line makes that filesystem the root context
# for finding the kernel and such
search --no-floppy --fs-uuid --set=root ${BOOTUUID}
 
"/media/34GB/videos/lubuntu-16.04.6-desktop-amd64.iso"
"/media/34GB/videos/ubuntu-mate-16.04.6-desktop-amd64.iso"
"/media/7.0GB/ubuntu-10.04-desktop-amd64.iso"

Unless I'm misunderstanding what the OP is trying to do. Boot from within a running system?
As I understand it, the OP is booting from an existing system (not a running system) to which he wishes to add the options of booting from the isofiles he mentions. In that case, the /media directory and its contents with the files and subdirectories must already exist to hold the isofiles as configured in post #1 on the existing system. If this interpretation isn't so, perhaps the OP can clarify :-) .
 
Last edited:
Hate to bring this up, folks, but Ubuntu 16.04 went though EOL (end of life) April 2021, and even if you had ESM (Extended Support Maintenance) for it, that ran out April past.

We cannot provide help, in all conscience, to Users who do not move on, and place themselves at risk.

Hope you understand.

Chris Turner
wizardfromoz
 
I have to confess, for all that I fool around with grub.cfg for frugally installed operating systems, I've never successfully directly booted any ISO from grub. It's not something I expect to want to do often, but this thread has been very informative...

(a few minutes pass)

... in fact, thanks to the snippet provided by tpkuser above, I was just now able to do so for the first time. :cool:
 
I have to confess, for all that I fool around with grub.cfg for frugally installed operating systems, I've never successfully directly booted any ISO from grub. It's not something I expect to want to do often, but this thread has been very informative...

(a few minutes pass)

... in fact, thanks to the snippet provided by tpkuser above, I was just now able to do so for the first time. :cool:
If you like a small linux :-) there's an example of a successful grub booting of a small linux isofile here: https://linux.org/threads/for-the-fun-of-it-how-big-is-your-distro-installation.57996/post-281500. Maybe of interest.
 
If this thread doesn't get resolved somebody will have to study GRUB documentation:

If I had this problem what I'd do is manually boot from grub CLI, e.g.
In GRUB CLI you can use ls command to list drives and partitions.
Then you use ls (hd0,1)/.. to list FS on particular (drive,partition) to find your ISO.

What follows is executing various commands that boot what you want to boot, but again, grub docs are your best friend to master grub CLI.

This is not something people use on daily basis, so even experts can forget the exact commands and may need to refresh their knowledge using docs.
 
Burn ISO to Flash Drive...restart computer tapping the Key that brings up the Boot Menu.

Select Flash Drive and hit Enter...Grub Menu appears with ISO highlighted...hit Enter...works every time...how hard is that.
1764071768129.gif


Unless the ISO is new and has bugs...had a few of them or the checksum is wrong.
1764072119891.gif
 
Last edited:
Updating: I tried two suggestions. The one from dos2unix and the one from tpkusr. The first one did not work (same errors). I then tried the second, a modified attempt (without the words "quiet splash").

It also did not work, but it went farther: I received:

"KERNEL PANIC - NOT SYNCING"
"VFS UNABLE TO MOUNT ROOT FS ON UNKNOWN-BLOCK (0,0)"

Then I thought a little and decided to remove the ".lz" from the last line. It worked. So main problem, solved.

Nonetheless, I do not comprehend exactly what is being done, and that prevents me from making the adjustment for booting Ubuntu 10.04, since it is in a different dir, in a different partition.

For instance how grub knows where the video dir it is? The "--set=root -f" command does not mention it.
So, how it knows that the video folder file is being mounted at /media/34GB and that it belongs to sda6?

For Lucid Lynx, it is mounted on /media/7.0GB and that it is on sda5, instead sda6.

So set=root and set isofile would just be "/ubuntu-10.04-desktop-amd64.iso" ?

I assume this doesn't work ?
 
If you like a small linux :-) there's an example of a successful grub booting of a small linux isofile here: https://linux.org/threads/for-the-fun-of-it-how-big-is-your-distro-installation.57996/post-281500. Maybe of interest.
I got this working mainly as a curiosity. When I passed in the same kernel options, it booted to the exact same system as when I do a frugal install, so I don't see much point in using the iso. It feels cleaner to me to just point to the kernel and initram files directly on the USB stick or hdd than to mount an iso and point to them inside of that. I'll keep one ISO and the associated grub menu entry around as an example of how it's done, but likely won't bother with it much. It does give me a convenient option for trying out distros that maybe don't lend themselves so well to frugal installs.

As for small linux - I'm pretty comfortable with Tiny Core and not doing a lot of distro hopping lately. I loaded up an old version of Tiny Core last night in an effort to get get nvidia drivers for some old video cards. That worked but, of course, these drivers are compiled for an older kernel version so, now that I know it all works, I just need to bring the whole mess up to modern times. (or retire the machine - it could still go either way)
 
I loaded up an old version of Tiny Core last night in an effort to get get nvidia drivers for some old video cards. That worked but, of course, these drivers are compiled for an older kernel version so, now that I know it all works, I just need to bring the whole mess up to modern times. (or retire the machine - it could still go either way)
As it turns out, the "nouveau" driver does the trick. I'd swear I tried that once before and it didn't work, but it works now on Tiny Core 16.2 on x86_64 so I'm all happy. The machine itself, of course, is still a big bulky tower that's loud and power hungry and doesn't give me anything my laptop doesn't (except for a whole slew of USB ports).
 


Follow Linux.org

Members online


Top