You are not logged in.
Pages: 1
I wanted erasing an external hard drive in safe way (not paranoid, just zeroing it) and so I used:
dd if=/dev/zero of=/dev/sdz bs=512 count=1000000
(Where 512 was the sector size and 1000000 was the number of sectors, as returned by fdisk /dev/sdz -lu)
This made me wonder, what is the best sh-wise way to fill something with a byte different than 0?
I thought this:
</dev/zero tr '\000' '\377' | dd if=/dev/stdin of=/dev/sdz bs=... count=...
Where, of course, `\377' can actually be any character, in this example it is an 'all ones'.
Is there a better ideas? And also, there can be smarter values for bs and count?
Offline
he he - I never thought of using 'tr' that way, but it should work.
If I really want to scramble something, I use 'dd if=/dev/urandom' ... that might cause some headaches for possible snoopers, they _think_ that there is something valuable there and waste their time trying to figure it out :-)
As for bs/count, I don't think it matters any more, a device is just looked upon as a looooong stream of sectors that gets filled.
You _could_ use bs=4M (or something like that) to speed up the i/o somewhat.
Offline
yes 'Nothing to see here, move along.' | dd if=/dev/stdin of=/dev/sdz bs=... count=...
Offline
If you ever do want to be paranoid, Darik's Boot and Nuke cannot be surpassed It does a very fast (optimized) single-pass zeroing too if you just want to be safe against snooping Joe Shmoes, but can do wiping higher than the standard used by the US Department of Defense. Good luck finding anything left on that drive.
It comes on the world's best rescue CD, SysRescCD.
Last edited by Ranguvar (2009-01-06 22:32:23)
Offline
Pages: 1