Page 1 of 1

[SOLVED]Cannot boot other distro after installing Mageia

PostPosted: Jan 5th, '13, 07:56
by martyway
Hello, I'm new to Mageia and only have limited knowledge of Linux. I have 2 drives on the system. On the first I installed Ubuntu Cinnamon Remix and everything was fine. I then installed Mageia on the second drive and everything works great. Now the problem is I cannot boot into Ubuntu anymore. The only option I have in the boot loader is for Mageia. Does anyone know a way to add Ubuntu into the boot loader so I can dual boot.

Thanks Marty

Re: Cannot boot other distro after installing Mageia

PostPosted: Jan 5th, '13, 09:55
by gohlip
First, let us know if your Mageia is using grub-legacy or grub2.

Then post menu entry (first entry) of Ubuntu's grub menu (ubuntu partition)/boot/grub/grub.cfg

Edit: prbably safer/faster to go to Mageia Control Centre and at boot section add the entry 'Ubuntu" and add the parameters shown at (ubuntu)/boot/grub/grub.cfg

Re: Cannot boot other distro after installing Mageia

PostPosted: Jan 6th, '13, 10:39
by benmc
have you tried to change the hdd boot order menu in your system bios?

you should be able then to boot into Ubuntu and retrieve the Ubuntu boot parameters if you can't access them from Mageia

Re: Cannot boot other distro after installing Mageia

PostPosted: Jan 8th, '13, 02:29
by martyway
I'm not getting anywhere with adding the boot entry. Also when I disconnect the drive with Mageia installed on it Ubunto still will not boot. I can only assume something got toasted on the Ubuntu install.

Thanks everyone

Re: Cannot boot other distro after installing Mageia

PostPosted: Jan 8th, '13, 06:43
by gohlip
First, let us know if your Mageia is using grub-legacy or grub2.

You did not tell us what grub your mageia is using.

So, I am writing this on the basis of you using grub2.
If grub-legacy, it will not apply, but it would cut a lot of your time and mine if you had told us at the beginning.

If your Ubuntu is at /dev/sdax and (hd0,x) ('x' is number) with label xxx and UUID xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Note for /dev/sdax, it is (hd0,x) for grub2 and (hd0,x-1) for grub-legacy

At Mageia grub menu, go to grub prompt.
Code: Select all
grub> insmod part_msdos
grub> insmod ext2
grub> search --no-floppy --fs-uuid --set=root xxxxxxxxxxxxxxxxxxxxxxx
grub> linux /vmlinuz root=UUID=xxxxxxxxxxxxxxxxxxxxx ro
grub> initrd /initrd.img
grub> boot


or
Code: Select all
grub> insmod part_msdos
grub> insmod ext2
grub> search --no-floppy --label --set=root xxx
grub> linux /vmlinuz root=LABEL=xxx ro
grub> initrd /initrd.img
grub> boot


or
Code: Select all
grub> insmod part_msdos
grub> insmod ext2
grub> set root=(hd0,x)
grub> linux (hd0,x)/vmlinuz root=/dev/sdax ro
grub> initrd (hd0,x)/initrd.img
grub> boot
if you use this, make sure it is (hd0,x) or (hd1,x)
to make sure, at beginning, "grub> ls"

You will then boot into Ubuntu, at Ubuntu terminal,
Code: Select all
sudo grub-install /dev/sda
sudo update-grub


Note you will then be using Ubuntu's grub menu with Mageia's entry in it as well.

Re: Cannot boot other distro after installing Mageia

PostPosted: Jan 8th, '13, 07:27
by gohlip
And if it is grub-legacy, And it will not apply for grub2.......
(caveat: I have not been using grub-legacy for about 5 years, so...)
note for /dev/sdax , it is (hd0,x-1)
Also make sure it is (hd0,x) or (hd1,x)
to make sure, "grub> ls" after each and every computer startup.

at grub prompt
Code: Select all
grub> root (hd0,x)
grub> kernel /boot/grub/core.img
grub> boot


or
Code: Select all
grub> find --set-root /boot/grub/core.img
grub> chainloader /boot/grub/core.img
grub> boot


or
Code: Select all
grub> root (hd0,x)
grub> chainloader +1


When booted to Ubuntu, proceeed to grub-install and update-grub

Re: Cannot boot other distro after installing Mageia

PostPosted: Jan 8th, '13, 07:40
by gohlip
benmc wrote:have you tried to change the hdd boot order menu in your system bios?

you should be able then to boot into Ubuntu and retrieve the Ubuntu boot parameters if you can't access them from Mageia


Ben, his Mageia's grub has 'taken over" the mbr or "set to sda", so changing hdd boot order has no effect, in fact, he must have his Mageia drive to boot anything at this point.
Hope this helps. Cheers. Take care.

Re: Cannot boot other distro after installing Mageia

PostPosted: Jan 8th, '13, 23:06
by martyway
Best I can tell is when I installed Mageia the default grub installed on drive 1 where the Ubuntu install was at. Mageia installed on drive 2. The Mageia grub has taken over and replaced Ubuntu's Grub and omitted Ubuntu from the listings. Mageia has taken control of both drives and corrupted the Ubuntu install. I can't even boot from the live CD into Ubuntu.

Re: Cannot boot other distro after installing Mageia

PostPosted: Jan 8th, '13, 23:51
by doktor5000
martyway wrote:Mageia has taken control of both drives and corrupted the Ubuntu install. I can't even boot from the live CD into Ubuntu.

By default Mageia installs bootloader into the MBR, where Ubuntu was before if you don't tell it otherwise. Ubuntu does the same, BTW.
You need to boot Ubuntu directly, as gohlip wrote already. Which method he posted did you try, and what outcome?

Re: Cannot boot other distro after installing Mageia

PostPosted: Jan 9th, '13, 05:55
by gohlip
martyway wrote: I can't even boot from the live CD into Ubuntu.

You cannot even boot Ubuntu livecd? Try again. You don't even need any OS (working or not) in hard drive to boot any livecd.
If you boot up ubuntu livecd successfully, at the livecd terminal,
Code: Select all
sudo fdisk -l

Be sure you know from this output where your Ubuntu partition is before proceeding next steps.
Lets say your Ubuntu is at /dev/sda3 (note this is my example only, it may be /dev/sda2 or some other for you)
Code: Select all
sudo mount /dev/sda3 /mnt

Find out which grub2 version it is
(if it is 12.04 and below, I think it should be 1.98 and below, otherwise it is 1.99)
but best to verify with
Code: Select all
grub-install -v

Note output, if it is 1.98 and below,
Code: Select all
sudo grub-install --root-directory=/mnt /dev/sda


Note output, if it is 1.99 and above,
Code: Select all
sudo grub-install --boot-directory=/mnt/boot /dev/sda


Exit your livecd and bootup normally into Ubuntu.
Then at Ubuntu terminal,
Code: Select all
sudo apt-get update
sudo apt-get dist-upgrade
sudo grub-install /dev/sda
sudo update-grub


You will then have Mageia's entry in it also.

Re: Cannot boot other distro after installing Mageia

PostPosted: Jan 10th, '13, 00:16
by martyway
Thanks to everyone, I now have UBUNTU back however I now get a Kernel Panic when I try to boot into Mageia. gohlip your instructions worked great once i was able to boot the live cd. UBUNTU is using the 1.99 Grub2 version. All listings are there for both operating systems, but to my dismay Mageia is not booting now. Please remember that what little I know has been self taught and my knowledge is limited.

Re: Cannot boot other distro after installing Mageia

PostPosted: Jan 10th, '13, 05:33
by gohlip
Forgot to ask if you're using Mageia2 or Mageia3. Please let us know.
Nonetheless, when at grub menu, scroll down to Mageia entry and press 'e' to edit.

You will see these 2 lines
Code: Select all
linux /boot/vmlinuz-desktop root=UUID=xxxxxxxxxxxxxxxxxxxxxxxxxxx ro splash
initrd /boot/initrd-desktop.img
if you see vmlinuz and initrd.img, change to vmlinuz-desktop and initrd-desktop.img
if you are on Mageia2, add also "nokmsboot" (no quotes) to linux line

