Linux Mint 13: Grub2 ISO Loopback Not Working?

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
User avatar
darethehair
Level 4
Level 4
Posts: 233
Joined: Sun Mar 08, 2009 2:22 pm
Location: Morden Manitoba Canada
Contact:

Linux Mint 13: Grub2 ISO Loopback Not Working?

Post by darethehair » Fri May 25, 2012 2:48 pm

Does anyone have a working 'grub.cfg' to do a successful 'boot from ISO' under grub2 i.e. from a USB stick, for the new Linux Mint 13? This is the template that *used* to work for me:

Code: Select all

menuentry "Mint" {
    set isofile="/boot/isos/LINUXMINT"

    loopback loop $isofile
    linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile quiet splash noprompt --
    initrd (loop)/casper/initrd.lz
}
Unless I have made a silly error, the working/regular entry that worked for previous versions no longer appears to work. Actually, as time goes on, it seems like it is becoming more and more difficult to use this 'direct boot from ISO' technique with the more popular linux distros. LMDE has given me trouble since the start, and now (it seems) regular Linux Mint will as well. Tinycore is also now giving me trouble with the latest versions. Puppy has never worked yet :(

Thanks
There is nothing more dangerous than a bored cat.

caribriz
Level 5
Level 5
Posts: 938
Joined: Mon Nov 28, 2011 7:43 am

Re: Linux Mint 13: Grub2 ISO Loopback Not Working?

Post by caribriz » Fri May 25, 2012 10:38 pm

Hi,
I'm using a 4gb SanDisk Cruzer to boot isos with grub2, set up with these instructions:
http://www.pendrivelinux.com/boot-multi ... ing-linux/

Here is my grub.cfg file for the usb stick:

Code: Select all

 # This grub.cfg file was created by Lance http://www.pendrivelinux.com
# Suggested entries and the suggestor, if available, will also be noted.

set timeout=18
set default=0

menuentry "Linux Mint 13 Cinnamon ISO" {
 loopback loop /linuxmint-13-cinnamon-dvd-32bit.iso
 linux (loop)/casper/vmlinuz file=/cdrom/preseed/mint.seed boot=casper initrd=/casper/initrd.lz iso-scan/filename=/linuxmint-13-cinnamon-dvd-32bit.iso noeject noprompt splash --
 initrd (loop)/casper/initrd.lz
}

menuentry "Linux Mint 13 Mate ISO" {
 loopback loop /linuxmint-13-mate-dvd-32bit.iso
 linux (loop)/casper/vmlinuz file=/cdrom/preseed/mint.seed boot=casper initrd=/casper/initrd.lz iso-scan/filename=/linuxmint-13-mate-dvd-32bit.iso noeject noprompt splash --
 initrd (loop)/casper/initrd.lz
}

menuentry "Linux Mint 12 LXDE ISO" {
 loopback loop /linuxmint-12-lxde-cd-32bit.iso
 linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/linuxmint-12-lxde-cd-32bit.iso noeject noprompt splash --
 initrd (loop)/casper/initrd.lz
}
EDIT: This works for me - sometimes.
Sometimes, when I reboot and choose another entry in the usb stick's grub menu, it won't boot up and gives a "BusyBox" message.
I've tried it with 2 different usb sticks - same thing happened.
Then I'll try it again, and .... it works!

It does usually work from a cold boot and seems to work more consistently if only one of the isos above is in the grub menu. :?: :?
I don't know enough about it to work out what's going on. Maybe you can try this and post back and tell us if it works for you.

caribriz
Desktop: C2D E6400 / Asus P5LD2SE / 2GB ram / Asus GeForce 210 / 320GB (WinXP) & 1TB (Mint - various)
Laptop: Asus A53E-SX1455V - i5 2450M / 4GB ram / Intel HD 3000 / 500GB (Win7/Mint 18.3 Cinnamon)

User avatar
darethehair
Level 4
Level 4
Posts: 233
Joined: Sun Mar 08, 2009 2:22 pm
Location: Morden Manitoba Canada
Contact:

Re: Linux Mint 13: Grub2 ISO Loopback Not Working?

Post by darethehair » Sat May 26, 2012 11:21 am

caribriz wrote:Maybe you can try this and post back and tell us if it works for you.
Well, thanks for providing your tests, but after trying a bunch of variations of this I still get failure. Perhaps like you, I end up with BusyBox messages, but of a strange nature:

1)

Code: Select all

mount: mounting /dev/sda1 on /isodevice failed: no such device
Does it literally mean the first partition on my HD? If so, why is it trying to look into my WinXP partition?

2)

Code: Select all

Could not find the ISO /boot/isos/linuxmint-13-cinnamon-dvd-32bit.iso
For sure that file exists in that directory, so I suspect that in the 'iso-scan' search, it is not finding it for some *other* reason.
There is nothing more dangerous than a bored cat.

caribriz
Level 5
Level 5
Posts: 938
Joined: Mon Nov 28, 2011 7:43 am

Re: Linux Mint 13: Grub2 ISO Loopback Not Working?

Post by caribriz » Sat May 26, 2012 11:10 pm

Sorry it didn't work for you.

When it doesn't work, it starts to boot up but then after a few seconds .....
I get a similar message to yours:

Code: Select all

BusyBox v1.18.5 (Ubuntu 1:1.18.5-1ubuntu4) built-in shell (ash)
Enter 'help' for a list of built-in commands.

(initramfs) Begin: Running /scripts/casper-premount ... done.
Begin: ...waiting for devs... ... done.
stdin: error 0
/sbin/mount.ntfs: line 1: ELF: not found
/sbin/mount.ntfs: line 2: : not found
/sbin/mount.ntfs: line3: syntax error: unexpected ")"
mount: mounting /dev/sda7 on /isodevice failed: No such device
Warning: Cannot mount /dev/sda7 on /isodevice

Could not find the ISO /linuxmint-13-cinnamon-dvd-32bit.iso
This could also happen if the file system is not clean because of an operating
system  crash, an interrupted boot process, an improper shutdown, or unplugging
of a removable device without first unmounting or ejecting it.  To fix this, 
simply reboot into Windows, let it fully start, log in, run 'chkdisk /r', then
gracefully shut down and reboot back into Windows.  After this you should be
able to reboot again and resume the installation.
I don't know what it means.
At the moment, I only have a linux hdd connected - no Windows hard drive.
The "/dev/sda7" referred to above is an ntfs partition on the linux hdd, which is not mounted automatically at boot.
I had accessed this partition to copy the iso file when I was making the usb stick - maybe I didn't unmount it properly before rebooting????

Anyway, as I said before - this does work for me sometimes, and when it does, it boots up into the isos perfectly.
I had made another usb stick with Mint 9, 10, 11, 12, 12 LXDE which worked properly.
I'd like to get this working as before, and also like to boot the iso from a hard drive, so if you come up with any solutions I'd love to hear about it.

caribriz
Desktop: C2D E6400 / Asus P5LD2SE / 2GB ram / Asus GeForce 210 / 320GB (WinXP) & 1TB (Mint - various)
Laptop: Asus A53E-SX1455V - i5 2450M / 4GB ram / Intel HD 3000 / 500GB (Win7/Mint 18.3 Cinnamon)

breaker
Level 5
Level 5
Posts: 608
Joined: Sun Mar 16, 2008 5:28 am

Re: Linux Mint 13: Grub2 ISO Loopback Not Working?

Post by breaker » Sun May 27, 2012 7:57 am

It works for me from hard disk and usb flash drive. Using GRUB 1.98 from HDD, 1.99-2ubuntu3 on USB flash.

Menu entries for USB (obviously my isos are simply in the root of the USB flash drive);

Code: Select all

 menuentry "Linux Mint 13 Cinnamon 64bit Live DVD" {
 loopback loop /linuxmint-13-cinnamon-dvd-64bit.iso
 linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/linuxmint-13-cinnamon-dvd-64bit.iso noeject noprompt --
 initrd (loop)/casper/initrd.lz
}
 menuentry "Linux Mint 13 MATE 64bit Live DVD" {
 loopback loop /linuxmint-13-mate-dvd-64bit.iso
 linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/linuxmint-13-mate-dvd-64bit.iso noeject noprompt --
 initrd (loop)/casper/initrd.lz
}
 menuentry "Linux Mint 9 LDXE Live CD" {
 loopback loop /linuxmint-9-lxde-cd-i386.iso
 linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/linuxmint-9-lxde-cd-i386.iso noeject noprompt --
 initrd (loop)/casper/initrd.lz
}
 menuentry "Linux Mint Debian XFCE linuxmint-201204-xfce-dvd-64bit.iso" {
 loopback loop /boot/linuxmint-201204-xfce-dvd-64bit.iso
 linux (loop)/casper/vmlinuz isofrom=/dev/sdb3/linuxmint-201204-xfce-dvd-64bit.iso boot=live live-media-path=/casper noeject nopromt --
 initrd (loop)/casper/initrd.lz
}
 menuentry "Linux Mint 13 MATE 64bit Live DVD [supergrubdisk wiki]" {
 iso_path=/linuxmint-13-mate-dvd-64bit.iso
 export iso_path
 search --set --file $iso_path
 loopback loop $iso_path
 root=(loop)
 configfile /boot/grub/loopback.cfg
 loopback --delete loop
}
The last entry was learned from the supergrubdisk wiki entry about loopback.cfg. The LM13 isos have a /boot/grub/loopback.cfg menu you can call from your first boot menu. I don't really have a need for it, but interesting nonetheless. It doesn't seem to work when the iso is on another disk or partition, such as (iso_path=(hd1,3)/linuxmint-13-mate-dvd-64bit.iso) At least I couldn't make it work.

Everything else worked off the hard drive, for example 2nd disk, 3rd partition aka /dev/sdb3 aka (hd1,3);

Code: Select all

 menuentry "Linux Mint 13 Cinnamon 64bit Live DVD" {
 loopback loop (hd1,3)/linuxmint-13-cinnamon-dvd-64bit.iso
 linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/linuxmint-13-cinnamon-dvd-64bit.iso noeject noprompt --
 initrd (loop)/casper/initrd.lz
}
 menuentry "Linux Mint 13 MATE 64bit Live DVD" {
 loopback loop (hd1,3)/linuxmint-13-mate-dvd-64bit.iso
 linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/linuxmint-13-mate-dvd-64bit.iso noeject noprompt --
 initrd (loop)/casper/initrd.lz
}
Again, in the root of the disk, if it had been in a directory such as boot-isos, then it would have been;

Code: Select all

loopback loop (hd1,3)/boot-isos/linuxmint-13-mate-dvd-64bit.iso
as an example...

