LinuxQuestions.org
Visit Jeremy's Blog.
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-05-2016, 09:30 PM   #1
firejc5
LQ Newbie
 
Registered: Mar 2016
Posts: 1

Rep: Reputation: Disabled
Dual Boot OS w/ .iso file


I am running CentOS but would like to also be able to run Ubuntu with only the .iso file.

How do you configure the GRUB file on a CentOS system using the .iso file?

Where does you retrieve the kernel/initrd paths?
 
Old 03-05-2016, 09:44 PM   #2
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
Hi & Welcome to LQ-

If you want to run Ubuntu on your Centos machine with only the .iso file you will have to take the .iso file and put it on a usb memory stick and make it bootable.

<OR> burn the .iso to a fresh CD/DVD.
Either way go into the BIOS and set the machine to boot to either 'usb' or the 'CD/DVD Drive'

I use Unetbootin to do that.
http://unetbootin.github.io/
 
Old 03-06-2016, 03:26 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
i think it is possible to point grub to an actual .iso file on the hard drive and tell it to boot from that.
it would then boot into a ubuntu live session, i guess.
actually a quick search seems to confirm this: https://duckduckgo.com/?q=grub+boot+.iso+file
 
Old 03-06-2016, 03:14 PM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,547

Rep: Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498
A more detailed explanation of the process is at the link to Ubuntu below.

https://help.ubuntu.com/community/Grub2/ISOBoot

I don't have CentOS installed so I can't test it. I believe CentOS defaulted to Grub2 with 7.0. If you still use Grub Legacy with an older CentOS, you would first have to create a mount point for the iso, then loop mount the iso, create a directory in CentOS, copy all the files/folders from the loop mount point to the new directory and then create a menu entry in either Grub Legacy grub.conf/menu.lst or the Grub2 grub.cfg file.
 
Old 03-06-2016, 04:53 PM   #5
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
Yeah, I'm running Centos 7 and it came with Grub 2.

Quote:
you would first have to create a mount point for the iso,
To do that I would just make a directory in my Home right?

I'm assuming the Menu Entry would look something like this?
label = /dev/sdb ubuntu

Last edited by Ztcoracat; 03-06-2016 at 04:57 PM.
 
Old 03-06-2016, 05:06 PM   #6
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
Here's a pic of the Grub and Config files in Centos.
http://i1052.photobucket.com/albums/...2017-59-48.png

Yancek the grub config file that you spoke of that we would edit, do you mean the one in the pic that says:
Code:
config-3.10.0-327.10.1.el7.x86_64
That's the file that says not to Edit it-
N/M that file was the kernel config file.
I found the grub2.cfg file however it is broken.

The error message says that the link cannot be used because it's target
./boot/grub2/grub.cfg' doesn't exist.

I'll do what I can to fix it or create another one and explain for OP.
I found the grub.d and the grub2.cfg in /etc/grub.

Last edited by Ztcoracat; 03-06-2016 at 06:06 PM.
 
Old 03-07-2016, 09:05 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,008

Rep: Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629
I'm kind of confused as to the question.

If you mean that you want to boot ubuntu directly from an iso file then you don't configure the kernel options. You boot to the iso. Not even sure if grub2 can boot to an iso, I know they were working on it.

May have to chain to grub4dos,grub4nt or other loader that can boot an iso directly. Not all iso's will boot this way.

Last edited by jefro; 03-07-2016 at 09:07 PM.
 
Old 03-07-2016, 09:34 PM   #8
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 couldn't find the Grub2 grub.cfg on my Centos box but I found it on my Korora desktop and where the menu entries are.

Code:
menuentry 'Korora (0-rescue-5cd71d3e8e8c4a5cad09e4025c445a49) 23 (Workstation Edition)' --class korora --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-5cd71d3e8e8c4a5cad09e4025c445a49-advanced-caf8ef94-ed06-403c-8934-abf6aa39381f' {
This is an old thread but it explains how to create a mnt point.
http://www.linuxquestions.org/questi...-linux-906731/
 
Old 03-08-2016, 07:45 PM   #9
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,547

Rep: Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498
Quote:
you would first have to create a mount point for the iso,
That wasn't clear. The above statement was in reference to using Grub Legacy to boot an extracted iso file which would then need to be copied to a directory on CentOS and a proper entry made in the grub.conf/menu.lst file.

If you are booting an iso, you just point to it in grub.cfg with Grub2. I usually put it in the / of the filesystem I am booting from but it can also be in the /boot directory and possibly elsewhere. I haven't tried anything else.

