How to safely wipe the MBR of an SSD

Write tutorials here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Do not start a support topic here please. Before you post please read this

How to safely wipe the MBR of an SSD

Postby catweazel on Sat Apr 13, 2013 8:53 pm

This tutorial applies only to SSDs that use a SandForce controller. You should check the specifications for your SSD before using this tip.

Unlike hard drives where binary 0 is 0 and binary 1 is 1, SSDs, or at least those based on the SandForce controller, use hexadecimal FF to represent binary 0. It's a lot more complicated than that but it's sufficient for this tutorial. The real story delves into electron traps and the analogue count of electrons used to decide if a NAND cell means 1 or 0...

Anyway, what the binary inversion means in terms of wiping the MBR on SSDs (SandForce, at least), or the entire drive for that matter, is that you cannot use the standard linux disk destoryer (dd) command line without clagging your SSD. The drive will become sluggish because zeroing it actually fills it with data, not emptying it. If you dd /dev/zero an SSD then you are effectively filling it with binary 1s, which means the SSD will have to erase those blocks the next time they are written to thus 'clagging' the drive. Onto the good bits...

Assume we have an SSD on /dev/sdd. Also assume that we want to 'zero' the first partion. We are going to blat the first 2MB of the SSD with hexadecimal FF:
Code: Select all
$ tr "\000" "\377" < /dev/zero | dd ibs=1k count=100 of=ff-file.bin
$ sudo dd if=ff-file.bin of=/dev/sdd bs=2M count=1

That's it, all done. We created a file filled with hexadecimal FF and dumped it into the first 2MB of the drive, thus wiping the MBR and partition table.
Mint Testing Team & Mint Donor #3606
KDE 4.12.0, custom preemptive kernel 3.12.5,
Intel i7 4770K @ 4.7GHz, 16GB 2666MHz XMP,
4 Samsung 840 PRO 512GB SSDs in RAID0,
6TB HW RAID10, dual 24" Acer X243H,
Gigabyte nVidia GTX 680 Super Overclock
User avatar
catweazel
Level 7
Level 7
 
Posts: 1656
Joined: Fri Oct 12, 2012 9:44 pm

Linux Mint is funded by ads and donations.
 

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 12 guests