Overwrite MBR from Linux

February 21st, 2008

If, like me, you are experimenting setting up usb drives as bootable Linux devices then you’ll find that after installing grub on the drive just deleting all the files will not remove grub. You need to completely wipe the Master Boot Record (MBR). Assuming your drive is located at /dev/sdb use this command as root:

dd if=/dev/zero of=/dev/sdb bs=512 count=1

Be very careful to do this on the correct drive! One error and you will wipe the MBR on your main hard drive leaving your computer unable to boot.

Google BookmarksEvernoteGoogle GmailHotmailWordPressLinkedInFacebookDeliciousShare

3 responses

  1. bobpeers -> blog » Backup your MBR pings back:

    [...] relation to the post ‘Overwrite mbr from Linux’ this is how to take a backup and restore your current Master Boot Record (mbr) in case you [...]

  2. mad_hatter comments:

    Hi,

    Wanted to leave a note of appreciation. I actually used a small utility called unetbootin to make a USB drive bootable. I installed linux on the USB drive. Since then I cannot make that drive windows bootable.

    Do you think MBR can be over-written with the above command.

    Cheers!

  3. Bob Peers comments:

    Hi,

    this command will wipe the MBR of the drive, so yes it will work for you.

    Bob Peers

Leave a comment

Switch to our mobile site