Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Dump from /dev/zero to the device.

dd if=/dev/zero of=/dev/sdX bs=32M
share|improve this answer
    
Is that 32M the size of the flash card? or something else and it figures out the size automatically? –  Itai May 21 '11 at 14:54
    
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. –  Ignacio Vazquez-Abrams May 21 '11 at 15:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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