Cannot create bootloader

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

Cannot create bootloader

Postby NickC » Nov 11th, '12, 17:29

Mageia installs fine but doesn't seem to have written the bootloader to /dev/sda2 as it should have done.

The disk drive has three Primary partitions and one Extended partition containing a small (4Gb) swap file. CentOS resides on partition 1 which boots fine, partition 2 is where I have installed Mageia, writing the bootloader to /dev/sda2.

I have attempted to fix this by booting to a rescue prompt and reinstalling the bootloader but that fails with:
Error 21, Selected disk does not exist
grub> setup -- stage2=/boot/grub/stage2(hd0,1)

I can boot to CentOS and mount the Mageia partition but don't know what to do to fix this.
NickC
 
Posts: 67
Joined: Nov 3rd, '12, 19:19
Location: Romford, Essex, England

Re: Cannot create bootloader

Postby marja » Nov 12th, '12, 12:10

Does CentOs use Grub2?

Please check our documentation about the bootloader

http://doc.mageia.org/installer/2/en/co ... inner.html

and (if needed)

http://doc.mageia.org/installer/2/en/co ... xpert.html

Hope that helps :)
User avatar
marja
 
Posts: 550
Joined: Aug 22nd, '11, 20:50

Re: Cannot create bootloader

Postby marja » Nov 12th, '12, 12:14

NickC wrote:
I have attempted to fix this by booting to a rescue prompt and reinstalling the bootloader but that fails with:


I don't understand how you could boot to a rescue prompt if you don't have a bootloader, maybe I misunderstood your post?
User avatar
marja
 
Posts: 550
Joined: Aug 22nd, '11, 20:50

Re: Cannot create bootloader

Postby magump » Nov 12th, '12, 14:56

