backing up and restoring boot sector

Thomas Kaiser thomas at kaiser.linux-site.net
Wed Apr 20 17:53:51 UTC 2005



ZIYAD A. M. AL-BATLY wrote:
> On Wed, 2005-04-20 at 22:05 +0900, toyfactory wrote:
> 
>>So this is why Grub can coexist with the Windows boot menu on my
>>computer.  Then I guess if I wiped the MBR by accident my computer would
>>still boot, no longer to Grub but instead directly to the Windows boot
>>menu.
> 
> I guess so, but only if the Windows partition is marked "boot" in the
> partition table (a deadly mistake that I always forgot).
> 
> 
>>Cheers, it's increased my understanding of the boot process!
>>
>>Nick
>>
> 
> 
> As a last word, back-up anything before doing anything! (I'm not
> kidding! I might be wrong in my last message.  If anyone knows any
> corrections, please correct me.)
> 
> (I'm sorry about the spelling/grammar errors in my last (and possibly
> this) message. English is not my native language.)
> Ziyad.
> 
> 

Hello

Be careful! There is not only the boot code in the MBR and partition BR.
Actually, Only the first 446 bytes of the MBR are boot code the rest is 
used for the partition table and maybe some more. So, for example, if 
you backup your MBR and then add new partitions and install something, 
play with boot loaders and finally your system will not boot anymore. 
You put back your backed up MBR and the new partitions are gone!
OK, only the entries in the partition table are missing, the data are 
still on your HD. If you now built the same partition layout again the 
data appears again. So, its always a good idea to write the partition 
layout on a piece of paper an put it at a save place, if you play with 
partitions and boot loaders and so on.

For the partition BR is it similar. The first 60 bytes are used for 
partition information data, such as file system type and so on. After 
that the boot code starts and ends at byte 512.

This is my understanding of the MBR and BR. I don't know if everything 
is correct, but it must look quite similar. If somebody else has more 
information about this topic, please :-).

Regards, Thomas







More information about the ubuntu-users mailing list