UNIX / Linux: copy master boot record (MBR)
Q. How do I copy MBR from one hard disk to another hard disk under Debian Linux? I need to do this because of RAID 1 configuration.
A. To copy MBR simply use dd command. dd command works under all Linux distros and other UNIX like oses.
dd command to copy MBR
Type dd command as follows:
dd if=/dev/sda of=/dev/sdb bs=512 count=1
Above command will copy 512 bytes (MBR) from sda to sdb disk.
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Other Helpful FAQs:
- Linux Copy File Command ( cp command examples )
- Linux Copy all the files including subdirectories from DVD / Floppy / CD / Other directory (recursive copy)
- Linux Copy One Hard Disk to Another Using dd Command
- Linux or UNIX securely copy files across a network computer
- Linux / UNIX: Cannot Preserve Ownership Error when Files are Moved or Copied
Discussion on This FAQ
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: dd_command, hard_disk, mbr, raid_1, UNIX



December 21st, 2007 at 10:02 pm
This is correct for EXACTLY the same partition sizes. In the case you want the MBR only on a drive that has a root partition of a different size then issue the same command with a smaller block size.
dd if=/dev/sda of=/dev/sdb bs=446 count=1
Thus preserving the partitioning schema.