I am no expert and have limited knowledge of grub. However, I tripple boot (Mageia2 is my main OS, Win7 is there for the grandkids when they need it and I try other OS's on the third partition).

Now with the brief explanation over the past two days I installed CentOS 6 on my third HD. That allowed only CentOS and Win7 to boot. I lost the boot for Mageia in the mbr. After poking around I found that CentOS uses grub legacy where Mageia has moved to Grub2.

I use Clonezilla for backing up partitions so I am not afraid to experiment with other OS's. I ran into the same problem you did. Couldn't get the Mageia partition to boot. I tried Boot Repair Disk but was returned with a message saying to enable a repository containing the grub 2 packages in the software sources of CentOS.

I have to admit, I have been using Linux for about 7 years and have never been good at working with grub. That is why I use Clonezilla. If something goes wrong, I install one of the other distros I experimented with and it will restore the OS and grub.

Although I am unable to help in many ways, I wanted you to have my input.

I guess I have been a bit "lazy" about working with grub but found it easier to install another OS or restore a backed up partition to recover grub.
magump
 
Posts: 2
Joined: Nov 12th, '12, 14:44

Re: Cannot create bootloader

Postby NickC » Nov 12th, '12, 15:17

marja wrote:I don't understand how you could boot to a rescue prompt if you don't have a bootloader, maybe I misunderstood your post?

Boot from Mageia DVD, select Rescue system.
NickC
 
Posts: 67
Joined: Nov 3rd, '12, 19:19
Location: Romford, Essex, England

Re: Cannot create bootloader

Postby NickC » Nov 12th, '12, 15:28

Perhaps I should have explained a bit more fully.

/dev/sda1 contains CentOS and boots fine, bootloader is written to /dev/sda1 (not to MBR). CentOS is using Grub 0.97.
/dev/sda2 is Mageia install, bootloader is written to /dev/sda2

but this is where it fails, for unknown reasons the bootloader just fails to write to /dev/sda2, apparently it can't find disk hd0.

The other alernative would be to boot Mageia from the CentOS bootloader, I can edit that menu.lst alright. However I don't know what parameters I need to put in there to boot Mageia.
NickC
 
Posts: 67
Joined: Nov 3rd, '12, 19:19
Location: Romford, Essex, England

Re: Cannot create bootloader

Postby gohlip » Nov 12th, '12, 16:04

First, have you booted into Centos and do 'update-grub' there to 'try' to include Mageia's entry?
Yes? Then bootloader is not installed in Mageia.

The other alernative would be to boot Mageia from the CentOS bootloader, I can edit that menu.lst alright. However I don't know what parameters I need to put in there to boot Mageia.


Good. Then mine as follows...
Code: Select all
title linux
kernel (hd0,1)/boot/vmlinuz BOOT_IMAGE=linux root=LABEL=Duo splash quiet nokmsboot resume=UUID=409eef4d-2da2-4a06-91aa-21f4bd388b8c vga=788
initrd (hd0,1)/boot/initrd.img


So you will need to amend/append yours to remove 'resume' (and so happens (hd0,1) is the right partition too)
Code: Select all
title mageia
kernel (hd0,1)/boot/vmlinuz BOOT_IMAGE=linux root=UUID=xxxxxxxxxxxxxxxxxxxx  nokmsboot  vga=788
initrd (hd0,1)/boot/initrd.img



However, it is highly likely you do not have any bootloader installed in Mageia, so when you boot up to mageia, install the bootloader package and then 'grub-install' and 'upgrade-grub' - (either to mbr or its own partition so you can continue to use Centos bootloader). Then go to Centos to 'upgrade-grub' as well (to include Mageia).

Good luck.

ps: there are 3 BOOT_IMAGE namely
BOOT_IMAGE=linux
BOOT_IMAGE=linux-nonfb
BOOT_IMAGE=failsafe
Not sure if you need any, actually.. (pps: I don't use Mageia's boot or any grub-legacy, Mageia's grub is installed to its own partition, but it works -tested).

ppps: if you are any less experienced, which you're are not, I'd suggest reinstall again, making sure bootloader is installed - how hard can it be? :) No new data/config to lose too.
and if I were you, I'd probably reinstall anyway, for laziness' sake.
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50

Re: Cannot create bootloader

Postby doktor5000 » Nov 12th, '12, 19:27

magump wrote:After poking around I found that CentOS uses grub legacy where Mageia has moved to Grub2.

Mageia 2 still only has grub legacy.
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: 18059
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Cannot create bootloader

Postby NickC » Nov 12th, '12, 20:09

Thanks gohlip those parameters almost worked. Mageia starts to boot but fails with some UUID errors. It is as if the UUID of that partition is now different, perhaps this was some sort of corrupt partition table problem all along.

I think it might be time to wipe that whole partition and reinstall.
NickC
 
Posts: 67
Joined: Nov 3rd, '12, 19:19
Location: Romford, Essex, England

Re: Cannot create bootloader

Postby NickC » Nov 12th, '12, 22:08

Argg...
Just wiped Mageia partition and done a completely clean install writing bootloader to /dev/sda2. Same problem, the only boot menu I see is that from CentOS on /dev/sda1.

I can only assume there must be something in the MBR causing it to use the /dev/sda1 bootloader rather than the Mageia /dev/sda2 one.

Nick
NickC
 
Posts: 67
Joined: Nov 3rd, '12, 19:19
Location: Romford, Essex, England

Re: Cannot create bootloader

Postby NickC » Nov 12th, '12, 22:56

Now tried booting to CentOS, running blkid to get the UUID of the Mageia partition and putting that in the CentOS menu.lst but still get same failure to boot UUID errors.

Here is the section from my menu.lst:
itle Mageia
kernel (hd0,1)/boot/vmlinuz BOOT_IMAGE=linux root=UUID="73eecb79-ed75-4c43-9f4b-b993f4a82fe5" nokmsboot vga=788
initrd (hd0,1)/boot/initrd.img
NickC
 
Posts: 67
Joined: Nov 3rd, '12, 19:19
Location: Romford, Essex, England

Re: Cannot create bootloader

Postby Ken-Bergen » Nov 13th, '12, 01:26

Try removing the quotation marks form around the UUID.
Ken
Ken-Bergen
 
Posts: 1019
Joined: Mar 30th, '11, 02:45
Location: Chilliwack, BC, Canada

Re: Cannot create bootloader

Postby NickC » Nov 14th, '12, 17:38

Thanks Ken & gohlip,

Removing those quotation marks works fine, can now boot into Mageia albeit from the CentOS bootloader.

Once in Mageia I user Mageia Control Center to rewrit the Mageia bootloader to /dev/sda2, no visable errors. However when I reboot I still get the CentOS bootloader not the Mageia one. Does this suggest that the CentOS bootloader is actually written into the mbr rather than /dev/sda1? If so how can I rewrite that mbr to chainload the Mageia bootloader.

Thanks,
Nick
NickC
 
Posts: 67
Joined: Nov 3rd, '12, 19:19
Location: Romford, Essex, England

Re: Cannot create bootloader

Postby gohlip » Nov 14th, '12, 19:00

First, have you booted into Centos and do 'update-grub' there to 'try' to include Mageia's entry?


Boot to Centos and 'sudo update-grub' at terminal.
If it doesn't give 'proper' menuentry (possibly missing out 'nokmsboot' or 'vga=788') then amend manually at /boot/grub/menu.lst (or copy Mageia's entry and put it there). Save and exit.
That should do it.

Explanation:
o You're using Centos bootloader and you've set Mageia's grub to its own partition (sda2).
That's quite alright, just that without 'update-grub' (in Centos), Mageia's entry will not be captured hence leaving out Mageia's entry.
o Sometimes, capturing menuentry will miss out some parameters especially when the distro uses 'unusual methods', like needing to boot without proprietary drivers.
o By setting Mageia bootloader to own partition (sda2), it will not be used. To use it instead of Centos, you need to set it to mbr, ie. to sda not sda2. But note you still need to update-grub in Mageia to capture Centos entry.

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

