USB trash

The place to post if you need help or advice

Moderators: ChriThor, LXF moderators

USB trash

Postby guy » Thu Feb 16, 2017 7:23 pm

When I unmount my USB stick it offers to empty the trash but that fails to remove trash files in a hidden folder called .Trash-1000. It's eating up nearly half the stick and I am running out of space. The whole filesystem in there is read-only and there is just too much stuff to clean it out manually file by file. I tried going in as root and doing
Code: Select all
$ rm -rf foldername
on one of the folders in there but it just said the folder was read-only. Any ideas?
"We don't need no frikkin' aliens, we c'n do this ourselves!" — anon.
guy
LXF regular
 
Posts: 1323
Joined: Thu Apr 07, 2005 12:07 pm
Location: Worcestershire

Re: USB trash

Postby lok1950 » Thu Feb 16, 2017 8:10 pm

There is always the nuclear solution backup the files you want to keep then reformat the stick restore the backup.

Enjoy the Choice :)
my box:Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.2 Win 7 acer S243HL K222HQL
amd XP1800 on a asusA7N8x/ 789Mb ram/ sda 120 Gb ntfs sdb 80 Gb ext3 (fedora 10) gForce 6800 gt 128 Mb
lok1950
LXF regular
 
Posts: 1134
Joined: Tue May 31, 2005 5:31 am
Location: Ottawa

Re: USB trash

Postby ajgreeny » Thu Feb 16, 2017 8:12 pm

The obvious question to ask is why is the USB filesystem read only; that would not normally be so.
Xubuntu 16.04 user, and loving it!
ajgreeny
LXF regular
 
Posts: 517
Joined: Wed May 10, 2006 8:18 pm
Location: Oxfordshire.

Re: USB trash

Postby guy » Thu Feb 16, 2017 8:30 pm

ajgreeny wrote:The obvious question to ask is why is the USB filesystem read only; that would not normally be so.

The trash filesystem is hidden as well, so I think there must be some kind of "standard" (i.e. Windows) trash process or API to access it, which Linux may not deliver on fully. But why store trash invisibly on a portable memory device anyway, where deleting all and dropping more stuff on must be commonplace? It's DOS formatted too - One thing the USB standard is not, is clean.
"We don't need no frikkin' aliens, we c'n do this ourselves!" — anon.
guy
LXF regular
 
Posts: 1323
Joined: Thu Apr 07, 2005 12:07 pm
Location: Worcestershire

Re: USB trash

Postby guy » Thu Feb 16, 2017 8:34 pm

lok1950 wrote:There is always the nuclear solution backup the files you want to keep then reformat the stick restore the backup.


There is no reformat option on my desktop that I can find (MATE on Debian). On the other stick I deleted everything then "ejected" it and that cleared its trash nicely. Not this one though.
"We don't need no frikkin' aliens, we c'n do this ourselves!" — anon.
guy
LXF regular
 
Posts: 1323
Joined: Thu Apr 07, 2005 12:07 pm
Location: Worcestershire

Re: USB trash

Postby lok1950 » Thu Feb 16, 2017 10:31 pm

There's always the command line :wink: I use Mint Cinnamon where the usb formatter is a separate app in accessories on Debian it maybe a optional .deb or the just not available though the Mate desktop menus.

Enjoy the Choice :)
my box:Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.2 Win 7 acer S243HL K222HQL
amd XP1800 on a asusA7N8x/ 789Mb ram/ sda 120 Gb ntfs sdb 80 Gb ext3 (fedora 10) gForce 6800 gt 128 Mb
lok1950
LXF regular
 
Posts: 1134
Joined: Tue May 31, 2005 5:31 am
Location: Ottawa

Re: USB trash

Postby nelz » Thu Feb 16, 2017 11:52 pm

The trash directory is unlikely to be a separate filesystem, it's just a directory with a specific name (the number is the UID of the user that created it). If you can't delete it, you probably can't delete any other files on the stick because it is mounted read-only. The output from mount run with no arguments will confirm both whether it is a separate filesystem and whether it is mounted read-only.

The stick could go read only for a number of reasons: the filesystem may have been corrupted and need to be fscked or you may have accidentally moved the write protect switch that some sticks have.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 9041
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Re: USB trash

Postby guy » Fri Feb 17, 2017 10:07 am

nelz wrote:The stick could go read only for a number of reasons: the filesystem may have been corrupted and need to be fscked or you may have accidentally moved the write protect switch that some sticks have.

Sounds likely, there have been other read-only anomalies. Will see if I can fsck it properly ;)
"We don't need no frikkin' aliens, we c'n do this ourselves!" — anon.
guy
LXF regular
 
Posts: 1323
Joined: Thu Apr 07, 2005 12:07 pm
Location: Worcestershire

Re: USB trash

Postby nelz » Fri Feb 17, 2017 10:10 am

It may just be worn out, I'd backup the contents first, and if you're going to do that, you may as well reformat and copy them back.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 9041
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Re: USB trash

Postby Dutch_Master » Fri Feb 17, 2017 10:36 am

File system check on the usb stick:
Code: Select all
sudo fsck /dev/sdX1

X is a letter designating your USB stick. You can find it looking at the tail end of dmesg after you've stuck the stick in
Code: Select all
cat dmesg | tail

GUI to solve partitioning and file system creation on the cli:
Code: Select all
sudo apt-get install gparted

Make sure to unmount the USB stick before starting gparted
Code: Select all
sudo umount -l /dev/sdX1
sudo gparted

HTH!
Dutch_Master
LXF regular
 
Posts: 2586
Joined: Tue Mar 27, 2007 1:49 am


Return to Help!

Who is online

Users browsing this forum: No registered users and 4 guests

cron