amend to
Code: Select all
linux /boot/vmlinuz-desktop  BOOT_IMAGE=linux root=UUID=xxxxxxxxxxxxxxxxxxxxxxxx gfxmode=640x480x32 splash quiet ro
initrd /boot/initrd-desktop.img
if you are on Mageia2, add also "nokmsboot" (no quotes) to linux line

Ctl +"x" to boot
Let us know if this boots up Mageia.
If it does, let us know and then we'll write how to keep this amendments for good.
Oh, let us know if it is Mageia2 or Mageia3

Good luck.

ps: most of us here are self-taught (me too)
hope that encourages, not to scare you. :D

Re: Cannot boot other distro after installing Mageia

PostPosted: Jan 10th, '13, 06:02
by gohlip
Okay, I'll jump the gun (er..go ahead of myself,...isn't english funny?)
To keep amendments, when you are booted in Ubuntu (you're using Ubuntu's grub menu)
Code: Select all
kdesudo kate /etc/grub.d/40_custom
if you're using gnome/unity, use "gksudo gedit" instead of "kdesudo kate"

Copy over only your Mageia's entry from your /boot/grub/grub.cfg taking care not to delete the top lines in that 40_custom file.
make the amendments and change Mageia title to "My Mageia - Special" (or whatever you like).
Save file and exit.
At terminal.
Code: Select all
sudo update-grub

You'll have your amended entry (at bottom though, let us know if you want it default, it can be done).
Done.

Re: Cannot boot other distro after installing Mageia

PostPosted: Jan 11th, '13, 05:47
by martyway
I'm working on your latest set of instructions. Hopefully I'll know more later tonight. I have The Ubuntu 12.04LTS with Cinnamon on top of it, see http://linux.softpedia.com/get/System/O ... 4680.shtml
Also Mageia 2, both are installed on separate drives. Ubuntu was installed first, later I read a review on Mageia 2 and decided to try it. Looking back I guess I should have kept them separate and used the menu from the bios to choose which one.

Re: Cannot boot other distro after installing Mageia

PostPosted: Jan 12th, '13, 02:50
by martyway
gohlip, your set of instructions on editing the grub menu worked. I am having problems with making them permanent. I can get to 40_custom file but from there I'm not having any luck

Re: Cannot boot other distro after installing Mageia

PostPosted: Jan 12th, '13, 06:02
by gohlip
Alright then, here's a simple grub-legacy-like way to do it. Caveats below. Read whole post before proceeding.

Step 1
At Ubuntu terminal,
gksudo gedit /boot/grub/grub.cfg

Step 2
Amend Mageia menuentry (to include nokmsboot, vmlinuz-desktop, gfxmode=... etc) appropriately.

Step 3
Save file

Done.

Caveats
o There is a warning not to simply amend grub.cfg as described above. It is not the proscribed way. Proceed nevertheless. You will not encounter problems.
o Like grub-legacy (just changing menu.lst), whenever there is a kernel change or grub update, the above amendments are undone. When this happens, redo the above steps.
o Best you learn to do the 'correct' recommended way as per my earlier post. It will never change.

Note
o The problem about not getting Mageia 2's menuentry right is not with Ubuntu or grub2.
All other OS bootloaders too cannot get Mageia's entry right, and even Mageia somehow does not get its own menuentry right too.
But it is much better with Mageia 3 (but then I used grub2 in it, not grub-legacy, so....)

Re: Cannot boot other distro after installing Mageia

PostPosted: Jan 17th, '13, 00:32
by martyway
Success!! I can now boot both OS's. Thank you gohlip !! All this time I've been leaving one space out from your instructions.

Marty

Re: Cannot boot other distro after installing Mageia

PostPosted: Jan 17th, '13, 05:10
by gohlip
Good to hear you've finally got it fixed, and you're most welcome.
Cheers, take care.

Re: Cannot boot other distro after installing Mageia

PostPosted: Jan 17th, '13, 08:06
by isadora
Martyway, now your problem seems to be solved, will you please mark the topic as such?
You can do so by editing the title of the first message by pre-fixing it with [SOLVED].

Thanks in advance!!! ;)