2

Looking for a way to zero-out a flash card (any format CD/SD/MS) so that it starts completely clean? By that I mean not just formated but all zeros or a fixed pattern.

It will be formated later and used to test photo recover software so it needs to start blank so that nothing is found by the software to start with.

Presently running OpenSUSE 11.2 64-bits, if that makes a difference.

1 Answer 1

4

Dump from /dev/zero to the device.

dd if=/dev/zero of=/dev/sdX bs=32M
2
  • Is that 32M the size of the flash card? or something else and it figures out the size automatically?
    – Itai
    May 21, 2011 at 14:54
  • 1
    bs is the amount of data that is read and written at one time. The default size is 512 bytes, which most cards will have to perform multiple writes to each block to handle (a 2kiB block size is not uncommon). This is bad because each write brings the card closer to death. Using such a large, aligned (to a power of 2) transfer size keeps the writes per block to a minimum. dd will keep dumping data until either the count argument is fulfilled, or until the end of the device. May 21, 2011 at 15:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.