Quote:
Yancek the grub config file that you spoke of that we would edit, do you mean the one in the pic that says:
config-3.10.0-327.10.1.el7.x86_64
No. The image you posted shows a Grub directory as well as a Grub2 directory and the grub.cfg file I would expect to find in Grub2.

Grub2 has been able to directly boot iso files for years. I usually boot an iso to install to another partition rather than using a DVD or flash drive. Most any Ubuntu derivative will work and you can also boot a Slackware iso, done that. Probably there are others that I haven't tested but I think there are probably a lot of distributions which cannot be booted directly from iso.

The menuentry below is an example of an entry in the Grub2 grub.cfg file to directly boot the Ubuntu 14.04 iso. It's in the / of the sdb3 partition so that would have to be changed.

Quote:
menuentry "UBUNTU-14.04-iso" {
insmod part_msdos
insmod ext2
set root='hd1,msdos3'
loopback loop (hd1,msdos3)/ubuntu-14.04.2-desktop-i386.iso
linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/ubuntu-14.04.2-desktop-i386.iso
initrd (loop)/casper/initrd.lz
}
If you want this on a permanent basis, put the entry in the /etc/grub.d/40_custom file, save the change and run update-grub or grub-mkconfig, depending upon your system.

Last edited by yancek; 03-08-2016 at 07:52 PM.
 
1 members found this post helpful.
Old 03-10-2016, 07:23 PM   #10
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
Quote:
Grub2 has been able to directly boot iso files for years. I usually boot an iso to install to another partition rather than using a DVD or flash drive.
I've never done that and I'm having trouble understanding how you were able to complete that task.
I'll do some reading online.
 
Old 03-10-2016, 08:45 PM   #11
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,008

Rep: Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629
Grub doesn't actually boot the iso file directly. You have to peek into the iso and find some files and create a menu. Almost more trouble than it's worth. This is what the OP I now get was originally asking about.

https://help.ubuntu.com/community/Gr...OBoot/Examples

Grub4dos is a slightly more direct approach.
 
1 members found this post helpful.
Old 03-10-2016, 09:01 PM   #12
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
Quote:
Originally Posted by jefro View Post
Grub doesn't actually boot the iso file directly. You have to peek into the iso and find some files and create a menu. Almost more trouble than it's worth. This is what the OP I now get was originally asking about.

https://help.ubuntu.com/community/Gr...OBoot/Examples

Grub4dos is a slightly more direct approach.
Thanks-
 
Old 03-10-2016, 10:23 PM   #13
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,547

Rep: Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498Reputation: 2498
Quote:
I've never done that and I'm having trouble understanding how you were able to complete that task.
If you are booting Ubuntu or one of its derivatives, the menuentries for all will be identical with the exception of the actual name of the iso file and the menuentry title so you won't need to do a loop mount to see what menuentry you need. If you are trying to boot some other distribution, the kernel and initrd path lines will be different so you would need to loop mount the iso. You would then check the syslinux, isolinux or whatever menu you have and modify it to fit Grub2 entries and put them in the grub.cfg file on your primary boot OS partition. I guess that's what jefro is referring to by "peek into the iso and find some files".

Once you know how to do this, it doesn't take any longer than burning a DVD or putting an iso on a flash drive plus you don't need to be buying DVDs and flash drives for the purpose. As I indicated above, there are a lot of distributions which won't work. Most Ubuntus should and a few others, some of which are listed at the link above.

I'm not sure what part of this you are having trouble with?

Last edited by yancek; 03-10-2016 at 10:25 PM.
 
Old 03-10-2016, 11:01 PM   #14
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
Quote:
If you are booting Ubuntu or one of its derivatives, the menuentries for all will be identical with the exception of the actual name of the iso file and the menuentry title so you won't need to do a loop mount to see what menuentry you need.
In this case the derivative is Black Lab Linux that I can easily transfer to my Centos box from my Slack box with a pendrive.
What configuration file does the .iso of Black Lab Linux go in?

Quote:
If you are trying to boot some other distribution, the kernel and initrd path lines will be different so you would need to loop mount the iso.
I would like to try to boot other distributions as a practice but don't understand how to 'loop mount the iso'

-::-I'd be happy not to have to purchase any more flash drives. I stopped burning DVD's a few years ago.-::-
 
Old 03-10-2016, 11:15 PM   #15
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
Quote:
The ISO file may be stored on any partition accessible to GRUB 2. The partition format does not need to be ext3/4.
In that case I can use g-parted to create a new partition.

Ensuring to properly identify the location of the ISO in the menuentry's PATH is what I'm having trouble with.
Once I figure that out the partition will be mounted by Grub2; right?

I'll re-read Grub2/ISOBoot when I have more time.
 
  


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 06:23 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