I don't know the "noeject noprompt" didn't seem to make any difference to the MATE or Cinnamon versions, they never asked me to remove a disk even when I removed the code.

For the Debian XFCE, I'm not sure yet if the "live-media-path=/casper" is needed or not, I have to test more.

So, it works multiple times.

Oh, make sure you shut down totally between booting, don't just restart. See if that helps. It can make a difference. It is different.

breaker
rtfm - read the fine manual...
Boot info script: http://ubuntuforums.org/showthread.php?t=1291280
grub2 https://help.ubuntu.com/community/Grub2
PC-BIOS based booting, mbr, boot records; http://thestarman.pcministry.com/

User avatar
darethehair
Level 4
Level 4
Posts: 233
Joined: Sun Mar 08, 2009 2:22 pm
Location: Morden Manitoba Canada
Contact:

Re: Linux Mint 13: Grub2 ISO Loopback Not Working?

Post by darethehair » Sun May 27, 2012 9:44 am

Thanks breaker for your comments and alternate suggestions to what I have already tried!

Unfortunately, no dice for me -- for the non-LMDE attempts I just made, I end up with those same strange 'busybox' messages. What strikes me as very odd is that I *think* this all happens well after Grub2 has done all of its own magic i.e. lots of healthy-looking bootup messages flash by, as if the system is starting up properly.

For my renewed LMDE experiments (basis your example) I end up with 'module not found unknown' repeating messages -- again after the bootup is well under way. Since you specifically mentioned your grub2 versions, I wonder if that has anything to do with it? BTW, you have an entry that says this:

Code: Select all

isofrom=/dev/sdb3/linuxmint-201204-xfce-dvd-64bit.iso
Do you have a version starting the LMDE ISO without reference to a device? In fact, what *is* 'sdb3' for you?

Thanks
There is nothing more dangerous than a bored cat.

breaker
Level 5
Level 5
Posts: 608
Joined: Sun Mar 16, 2008 5:28 am

Re: Linux Mint 13: Grub2 ISO Loopback Not Working?

Post by breaker » Sun May 27, 2012 1:58 pm

Yes, with the iso on the root of the USB flash drive, GRUB 1.99-2ubuntu3 installed to MBR and GRUB files in /boot/grub, the grub.cfg in /boot/grub includes this entry;

Code: Select all

menuentry "Linux Mint Debian XFCE linuxmint-201204-xfce-dvd-64bit.iso" {
    loopback loop /linuxmint-201204-xfce-dvd-64bit.iso
    linux (loop)/casper/vmlinuz isofrom=/linuxmint-201204-xfce-dvd-64bit.iso boot=live live-media-path=/casper noeject nopromt --
    initrd (loop)/casper/initrd.lz
}
It works. Could be a hardware incompatibility if it doesn't work for you. What's your disk layout? Where are your isos? What's your menu entry again?

You can install GRUB to the USB flash from a Live CD or any other Live USB. That's how I installed a newer version to the USB stick.
rtfm - read the fine manual...
Boot info script: http://ubuntuforums.org/showthread.php?t=1291280
grub2 https://help.ubuntu.com/community/Grub2
PC-BIOS based booting, mbr, boot records; http://thestarman.pcministry.com/

caribriz
Level 5
Level 5
Posts: 938
Joined: Mon Nov 28, 2011 7:43 am

Re: Linux Mint 13: Grub2 ISO Loopback Not Working?

Post by caribriz » Sun May 27, 2012 7:52 pm

An update of my situation:

First up, booting isos from hard drive:

I tried breaker's menu entries (adapting for 32bit). Unfortunately, these didn't work for me.
Got the same busybox messages as my own entries ......

Code: Select all

.........stdin: error 0
/sbin/mount.ntfs: line 1: ELF: not found
/sbin/mount.ntfs: line 2: : not foundset timeout=18
/sbin/mount.ntfs: line3: syntax error: unexpected ")"
mount: mounting /dev/sda7 on /isodevice failed: No such device
Warning: Cannot mount /dev/sda7 on /isodevice
So decided to delete the ntfs partition (sda7) on my hdd and see if it made any difference. (It didn't have much data on it anyway)
Used gparted live cd to delete it, which altered the partition number of my main Mint 9 install, then had to boot live cd and reinstall grub.


Then used these entries in /etc/grub.d/40_custom - adjusting for the new partition number:

Code: Select all

menuentry "Linux Mint 13 Cinnamon ISO" {
	set isofile="/boot/iso/linuxmint-13-cinnamon-dvd-32bit.iso"
	loopback loop (hd0,7)/$isofile
	linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noprompt noeject 
	initrd (loop)/casper/initrd.lz
}

menuentry "Linux Mint 13 Mate ISO" {
	set isofile="/boot/iso/linuxmint-13-mate-dvd-32bit.iso"
	loopback loop (hd0,7)/$isofile
	linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noprompt noeject 
	initrd (loop)/casper/initrd.lz
}
ran sudo update-grub
and the isos now boot from the hard drive :)

