0

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

Itay Moav -Malimovka
  • 1,928
  • 3
  • 15
  • 17
  • 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 03 '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 03 '12 at 17:02
  • @ItayMoav Have you tried putting it in a card-reader and formatting it with gnome-disk-utility? –  Sep 03 '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 03 '12 at 17:20

1 Answers1

0

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

user85321
  • 1,375
  • 1
  • 9
  • 7