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.

Hi I have a flash memory which is damaged and became read-only. I want to delete my data. How can I do so? Is there any way to make it completely impossible to read files on my flash memory?

share|improve this question
    
Why not formatting it? –  LucaB Oct 28 '10 at 14:26
    
It became read-only I can't delete or format it. The files are not read-only,The whole thing is. –  user12345 Oct 28 '10 at 14:35

3 Answers 3

Without destroying? You can repair it first. Assuming your flash is /dev/sdb1:

sudo fsck -a /dev/sdb1

If it succeeds, turn it on and off, then delete files.

share|improve this answer

If the drive has become read-only on the hardware level because of an electronic problem or such, your only way is to destroy it, I suppose...

But some USB memory sticks can be made read-only with a switch, either a hardware switch (I guess you would know if it had one) or a software switch. E.g. if it's an U3-compatible device, you might be able to do something with u3-tool Install u3-tool.

share|improve this answer

To delete all your data : sudo rm -r /<path to media>/*
To make it completely impossible to rea the data, even for you, sudo chmod 000 /<path to media>/*

share|improve this answer
    
I tried this one but it doesn't work. The first command doesn't finish and the second one doesn't work. It gives no error but it simply doesn't change the permissions. –  user12345 Oct 28 '10 at 14:57
    
And how can he delete data from a read-only device? –  Anwar Shah Sep 12 '12 at 2:16
    
Suffices to remount it in read/write mode : mount -o remount,rw <device> –  Popinou Dec 19 '12 at 11:28

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.