How to boot Fedora from an ISO file in GRUB 2


TL;DR: What formation of GRUB2 menuentry / linux kernel boot options do I need in order to boot Fedora using the iso as its filesystem / source / get anything to work that way, and not simply burn it to a disc, set the ISO to a VM's virtual optical drive, or empty the ISO's contents into a separate drive partition and chainload into that?

Background / Research

I need a menuentry that works. I've tried a bunch and can't remember what place I stand at. It's been a while..

This link might have almost helped, but there's no further information in that section: Ubuntu Documentation – Grub2/ISOBoot/Examples#Fedora

These links do not help, as I do not want to store every distro/tool I need to individual media:

This link seems to mention the root= parameter several times, and would be a helpful place to look, but I have not been able to use it to understand and fix my situation: fedora – Common kernel problems

An old iteration of my boot configuration with multiple items that doesn't look as messy: GitHubGist – Pysis868/grub.cfg

I believe I have taken out the '0's in the Fedora entry for the required boot files, and have gotten past that point in my progress.

I think I'm at a point of trying to get the root filesystem set-up correctly.
Right now I receive the errors:

[  <system_Step_time> dracut-initqueue[604]: mount: unknown filesystem type 'ntfs'
...<below message repeated>...
[  <system_Step_time> dracut-initqueue[604]: Warning: dracut-initqueue timeout - starting timeout scripts
[  <system_Step_time> dracut-initqueue[604]: Warning: Could not boot.
[  <system_Step_time> dracut-initqueue[604]: /dev/mapper/live-rw does not exist
[  <system_Step_time> dracut-initqueue[604]: /dev/root does not exist
        Starting Dracut Emergency Shell...

The 'ntfs' error may just be from the system trying to read from another partition. The boot files are all located on the first partition, in a FAT32 filesystem (command and output from another one of my Linux-based VMs):

username@localhost > sudo fdisk -l
Disk /dev/sda: 57.9 GiB, 62176362496 bytes, 121438208 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x745111c0

Device     Boot     Start       End  Sectors  Size Id Type
/dev/sda1  *         2048  82915264 82913217 39.5G  c W95 FAT32 (LBA)
/dev/sda2        82915265 121436159 38520895 18.4G  f W95 Ext'd (LBA)
/dev/sda5        82915328  89982975  7067648  3.4G  7 HPFS/NTFS/exFAT
/dev/sda6        89982976 117438463 27455488 13.1G 83 Linux
/dev/sda7       117440512 121436159  3995648  1.9G 82 Linux swap / Solaris

From inside the rescue shell:

dracut:/# ls /dev/s* -1

dracut:/# fdisk
sh: fdisk: command not found

Fedora-Workstation-Live-x86_64-25-1.3.iso/isolinux/grub.conf relevant excerpt:

title Start Fedora-Workstation-Live 25
    kernel @KERNELPATH@ @ROOT@ quiet
    initrd @INITRDPATH@

Fedora-Workstation-Live-x86_64-25-1.3.iso/isolinux/isolinux.cfg relevant excerpt:

menu label ^Start Fedora-Workstation-Live 25
  kernel vmlinuz
  append initrd=initrd.img root=live:CDLABEL=Fedora-WS-Live-25-1-3 quiet

I looked inside of Unetbootin's installer, but didn't find any useful files yet.

LinuxLive USB Creator 2.9.4\sources\LiLi\Boot_Menus.au3 relevant excerpt:

         & @LF & "label live" _
         & @LF & "  menu label " & Translate("Live Mode") _
         & @LF & "  kernel "&$vmlinuz_file _
         & @LF & "  append initrd="&$initrd_file&" root=UUID=" & $uuid & " rootfstype=vfat ro "&$liveimg_text&" quiet rhgb rd.luks=0" _
         & @LF & "  menu default"

Relevant excerpt from my current messy test block in /boot/grub2/grub.cfg:

menuentry "TEST Fedora-Workstation-Live-x86_64-25-1.3 TEST 2" {
  set isofile="$linuxPath/Fedora-Workstation-Live-x86_64-25-1.3.iso"
  loopback loop "$isofile"
  # linux (loop)/isolinux/vmlinuz root=live:CDLABEL=Fedora-WS-Live-25-1-3 quiet
  # linux (loop)/isolinux/vmlinuz root=UUID="2016-11-15-22-03-09-00" rootfstype=vfat ro quiet rhgb rd.luks=0
  linux (loop)/isolinux/vmlinuz iso-scan/filename="$isofile" rootfstype=vfat ro quiet rhgb rd.luks=0
  # linux (loop)/isolinux/vmlinuz root=CDLABEL=Fedora-WS-Live-25-1-3 quiet
  initrd (loop)/isolinux/initrd.img

Link related to the topic, just doesn't cover Fedora specifically: SuperUser – grub: boot from ISO

I don't know if this helps, but I think the search command is neat: askubuntu – How to boot from an .iso file in GRUB2? [duplicate]

I would not be using this from the hard disk and the partition's filesystem directly.

This did not specifically cover the root= boot/kernel parameter, but it does seem to have template formats that resemble its value under the 9.1.4. Specifying the Installation Method section: Fedora Documentation – Chapter 9. Boot Options

Installation method – Option format

  • CD or DVD drive – repo=cdrom:device
  • Hard Drive – repo=hd:device/path
  • HTTP Server – repo=http://host/path
  • FTP Server – repo=ftp://username:password@host/path
  • NFS Server – repo=nfs:server:/path
  • ISO images on an NFS Server – repo=nfsiso:server:/path

Actually, reading into the help bubble that is coupled with the link to the "Boot Options" page this time, tells me I can read the /usr/share/doc/kernel-doc-version/Documentation/kernel-parameters.txt file from the kernel-doc package for the full list of kernel options.

That package was not installed on my F25 system by default, and I also did not see it in the repository. I only saw kernel- packages mainly with the suffixes core, PAE, header, modules, debug, devel, rpm, and tools.


Host: Windows 10 Pro x64

Hyperviser: Oracle VirtualBox 5.1.22 with Oracle VM VirtualBox Extension Pack 5.1.22 ran as administrator for direct disk access

VM Specs.png


Best Answer

From another iteration of some Google searching, this link seemed like a good trail: askubuntu - Grub2/ISOBoot#Example_ISO_Menuentries

Led me here: askubuntu - Grub2/ISOBoot/Examples#Gparted

When working on that random other section of my boot device, I noticed the link in the example code, leading me to here: ArchLinux - Multiboot USB drive - Fedora#Workstation_live_medium

and it boots!

ArchLinux always has good wiki pages :)

Related Question