Iso-scan/filename not working?

Why do you need to create a menu? There is already a grub2 boot loader with menu on the ISO. It’s literally designed to be plug and play.

I have a USB drive
The USB drive is formatted as FAT32
On the USB drive is the OpenMandriva ISO file.
I want to boot using the ISO file.
The only way to do this is to use a menu with the iso-scan-filename cheat code in it.
That is why the wiki has a separate section for booting from an ISO file.

And what I’m saying is that the OpenMandriva ISO file ending in .iso is already bootable you don’t need to add anything to it just plug it in and boot it. It has it’s own boot loader and boot menu.

So you need Booting from USB, not Booting from ISO file.
Forget Booting from ISO file.

  1. Plug in your USB

  2. Launch ROSA Image Writer (on OpenMandriva or ROSA. Otherwise here are the sources)

  3. Select output device

  4. Write

  5. Reboot

  6. Select your USB device to boot

  7. Enjoy

Thanks, but I want to create a multiboot USB drive which can boot many ISOs.

ok.

Postedit

After more experimentation I found that it can boot from NTFS as well !
The problem was that I was also setting up a partition which pointed to the ISO file, so /dev/sdb4 pointed to the ISO file and this was causing the problem!

This menu works for FAT32 and NTFS

title OpenMandriva 
set ISO=/_ISO/LINUX/OpenMandrivaLx.3.0-PLASMA.x86_64.iso
map %ISO% (0xff)
map --hook
root (0xff)
set bootd=rootfstype=auto ro rd.luks=0 rd.lvm=0 rd.md=0 rd.dm=0 rd.live.image acpi_osi=Linux acpi_osi='!Windows 2012' acpi_backlight=vendor audit=0 logo.nologo
set bootl=locale.lang=en_US
set vol=OpenMandrivaLx_3.0
kernel /boot/vmlinuz0 %bootd% root=live:LABEL=%vol% iso-scan/filename=%ISO% %bootl% quiet rhgb splash=silent
initrd /boot/liveinitrd.img
boot

I guess it works for grub4dos because it still uses a grub like syntax (mixed to bath) with is different to grub2. But grub2 is really more powerful than grub or grub4dos so my suggest is to install grub2 in MBR of you USB device. I’s several years I use method and I am fully satisfied of it even I0ve never found the time to wrote a guide for it.

@ben79 because you are a tester you may be interested to this method. In this way you can test ISO image on real hardware at (quite) real the speed if you put the iso on the hadrdisk instead of on an USB devices. Also maintenance is quite low because most times you only need to replace the ISO. On the other hand you may build a USB device as @SteveSi did so you can put several ISO on the same device and maintenance is as simple as before. Also you may use the remaining space on the device as usual usb.

Thanks mandian and SteveSi, in time I will check out both of these. Currently I try to test in way likely to duplicate what most users would be likely to do for one thing to be sure all of that is actually working. Part of the current checklist for all OM testers (and OM-QA) is that ISO needs to burn and boot and install from DVD and USB flash drive.

Being able to multi-boot with other systems on a flash drive would not be officially supported to my knowledge though so need for testing that. This also strikes me as doing something the ‘hard way’ for no apparent gain (for me). If someone else sees this as “Wow what a great thing to do” then that’s the beauty and freedom of Linux. Just remember there are many things users can do in Linux that aren’t officially supported anywhere.

I can see where for some testing being able to boot ISO directly from hard drive might be useful and quicker.

Don’t know if officially, but it is supported, and it is mentioned of the wiki, as linked in above posts. :wink:

To be clear I was talking about multi-booting from a flash drive not booting from an ISO file. Sorry if I wasn’t clear. To me those are not the same thing. And bear in mind that I’m not a technical expert. Most people connected with OpenMandriva have more technical knowledge than I possess.

Edit: Except if I think more both require ability to boot from ISO file.

1 Like

Just to give you some background. I am the author of Easy2Boot which is a free multiboot USB solution. One of the major features is that you just copy all your ISOs directly onto the USB drive and then boot to it (no application required). Then you can directly boot from any of the linux ISOs which are automatically listed in the menu (menu is dynamically built each time you boot).
This ‘just works’ with 99% of linux distros - EXCEPT OpenMandriva!
It works by writing a new partition table entry into the MBR of the USB drive which points to the start of the linux ISO file. Then we boot via grub4dos to the ISO file and when the kernel loads, it ‘sees’ the partition table entry and mounts the ‘volume’ as a iso9660 filesystem - thus the 2nd stage (squashfs, etc.) just works and no cheat code (iso-scan/filename= or boot-from etc.) is required.
You get the full and original ISO boot menu - it is not altered in anyway. You can simply delete or add ISOs at will.
The problem with OpenMandriva not working, seems to be that it does see the partition but does not recognise the file system in that partition as a valid ISO9660 fs. This is odd, because most other linux liveCD ISOs just work.
See here for a list of over 300 ISOs that just work. Note that no cheat codes are used, so it is a ‘generic’ solution for Legacy booting linux ISOs.
Hence I tried using cheat codes with OpenMandriva and had problems (which it turns out was not OM’s fault, but mine!).
cheers
Steve

OK, so now the plot both thickens and gets more interesting. Whether this is ‘officially’ supported (and remembering I said “to my knowledge”) I suspect there are OpenMandriva contributors that would be interested and willing to help with this.

And in pointing this out you may well have identified something that has caused other issues with our grub2 script and osprober/grub2 support. So thanks.

