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.

One response

  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 [...]

Leave a comment