126 – BOOT CENTOS OR FEDORA FROM AN ISO FILE USING GRUB4DOS

Table of Contents

Here is how to boot directly from a CentOS 7 or Fedora 20 ISO file using grub4dos.

The USB drive must be formatted as FAT32 or ext2/3/4 – NOT NTFS.

Use a November 2014 or later version of grub4dos.

The full path and filename of the ISO file must not contain spaces.

CENTOS 7

It is possible to boot CentOS directly from an ISO file using grub4dos, but you must specify the CD Volume Label correctly and the full path of the ISO file.

You must pay particular attention to any spaces that are in the ISO volume label (if possible, remove any spaces to make life easier!).

NO SPACES! – DO NOT USE A PATH OR ISO FILENAME THAT HAS SPACES IN IT (using \\x20 in the iso-scan/filename= parameter does not seem to work, or anything else I have tried such as %x20!)

CD volume lablels, Paths and Filenames are case sensitive.

If you use a CD/DVD ISO editing tool such as UltraISO, it will display the volume label of the ISO.

If the ISO volume label is A B (note the space in the label) then:

# spaces must be replaced by \\x20 in a volume label

set LBL=A\\x20B

Example menu (only works for CentOS 7 not CentOS 6)

  • title Boot CentOS 7 from ISO\n Direct boot CentOS 7 from ISO file
  • #ISO is full path to ISO – no spaces
  • set ISO=/_ISO/CentOS-7.0-1406-x86_64-DVD.iso
  • #LBL=CD VOLUME LABEL OF THE ISO – spaces replaced by \\x20
  • set LBL=CentOS\\x207\\x20x86_64
  • map %ISO% (0xff) || echo -e $[0147]%ISO% IS NOT CONTIGUOUS! && map –mem %ISO% (0xff)
  • map –hook
  • root (0xff)
  • # CDLABEL must match ISO volume label (usually file name)
  • # NTFS is not supported! use FAT32 or ext2/3/4
  • # ISO must not have spaces
  • echo
  • echo -e $[1174]WARNING: THIS WILL NOT WORK ON NTFS DRIVES (use FAT32 or ext2/3/4).
  • echo
  • kernel /isolinux/vmlinuz root=live:CDLABEL=%LBL% iso-scan/filename=%ISO% rd.live.image vga=791
  • initrd /isolinux/initrd.img
  • boot

FEDORA 20

You can use the same technique for Fedora too (you can add parameters such as quiet or splash or nosplash or vga=ask as required

  • title Boot Fedora 20 from ISO\n Direct boot Fedora from ISO file
  • #ISO is full path to ISO – no spaces
  • set ISO=/_ISO/Fedora-Live-Desktop-x86_64-20-1.iso
  • #LBL=CD VOLUME LABEL OF THE ISO (usually same as ISO filename) – spaces replaced by \\x20
  • set LBL=Fedora-Live-Desktop-x86_64-20-1
  • map %ISO% (0xff) || echo -e $[0147]%ISO% IS NOT CONTIGUOUS! && map –mem %ISO% (0xff)
  • map –hook
  • root (0xff)
  • # CDLABEL must match ISO volume label (usually file name)
  • # NTFS is not supported! use FAT32 or ext2/3/4
  • # ISO must not have spaces
  • echo
  • echo -e $[1174]WARNING: THIS WILL NOT WORK ON NTFS DRIVES (use FAT32 or ext2/3/4).
  • echo
  • kernel /isolinux/vmlinuz0 iso-scan/filename=%ISO% root=live:CDLABEL=%LBL% nosplash rootfstype=auto live-config.timezone=America/Los_Angeles ro rd.live.image rhgb rd.luks=0 rd.md=0 rd.dm=0
  • initrd /isolinux/initrd0.img
  • boot

TROUBLESHOOTING

Symptoms and causes:

Loading progress bar or splash screen appears but activity LED on USB drive is not flashing

The iso-scan/filename was correct, but the CDLABEL was specified incorrectly. (press ESC to see messages)

Warning: /dev/disk/by-label/Fedora-Live-Desktop-x86_64-20-1 does not exist

Warning: /dev/mapper/live-rw does not exist

The iso-scan/filename was not correctly specified and so it was not mounted as a filesystem by linux.

dracut: FATAL: For argument ‘ip=frommedia’\nSorry unknown value ‘frommedia’

Check E2B USB drive is not NTFS!

dracut-initqueue[323]: mount: unknown filesystem type ‘ntfs’

There will be one line for every NTFS volume found (make sure the E2B drive is not formatted as NTFS)

Easy2Boot (E2B) is popular multiboot USB solution that also contains agFM and Ventoy. It supports both Legacy and UEFI.
Simply copy on your bootable ISO files to the E2B USB drive and boot! Boot to DOS, Linux, Windows Install ISOs (XP>Win11),
automate Windows installs, WIM files, VHD files, images of flash drives, Linux ISO+persistence, etc.
E2B is unique in that it uses partition images which allows you to directly boot from Secure Boot images (no need to disable Secure Boot or run MOK manager or modify your UEFI BIOS).

eBooks (multi-buy discount 10%)

The following eBooks (in PDF format) are available from the developer (rated 4.5/5 stars).

Also visit Easy2Boot.xyz and the my blog – please subscribe for the latest news, tips, USB boot articles and news of free eBook updates.