Bug 923268

Summary: Unable to boot Fedora 14 Live iso image from grub2 (iso-scan/filename kernel parameter)
Product: [Fedora] Fedora Reporter: Taunus <codezilla>
Component: dracutAssignee: dracut-maint
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 18CC: 04mvs89, bugzilla, davidz, diego.viola, dracut-maint, epsilon, ghaspias, grantbow, harald, iiska, imgx64+bzrh, jaivuk, jonathan, klik.atekon.de, leho, luther138, mansour, maurizio.antillon, michael, mopsfelder, nullakilla, theoneandonlyron, the.ridikulus.rat, travneff, valent.turkovic, xiaqqaix, zing
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 650672 Environment:
Last Closed: 2013-05-29 12:22:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Taunus 2013-03-19 15:18:14 UTC
+++ This bug was initially created as a clone of Bug #650672 +++

Description of problem:
Getting boot error when trying to boot Fedora 14 Live iso image from grub2.
I have iso image on my usb flash disk. Flash disk is formatted to ext2 filesystem.
Grub2 is installed to the mbr on flash disk.

Version-Release number of selected component (if applicable):
Fedora 14 Live iso image

Steps to Reproduce:

Here is the configuration of booting item for this live fedora 14 iso:

[code]
menuentry "Fedora 14 Live" {
 set isofile="/RFRemix-14-i686-Live-GNOME.iso"
 loopback loop (hd0,1)$isofile
 linux (loop)/EFI/boot/vmlinuz0
root=live:UUID=3f63c06f-faf6-46f2-850c-89bb170a7306:$isofile rootfstype=auto ro
verbose debug boot=EFI/boot iso-scan/filename=$isofile noeject noprompt
rd_NO_LUKS rd_NO_MD rd_NO_DM --
 initrd (loop)/EFI/boot/initrd0.img
}
[/code]

  
Actual results:

At the end of booting attempt next info is printed to the teminal:

[code]
No root device found

Boot has failed, sleeping forever
[/code]

Expected results:

Booting Live Fedora 14 without any problems.
There are no such problems when booting Ubuntu 10.04 this way.

--- Additional comment from  on 2011-01-07 12:10:47 EST ---

It seems based on the discussion in:
https://bugzilla.redhat.com/show_bug.cgi?id=557426

That this is really a dracut bug and should be moved to
dracut instead of LiveCD.

Since 557426 was closed according to the dracut people:
https://bugzilla.redhat.com/buglist.cgi?component=dracut&product=Fedora
They may not even know this is still an issue.

I would really like to boot fedora iso's from grub2, and am eagerly
awaiting this feature.

If my logic seems sound, could someone move this bug to
dracut from LiveCD?

Thanks, Luther

--- Additional comment from  on 2011-01-07 16:30:21 EST ---

Moved to dracut

--- Additional comment from cheer xiao on 2011-03-29 03:57:41 EDT ---

I vote for this feature.
Hope this won't be considered spamming. :)

--- Additional comment from Leho Kraav on 2011-04-07 17:07:53 EDT ---

GNOME3 has a Fedora LiveCD, would be nice to have this indeed.

--- Additional comment from An. N on 2011-04-08 09:56:57 EDT ---

Doesn't work here either.

--- Additional comment from Valent Turkovic on 2011-04-12 09:56:37 EDT ---

Please make this feature so that we can have Fedora also boot from multiboot usb sticks that have grub2 installed. This is a must have feature.

--- Additional comment from  on 2011-05-29 07:06:13 EDT ---