Then, tried the following grub menu entries (adapted from breaker's entries - Thank you breaker :) ) with the usb stick:

Code: Select all

 set timeout=18
set default=0

menuentry "Linux Mint 13 Cinnamon ISO" {
 loopback loop /linuxmint-13-cinnamon-dvd-32bit.iso
 linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/linuxmint-13-cinnamon-dvd-32bit.iso noeject noprompt --
 initrd (loop)/casper/initrd.lz
}

menuentry "Linux Mint 13 Mate ISO" {
 loopback loop /linuxmint-13-mate-dvd-32bit.iso
 linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/linuxmint-13-mate-dvd-32bit.iso noeject noprompt --
 initrd (loop)/casper/initrd.lz
}
These now also work on the usb stick.

So, in my case, it appears that the single ntfs data partition on my otherwise ext4 formatted hard drive was *somehow* preventing the system being able
to boot from the isos on both the hard drive and the usb stick.
:?

caribriz
Desktop: C2D E6400 / Asus P5LD2SE / 2GB ram / Asus GeForce 210 / 320GB (WinXP) & 1TB (Mint - various)
Laptop: Asus A53E-SX1455V - i5 2450M / 4GB ram / Intel HD 3000 / 500GB (Win7/Mint 18.3 Cinnamon)

breaker
Level 5
Level 5
Posts: 608
Joined: Sun Mar 16, 2008 5:28 am

Re: Linux Mint 13: Grub2 ISO Loopback Not Working?

Post by breaker » Sun May 27, 2012 9:23 pm

darethehair wrote:Thanks breaker for your comments and alternate suggestions to what I have already tried!

Unfortunately, no dice for me -- for the non-LMDE attempts I just made, I end up with those same strange 'busybox' messages. What strikes me as very odd is that I *think* this all happens well after Grub2 has done all of its own magic i.e. lots of healthy-looking bootup messages flash by, as if the system is starting up properly.

For my renewed LMDE experiments (basis your example) I end up with 'module not found unknown' repeating messages -- again after the bootup is well under way. Since you specifically mentioned your grub2 versions, I wonder if that has anything to do with it? BTW, you have an entry that says this:

Code: Select all

isofrom=/dev/sdb3/linuxmint-201204-xfce-dvd-64bit.iso
Do you have a version starting the LMDE ISO without reference to a device? In fact, what *is* 'sdb3' for you?

Thanks
Sorry, I was wrong about my last LMDE USB flash entry. I had copied it from the HDD and modified it but lack of sleep and I thought I had fully tested it, but no. These 2 entries are tested and work 100% for sure for me;

Code: Select all

menuentry "Linux Mint Debian XFCE linuxmint-201204-xfce-dvd-64bit.iso" {
 loopback loop /linuxmint-201204-xfce-dvd-64bit.iso
 root=(loop)
 linux /casper/vmlinuz isofrom=/dev/disk/by-label/SanDisk/linuxmint-201204-xfce-dvd-64bit.iso boot=live live-media-path=/casper noeject nopromt --
 initrd /casper/initrd.lz
}
menuentry "Linux Mint Debian XFCE linuxmint-201204-xfce-dvd-64bit.iso" {
 loopback loop /linuxmint-201204-xfce-dvd-64bit.iso
 linux (loop)/casper/vmlinuz isofrom=/dev/disk/by-uuid/D921-3C64/linuxmint-201204-xfce-dvd-64bit.iso boot=live live-media-path=/casper noeject nopromt --
 initrd (loop)/casper/initrd.lz
}
EDIT: As you can see, you can either do root=(loop) or put loop in the appropriate places.

The FAT32 volume is named SanDisk for the first one, but that will work with ext2 and a partition label also. The second is using the uuid as found by sudo blkid.

/dev/sdb3 for me is a FAT32 partition (3rd) on my second hard disk as seen by Linux.
rtfm - read the fine manual...
Boot info script: http://ubuntuforums.org/showthread.php?t=1291280
grub2 https://help.ubuntu.com/community/Grub2
PC-BIOS based booting, mbr, boot records; http://thestarman.pcministry.com/

breaker
Level 5
Level 5
Posts: 608
Joined: Sun Mar 16, 2008 5:28 am

Re: Linux Mint 13: Grub2 ISO Loopback Not Working?

Post by breaker » Sun May 27, 2012 9:31 pm

caribriz wrote:An update of my situation:

These now also work on the usb stick.

So, in my case, it appears that the single ntfs data partition on my otherwise ext4 formatted hard drive was *somehow* preventing the system being able
to boot from the isos on both the hard drive and the usb stick.
:?

caribriz
Great job on getting it working! Hmm, sometimes you might have to add a line like

Code: Select all

insmod ntfs
first thing after the menu entry to get support for mounting ntfs volumes.
However, that might not have been your problem. Strange things happen with this stuff!
Glad you got it though.

EDIT: One last thing. I find it helpful to have a separate FAT32 partition because both Windows and Linux can read it, AND it is a handy place to drop ISOs for Live ISO boots from GRUB2.
rtfm - read the fine manual...
Boot info script: http://ubuntuforums.org/showthread.php?t=1291280
grub2 https://help.ubuntu.com/community/Grub2
PC-BIOS based booting, mbr, boot records; http://thestarman.pcministry.com/

caribriz
Level 5
Level 5
Posts: 938
Joined: Mon Nov 28, 2011 7:43 am

Re: Linux Mint 13: Grub2 ISO Loopback Not Working?

Post by caribriz » Mon May 28, 2012 3:50 am

breaker wrote:Strange things happen with this stuff!
Weird that booting Mint 12 iso was ok with the ntfs partition there and that deleting that partition allowed the Mint 13 iso to boot up properly.

It's a pretty drastic solution to delete the ntfs partition (I wasn't using it much so no big deal for me) - but it worked. :lol:
But someone with a dual boot hdd with Windows? ... as you say they could try adding "insmod ntfs" to the grub2 menu entry.