menuentry "OpenMandrivaLx" {
set iso_path="/OpenMandrivaLx.3.01-PLASMA.x86_64.iso"
loopback loop ${iso_path}
set boot_locale='locale.lang=en_US'
set boot_default='rootfstype=auto ro rd.luks=0 rd.lvm=0 rd.md=0 rd.dm=0 rd.live.image acpi_osi=Linux acpi_osi='!Windows 2012' acpi_backlight=vendor audit=0 logo.nologo'
probe -u -s isouuid (loop)
linux	(loop)/boot/vmlinuz0 ${boot_default} root=live:UUID=${isouuid} iso-scan/filename=${iso_path} ${boot_locale} quiet rhgb splash=silent
initrd	(loop)/boot/liveinitrd.img
loopback -d loop
}

This is a grub2 menu that has been tested and reported as working.
It is similar to the grub4dos one I posted earlier.

Here is a screenshot of the situation I described where it does not recognise the ISO file when written as a partition table entry (no cheat codes used - just normal boot menu in ISO). It should mount the partition as a ISO9660 file system and then find the squashfs, but it does not seem to like something about the structure of the ISO (I guess?).

Well it is an interesting approach.

It sounds strange because the isofs is in list:
https://github.com/OpenMandrivaAssociation/omdv-build-iso/blob/master/dracut/dracut.conf.d/60-dracut-isobuild.conf#L13
Could you mount the ISO from the emergency shell?

Sorry, I don’t know how to do that.
It is probably easiest if you make an Easy2Boot USB drive, copy an OM ISO to _ISO\MAINMENU and then boot to the flash drive and run the OM iso.
Then you can play with it yourself.
partition 4 of the USB drive will be the new partition entry for the ISO file, e.g. sdb4 or sdc4 etc.
I am afraid I am not very familiar with linux…

Well, I’ll try ASAP.

Hi @SteveSi, I didn’t forgot your question but I haven’t found the time to make some test until now. The good news is I think I found the bug :slight_smile::

openmandriva dracut-initqueue[350]: ++ echo /dev/sdb4
openmandriva dracut-initqueue[350]: ++ sed 's,\(/dev/sd[a-z]\)[1-9],\1,g'
openmandriva dracut-initqueue[350]: + realdev=/dev/sdb
ppenmandriva dracut-initqueue[350]: + getargbool 0 UEFI
openmandriva dracut-initqueue[350]: + local _b
openmandriva dracut-initqueue[350]: + unset _b
openmandriva dracut-initqueue[350]: + local _default
openmandriva dracut-initqueue[350]: + _default=0
openmandriva dracut-initqueue[350]: + shift
openmandriva dracut-initqueue[350]: ++ getarg UEFI
openmandriva dracut-initqueue[350]: ++ debug_off
openmandriva dracut-initqueue[350]: ++ set +x
openmandriva dracut-initqueue[350]: ++ return 1
openmandriva dracut-initqueue[350]: + _b=
openmandriva dracut-initqueue[350]: + '[' 1 -ne 0 -a -z '' ']'
openmandriva dracut-initqueue[350]: + _b=0
openmandriva dracut-initqueue[350]: + '[' -n 0 ']'
openmandriva dracut-initqueue[350]: + '[' 0 = 0 ']'
openmandriva dracut-initqueue[350]: + return 1
openmandriva dracut-initqueue[350]: + '[' -n '' ']'
openmandriva dracut-initqueue[350]: + mount -n -t iso9660 -o ro /dev/sdb /run/initramfs/omdv
openmandriva dracut-initqueue[350]: mount: wrong fs type, bad option, bad superblock on /dev/sdb,
openmandriva dracut-initqueue[350]:        missing codepage or helper program, or other error
openmandriva dracut-initqueue[350]:        In some cases useful info is found in syslog - try
openmandriva dracut-initqueue[350]:        dmesg | tail or so.
openmandriva kernel: ISOFS: Unable to identify CD-ROM format.
openmandriva dracut-initqueue[350]: ++ losetup -f
openmandriva dracut-initqueue[350]: + LOOPDEV=/dev/loop0
openmandriva dracut-initqueue[350]: + losetup -r /dev/loop0 /run/initramfs/omdv/LiveOS/squashfs.img
openmandriva dracut-initqueue[350]: losetup: /run/initramfs/omdv/LiveOS/squashfs.img: failed to set up loop device: No such file or directory
openmandriva dracut-initqueue[350]: + mount -n -t squashfs -o ro /dev/loop0 /run/initramfs/image

As you can read it detects the right partition (/dev/sda4) but then it tries to mount the disk (dev/sdb) instead of the partition. It it due to /sbin/live-iso-root script of initial ramdisk (it is inside the liveinitrd.img into the iso). I report here lines from 18 to 29:

# fix udev isohybrid LABEL issues (mga #3334)
# by reading the device we get, stripping away partition number,
# and mount the resulting device
realdev=$(echo $livedev |sed 's,\(/dev/sd[a-z]\)[1-9],\1,g')

# mount the live media
getargbool 0 UEFI && liveuefi="yes"
if [ -n "$liveuefi" ]; then
    mount -n -t vfat -o ro $livedev /run/initramfs/omdv
else
    mount -n -t iso9660 -o ro $realdev /run/initramfs/omdv
fi

IMO you may file a bug on bugzilla about this because developers are needed to fix this.

btw Mageia isos are working?

PS. Maybe you can be interested in the latest release on grbu2 because on April upstream released a pre-compiled binary version of grub2.

@TPG is the above hack still needed?