The OP could BU his mbr first... [was: Ubuntu 9.10 with Grub 2 installed in partition unable to boot]

Joe(theWordy)Philbrook jtwdyp at
Sun Dec 20 17:48:49 UTC 2009

It would appear that on Dec 20, Goh Lip did say:
> On 20/12/09 15:42, peter.soares at wrote:
-snipped. .  .   .    .     .      .       .        .         .stuff
> > I do not want to install into MBR because this box boots Windows7,
> > Vista and XP (and losing access to Windows would be very painful). 
> > Experiments with EasyBCD beta 2 have not worked for me.&n bsp; I am
> > trying to get the Vista bootmgr to boot Ubuntu without using the rescue CD.
> > Any ideas?
-snipped. .  .   .    .     .      .       .        .         .stuff
> Yes, if you don't install grub2 to sda, you will not be able to boot to 
> ubuntu. Windows will not be able to do that with its boot.
> If you install grub2 to sda it will be able to boot into windows (all of 
> them) as well. And yes, you will lose your windows mbr.
> Easy BCD may not work on grub2. Don't know, never tried, but would be 
> surprised if it does. Maybe it did worked on your 9.04 which uses 
> grub-legacy.
> The warning (about installing to other than sda) will always appear if 
> you do not install grub2 to sda, even if you know what you're doing.
> Sorry, you've got to set grub2 to mbr to boot up ubuntu as well as 
> windows. I really do not see any problem with it.

I once read someone explain how to use dd to backup the mbr to a file,
with which you could then use dd to restore the mbr to it's exact
original contents in the even some new boot loader didn't work the way it
should have... Then I found out about a "better" method using sfdisk

Anyway for the benefit of anyone who simply wants to back-up the mbr
BEFORE letting an unfamiliar or any "beta" boot loader mess with it
Here are my notes on the subject... 

I note that nowadays most linux installations would use /dev/sda
instead of the archaic /dev/hda So these will likely need editing.
And of course since these are linux methods if the mbr gets trashed in
such a way as to prevent booting linux then a live or rescue disk may be
needed to boot linux so as to use one of the restore commands...

=> dd:  

copy ONLY MBR to file in current directory:

$dd if=/dev/hda of=MBR-BU bs=512 count=1 

restore ONLY MBR from file in current directory:

$dd if=MBR-BU of=/dev/hda bs=512 count=1

*Note sfdisk is supposedly a better method.

=> sfdisk: 

create a text data file of whole partition table:

sfdisk -d /dev/hda > hda_partition-table.txt

Then you can restore with:

rebuild whole partition table using data in the text file:

sfdisk /dev/hda < hda_partition-table.txt

Though I suspect that if the size or type of any of the partitions
were modified it might be better to just restore the MBR using the
dd method... The way I see it, it can't hurt to make both backups
And then think about it when/if it's time to restore one of them.

|   ---   ___
|   <0>   <->	   Joe (theWordy) Philbrook
|	^		J(tWdy)P
|    ~\___/~	     <<jtwdyp at>>

More information about the kubuntu-users mailing list