LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   CentOS (https://www.linuxquestions.org/questions/centos-111/)
-   -   Dual Boot OS w/ .iso file (https://www.linuxquestions.org/questions/centos-111/dual-boot-os-w-iso-file-4175574078/)

Ztcoracat 03-17-2016 08:20 PM

This entry goes in the grub2.cfg correct?

Quote:

menuentry "black lab" {
insmod part_msdos
insmod ext2
set root='hd1,msdos3'
loopback loop (hd1,msdos3)/black-lab-702-x86_64.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/black-lab-702-x86_64.iso
initrd (loop)/casper/initrd.gz
}
<OR> should I cp it and place it in the /etc/grub.d instead?

yancek 03-17-2016 11:21 PM

Quote:

This entry goes in the grub2.cfg correct?
Either would work. If you put it in /boot/grub/grub.cfg file, do NOT run grub-mkconfig. Put it right below your CentOS menuentry.
If you put it in /etc/grub.d/40_custom then you MUST run grub-mkconfig. Make sure you change the set root line to below as it is on sda1. Also, the iso name has to be exact if you don't have the same one listed below. Running grub-mkconfig is shown at the link below. I would suggest you put the iso in the /boot directory as it is more likely to boot but you can try it from the Downloads directory. Obviously, if you do move it to the /boot directory, you need to change the path on the loopback and linux lines to reflect that.

Quote:

menuentry "black lab" {
insmod part_msdos
insmod ext2
set root='hd0,msdos1'
loopback loop (hd0,msdos1)/black-lab-702-x86_64.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/black-lab-702-x86_64.iso
initrd (loop)/casper/initrd.gz
}
Where was the grub.cfg file or is it grub2.cfg? According to the information I could find on the Red Hat and CentOS sites, it should be in the /boot/grub2 directory. Post back your results. I don't think it will boot the iso directly with CentOS so I would be interested to know if it worked.



http://superuser.com/questions/78130...le-in-centos-7

Ztcoracat 03-18-2016 04:39 PM

I typed the menuentry under the Centos rescue menu entry.

Code:

menuentry 'CentOS Linux, with Linux 0-rescue-84da9de2297e494a9a67e135e79bf1fc' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-84da9de2297e494a9a67e135e79bf1fc-advanced-4f9c4f4e-fe63-4c0e-87cc-e17dea438df4' {
        load_video
        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'  41d972b5-1780-4093-8d06-36cc0dd63503
        else
          search --no-floppy --fs-uuid --set=root 41d972b5-1780-4093-8d06-36cc0dd63503
        fi
        linux16 /vmlinuz-0-rescue-84da9de2297e494a9a67e135e79bf1fc root=UUID=4f9c4f4e-fe63-4c0e-87cc-e17dea438df4 ro rd.lvm.lv=cl/root vconsole.font=latarcyrheb-sun16 crashkernel=auto  vconsole.keymap=us rd.lvm.lv=cl/swap rhgb quiet
        initrd16 /initramfs-0-rescue-84da9de2297e494a9a67e135e79bf1fc.img
}

menuentry"blacklab"{
insmod part_msdos
set root='hd0,msdos1'
loopback loop (hd0,msdos1)/black-lab-702-x86_64.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/black-lab-702-x86_64.iso
initrd (loop)/casper/initrd.gz
}


### END /etc/grub.d/10_linux ###

Quote:

Where was the grub.cfg file or is it grub2.cfg?
It was in the grub2 config file.

For now the black lab .iso is in the Downloads directory. I'll update Grub and see if it boots. If it doesn't I'll move it to the /boot directory.

Ztcoracat 03-18-2016 06:10 PM

Running update-grub as root returned:
Code:

no such command
I also tried 'yum update grub as root' and the result was the same.
After adding the black lab menu entry to the /boot/grub2/grub.cfg file and rebooting it didn't work.
My Vaio booted directly into CentOS 7.

I do not run Centos as sudo but rather su-

yancek 03-18-2016 08:03 PM

I downloaded and installed CentOS 7 to check it out. The grub.cfg file was in the /boot/grub2 directory. The reason you previously saw the grub.cfg file as empty is because you tried to open it as a normal user. Did this to test and got the same message you posted earlier and an empty file showing. No problem with it as root.

I moved the black lab iso to the / of the CentOS partition and used the loopback entry pointing to it and it failed with the message:

Quote:

no server is found, you need to load the kernel first
I extracted the black lab directories/files from the iso and copied them to the / of CentOS and then changed the menuentry path to the kernel (vmlinuz) and initrd in the CentOS grub.cfg file and once again it failed with the message:

Quote:

file /casper/vmlinuz not found, you need to load the kernel first.
I've booted extracted Linux iso files dozens of times with various Linux distributions using Grub Legacy and Grub2 and this is the first time I can recall not being able to boot an extracted iso from /. Booting an iso usually fails unless you are using one of the Ubuntus so that was no surprise.

Quote:

loopback loop (hd0,msdos1)/black-lab-702-x86_64.iso
If you try to boot it from the boot or Downloads directory, you need to change the above, for example from boot:

Quote:

loopback loop (hd0,msdos1)/boot/black-lab-702-x86_64.iso
Quote:

Running update-grub as root returned
Yes, that is expected behavior because only the Ubuntus and maybe Debian use update-grub. It's just a stub pointing to the grub-mkconfig command. Look at the link in my last post for the exact command. If you put the entry in grub.cfg, do NOT run grub-mkconfig as it will remove that entry. Just save and reboot. If you had put the entry in the /etc/grub.d/40_custom, then you would run grub-mkconfig.

Ztcoracat 03-18-2016 09:50 PM

Did Black Lab Linux boot for you under Centos 7?

I don't know how to load the kernel first:-

Quote:

I've done this dozens of times with various Linux distributions
-::-Clearly, you have the experience with this that I don't.-::-
I won't give up so easily yancek, but I have to leave it alone for a while it's no longer enjoyable and challenging like it first was.

yancek 03-19-2016 08:53 AM

Quote:

Did Black Lab Linux boot for you under Centos 7?
No. Results explained in my last post. I don't know how to 'load the kernel first' in this instance either. Generally, you would have a correct path to where the kernel is. I was not surprised the iso didn't boot, most systems won't boot an iso copied to a partition but most Linux systems I have used will boot an extracted iso copied to the / of a partition. I might try some different options is I have the time as I find it interesting, to a point.

Ztcoracat 03-19-2016 04:29 PM

Thank you for your time yancek it was good to learn something new.

colorpurple21859 03-19-2016 04:42 PM

you need to run
Code:

grub-mkconfig -o /boot/grub2/grub.cfg
to update the grub config file if you put your iso entry in /etc/grub.d/40_custom, but will change any changes made to /boot/grub2/grub.cfg

yancek 03-20-2016 04:24 PM

Quote:

Did Black Lab Linux boot for you under Centos 7?
I'm happy to report a yes to that question now. Another PEBKAC error, embarassing. I had the set root line pointing to the wrong drive as CentOS was on an external drive. I noticed this morning the CentOS menuentry had a set root of hd0,msdos11 and I had been using hd1,msdos11 because it was an external drive. So what did work is having the actual iso file for blacklab in the / of the CentOS partition and booting it from sdb11 using the grub.cfg menuentry below. I was able to navigate through the filesystem and start the installer:

Quote:

menuentry 'Blacklab-iso' {
insmod part_msdos
insmod ext2
insmod iso9660
set root='hd0,msdos11'
loopback loop /black-lab-702-x86_64.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/black-lab-702-x86_64.iso quiet splash --
initrd (loop)/casper/initrd.gz
}
It also worked putting the iso file in the /boot directory by changing the path to /boot/black-lab-702-x86_64.iso and it worked.


All times are GMT -5. The time now is 07:31 PM.