caribriz
Desktop: C2D E6400 / Asus P5LD2SE / 2GB ram / Asus GeForce 210 / 320GB (WinXP) & 1TB (Mint - various)
Laptop: Asus A53E-SX1455V - i5 2450M / 4GB ram / Intel HD 3000 / 500GB (Win7/Mint 18.3 Cinnamon)

User avatar
darethehair
Level 4
Level 4
Posts: 233
Joined: Sun Mar 08, 2009 2:22 pm
Location: Morden Manitoba Canada
Contact:

Re: Linux Mint 13: Grub2 ISO Loopback Not Working?

Post by darethehair » Mon May 28, 2012 10:45 am

Good news and bad news...

This works for me for LMDE:

Code: Select all

menuentry "Mint Debian Edition" {
    set isofile="/boot/isos/lmde-201204-mate-cinnamon-dvd-32bit.iso"

    loopback loop $isofile
    linux (loop)/casper/vmlinuz fromiso=/dev/disk/by-label/darelinux/$isofile boot=live config live-media-path=/casper noeject --
    initrd (loop)/casper/initrd.lz
}
The 'by-uuid' technique also works, but appears to have the (severe) limitation of only working on the computer where that particular UUID is assigned to the USB stick -- making it impossible for this multi-ISO stick to be useful to demonstrated/use on multiple PCs. The 'by-label' technique has the superior advantage of avoiding that! Thanks for the tip breaker for that syntax! Of course, this still begs the question as to why the good old 'iso-scan/filename' doesn't work the way it should :(

The bad news is that this working technique does NOT succeed for LM13 (why?). Instead, no matter what, booting trips over that '/sbin/mount.ntfs' problem -- no matter if 'insmod ntfs' is used or not :(

Code: Select all

/sbin/mount.ntfs: line 1: ELF: not found
/sbin/mount.ntfs: line 2: : not found
/sbin/mount.ntfs: line3: syntax error: unexpected ")"
mount: mounting /dev/sda1 on /isodevice failed: No such device
For me, '/dev/sda1/ is where my WInXP NTFS partition is. For reasons unknown, GRUB2/casper/whatever is looking there. From various Googled sites, it looks like this has been a problem for a while -- even on different distros. No solution that I can see yet, and at least two bug cases opened:

https://bugs.launchpad.net/ubuntu/+sour ... bug/520500
https://bugs.launchpad.net/ubuntu/+sour ... bug/893707

Of course it is unrealistic to expect anyone to remove all 'NTFS' partitions in order to avoid this error :)

