was: Dual boot linices?

Jarod Wilson jarod at wilsonet.com
Tue Oct 21 21:26:23 EDT 2008


On Oct 21, 2008, at 5:02 PM, bruce.labitt at autoliv.com wrote:

>>> Anyone installed ubuntu to be
>>> dual boot with centos?  What do I look out for?
>>
>> If you wanted to use a shared /boot between the two, it'd be a bit
>> messy... For one, Ubuntu uses menu.lst for its grub config, CentOS  
>> uses
>> grub.conf, with a menu.lst symlink to it, so depending on which  
>> distros
>> version of grub is actually installed into the boot sector...
>>
>> What I'd do is have separate /boot partitions for each. Install  
>> Ubuntu
>> with /dev/sda1 as /boot, with grub installed into the MBR. Then  
>> install
>> CentOS with /dev/sda2 as its boot, and install grub into the  
>> beginning
>> of the partition, instead of the MBR. Now configure Ubuntu's grub to
>> chainload CentOS' grub on /dev/sda2. Then both can happily update  
>> their
>> boot menu options without stomping on one another.
>>
>
> I already have CentOS installed on my machine.

Ah. That complicates things, unless you happened to leave a bunch of  
free space on the disk... Or are using lvm and feel comfortable  
shrinking partitions...

> I don't really understand
> your explanation of what to do.  I think it is a reflection of my
> knowledge in this area rather than your explanation.

If there were nothing already installed, 6 partitions is what I'd do:

/dev/sda1 -- ~100MB /boot for Ubuntu
/dev/sda2 -- ~100MB /boot for CentOS
/dev/sda3 -- some appropriate amount of swap (can be used by both)
/dev/sda5 -- / for Ubuntu
/dev/sda6 -- / for CentOS
/dev/sda7 -- /data or some such thing, for data you want shared  
between the two

I'd make /data as /home potentially, but I don't know how well using a  
shared /home directory would be, given that the versions of gnome  
differ by about a year and a half between current Ubuntu and CentOS...

So you install Ubuntu first, saving space for CentOS. Ubuntu installs  
grub into the master boot record of the drive. Next, you install  
CentOS. When it asks about bootloader, choose to customize, and  
install it into /dev/sda2 instead of the master boot record.  
Everything else should be the same as usual. Now, when you reboot,  
only Ubuntu will be available. Boot it, and add a chainloader entry  
to /boot/grub/menu.lst that points to /dev/sda2 (I forget the exact  
syntax for this). Now reboot again. If you choose the chainloader  
option, it'll spin up the CentOS copy of grub, and you can choose  
which CentOS kernel to boot. (I believe you could also add a  
chainloader option in the CentOS grub to hop back to the Ubuntu grub).  
You could also of course flip-flop the two, which is what it sounds  
like you might be looking at doing, since CentOS is already installed.

> What do I need to change in CentOS first?

First and foremost, you need disk space free.

> How do I alter the Ubuntu install, so I don't hose the CentOS install?

Definitely need to do custom partitioning, making sure not to blow  
away the CentOS partitions.

> Why are these linices hostile to each other?  Philosophical  
> question, I
> sort of understand your explanation.  Many linux distros are  
> tolerant to a
> dual boot with windows, but not as it seems, to other linux distros?

Like Bill said, some distros have slightly different flavors of  
bootloaders, and yeah, they typically only anticipate coexisting with  
a Windows install. I *think* I vaguely recall seeing openSUSE preserve  
bootloader configs from another Linux install once. But yeah, even Red  
Hat Enterprise Linux and Fedora don't cooperate together, the second  
one installed moves the first's grub.conf out of the way if you use a  
shared /boot, so you have to actually munge the old grub.conf.rpmsave  
onto the end of the new grub.conf. Then things pretty much Just Work.  
Should actually be doable with an Ubuntu/CentOS mix as well, with  
liberal use of symlinks, I think...

-- 
Jarod Wilson
jarod at wilsonet.com





More information about the gnhlug-discuss mailing list