This requires a new parameter for dracut, for specifying the device that contains the iso image. A patch https://bugzilla.redhat.com/attachment.cgi?id=394679&action=diff in bug#557426 has been proposed, and for what I can tell it should work. Could this small patch be included in dracut?
Another issue is that the initrd doesn't include support for ntfs, so if your iso image is in an ntfs filesystem, it can-t be accessed anyway even if dracut is patched.
One could mount the iso image, extract only the initrd.gz, extract it-s contents, patch the relevant files, rebuild the initrd.gz, and boot from grub by specifying that initrd instead of the one in the iso, and the additional parameters [which I don't remember but you can look up in the original bug].

--- Additional comment from Valent Turkovic on 2011-06-23 07:46:55 EDT ---

Any updates regarding this issue? When can we expect this patch be implemented and in mainstream Fedora repos?

--- Additional comment from Jaiv on 2011-07-21 04:25:00 EDT ---

It is unbelievable but this is apparently still not working for Fedora 15.
The small progress is the fact that now we end up in dracut shell...

I reopened this bug against rawhide - 723801 and I'm going to post an e-mail to dracut list.

--- Additional comment from Thue Janus Kristensen on 2011-08-24 18:55:07 EDT ---

I was able to boot from iso on USB, by using the setup found here: http://www.panticz.de/MultiBootUSB , created from my Debian Sid (Unstable) desktop.

The grub entry I used was simply


#ok, boot pauses 2 minutes with a blinking cursor                                                                                                                                                                                                                              
menuentry "Fedora 15 (DVD)" {
 loopback loop /boot/iso/Fedora-15-x86_64-DVD.iso
 linux (loop)/isolinux/vmlinuz iso-scan/filename=/boot/iso/Fedora-15-x86_64-DVD.iso
 initrd (loop)/isolinux/initrd.img
}

Where my usb stick had a /boot/iso/ directory with the iso.

But note that it showed a black screen with a blinking cursor for 2 minutes after starting it from grub, before the real boot process started. I don't know why.

--- Additional comment from Fedora Admin XMLRPC Client on 2011-10-20 12:21:53 EDT ---

This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

--- Additional comment from Valent Turkovic on 2011-10-22 12:33:51 EDT ---

Are Live images of Fedora 15 iso or Fedora 16 booting via grub2 now?
Should this bug be closed?

--- Additional comment from Valent Turkovic on 2011-10-23 05:11:52 EDT ---

I tried these two grub entries on my GRUB2 multiboot USB stick, and they both fail:


menuentry "Fedora 16 Beta" {
 root (hd0,1)
 linux /iso/Fedora-16-beta/isolinux/vmlinuz0 ro root=live:LABEL=multi-boot live_dir=/iso/Fedora-16-beta/LiveOS/ rootfstype=auto liveimg quiet rhgb selinux=0
 initrd /iso/Fedora-16-beta/isolinux/initrd0.img
}


menuentry "Fedora 16 Beta test" {
 loopback loop (hd0,1)/iso/Fedora-16-Beta-i686-Live-Desktop.iso
 linux (loop)/isolinux/vmlinuz0 root=live:LABEL=multi-boot boot=isolinux iso-scan/filename=/iso/Fedora-16-Beta-i686-Live-Desktop.iso noeject noprompt --
 initrd (loop)/isolinux/initrd0.img
}

--- Additional comment from Valent Turkovic on 2011-10-23 05:13:18 EDT ---

I made a mistake, first entry works, but you have to extract Fedora ISO, if you keep the iso and try to boot it via second menu option that one fails.

--- Additional comment from Diego Viola on 2011-12-29 22:38:44 EST ---

I also look forward to see this feature implemented in Fedora.

GRUB 2 with its lookback feature is an amazing and very practical tool, it would be great if we can test further Fedora versions with loopback.

I look forward to see it implemented and use this feature!

--- Additional comment from Diego Viola on 2011-12-29 22:57:41 EST ---

(In reply to comment #15)
> I also look forward to see this feature implemented in Fedora.
> 
> GRUB 2 with its lookback feature is an amazing and very practical tool, it
> would be great if we can test further Fedora versions with loopback.
> 
> I look forward to see it implemented and use this feature!

Oops typo.

s/lookback/loopback/g

--- Additional comment from Valent Turkovic on 2012-01-27 03:59:10 EST ---

Any updates?

--- Additional comment from Mike Heller on 2012-02-29 05:57:31 EST ---

hi everybody

I figured out how to boot Fedora-16 directly from iso.
This is my grub2 entry on my bootable usb-stick:

menuentry "Fedora 16 Live" {
loopback loop /Fedora-16-i686-Live-Desktop.iso
linux (loop)/isolinux/vmlinuz0 rootfstype=auto root=UUID=<UUID-of-the-USB> liveimg ro quiet rhgb
initrd (loop)/isolinux/initrd0.img
}

maybe it helps.

--- Additional comment from Mike Heller on 2012-02-29 06:30:19 EST ---

doh, I was to quick with my post. doesen't work. :-(

--- Additional comment from Harald Hoyer on 2012-02-29 07:59:36 EST ---

Does this work?

menuentry "Fedora 16 Live" {
loopback loop /Fedora-16-i686-Live-Desktop.iso
linux (loop)/isolinux/vmlinuz0 rootfstype=auto root=live:UUID=<UUID-of-the-USB>
liveimg ro quiet rhgb
initrd (loop)/isolinux/initrd0.img
}

--- Additional comment from Mike Heller on 2012-02-29 08:20:25 EST ---

(In reply to comment #20)
> Does this work?
> 
> menuentry "Fedora 16 Live" {
> loopback loop /Fedora-16-i686-Live-Desktop.iso
> linux (loop)/isolinux/vmlinuz0 rootfstype=auto root=live:UUID=<UUID-of-the-USB>
> liveimg ro quiet rhgb
> initrd (loop)/isolinux/initrd0.img
> }

nope, it doesen't.

--- Additional comment from Ron on 2012-03-05 14:57:32 EST ---

I've tested Fedora 17 Alpha and it seems that there is still no option for this use case but I found another way to boot from an ISO. This is my Grub2 menu entry:

menuentry "Fedora ISO" { 
    set isofile="/iso/Fedora-17-Alpha-x86_64-Live-Desktop.iso" 
    loopback loop "$isofile" 
    set root=(loop) 
    linux /isolinux/vmlinuz0 root=live:/isodevice$isofile rootfstype=auto ro liveimg rd.luks=0 rd.md=0 rd.dm=0 rd.break=pre-udev 
    initrd /isolinux/initrd0.img 
} 

This pauses the boot process and gives me a command prompt where I enter the following commands:

mkdir /isodevice
mount /dev/sda1 /isodevice
exit

Now Dracut is able to find the ISO file and successfully boots.

--- Additional comment from Harald Hoyer on 2012-03-06 02:27:56 EST ---

(In reply to comment #22)
> I've tested Fedora 17 Alpha and it seems that there is still no option for this
> use case but I found another way to boot from an ISO. This is my Grub2 menu
> entry:
> 
> menuentry "Fedora ISO" { 
>     set isofile="/iso/Fedora-17-Alpha-x86_64-Live-Desktop.iso" 
>     loopback loop "$isofile" 
>     set root=(loop) 
>     linux /isolinux/vmlinuz0 root=live:/isodevice$isofile rootfstype=auto ro
> liveimg rd.luks=0 rd.md=0 rd.dm=0 rd.break=pre-udev 
>     initrd /isolinux/initrd0.img 
> } 
> 
> This pauses the boot process and gives me a command prompt where I enter the
> following commands:
> 
> mkdir /isodevice
> mount /dev/sda1 /isodevice
> exit
> 
> Now Dracut is able to find the ISO file and successfully boots.

can you do "rd.break rd.shell" and wait until it errors out, then type in the dracut shell:

# ls -l /dev/disk/by*

and see if you can find a symlink to sda1?

--- Additional comment from Ron on 2012-03-06 14:23:40 EST ---

(In reply to comment #23)
> can you do "rd.break rd.shell" and wait until it errors out, then type in the
> dracut shell:
> 
> # ls -l /dev/disk/by*
> 
> and see if you can find a symlink to sda1?

Yes, there are several symlinks to the device.

--- Additional comment from Harald Hoyer on 2012-03-07 04:59:04 EST ---

(In reply to comment #24)
> (In reply to comment #23)
> > can you do "rd.break rd.shell" and wait until it errors out, then type in the
> > dracut shell:
> > 
> > # ls -l /dev/disk/by*
> > 
> > and see if you can find a symlink to sda1?
> 
> Yes, there are several symlinks to the device.

which are? Especially: /dev/disk/by-label/* ?

--- Additional comment from Ron on 2012-03-07 15:10:37 EST ---

Created attachment 568402 [details]
"ls -l /dev/disk/by*" result

In this case the device which contains the ISO is /dev/sda2 with the label "Boot"

--- Additional comment from Harald Hoyer on 2012-03-08 04:18:34 EST ---

so, this might work:

menuentry "Fedora 16 Live" {
   loopback loop /Fedora-16-i686-Live-Desktop.iso
   linux (loop)/isolinux/vmlinuz0 rootfstype=auto root=live:LABEL=Boot liveimg ro quiet rhgb
   initrd (loop)/isolinux/initrd0.img
}

--- Additional comment from Juhamatti Niemelä on 2012-03-08 05:25:19 EST ---

I have similar issue (though I'm using 64 bit image). In dracut shell ls -l /dev/disk/by-label/* gave me:

Bootstick -> ../../sdd1
Fedora-13-x86_64 -> ../../dm-0 (quite odd that label has 13 while image is F16)

So I tested following menuentry with both Bootstick and Fedora-13-x86_64 as label and neither worked.

menuentry "Fedora 16 Live 64bit" {
          loopback loop /Fedora-16-x86_64-Live-Desktop.iso
          linux (loop)/isolinux/vmlinuz0 rootfstype=auto root=live:LABEL=Fedora-13-x86_64 liveimg quiet rhgb
          initrd (loop)/isolinux/initrd0.img
}

In both cases the error message was:

dracut Warning: no root device "/dev/disk/by-label/Fedora-13-x86_64" found

and:

dracut Warning: no root device "/dev/disk/by-label/Bootstick" found


Still I could list both of them with ls -l in Dracut shell at both test times.

--- Additional comment from Ron on 2012-03-08 20:40:05 EST ---

(In reply to comment #27)
> so, this might work:
> 
> menuentry "Fedora 16 Live" {
>    loopback loop /Fedora-16-i686-Live-Desktop.iso
>    linux (loop)/isolinux/vmlinuz0 rootfstype=auto root=live:LABEL=Boot liveimg
> ro quiet rhgb
>    initrd (loop)/isolinux/initrd0.img
> }

No it doesn't and I don't think it can work without telling Dracut where it can find the ISO file. Maybe it helps if I summarize my view of the problem.

The starting point is a Fedora LiveCD ISO file on a device partition. Now Grub2 is able to mount the ISO (with the loopback command) and can directly boot the kernel and initrd image. It is important that the Grub2 context ends here and so does the loopback device.

At this point Dracut takes over and must find the livesystem root. Because the livesystem root is the ISO file it is required to mount the related device partition first. Correct me if I'm wrong but I think this is currently not possible.

I can think of two ways to get to the ISO file:

1. A kernel parameter with the device and the path to the ISO file is specified (e.g. root=live:LABEL=Boot:/iso/Fedora.iso).

2. A kernel parameter that only contains the path to the ISO file is specified (e.g. root=live:/iso/Fedora.iso). This would require to mount every device to check if it contains the ISO file. This is how the “iso-scan/filename” kernel parameter from Ubuntu works.

--- Additional comment from Mansour on 2012-03-20 02:48:26 EDT ---

Created attachment 571299 [details]
Boot from ISO using live:/*.iso boot parameter

This patch must be applied to (fedora-iso)/EFI/boot/initrd0.img

--- Additional comment from Mansour on 2012-03-20 02:50:02 EDT ---

> 2. A kernel parameter that only contains the path to the ISO file is specified
> (e.g. root=live:/iso/Fedora.iso). This would require to mount every device to
> check if it contains the ISO file. This is how the “iso-scan/filename” kernel
> parameter from Ubuntu works.

This seems to be already half implemented in F16 (and perhaps even earlier releases).

I did a patch (attached) for the missing part. I have only tested it with CD/DVD media using grub2. I also wrote a shell script which does the patching automatically:

https://gist.github.com/2132076

Example and usage info is in the comments.This is obviously just a temporary solution until Fedora folks get it sorted.

--- Additional comment from Fedora End Of Life on 2012-08-16 14:04:28 EDT ---

This message is a notice that Fedora 14 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 14. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained.  At this time, all open bugs with a Fedora 'version'
of '14' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this 
occurring, but we forgot to do that. A thousand apologies.)

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, feel free to reopen 
this bug and simply change the 'version' to a later Fedora version.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we were unable to fix it before Fedora 14 reached end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" (top right of this page) and open it against that 
version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

--- Additional comment from Valent Turkovic on 2013-02-27 09:44:01 EST ---

I have found a script that actually works:
http://git.marmotte.net/git/glim/plain/fedora18-fromiso

Details are here:
http://git.marmotte.net/git/glim/plain/README

Cheers,
Valent.

Comment 1 Taunus 2013-03-19 15:19:37 UTC
Please fix This bug. It is three years old already. The fix is simple and it can be done.

Comment 2 Taunus 2013-03-19 16:11:52 UTC
This is related https://bugzilla.redhat.com/show_bug.cgi?id=557426

Comment 3 Harald Hoyer 2013-05-29 12:22:12 UTC
Fixed in Fedora 19.

Comment 4 Andrew 2013-05-29 13:37:10 UTC
(In reply to Harald Hoyer from comment #3)
> Fixed in Fedora 19.

Awesome. I put this link here for the usage example:

http://pkgs.fedoraproject.org/cgit/dracut.git/diff/0025-dmsquash-live-add-support-for-iso-scan-filename-kern.patch?id=e787af592176f3d69f626c474d192d1b4a68b57b

Comment 5 Taunus 2013-07-07 18:54:20 UTC
Thanks. One version of grub.cfg that boots Fedora 19:

# Boot multiple .iso files from USB stick. Boot parameters are distribution specific.

set timeout=10
set default=0

menuentry "Boot from local drive" {
set root=(hd1)
drivemap -s (hd0) (hd1)
chainloader +1
}

menuentry "Redhat Enterprise Linux 6.4 Installation" {
set isofile='/rhel-workstation-6.4-x86_64-boot.iso'
loopback loop $isofile
linux (loop)/isolinux/vmlinuz ksdevice=eth0 ks=http://your.kickstart.location nousb
initrd (loop)/isolinux/initrd.img
}

menuentry "Fedora 19 Live i686" {
set isofile="Fedora-Live-Desktop-i686-19-1.iso"
loopback loop /$isofile
linux (loop)/isolinux/vmlinuz0 root=live:CDLABEL=Fedora-Live-Desktop-i686-19-1 rootfstype=auto ro rd.live.image quiet rhgb rd.luks=0 rd.md=0 rd.dm=0 iso-scan/filename=${isofile}
initrd (loop)/isolinux/initrd0.img
}

menuentry "Memtest 86+" {
 linux16 /memtest86+.bin
}