"File not found" when trying to boot with grub2 (multiboot usb from live CD/ISOs)

I’m new to grub2 and trying to get all my Live CD ISOs onto a single usb to boot from.

I’ve been working at this all weekend, but can’t get it quite right.

Today I got the farthest yet with the GRUB menu actually appearing instead of booting to command line.

All the menu entries are there, but no matter which one I select I get the following error:

error: file not found.
error: you need to load the kernel first.

Press any key to continue… #brings me back to grub2 menu with entries

Below is a snippet of my grub.cfg file:


set timeout=10
set default=0

menuentry "archlinux-2011.08.19-netinstall-x86_64.iso" {
set isofile="boot/iso/archlinux-2011.08.19-netinstall-x86_64.iso"
loopback loop (hd0,msdos1)/$isofile
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noprompt noeject
initrd (loop)/casper/initrd.lz
}

...
... <more entries...>
...

menuentry "openSUSE-12.1-NET-x86_64.iso" {
set isofile="boot/iso/openSUSE-12.1-NET-x86_64.iso"
loopback loop (hd0,msdos1)/$isofile
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noprompt noeject
initrd (loop)/casper/initrd.lz
}

My USB directory structure:


find /media/ -type d


/media/
/media/MULTIBOOT
/media/MULTIBOOT/boot
/media/MULTIBOOT/boot/grub2
/media/MULTIBOOT/boot/grub2/locale
/media/MULTIBOOT/boot/iso

So, you are not supposed to edit the file /boot/grub2/grub.cfg file directly and its further suggested that doing this will not work. What I did was to create a new /boot/grub.menu.lst file with the added entries I wanted, just as it used to be setup with grub legacy and then ran the following command:

grub2-menulst2cfg /boot/grub/menu.lst /boot/grub/grub.cfg

My added entries then show up in the main menu as saying Previous Linux versions, which I must select from the main menu that appears at which time my newly added /boot/grub/menu.lst items then appear in this second menu. By the way, I am also using an external USB hard drive, but its a USB3 version in a USB3 port and I had to add support for USB3 to the initrd file as well, before they would load. My BIOS supports USB3 booting and grub comes up with the drive, but when the kernel starts to load initrd, it all falls apart due to lack of USB3 support in the initrd file. This should not be a problem with USB2 drives and ports however.

Thank You,

I got further and came back and also tried your @jdmcdaniel3 suggestion but that hasn’t changed the new errors I am getting.

Now I got it to load the CDs. Splash screens come up and such.

I had to edit the grub.cfg further and include parts of each individuals ISOs cfg files (looked for keyword APPEND, KERNEL, INITRD for example) and insert them into my linux/initrd entries for each grub2 menu item . Some of those files I had to find were named like syslinux.cfg, grub.cfg, … .

This involved mounting each ISO while I was in a running OS and browsing them for the appropriate cfg files.

But now each time I try to load one of those menu entries they get an error as soon as the initial splash screen is done loading, unique to each of them (ie, openSUSE, fedora, archlinux).

It seems I can get the Fedora and openSUSE netinstaller ISOs to go through all the way and even install an OS. It’s the other live ISOs that aren’t booting properly like the KDE/GNOME/LXDE/XFCE derivatives.

Getting the netinstallers (except the archlinux one) to go all the way through is a good sign for me. =)

Here is my latest grub.cfg file after editing manually and doing the suggestion above:


#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#


### BEGIN /etc/grub.d/00_header ###
if  -s $prefix/grubenv ]; then
  load_env
fi
set default="0"
if  "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi


function savedefault {
  if  -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}


function load_video {
  insmod vbe
  insmod vga
  insmod video_bochs
  insmod video_cirrus
}


if sleep --interruptible 0 ; then
  set timeout=10
fi
### END /etc/grub.d/00_header ###


### BEGIN /etc/grub.d/10_linux ###
menuentry 'openSUSE, with Linux 3.1.9-1.4-desktop' --class opensuse --class gnu-linux --class gnu --class os {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos5)'
	search --no-floppy --fs-uuid --set=root 7fbff91b-338c-40e9-b929-3edd43185c57
	echo	'Loading Linux 3.1.9-1.4-desktop ...'
	linux	/vmlinuz-3.1.9-1.4-desktop root=UUID=e222340c-1f31-47f6-9fab-38231d0e164f  quiet splash=silent
	echo	'Loading initial ramdisk ...'
	initrd	/initrd-3.1.9-1.4-desktop
}
menuentry 'openSUSE, with Linux 3.1.9-1.4-desktop (recovery mode)' --class opensuse --class gnu-linux --class gnu --class os {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos5)'
	search --no-floppy --fs-uuid --set=root 7fbff91b-338c-40e9-b929-3edd43185c57
	echo	'Loading Linux 3.1.9-1.4-desktop ...'
	linux	/vmlinuz-3.1.9-1.4-desktop root=UUID=e222340c-1f31-47f6-9fab-38231d0e164f single 
	echo	'Loading initial ramdisk ...'
	initrd	/initrd-3.1.9-1.4-desktop
}
### END /etc/grub.d/10_linux ###


### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###


### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###


### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###
menuentry "archlinux-2011.08.19-netinstall-x86_64.iso" {
set isofile="boot/iso/archlinux-2011.08.19-netinstall-x86_64.iso"
loopback loop (hd0,msdos1)/$isofile
linux (loop)/arch/boot/x86_64/vmlinuz archisobasedir=arch archisolabel=MULTIBOOT
initrd (loop)/arch/boot/x86_64/archiso.img
}


menuentry "Fedora-16-x86_64-Live-LXDE.iso" {
set isofile="boot/iso/Fedora-16-x86_64-Live-LXDE.iso"
loopback loop (hd0,msdos1)/$isofile
linux (loop)/EFI/boot/vmlinuz0 root=live:LABEL=MULTIBOOT rootfstype=auto quiet rhgb ro liveimg rd.luks=0 rd.md=0 rd.dm=0
initrd (loop)/EFI/boot/initrd0.img
}


menuentry "Fedora-16-x86_64-Live-XFCE.iso" {
set isofile="boot/iso/Fedora-16-x86_64-Live-XFCE.iso"
loopback loop (hd0,msdos1)/$isofile
linux (loop)/EFI/boot/vmlinuz0 root=live:LABEL=MULTIBOOT rootfstype=auto ro liveimg quiet rhgb rd.luks=0 rd.md=0 rd.dm=0
initrd (loop)/EFI/boot/initrd0.img
}


menuentry "Fedora-16-x86_64-netinst.iso" {
set isofile="boot/iso/Fedora-16-x86_64-netinst.iso"
loopback loop (hd0,msdos1)/$isofile
linux (loop)/images/pxeboot/vmlinuz initrd=initrd.img quiet
initrd (loop)/images/pxeboot/initrd.img
}


menuentry "openSUSE-12.1-GNOME-LiveCD-x86_64.iso" {
set isofile="boot/iso/openSUSE-12.1-GNOME-LiveCD-x86_64.iso"
loopback loop (hd0,msdos1)/$isofile
linux (loop)/boot/x86_64/loader/linux initrd=boot/x86_64/loader/initrd ramdisk_size=512000 ramdisk_blocksize=4096 splash=silent quiet preloadlog=/dev/null showopts
initrd (loop)/boot/x86_64/loader/initrd
}


menuentry "openSUSE-12.1-KDE-LiveCD-x86_64.iso" {
set isofile="boot/iso/openSUSE-12.1-KDE-LiveCD-x86_64.iso"
loopback loop (hd0,msdos1)/$isofile
linux (loop)/boot/x86_64/loader/linux initrd=boot/x86_64/loader/initrd ramdisk_size=512000 ramdisk_blocksize=4096 splash=silent quiet preloadlog=/dev/null showopts
initrd (loop)/boot/x86_64/loader/initrd
}


menuentry "openSUSE-12.1-NET-x86_64.iso" {
set isofile="boot/iso/openSUSE-12.1-NET-x86_64.iso"
loopback loop (hd0,msdos1)/$isofile
linux (loop)/boot/x86_64/loader/linux initrd=initrd splash=silent showopts
initrd (loop)/boot/x86_64/loader/initrd
}
### BEGIN /etc/grub.d/41_custom ###
if  -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###


### BEGIN /etc/grub.d/90_persistent ###
### END /etc/grub.d/90_persistent ###

The thing I don’t like about this grub.cfg file is that it contains the entries for this specific laptop. I was hoping to have something that was just for the USB.

Hello,

Although I haven’t yet touched anything lately how openSUSE is using GRUB2, I did some research awhile back which IMO should be relevant to what you’re trying to do…

You should know that Linux can mount USB devices as Loop Devices(There a a couple ways Linux mounts USB devices), and one of the cool new features in GRUB2 over previous legacy versions of GRUB is that you can mount Loop Devices immediately during boot and not have to wait until the main OS loads.

So, you should be able to look up the specific commands for GRUB2 launching a USB Loop Device and enter that into the GRUB2 config file using the method described by jdmcdaniel.

I haven’t looked at the specifics of this for about a year now, but if you continue to have problems finding resources or the correct config, you can either post to this thread or PM me… but it might take awhile for me to dig up the resources I was using at the time.

HTH,
TS

I am going to read more about what the command are and try it out tonight, thanks for the suggestion. This seems like it may help things quite a bit.

Can you provide the link to the thread? Looks like it got missed.

Thanks!

Was referring to this thread if you have questions. Am not aware of another thread describing this in these forums have only PM’d a few people on special projects.

TS

II’ve never done that, but it seems logical to load the loopback module before.

insmod loopback