Of course I do not know what the true problem is, but just running '/sbin/mount.ntfs' (or even '/sbin/mount.ntfs-3g') on its own results in those errors -- almost as if that binary is *bad* -- trying to run it as a shell script instead of an executable? This suggests to me that '/sbin/mount.ntfs' is broken :(
There is nothing more dangerous than a bored cat.

breaker
Level 5
Level 5
Posts: 608
Joined: Sun Mar 16, 2008 5:28 am

Re: Linux Mint 13: Grub2 ISO Loopback Not Working?

Post by breaker » Mon May 28, 2012 1:19 pm

So, each distro has it's own "cheatcodes" you can pass to it at boot time. The main version of Linux Mint is based on Ubuntu, and their cheatcode is iso-scan, but the Debian based version uses cheatcodes for Debian. The two versions are quite different in other ways. Linux, variety, etc.

In other words, GRUB2 handles the loop part, but the Linux kernel you boot needs to be passed an argument telling it it is being booted in this fashion. Different distros do it differently, and some don't work at all.

Have you tried this for the main LM version, with the iso in the root of you usb flash drive?

Code: Select all

menuentry "Linux Mint 13 MATE 64bit Live DVD [supergrubdisk wiki method]" {
iso_path=/linuxmint-13-mate-dvd-64bit.iso
export iso_path
search --set --file $iso_path
loopback loop $iso_path
root=(loop)
configfile /boot/grub/loopback.cfg
loopback --delete loop
}
rtfm - read the fine manual...
Boot info script: http://ubuntuforums.org/showthread.php?t=1291280
grub2 https://help.ubuntu.com/community/Grub2
PC-BIOS based booting, mbr, boot records; http://thestarman.pcministry.com/

User avatar
darethehair
Level 4
Level 4
Posts: 233
Joined: Sun Mar 08, 2009 2:22 pm
Location: Morden Manitoba Canada
Contact:

Re: Linux Mint 13: Grub2 ISO Loopback Not Working?

Post by darethehair » Mon May 28, 2012 1:43 pm

breaker wrote:So, each distro has it's own "cheatcodes" you can pass to it at boot time. The main version of Linux Mint is based on Ubuntu, and their cheatcode is iso-scan, but the Debian based version uses cheatcodes for Debian. The two versions are quite different in other ways. Linux, variety, etc.

In other words, GRUB2 handles the loop part, but the Linux kernel you boot needs to be passed an argument telling it it is being booted in this fashion. Different distros do it differently, and some don't work at all.
Ah! Makes sense -- I think that I have read similar comments in the past, but now you have confirmed that. Too bad there isn't some standardization going on between all the distros -- or at least a published list of working techniques for each one :(
breaker wrote:Have you tried this for the main LM version, with the iso in the root of you usb flash drive?

Code: Select all

menuentry "Linux Mint 13 MATE 64bit Live DVD [supergrubdisk wiki method]" {
iso_path=/linuxmint-13-mate-dvd-64bit.iso
export iso_path
search --set --file $iso_path
loopback loop $iso_path
root=(loop)
configfile /boot/grub/loopback.cfg
loopback --delete loop
}
Well, sadly, the same ultimate result i.e. the '/sbin/mount.ntfs' BusyBox error problem. Again, this might not be GRUB2's fault -- but something else in the whole chain of events -- which is affecting quite a few people and other distros :(
There is nothing more dangerous than a bored cat.

breaker
Level 5
Level 5
Posts: 608
Joined: Sun Mar 16, 2008 5:28 am

Re: Linux Mint 13: Grub2 ISO Loopback Not Working?

Post by breaker » Mon May 28, 2012 2:53 pm

Well, make sure your path is correct, if your iso is in "/boot/isos" then use this;

Code: Select all

menuentry "Linux Mint 13 MATE 64bit Live DVD" {
loopback loop /boot/isos/linuxmint-13-mate-dvd-64bit.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/boot/isos/linuxmint-13-mate-dvd-64bit.iso noeject noprompt --
initrd (loop)/casper/initrd.lz
}
If it the root of the usb flash drive use;

Code: Select all

menuentry "Linux Mint 13 MATE 64bit Live DVD" {
loopback loop /linuxmint-13-mate-dvd-64bit.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/linuxmint-13-mate-dvd-64bit.iso noeject noprompt --
initrd (loop)/casper/initrd.lz
}
I guess using your variable set isofile="/boot/isos/LINUXMINT" should work, but try it without that line as above.

Pay special attention to the path both in the loopback loop line, and the linux line, namely iso-scan/filename=

If you do use the variable, this method using export, and no quote marks instead;

Code: Select all

menuentry "Linux Mint 13 MATE 64bit Live DVD" {
iso_path=/boot/isos/linuxmint-13-mate-dvd-64bit.iso
export iso_path
search --set --file $iso_path
loopback loop $iso_path
root=(loop)
linux /casper/vmlinuz boot=casper iso-scan/filename=$iso_path noeject noprompt --
initrd /casper/initrd.lz
}
You can also try some insmod lines right after the menuentry;

Code: Select all

insmod linux
insmod loopback
insmod iso9660
insmod fat        # If ISO is located on fat16 or fat32 formatted partition.
insmod ntfs       # If ISO is located on an NTFS formatted partition.
insmod nftscomp   # If NTFS compression is used on the partition. Load if you aren't sure.
Moreover, what is your current menuentry for LM13 (which edition is it?), and what is the path to your iso file, and what kind of formatting on the disk or flash drive?
rtfm - read the fine manual...
Boot info script: http://ubuntuforums.org/showthread.php?t=1291280
grub2 https://help.ubuntu.com/community/Grub2
PC-BIOS based booting, mbr, boot records; http://thestarman.pcministry.com/

User avatar
darethehair
Level 4
Level 4
Posts: 233
Joined: Sun Mar 08, 2009 2:22 pm
Location: Morden Manitoba Canada
Contact:

Re: Linux Mint 13: Grub2 ISO Loopback Not Working?

Post by darethehair » Mon May 28, 2012 6:19 pm

Breaker, I thank you for all your suggestions and variations on syntax, but the deeper '/sbin/mount.ntfs' always occurs -- I don't think the problem is at the 'higher level' that you are attempting to tweet. My menu entries are valid and modeled after your own -- the only difference being 32bit instead of 64bit. I have tried both major variations of style, with the ISO at the root level and down in my normal directory structure. There are no obvious failures like 'ISO cannot be found'. I can say, though, that the extra 'insmod' suggestions do not appear to make any difference -- and the one to insmod 'nftscomp' seems to result in a message 'error: file not found'. The booting always appears to make good progress, but then dies. The error is not 'up front' and obvious.
breaker wrote:Moreover, what is your current menuentry for LM13 (which edition is it?), and what is the path to your iso file, and what kind of formatting on the disk or flash drive?
The USB stick is formatted with fat32 -- and menu entries look like you have suggested (noting the 32bit vs 64bit difference). At this point, it would be nice if other people could verify that the
'mount.ntfs' problem also hangs them up -- or that one of your suggestions has successfully (somehow) worked around that deeper problem :)
There is nothing more dangerous than a bored cat.

User avatar
karlchen
Level 19
Level 19
Posts: 9935
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Linux Mint 13: Grub2 ISO Loopback Not Working?

Post by karlchen » Mon May 28, 2012 7:16 pm

Hello, folks.

As far as I understand from this thread no-one participating in this thread so far has successfully booted Linux Mint 13 32-bit, Cinnamon or Mate edition, directly from the downloaded ISO file.
Is it imaginable that the reason is the same why the 32-bit editions of Linux Mint 13 cannot be installed via Wubi/mint4win? Cf. the release notes which state that mint4win can only be used with 64-bit editions of Linux Mint 13. This corresponds to my tests as well.

During the mint4win installation mint4win reboots the machine and tries to boot into the Linux Mint 13 live system which in turn is supposed to perform the actual Mint installation. The live system is loaded from a copy of the original Mint ISO file, renamed to "installation.iso".
The startup of the 32-bit live system fails. My theory is that the casper lupin support is broken, not activated or missing complete. I admit that this is a hypothesis. I have not yet taken the time to investigate the failed mint4win live system start thoroughly.

