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.

I'm trying to delete the .Trash-1000 from my pen drive, but with

sudo rm -rf .Trash-1000/

I got

rm: cannot remove `.Trash-1000/expunged/2660089871/apps.log': Read-only file system

(one line of this for each file within .Trash-1000/)

I found this similar question, but I still got the same result after running:

sudo mount -o remount,rw '/media/SGTL MSCN'
sudo rm -rf .Trash-1000

So, any idea how to remove this folder (or its content)?

By the way, I need to remove it because I'm using the pen drive to test a software, and there's a file there that should not be found in the pen drive.

--update

I thought it was corrupted, like Allan pointed, but the same just happened to another new pen drive I plugged here.. After use it on VMWare (in a new OS that still don't have a name), and go back to Ubuntu, I can no more edit it's files, nither make a filesystem check or format it.

share|improve this question
2  
Is there any reason you cant just reformat the whole drive? –  Allan Aug 12 '11 at 17:07
    
@Allan Actually, I could backup the data, format it, and rewrite. It's a good workaround. But I really would like to understand why I can't delete the trash content, even with sudo. –  Tom Brito Aug 12 '11 at 17:45
    
Is it an ntfs/fat drive? Are you able to change the permissions of the folder and files using chmod? –  Allan Aug 12 '11 at 17:53
    
@Allan It's properties says "Filesystem type: MSDOS", I'm not sure if this means ntfs/fat. And I'm not able to change anything using chmod, I get that same message about read-only. If I mount it as sudo, I don't get the message when using chmod, but it also has no effect. –  Tom Brito Aug 12 '11 at 18:49
    
Can you find the drive in Disk Utility? askubuntu.com/questions/27997/which-hard-disk-drive-is-which/… –  Allan Aug 12 '11 at 19:07
show 2 more comments

3 Answers 3

up vote 2 down vote accepted

If I were to guess it sounds to me like your Pendrive is corrupted. the simple solution is to back-up and reformat however if you want to find out if it is really corrupted or not which could be a sign of a failing flash drive use fsck

first back-up your pendrive/card then find out what mount point its under eg. /dev/sdb , /dev/sdc etc.

You can find this information in disk utility under the heading Device:

in the screen shot it is /dev/sdb1

You can then modify these commands and run each

sudo umount /media/disk

sudo fsck -favVr /dev/sdb1

Alternatively you can click "check file system" after unmounting the drive in disk utility

Disk Utility

Edit:

I have found another solution to this problem the steps are as follows

  1. Mount the USB Drive you are having the problem with
  2. Open Disk Utility as root open a terminal and enter gksu palimpsest
  3. Unmount the Drive and remove
  4. Plug it back in

Hopefully this will work if all else has failed

share|improve this answer
    
Yes, it's corrupted, I can't do a disk check or even format it. Thanks! –  Tom Brito Aug 15 '11 at 13:51
    
Yikes RIP Pendrive –  Allan Aug 15 '11 at 16:47
    
ops, wait a second, the same just happened to another new pen drive I plugged here.. After some use, I can no more edit it's files, nither make a filesystem check or format it.. –  Tom Brito Aug 15 '11 at 16:52
    
is it showing at all in disk utility or nautilus? –  Allan Aug 15 '11 at 16:54
    
Yes it is, I discovered that VMWare or the OS have any problem with the Fat system. It's working ok as NFTS now. –  Tom Brito Aug 15 '11 at 17:47
add comment

i had a similiar issue. I was doing a backup of a partition with "Redo Backup" to a usb drive. I had to cancel the backup, and the files could not be deleted. The files were in the Trash and still on my external drive, but I could'nt delete any of those, even as root.

My solutuion was to boot Windows (I still use it for playing games), and then I could delete the files. Maybe booting from a Live CD helps, or you plug the USB drive to a other computer running a diferent OS. I know this is a bit lame, but it was the quickest solution for me.

share|improve this answer
add comment
chmod +rx .Trash-1000 -R
rm -rf .Trash-1000

This should hopefully fix your issue, I had the problem few days back where even if I owned folder I couldn't delete content cause folder was not executable -R if u have recursive folders

Hope that does it for you

share|improve this answer
    
Unfortunately not, I still get the same message. Also, looks like the chmod has no effect at all. When I see in the .Trash properties (using Nautilus), it have a "-" in the "executable" box. And if I change it as sudo (using gnome-terminal), I get the same message about "read only". –  Tom Brito Aug 12 '11 at 18:54
    
well I don't know in that case, cause for folder to be deleted it needs to be executable (I've no idea why). You can try mounting USB with sudo and then sudo rm -rf .Trash <-- I never tried it myself –  wisemonkey Aug 12 '11 at 21:23
add comment

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.