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.

I have a CF card I'd like to erase. My CF card reader is connected to my Linux machine via USB. How do I do a secure erase (i.e., the ATA Secure Erase functionality) of the CF card?

I have tried hdparm --security-erase NULL /dev/sdc, but I get an error: ERASE_PREPARE: Invalid exchange. In fact, any hdparm command gives me the same error:

# hdparm -I /dev/sdc

/dev/sdc:
 HDIO_DRIVE_CMD(identify) failed: Invalid exchange

I read somewhere that hdparm can't do an ATA Secure Erase of a drive that is connected over USB. Is this true? I tried using sdparm, but sdparm doesn't seem to have the capability to send the ATA Secure Erase command to the CF card. So, what is the proper way to do this?

share|improve this question

1 Answer 1

You'll be all well with a single overwrite, but if you are paranoid, with multiple overwrites (let's say five times). I suggest you use the dd command.

dd if=/dev/urandom of=/dev/<yourdevice> bs=1M count=8000

Tweak the bs parameters until the operation will be fast enough, then adjust the count (now it is writing 8000 times 1 megabytes of random data). Be very cautious what parameter you give to of, although you can only target unmounted devices, you wouldn't want to randomize a partition that, say, contains all of your works.

share|improve this answer
1  
An overwrite is a good first start, but an overwrite does not erase remnant data that may be left on bad blocks or on remapped blocks. I understand that there can be a significant amount of data left behind, even after a single overwrite. ATA Secure Erase is designed to address this problem. And every source I've ever read says that for flash-based media, it is very important to use ATA Secure Erase: an overwrite is not secure enough. That's why I'd like to use ATA Secure Erase, instead of an overwrite. So, any suggestions on how to do the ATA Secure Erase? –  D.W. Aug 10 '11 at 21:28
2  
Let's do some lite Common Criteria then. Do you value the possible damage of a suspected leak of data higher than the CF card? If you do, the simply burn the CF card to ashes. –  karatedog Aug 26 '11 at 10:58

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.