In case casper lupin support is broken in the 32-bit ISO images of Mint 13, this would explain why you cannot boot directly from the ISOs and why mint4win cannot do so either.

Cheers,
Karl
Image
Linux Mint 18.1 64-bit Cinnamon Desktop, Total Commander 9.21a 64-bit
Ubuntu 18.04.1 32-bit Mate Desktop, Total Commander 9.21a 32-bit
Windows? - 1 window in every room

breaker
Level 5
Level 5
Posts: 608
Joined: Sun Mar 16, 2008 5:28 am

Re: Linux Mint 13: Grub2 ISO Loopback Not Working?

Post by breaker » Tue May 29, 2012 4:15 am

I just tried with 32bit and...

Wow! You're right! The 32bit version doesn't work! I get the same message. Strange (or maybe not), the 64bit works. So, GRUB can make the loopback file, but the initrd can't mount the flash drive and find the iso (I think).

@karlchen I think you are probably correct. I think it is related to the mint4win issue on the 32bit version.
rtfm - read the fine manual...
Boot info script: http://ubuntuforums.org/showthread.php?t=1291280
grub2 https://help.ubuntu.com/community/Grub2
PC-BIOS based booting, mbr, boot records; http://thestarman.pcministry.com/

User avatar
darethehair
Level 4
Level 4
Posts: 233
Joined: Sun Mar 08, 2009 2:22 pm
Location: Morden Manitoba Canada
Contact:

Re: Linux Mint 13: Grub2 ISO Loopback Not Working?

Post by darethehair » Tue May 29, 2012 9:05 am

Yep, confirmed here as well -- up till now most of my tests have been on my netbook using the 32bit versions (for convenience), but I downloaded the 64bit versions of Mint13/Maya and confirmed on my 64bit desktop PC that the 32bit versions do NOT work, but the 64bit versions DO work.

The evidence beaker and I were gathering was beginning to focus, and karlchen helped get us the rest of the way :)

So...where does this go now? Again, I would argue, for maximum portability and demonstration purposes, being able to carry multiple linux distros -- in ISO form -- on a USB stick, is highly desirable. I would further argue that 32bit is even more important for this purpose than 64bit -- though if in demonstrating a working system on a friend's PC, it might then be appropriate to point out that a 64bit version of Linux Mint is available for those that could benefit.

With the way things are now, I can at least demonstrate 32bit LMDE if I want to, but 32bit Maya is not an option :(
There is nothing more dangerous than a bored cat.

breaker
Level 5
Level 5
Posts: 608
Joined: Sun Mar 16, 2008 5:28 am

Re: Linux Mint 13: Grub2 ISO Loopback Not Working?

Post by breaker » Mon Jun 04, 2012 2:35 am

I have some more notes about this. I did some testing booting these things. The 32bit also fails when it is unpacked from the ISO and called with GRUB2. Syslinux works fine (Unetbootin uses Syslinux). I think there is something about the way GRUB loads the 32 bit linux kernel that causes the problem. It seemed to fail on slightly older versions of GRUB as well as 1.99.

I tried getting some logs, and it seems it can't find the ISO. The error having to do with the ntfs, is logged even on systems that boot ok;

Code: Select all

/sbin/mount.ntfs: line 1: ELF: not found
/sbin/mount.ntfs: line 2: €: not found
/sbin/mount.ntfs: line 3: syntax error: unexpected ")"
So, I don't think that is the issue.

Logs are available after boot in /var/log/casper.log, or can be copied at the fail point after mounting the flash drive or another flash drive.

As we can see, it fails during this script inside initrd - /scripts/casper-premount/20iso_scan
Log, at panic;

Code: Select all

+ tailpid=427
+ parse_cmdline
+ tail -f casper.log
+ cat /proc/cmdline
+ [  =  ]
+ export UNIONFS=DEFAULT
+ set_usplash_timeout
+ [ -x /sbin/usplash_write ]
+ start_usplash_pulse
+ [ -x /sbin/usplash_write ]
+ [ n != y ]
+ log_begin_msg Running /scripts/casper-premount
+ _log_msg Begin: Running /scripts/casper-premount ... 
+ [ n = y ]
+ printf Begin: Running /scripts/casper-premount ... 
Begin: Running /scripts/casper-premount ... + run_scripts /scripts/casper-premount
+ initdir=/scripts/casper-premount
+ [ ! -d /scripts/casper-premount ]
+ [ -f /scripts/casper-premount/ORDER ]
+ . /scripts/casper-premount/ORDER
+ /scripts/casper-premount/10driver_updates
done.
+ [ -e /conf/param.conf ]
+ /scripts/casper-premount/20iso_scan
Begin: ...waiting for devs... ... done.
/sbin/mount.ntfs: line 1: ELF: not found
/sbin/mount.ntfs: line 2: €: not found
/sbin/mount.ntfs: line 3: syntax error: unexpected ")"
mount: mounting /dev/sda1 on /isodevice failed: No such device
Warning: Cannot mount /dev/sda1 on /isodevice

Could not find the ISO /linuxmint-13-mate-dvd-32bit.iso
This could also happen if the file system is not clean because of an operating
system crash, an interrupted boot process, an improper shutdown, or unplugging
of a removable device without first unmounting or ejecting it.  To fix this,
simply reboot into Windows, let it fully start, log in, run 'chkdsk /r', then
gracefully shut down and reboot back into Windows. After this you should be
able to reboot again and resume the installation.
The 20iso_scan script;

Code: Select all

#!/bin/sh

PREREQ=""

prereqs()
{
       echo "$PREREQ"
}

case $1 in
# get pre-requisites
    prereqs)
           prereqs
           exit 0
           ;;
