Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Possible Duplicate:
How to delete/edit files from readonly filesystem

i have a memory card (MS-DOS file system I believe) which I want to delete ALL the files in it.
Even though I use sudo rm -fr * I still get

Read-only file system

For the files in the memory card folder.
How do I remove all the files? (Or maybe just format it?)

share|improve this question

marked as duplicate by Lekensteyn, Tom Brossman, Mitch, WarriorIng64, Jjed Sep 3 '12 at 19:00

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Sometimes the memory cards have a tiny switch on the side to lock them as read-only, can you check and see if this is the issue? Also, be very careful deleting files with sudo and the * character, things can go very wrong very quickly if you mis-type anything. –  Tom Brossman Sep 3 '12 at 17:01
    
No, the lock switch is in the right place, and this card is no longer functional (due to space) so, I can't really damage it more.. –  Itay Moav -Malimovka Sep 3 '12 at 17:02
    
@ItayMoav Have you tried putting it in a card-reader and formatting it with gnome-disk-utility? –  user76204 Sep 3 '12 at 17:15
    
Did it windows machine. This is actually a duplicate as first comments suggests, although the solution there did not help me. –  Itay Moav -Malimovka Sep 3 '12 at 17:20

1 Answer 1

How to delete an SD CARD

Hi,

... try the "dd" command. It securely overwrites all with zeros. First, get the device by :

sudo fdisk -l Your device will be something like sdX. (sdX --> only an example device name)

and be sure to identify the right device. Then use "dd" to overwrite the sd card with ZEROs:

sudo dd if=/dev/zero of=/dev/sdX

While dd is working on your sd card, you won't see a progress bar , so wait until dd has finished :o)

alternatively try this "shred" command (it takes time !!!):

sudo shred -vfz -n 100 /dev/sdX

You will find here an example, how to use "shred" with sd cards.

Kind regards

share|improve this answer

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