3

I've got a usb-key setup to multi-boot different Linux images. I'm trying to add CentOS, here's a post with similar entries for grub.cfg

set drive_label=multipass01
set isopath=/iso

menuentry "CentOS-6.3-x86_64-LiveCD" {

# Tried the following root designations;
# root=live:LABEL="multipass01" 
# root=live:LABEL=multipass01 
# root=live:LABEL="multipass01":$isofile
# root=live:LABEL=multipass01:$isofile
# root=live:/dev/disk/by-label/$drive_label$isofile
# root=live:UUID=3A55-12BC:$isofile
# root=live:UUID=:$isofile
# root=UUID=3A55-12BC
# root=live:$isofile
# iso-scan/filename=$isofile

    set isofile="$isopath/CentOS-6.3-x86_64-LiveCD.iso"
    loopback loop $isofile
    linux (loop)/isolinux/vmlinuz0 boot=isolinux root=live:LABEL=multipass01:$isofile rootfstype=auto ro liveimg 3 rhgb rd.luks=0 rd.md=0 rd.dm=0 splash --
    initrd (loop)/isolinux/initrd0.img
}

Heres the result of attempting to boot this entry (regardless of which root=);

kernel panic

edit; related fedora bug

1

I tried the same approach as you(but the liveos is Fedora 17 for me), I failed too, we can't use isofile for root=live: option. root=live:LABEL=multipass01:$isofile can't be recognized(maybe it can be recognized in future fix, but I can't wait).

So I used a different approach:

#step 1 create a blank partition that can hold the liveos.(/dev/sdb5)

#step 2 copy the liveos to the partition
dd if=/my-path-to-f17-live-iso of=/dev/sdb5

#step 3 change the grub.cfg,
#note1: don't need to use loopback, just use (hdX,Y).
#note2: "root=" becomes "root=live:/dev/sdb5"
menuentry 'F17 install' --class fedora --class gnu-linux --class gnu --class os {
    insmod part_msdos
    linux (hd1,5)/isolinux/vmlinuz0 linux root=live:/dev/sdb5 rootfstype=auto ro liveimg rd.luks=0 rd.md=0 rd.dm=0 
    initrd (hd1,5)/isolinux/initrd0.img
}

You can try this approach too, the /dev/sdb5 act as a CD/DVD-rom in this approach.

Another approach is changing the python script of the dracut to make it recognize such options, but I don't think it is worth.

0

Was not able to find a viable answer either. But it seems to be implemented by now.

This post mentions a commit which implements said functionality in dracut (this is what you want).

Remember that the root= option is a kernel commandline parameter:

root=       [KNL] Root filesystem
        See name_to_dev_t comment in init/do_mounts.c.

For these kinds of setups to work, you have to look inside the initramfs infrastructure and see whether this is supported. (i.e. the kernel mounting .iso's for use as root is apparently not a kernel task?)

If you look at comment 38 and later you will see some sort of step by step instruction. I'm going to test this myself now.

EDIT: This is not going to fly for Centos 6.4 :/ which has an ancient version of dracut.

0

Just like this

menuentry "CentOS-7.0-1406-x86_64-DVD" {
    set root='hd1,msdos1'
    set isofile='/CentOS-7.0-1406-x86_64-DVD.iso'
    loopback loop $isofile
    linux (loop)/isolinux/vmlinuz noeject inst.stage2=hd:/dev/vdb1:$isofile
    initrd (loop)/isolinux/initrd.img
}
  • 1
    Could you further explain what you changed an why? – Raphael Ahrens Jul 26 '16 at 7:24
  • I just add inst.stage2=hd:/dev/vdb1:$isofile, it's specifies the location of the installation program runtime image to be loaded. You can look at this. Sorry for my English! – zijung Aug 29 '16 at 15:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.