[SOLVED] Dual-boot with 2 Linux distros - how?

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

[SOLVED] Dual-boot with 2 Linux distros - how?

Postby zugunder » Sep 16th, '13, 23:45

Hi,

I'd like to try one more distro on my laptop (Xubuntu) and I am curious what exactly I should do in order to be able to use the existing bootloader (from Mageia3).
So, as of now, I have a Mageia bootloader managing Mageia 3 and Win7 on the same (and only) hard drive.
As far as I understand, I need to make a new set of partitions (I am thinking of /, /home and swap) and to install another distro there. My question is - will it be better to skip bootloader installation completely or to install it to the new distro's root partition? Will it be automatically recognized by Mageia's grub or will I have to specify it (via MCC or config files) manually?
Sorry, I've never done that before and am not aware of grub functions in detail.

Thank you.
Last edited by zugunder on Oct 13th, '13, 23:12, edited 1 time in total.
zugunder
 
Posts: 388
Joined: Jun 10th, '11, 00:22

Re: Dual-boot with 2 Linux distros - how?

Postby Ken-Bergen » Sep 17th, '13, 01:12

Someone else that knows more than me should help you with the bootloader.

For partitioning a separate / partition would enough. You can share the /swap partition as only one operating system will be running at any one time.
You can also share the /home partition as long as you create different users.
Ken
Ken-Bergen
 
Posts: 1019
Joined: Mar 30th, '11, 02:45
Location: Chilliwack, BC, Canada

Re: Dual-boot with 2 Linux distros - how?

Postby David_Batson » Sep 17th, '13, 01:49

I did this the other way around, using my Arch Linux grub2 boot loader to load Mageia and Fedora. When installing Fedora after Arch Linux was installed, I had to tell Fedora not to install the boot loader. Afterwards, I had to chroot into Fedora and and run the commands to install the grub files. You can chroot from an existing linux installation, or from a live CD. One problem was that Fedora did not create a /etc/default/grub file. I ended up copying that file from my Arch installation into Fedora, and editing as appropriate.

See following for more info:
https://bugzilla.redhat.com/show_bug.cgi?id=872826#c99

I used the info from Arch's Chroot wiki for using chroot:
https://wiki.archlinux.org/index.php/Ch ... hange_root

Note: when you issue grub commands, check that the path matches your installation. The path varies from one distro to another (i.e. /boot/grub/grub.cfg vs /boot/grub2/grub.cfg).

One other thing, I use configfile to boot the other OS's.
See following for more info (Note the mention of Mageia in that comment is Mageia 2 with Legacy Grub. I am using Mageia 3 now with Grub 2.):
https://bugzilla.redhat.com/show_bug.cgi?id=872826#c88

HTH
David_Batson
 
Posts: 128
Joined: May 1st, '11, 05:19

Re: Dual-boot with 2 Linux distros - how?

Postby jtwdyp » Sep 21st, '13, 22:19

zugunder wrote:Hi,

I'd like to try one more distro on my laptop (Xubuntu) and I am curious what exactly I should do in order to be able to use the existing bootloader (from Mageia3).

So, as of now, I have a Mageia bootloader managing Mageia 3 and Win7 on the same (and only) hard drive.

As far as I understand, I need to make a new set of partitions (I am thinking of /, /home and swap) and to install another distro there.


Not bad, But I'd agree with Ken-Bergen's suggestion about the swap and home partitions... One thing, you might want to wait until after the installation of the 2nd Linux to create your actual user account there. It may be that their gui will let you specify the same user UID number as your Mageia user to facilitate easy data file sharing... Certainly that can be done on the command line with useradd.

My question is - will it be better to skip bootloader installation completely or to install it to the new distro's root partition?


I would definitely install their bootloader to their root partition. This will make it possible to chainload their bootloader if you don't want to edit or update Mageia's every time Xubuntu updates the kernel.

Will it be automatically recognized by Mageia's grub or will I have to specify it (via MCC or config files) manually?


That might depend on whether your Mageia3 is using grub {legacy} or grub2 such as David_Batson describes. If grub2, it might get picked up automatically when you update Mageia's grub. with something like:
Code: Select all
grub-mkconfig -o /boot/grub/grub.cfg

for which your Xubuntu will probably simplify with a script named "update-grub"

If you are using grub2, I'm hoping somebody else will advise you. I make a point of using grub legacy where ever possible. Which includes my Mageia3. Where I see no evidence of any automatically updated grub entries in the /boot/grub/menu.lst file. Instead the current vmlinuz & initrd files are references with symlinks. Such as:
Code: Select all
JtWdyP -> ~
> ls -l /boot/vmlinuz
lrwxrwxrwx 1 root root 31 Sep 17 15:40 /boot/vmlinuz -> vmlinuz-3.8.13.4-desktop-1.mga3
JtWdyP -> ~
>

And my other Linux are referenced like so:
Code: Select all
title openSUSE 12.2 (x86_64)
root (hd0,4)
configfile /boot/grub/menu.lst

title Linux sda6
root (hd0,5)
chainloader +1