esac

. /scripts/casper-functions
. /scripts/lupin-helpers

iso_path=
for x in $(cat /proc/cmdline); do
    case ${x} in
        iso-scan/filename=*)
            iso_path=${x#iso-scan/filename=}
            ;;
    esac
done
if [ "$iso_path" ]; then
    if find_path "${iso_path}" /isodevice rw; then
        echo "LIVEMEDIA=${FOUNDPATH}" >> /conf/param.conf
        if [ -f "${FOUNDPATH}" ]; then
            echo "LIVEMEDIA_OFFSET=0" >> /conf/param.conf
        fi
    else
        panic "
Could not find the ISO $iso_path
This could also happen if the file system is not clean because of an operating
system crash, an interrupted boot process, an improper shutdown, or unplugging
of a removable device without first unmounting or ejecting it.  To fix this,
simply reboot into Windows, let it fully start, log in, run 'chkdsk /r', then
gracefully shut down and reboot back into Windows. After this you should be
able to reboot again and resume the installation.
"
    fi
fi
/scripts/casper-helpers this one helps 20iso_scan;

Code: Select all

. /scripts/casper-helpers

is_supported_fs(){
    [ -z "${1}" ] && return 1
    case ${1} in
        ext2|ext3|ext4|xfs|jfs|reiserfs|vfat|ntfs|iso9660)
            return 0
            ;;
    esac
    return 1
}

wait_for_devs(){
    if [ -e /dev/.initramfs/lupin-waited-for-devs ]; then
        return
    fi
    [ "$quiet" != "y" ] && log_begin_msg "...waiting for devs..."
    udevadm trigger --subsystem-match=block
    udevadm settle
    #TBD, modprobe on demand?
    modprobe ext3
    modprobe ext4
    modprobe reiserfs
    modprobe xfs
    modprobe jfs
    modprobe vfat
    modprobe fuse
    [ "$quiet" != "y" ] && log_end_msg "...devs loaded..."
    touch /dev/.initramfs/lupin-waited-for-devs
}

find_path()
{
    local path="${1}"
    # must match find_path_cleanup
    local default_mountpoint="${2:-/tmpmountpoint}"
    local mountoptions="${3:-ro}"
    local mountpoint=
    local dev devname devfstype
    local trial_number
    FOUNDDEV=
    FOUNDPATH=
    [ -z "${path}" ] && return 1
    wait_for_devs
    mkdir -p "${default_mountpoint}"
    for trial_number in 1 2 3; do
        [ $trial_number -gt 1 ] && sleep 3
        for sysblock in $(echo /sys/block/* | tr ' ' '\n' | grep -v /ram | grep -v /loop | grep -v /fd); do
            for dev in $(subdevices "${sysblock}"); do
                devname=$(sys2dev "${dev}")
                devfstype="$(get_fstype ${devname})"
                if is_supported_fs "${devfstype}" ; then
                                    #if device is already mounted, do not remount
                    if grep -q "^${devname} " /proc/mounts; then
                        mountpoint=$(grep "^${devname} " /proc/mounts|cut -d ' ' -f 2)
                        unmount=false                
                    else                
                        mountpoint="${default_mountpoint}"                    
                        try_mount "$devname" "$mountpoint" "$mountoptions" || return 1
                        unmount=true    		    
                    fi                
                    if [ -e "${mountpoint}${path}" ]; then
                        FOUNDDEV="${devname}"
                        FOUNDPATH="${mountpoint}${path}"
                        return 0
                    fi
                    [ "${unmount}" = "true" ] && umount ${mountpoint} 2> /dev/null || true
                fi
            done
        done
    done
    return 1
}

find_path_cleanup()
{
    # must match find_path
    local default_mountpoint="${1:-/tmpmountpoint}"
    if grep -q "^[^ ]* $default_mountpoint " /proc/mounts; then
        umount "$default_mountpoint" 2>/dev/null || true
    fi
    rmdir "$default_mountpoint" 2>/dev/null || true
}
It has been a while since I messed with shell scripting, and I was never very adept, however, from some other logs, it seems that these scripts try to mount all of the devices (/dev/sda1) etc, check for the iso, then unmount if not found. Finally panic if it can't find the iso. Even if the iso is in /dev/sdb1, for example, the scripts go through the process, but it is never seen.

However, I can sit there at the busybox, find and mount the drive and the iso into /isodevice and /cdrom manually. Pressing exit after that doesn't help recovery, just another long process of mounting with no good results by the scripts.

Some variables or paths perhaps could be hard-coded into the initrd scripts and then the iso could be rebuilt for testing, but this will be a lot of work.

For now, I have a USB stick using Syslinux in the MBR, calling the isolinux.cfg menu from the iso, but renamed syslinux.cfg, then I added a chainload to boot.img in my existing /boot/grub directory on the USB stick, which loads core.img and finally my grub.cfg with the entries to iso booting that actually work.

cheers!
rtfm - read the fine manual...
Boot info script: http://ubuntuforums.org/showthread.php?t=1291280
grub2 https://help.ubuntu.com/community/Grub2
PC-BIOS based booting, mbr, boot records; http://thestarman.pcministry.com/

Post Reply

Return to “Installation & Boot”