0

I could not get working a grub2 custom item menu for installing Centos 7 on a VM.

Actual scenario from lsblk command:

1 disk (sda), with two partitions: sda1 mounted on /BOOT, sda2 mounted on / (dev/sda2/centos-root) and the swap (dev/sda/centos-swap).

I have the ISO file loaded here: /home/user/CentOS-7-x86_64-Minimal-1708.iso.

I edited /etc/grub.d/40_custom as follows:

menuentry 'CentOS7_Test' --class centos --class gnu-linux --class gnu --class os  {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_msdos
        insmod xfs
        set root='hd0,msdos1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1 --hint='hd0,msdos1'  7ffca464-c438-4591-be4f-4a7d968087cb
        else
          search --no-floppy --fs-uuid --set=root 7ffca464-c438-4591-be4f-4a7d968087cb
        fi
        linux16 /vmlinuz inst.repo=hd:/dev/sda2:home/user/CentOS-7-x86_64-Minimal-1708.iso
        initrd16 /initrd.img
}

Then, I ran the command grub2-mkconfig -o /boot/grub2/grub.cfg and rebooted. Both vmlinuz and initrd.img have been extracted from the /isolinux directory within the ISO and placed into /BOOT directory.

When I select the CentOS7_Test as custom menu item, I finally get this error during installation:

mount: /run/install/isodir/home/user/iso-file-name: failed to setup loop device: No such file or directory

Warning: /run/install/isodir/home/user/iso-file-name has no suitable runtime

May I ask you some hints how to fix the problem? Thank you.

Your Answer

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

Browse other questions tagged or ask your own question.