Re: Cannot create bootloader

Postby gohlip » Nov 14th, '12, 19:10

If so how can I rewrite that mbr to chainload the Mageia bootloader


Code: Select all
title Mageia (chainload)
root (hd0,1)
chainloader +1


This is to answer your question directly, it will work but it is better to use my previous post to boot directly.

Why? Er....personally I think whenever we can boot up directly, we should do that.
But you can follow whatever you feel comfortable with.

ps: its not 'rewrite that mbr' but to include chainload entry in your Centos menu.lst.
but I guess you meant that.
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50

Re: Cannot create bootloader

Postby NickC » Nov 14th, '12, 19:33

Now I don't really understand this completely. I do not believe that the CentOS bootloader is written to MBR rather that is it in /dev/sda1, this must be the case because I can edit menu.lst in /dev/sda1 and that automatically shows in the boot menu.

My understanding is that the MBR contains Grub stage 1 which when it runs then starts Grub stage 2 from whatever partition is has last been told to use, /dev/sda1 or /dev/sda2. So there must be something in the MBR so that it knows which partition to look at for its stage 2 /boot process.

Edit:
PS. update-grub command not found
NickC
 
Posts: 67
Joined: Nov 3rd, '12, 19:19
Location: Romford, Essex, England

Re: Cannot create bootloader

Postby gohlip » Nov 14th, '12, 19:58

You said..
Once in Mageia I user Mageia Control Center to rewrit the Mageia bootloader to /dev/sda2

You used /dev/sda2 not /dev/sda
This means Mageia's bootloader is not 'set' to mbr (sda) but to its own partition (sda2)
That means...what I said previously - bottom line Mageia's bootloader is not used.

Again - it's quite alright. Just that you're using Centos bootloader instead of Mageia's bootloader.
After all they're all grub-legacy.
You only need to watch out if you unistall Centos OS, then your system will become unbootable.
If you want to uninstall Centos, set Mageia's bootloader to /dev/sda from /dev/sda2 first.

note: mbr is at first sector of hard disk drive while sda2 is at first sector of partition sda2
But really, there's no need to trouble ourselves with these.

this must be the case because I can edit menu.lst in /dev/sda1 and that automatically shows in the boot menu.

does not mean it is not set to mbr. Of course all your menu.lst is at the partitions, Centos as well as Mageia; but there can only be one OS you can set to mbr, and in your case, it's Centos.
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50

Re: Cannot create bootloader

Postby gohlip » Nov 14th, '12, 20:04

Edit:
PS. update-grub command not found


sudo update-grub
edit: never used centos, but see...
http://boardreader.com/thread/update_Gr ... dXqm9.html
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50

Re: Cannot create bootloader

Postby gohlip » Nov 14th, '12, 20:11

If centos does not have update-grub, (strange, a linux distro doens't do this), what I read very briefly is to manually amend the menu.lst

I this is the case, I'd strongly suggest you boot into Mageia and set Mageia's bootloader to mbr (Again /dev/sda not /dev/sda2)
Update-grub (as root) or use the Mageia Control Centre to do this.
(sorry I deliberately don't use command lines in Mageia)

[edit] or just copy Mageia's entry into Centos menu.lst (as per my previous post)
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50

Re: Cannot create bootloader

Postby NickC » Nov 14th, '12, 20:18

I guess I must be mistaken and at some point I must have written the CentOS bootloader to /dev/sda. Either way I now have two ways to boot Mageia from the CentOS bootloader, one direct Kernel boot the othert chainloaded, both work perfectly. Also I now know that I can boot from DVD to rescue prompt and install Mageia bootloader to /dev/sda from there should it ever become necessary.

Regarding update-grub, neither CentOS nor Mageia seem to have this command.

Many thanks,
Nick
NickC
 
Posts: 67
Joined: Nov 3rd, '12, 19:19
Location: Romford, Essex, England

Re: Cannot create bootloader

Postby gohlip » Nov 14th, '12, 20:32

Regarding update-grub, neither CentOS nor Mageia seem to have this command.


Yes, you're right!
I do not use command lines (in Mageia only), and this don't exist!
I stand corrected. Thanks!

So you can either manually amend menu.lst or use Mageia Control Centre to do this.
Sheesh.
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50

Re: Cannot create bootloader

Postby gohlip » Nov 14th, '12, 20:43

[/quote]
Either way I now have two ways to boot Mageia from the CentOS bootloader, one direct Kernel boot the othert chainloaded, both work perfectly. Also I now know that I can boot from DVD to rescue prompt and install Mageia bootloader to /dev/sda from there should it ever become necessary.


Very good. take care and cheers.
Why do we live? To prove not everything in nature has a purpose.
gohlip
 
Posts: 573
Joined: Jul 9th, '12, 10:50


Return to Basic support

Who is online

Users browsing this forum: Google [Bot] and 1 guest