LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 03-17-2016, 08:20 PM   #31
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176

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?
 
Old 03-17-2016, 11:21 PM   #32
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,501

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
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

Last edited by yancek; 03-17-2016 at 11:24 PM.
 
Old 03-18-2016, 04:39 PM   #33
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
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.

Last edited by Ztcoracat; 03-18-2016 at 04:43 PM.
 
Old 03-18-2016, 06:10 PM   #34
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
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-
 
Old 03-18-2016, 08:03 PM   #35
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,501

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
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.

Last edited by yancek; 03-19-2016 at 08:44 AM.
 
Old 03-18-2016, 09:50 PM   #36
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
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.

Last edited by Ztcoracat; 03-18-2016 at 10:02 PM.
 
Old 03-19-2016, 08:53 AM   #37
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,501

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
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.

Last edited by yancek; 03-19-2016 at 08:54 AM.
 
Old 03-19-2016, 04:29 PM   #38
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Thank you for your time yancek it was good to learn something new.
 
Old 03-19-2016, 04:42 PM   #39
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,346

Rep: Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589Reputation: 1589
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

Last edited by colorpurple21859; 03-19-2016 at 04:45 PM.
 
Old 03-20-2016, 04:24 PM   #40
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,501

Rep: Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489Reputation: 2489
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
pxe boot an iso file aclhkaclhk Linux - Networking 4 09-04-2009 12:04 AM
Which ISO for RHEL 4 WS for x86-64 - And How to Dual-Boot Vista 64 steventimothy Red Hat 2 05-11-2009 01:06 AM
Boot an iso file. LiquidLithium Linux - Newbie 2 07-30-2005 03:51 AM
Got the ISO working...Now How to set up dual boot xp and suse 9.3 smattmac Linux - Newbie 6 06-10-2005 05:17 PM
Dual layer ISO file mrohekar SUSE / openSUSE 4 05-16-2005 09:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 04:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration