help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Is it ok to copy first 446 bytes of MBR between Harddrives of different


From: Jorge Canas
Subject: Is it ok to copy first 446 bytes of MBR between Harddrives of different sizes?
Date: Wed, 29 Jul 2009 03:52:59 -0400

Is it safe to copy the first 446 bytes of an MBR from one harddrive to another, 
if the harddrives are NOT of the same size, but have identical partitions and 
content?

For example, I have the following partitions defined in harddrive A, which is 
320 GB, and also on hard drive B, which is 120GB:

partition    size      type              fstype   mount_point
==================================
primary1   2GB      linux             ext3      /boot
primary2   2GB      linux_swap
primary3   100GB  linux_LVM                /

The partitions contain the same exact content:  Harddrive A is a result of an 
OS install via CD.  Harddrive B is the result of my manual cloning of the 
contents of A onto B.  Basically, what I did on B was recreate the partition 
table using FDISK (I used the same cylinder numbers from A on  every partition 
on B).  Then, I tarred up the contents from A (/boot and /) and transferred the 
tar over to B and untarred in the respective partitions.

The MBR from Harddrive A was cloned by running this command:

  # dd if=/dev/sda of=mbr.bin bs=512 count=1

I copied the MBR file (mbr.bin) to a CD and then physically removed and 
replaced harddrive A with harddrive B, and wrote the MBR to B running this 
command:

  # dd if=mbr.bin of=/dev/sda bs=1 count=446 conv=notrunc

Then I rebooted the machine.

After that, the computer did not boot.  It just got stuck right at the point 
where, it seems to me, the BIOS reads the MBR.    There is no error message or 
anything, just the flashing underlined cursor...

So, a friend and I are wondering if GRUB perhaps stores some physical address 
in the MBR which tells GRUB where it can find one or more of its stage files.  
If so, is this address universally applicable across harddrive sizes? or is it 
only applicable/valid for harddrives of the same size?

If the first 446 bytes of the MBR can be reused, even if the harddrives are of 
different size, then can someone please throw me a bone and explain why cloning 
the MBR as described here does not produce a bootable harddrive?

Thanks!


_________________________________________________________________
Windows Live™ Hotmail®: Search, add, and share the web’s latest sports videos. 
Check it out.
http://www.windowslive.com/Online/Hotmail/Campaign/QuickAdd?ocid=TXT_TAGLM_WL_QA_HM_sports_videos_072009&cat=sports



reply via email to

[Prev in Thread] Current Thread [Next in Thread]