Where the Linux I used to have on /dev/sda6 had grub2 installed to it's root partition when the Mageia installer created these. If you are using grub legacy, and If you installed the Xubuntu bootloader to Xubuntu's root partition then with the correct "root" line the chainloader entry would likely work for you.

Though don't simply copy it from Xubuntu's /boot/grub/grub.cfg as grub2 uses slightly different logic on drive/partition numbering. They still start at zero when they number the hard drive, But they now start with a one when they number the partitions. So while grub legacy refers to my /dev/sda6 partition as (hd0,5) grub2 would say (hd0,6) Or even (hd0,msdos6) Though what dos has to do with an ext3 partition I'll never know.

Sorry, I've never done that before and am not aware of grub functions in detail.


Don't be sorry. We are all still learning. ;)
--
JtWdyP
User avatar
jtwdyp
 
Posts: 88
Joined: Jun 10th, '13, 08:30

Re: Dual-boot with 2 Linux distros - how?

Postby zeebra » Sep 25th, '13, 19:45

zugunder wrote:Hi,

I'd like to try one more distro on my laptop (Xubuntu) and I am curious what exactly I should do in order to be able to use the existing bootloader (from Mageia3).
So, as of now, I have a Mageia bootloader managing Mageia 3 and Win7 on the same (and only) hard drive.
As far as I understand, I need to make a new set of partitions (I am thinking of /, /home and swap) and to install another distro there. My question is - will it be better to skip bootloader installation completely or to install it to the new distro's root partition? Will it be automatically recognized by Mageia's grub or will I have to specify it (via MCC or config files) manually?
Sorry, I've never done that before and am not aware of grub functions in detail.

Thank you.


I find my way very easy and I did it many times.

One question first. Why create another home? You can use the same home partition and create a different named user. That way you are sure not to mix any settings between the two distroes.

ALWAYS use custom disk partition setup when installing a GNU/Linux distro!!!!
(Remember to select your current /home partition as your new /home partition when installing, but DO NOT FORMAT IT)

Anyways..
1. For the new distro, create one partition using Mageia "system settings" and "disk management".

2. Reboot and pop your new distro into the CD drive. Install the new distro on the available partition. SKIP setting up boot manager section during installation. Reboot into Mageia again once installation is finished.

3. Go to "system settings" and Mageia and manage the boot loader. It will simply add the new distro.(or you can even add anything you want there manually)
zeebra
 
Posts: 125
Joined: Sep 7th, '13, 21:20

Re: Dual-boot with 2 Linux distros - how?

Postby zugunder » Oct 12th, '13, 00:58

Hi,

here is my update. To put it briefly - it does not work.
I made a new partition for a new / (sda8).
While installing Xubuntu, I specified this new partition for root, my old /home for /home (with a different username) and left the same swap.
However, the installer DOES NOT have an option to skip installation of a bootloader. Bootloader location selection is combined with a partition table, so it is not possible to "skip" it. So I chose to install a new bootloader onto a newly made /, where I have just installed the system. I did not choose the /sda because it is in use by Mageia bootloader and I'd like to keep it intact.
After installation I went to Boot -> Bootloader setup in Mageia, but there are no traces of the newly installed system.
update-grub did not work with a warning "command not found"
Whatever I tried to put into a new boot option in Mageia bootloader setup did not work.

Is there any way to make grub (grub is in use, not grub2) to detect a new installation?
If not, how do I specify the path to a new installation in the Mageia bootloader setup? Whatever I tried - it did not work.

Here is my menu.lst from Mageia grub:
Code: Select all
timeout 10
color black/cyan yellow/cyan
gfxmenu (hd0,2)/boot/gfxmenu
default 0

title linux
kernel (hd0,2)/boot/vmlinuz BOOT_IMAGE=linux root=UUID=6133f010-e716-4ac9-ba09-446b5749c7aa splash quiet resume=UUID=ccb4e5c6-0337-4a1d-99da-fc99290e054c acpi_backlight=vendor vga=788
root (hd0,2)
initrd /boot/initrd.img

title linux-nonfb
kernel (hd0,2)/boot/vmlinuz BOOT_IMAGE=linux-nonfb root=UUID=6133f010-e716-4ac9-ba09-446b5749c7aa resume=UUID=ccb4e5c6-0337-4a1d-99da-fc99290e054c
root (hd0,2)
initrd /boot/initrd.img

title failsafe
kernel (hd0,2)/boot/vmlinuz BOOT_IMAGE=failsafe root=UUID=6133f010-e716-4ac9-ba09-446b5749c7aa failsafe
root (hd0,2)
initrd /boot/initrd.img

title TMB Laptop
kernel (hd0,2)/boot/vmlinuz-3.8.13.4-tmb-laptop-1.mga3 BOOT_IMAGE=TMB_Laptop root=UUID=6133f010-e716-4ac9-ba09-446b5749c7aa splash quiet resume=UUID=ccb4e5c6-0337-4a1d-99da-fc99290e054c acpi_backlight=vendor vga=788
root (hd0,2)
initrd /boot/initrd-3.8.13.4-tmb-laptop-1.mga3.img

title windows
root (hd0,1)
makeactive
chainloader +1

