Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .