Hi all,
I'm trying to wipe out an SSD drive and prepare it for new use.
Normally, I wipe a drive by using:
Code:
dd if=/dev/zero of=<device> bs=128k &
(The 128k blocksize increases efficiency and speeds up the wipe.)
While this works fine on an SSD, I've read that SSDs actually are at their "virgin" state when the blocks contain all bits on (i.e. 0xFF characters). Therefore, it would stand to reason that writing 0x00 characters actually "uses up" the SSD and would cause the effect that any and all data written to it from then on would require an erase/write cycle.
Since I'm working with an older SSD that doesn't have TRIM support I wanted to do this to "virginize" the SSD. This is for a low I/O application and it is feasible for me to manually script a way to delete data off the SSD by filling the file to be deleted with 0xFF characters. Not as efficient as TRIM but better than nothing. Either way, though, it's best to start with a cleared SSD.
The point is, I'd like to be able to use dd to write something other than zeroes to the drive.
I decided to write a tiny C program like this:
Code:
#include <stdio.h>
void main()
{
while (1)
{
putchar('\xff');
}
}
and then pipe that program's output into dd:
Code:
./ffgenerator | dd of=<device> bs=128k
This works, but the little app quickly shoots up to 100% CPU usage and the zeroing process is very, very slow. (about 5MB/sec on an SSD capable of writing well over 50MB/sec)
Is there a more efficient way to basically generate tons of 0xFF characters so that I can push them into dd?
Thought of using "yes" but this adds LF characters and also generating the initial 0xFF is a bit of a pain.
Ideas?
Thanks
F