title Xubuntu
kernel (hd0,8)/boot/vmlinuz-3.2 BOOT_IMAGE=Xubuntu root=UUID=40e468a2-de21-41b3-9e49-777b5989f670
root (hd0,8)
initrd /boot/initrd.img-3.2


When I use it as it is shown I get an error: No such partition.
In a partition table it is labeled as sda8, flagged as bootable.

Thank you.
zugunder
 
Posts: 388
Joined: Jun 10th, '11, 00:22

Re: Dual-boot with 2 Linux distros - how?

Postby gohlip » Oct 12th, '13, 07:37

Code: Select all
title Xubuntu
kernel (hd0,8)/boot/vmlinuz-3.2 BOOT_IMAGE=Xubuntu root=UUID=40e468a2-de21-41b3-9e49-777b5989f670
root (hd0,8)
initrd /boot/initrd.img-3.2

When I use it as it is shown I get an error: No such partition.
In a partition table it is labeled as sda8, flagged as bootable.

(hd0,8) should be (hd0,7)

or you can manually add to your /boot/grub/menu.lst [one of the following.....in this order preference]
Code: Select all
title Xubuntu
root (hd0,7)
kernel /boot/grub/i386-pc/core.img
[edit] - works only if your xubuntu uses grub 2.00 (will not work with grub 1.99)

Code: Select all
title Xubuntu
kernel (hd0,7)/vmlinuz root=UUID=xxxxxxxxxxxxxxxxxxxx ro
initrd (hd0,7)/initrd.img


Code: Select all
title Xubuntu
root (hd0,7)
chainloader +1


[edit] caveat - I have not used grub-legacy for years, I have not tested above - but fairly confident it will work. Take note.
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50

Re: Dual-boot with 2 Linux distros - how?

Postby zeebra » Oct 12th, '13, 15:14

I really don't know why someone would not install the bootloader.

I always say it. INSTALL THE GRUB BOOTLOADER TO MBR.

Every time someone does not do it, they end up in trouble. Also, ALWAYS use customer disk partitioning!
zeebra
 
Posts: 125
Joined: Sep 7th, '13, 21:20

Re: Dual-boot with 2 Linux distros - how?

Postby doktor5000 » Oct 12th, '13, 19:19

When installing another OS, the point is actually to not install the bootloader to MBR, to avoid overwriting the present bootloader.
Instead either create new bootloader entries in the existing one for the new OS or use the chainloader approach, which is more hassle-free IMHO.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18073
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Dual-boot with 2 Linux distros - how?

Postby zugunder » Oct 13th, '13, 05:36

gohlip

Thanks a lot, the first option worked. Apparently, Xubuntu 12.04 LTS uses GRUB2... Correct me please if I am not right - this command simply initiated Xubuntu's GRUB2 bootloading sequence (as I was directed to the list of all distros, including Windows, available on my machine).
Thank you!
zugunder
 
Posts: 388
Joined: Jun 10th, '11, 00:22

Re: Dual-boot with 2 Linux distros - how?

Postby gohlip » Oct 13th, '13, 05:48

Yes you're right, it initiated Xubuntu's grub. It's like using "configfile" wheareas configfile uses the "original" grub to load the "target OS" grub.cfg (where it may conflict), "booting" core.img starts the grub of the target OS. Personally, I prefer to boot the vmlinuz directly (skipping a step), but core.img is using the target OS, especially if we have any problem booting up. And chainloading may not work with different versions of the "same" grub. Note you can boot windows directly with grub2 without chainloading too. Chainloading is the last of my preference. Haven't used it for some time, perhaps other than for testing.

And you're welcome. Cheers.
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50

Re: Dual-boot with 2 Linux distros - how?

Postby doktor5000 » Oct 13th, '13, 10:38

Please mark the thread accordingly by editing the topic of the first post and prefix it by [SOLVED], thanks
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 18073
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Dual-boot with 2 Linux distros - how?

Postby zeebra » Oct 13th, '13, 19:28

doktor5000 wrote:When installing another OS, the point is actually to not install the bootloader to MBR, to avoid overwriting the present bootloader.
Instead either create new bootloader entries in the existing one for the new OS or use the chainloader approach, which is more hassle-free IMHO.


I always just use the best bootloader. depends entirely on the situation, but normally I use the first installed one. I prefer Grub legacy, so I always go for that.
zeebra
 
Posts: 125
Joined: Sep 7th, '13, 21:20

Re: [SOLVED] Dual-boot with 2 Linux distros - how?

Postby zugunder » Oct 13th, '13, 23:14

gohlip

Thanks a lot, the explanations saved me a lot of time!
zugunder
 
Posts: 388
Joined: Jun 10th, '11, 00:22

Re: Dual-boot with 2 Linux distros - how?

Postby zugunder » Oct 13th, '13, 23:15

doktor5000 wrote:Please mark the thread accordingly by editing the topic of the first post and prefix it by [SOLVED], thanks


Done. I'd like just to make sure that I understand what I have done first :-).
zugunder
 
Posts: 388
Joined: Jun 10th, '11, 00:22


Return to Basic support

Who is online

Users browsing this forum: Majestic-12 [Bot] and 1 guest