Wipe partition table / MBR from a drive

By | 2010/06/22

How do I wipe the partition table from a hard drive?

This command will wipe the partition table and master boot record. Warning! Backup any and all data first!

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

Where /dev/sdX is the location of the drive you wish to wipe.
For instance, if the drive is /dev/sda, change that to /dev/sda

The output will look something like this:

stmiller@brahms:~$ sudo dd if=/dev/zero of=/dev/sdf bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.0105726 s, 48.4 kB/s

One thought on “Wipe partition table / MBR from a drive

  1. john

    Thanks for this post,
    I had a ssd drive which resisted all attempts to take a new partition table (previous it had a lvm setup) this little line cleared things out and got me started again I thought the ssd was shot and needed replacing


Leave a Reply

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.