9

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.

7
  • 2
    Is there any reason you cant just reformat the whole drive?
    – Allan
    Commented Aug 12, 2011 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. Commented Aug 12, 2011 at 17:45
  • Is it an ntfs/fat drive? Are you able to change the permissions of the folder and files using chmod?
    – Allan
    Commented Aug 12, 2011 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. Commented Aug 12, 2011 at 18:49
  • Can you find the drive in Disk Utility? askubuntu.com/questions/27997/which-hard-disk-drive-is-which/…
    – Allan
    Commented Aug 12, 2011 at 19:07

5 Answers 5

5

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

5
  • Yes, it's corrupted, I can't do a disk check or even format it. Thanks! Commented Aug 15, 2011 at 13:51
  • Yikes RIP Pendrive
    – Allan
    Commented Aug 15, 2011 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.. Commented Aug 15, 2011 at 16:52
  • is it showing at all in disk utility or nautilus?
    – Allan
    Commented Aug 15, 2011 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. Commented Aug 15, 2011 at 17:47
0

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.

0

Open the disk utility(Type "disk" in search and click on the first application) then after opening of the application click on your pendrive name screenshot1

Then, click on the white space(In my case its written "Sony partition 1 32gb") screenshot2

Then, click on "setting" icon and select "Format Partition".The below screen will appear.Enter "volume name" and in "type" choose "for use with all systems and devices(FAT)" screenshot3

Then press "next" > press "format". You are done.

0

For the case of emptying the trash on a pen drive, this ubuntuforums.org page addresses a similar situation.

One solution discussed on that page is to select the .Trash-1000 folder in the File Manager and then press <Shift>-<Delete>.

Upon doing this, the file manager pops up a dialog indicating the action is irreversible and queries whether to continue or not.

This solution is known to work on other Linux distributions.

-1
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

2
  • 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". Commented Aug 12, 2011 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
    Commented Aug 12, 2011 at 21:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .