How to erase or wipe a hard drive and MBR using linux

Sometimes you may need to wipe your hard drive for either security reasons or just to have a clean hard drive.  Here are a few commands you can use under linux to wipe either the entire hard drive or just the MBR.  You can do this with all 0’s or random data for security.

These instructions are assuming you’re wiping /dev/sda, replace this with your correct drive. If you want to wipe just partitions you can use /dev/sda1, or /dev/sda2, etc.

This will wipe the drive, including all partitions, and the MBR changing every bit of data to a 0

Wipe just the MBR

If you’re wiping the drive for security reasons you should use random data instead

Myles

Orlando, FL

Did this post help you?

Give back and rate it for me!

Related Posts