User avatar
j1miroquai
Posts: 11
Joined: Tue Jul 23, 2013 7:54 am
Location: Greece

Empty trash problems

Wed Jul 24, 2013 6:37 am

Hi

I can't access my trash folder and also I can't delete the files in them.

as a result the disk keeps getting growing and growing until it gets full of data.

I found a temp solution via the terminal with the rm -rf command .

but I don't understand why I can`t simply empty the trash or access it.

dspolleke
Posts: 114
Joined: Thu Feb 07, 2013 7:09 pm
Location: Netherlands

Re: Empty trash problems

Wed Jul 24, 2013 8:47 am

Do you get an error message?
Please elaborate.
Please read: http://www.biblegateway.com/passage/?search=Matthew+7%3A7&version=NIV

Use loads of sunscreen, use the search, be elaborate in questions, paste commands and error messages, and remember google is your friend!

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

Re: Empty trash problems

Wed Jul 24, 2013 8:53 am

Which Operating System are you running on your RPi?

How do you get files into 'trash'?
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

RediJedi
Posts: 45
Joined: Sun Apr 21, 2013 9:56 am

Re: Empty trash problems

Wed Jul 24, 2013 3:57 pm

Hi, run this command in the terminal to check you have ownership of the trash folder:

Code: Select all

ls -l ~/.local/share/Trash/ 
you should have 2 or 3 folders, expunged, files, info. we are interested in the 1st part "drwx" the permissions and the "jock users" part shows the owner.
If they look like the following but with extra rwx's, then ownership isn't the problem.

Code: Select all

drwx------ 2 jock users 4096 Jul 17 16:49 files
drwx------ 2 jock users 4096 Jul 17 16:49 info
If your results are similar to these:

Code: Select all

d--------- 2 jock users 4096 Jul 17 16:49 files
d--------- 2 root  root 4096 Jul 17 16:49 info
And you see only 1 file permission and root as the owner, you need to take ownership and change permissions.

To take ownership of the folder, use the following command replacing "user" with your user name, and replacing "group" with the group your user belongs to. In my case "jock" & "users".

Code: Select all

sudo chown -R user:group ~/.local/share/Trash/
To change the file permissions, use the following command:

Code: Select all

chmod -R 770 ~/.local/share/Trash/
You should now have access and be able to delete anything in the trash folder.

If ownership wasn't the problem I can't help without knowing more details.

User avatar
j1miroquai
Posts: 11
Joined: Tue Jul 23, 2013 7:54 am
Location: Greece

Re: Empty trash problems

Wed Jul 24, 2013 4:51 pm

RediJedi wrote:Hi, run this command in the terminal to check you have ownership of the trash folder:

Code: Select all

ls -l ~/.local/share/Trash/ 
you should have 2 or 3 folders, expunged, files, info. we are interested in the 1st part "drwx" the permissions and the "jock users" part shows the owner.
If they look like the following but with extra rwx's, then ownership isn't the problem.

Code: Select all

drwx------ 2 jock users 4096 Jul 17 16:49 files
drwx------ 2 jock users 4096 Jul 17 16:49 info
If your results are similar to these:

Code: Select all

d--------- 2 jock users 4096 Jul 17 16:49 files
d--------- 2 root  root 4096 Jul 17 16:49 info
And you see only 1 file permission and root as the owner, you need to take ownership and change permissions.

To take ownership of the folder, use the following command replacing "user" with your user name, and replacing "group" with the group your user belongs to. In my case "jock" & "users".

Code: Select all

sudo chown -R user:group ~/.local/share/Trash/
To change the file permissions, use the following command:

Code: Select all

chmod -R 770 ~/.local/share/Trash/
You should now have access and be able to delete anything in the trash folder.

If ownership wasn't the problem I can't help without knowing more details.
when I type ls -l ~/.local/share/Trash/
I get
ls: cannot access /home/pi/.local/share/Trash/: No such file or directory

when I'm in graphical env and i click the trash bin i get an error message
Error
operation not supported.

User avatar
j1miroquai
Posts: 11
Joined: Tue Jul 23, 2013 7:54 am
Location: Greece

Re: Empty trash problems

Wed Jul 24, 2013 4:55 pm

I think it's not an ownership problem

Code: Select all

drwx------ 2 pi pi 4096 Jul 24 16:53 files
drwx------ 2 pi pi 4096 Jul 24 16:53 info

sdjf
Posts: 1395
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Re: Empty trash problems

Wed Jul 24, 2013 5:46 pm

Try this instead, to see the ownership of the files inside those folders:

ls -l ~/.local/share/Trash/*/*

Sometimes the files within a directory have different ownership and permissions than the files inside of it.
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B

RediJedi
Posts: 45
Joined: Sun Apr 21, 2013 9:56 am

Re: Empty trash problems

Thu Jul 25, 2013 7:46 pm

Hi again, forgot I had posted here.
you could try the command again but with -a this will show hidden items, I don't think expunged is hidden though so would probably be a fruitless exercise.

ls -al ~/.local/share/Trash/

There are a few things that could be at fault, the file manager you use might need a few extras to be able to handle the trash folder "gvfs" springs to mind..
what file manager are you using? can you browse the trash folder? does the file manager have a trash icon in places?

Mennims
Posts: 105
Joined: Sun May 19, 2013 9:37 am

Re: Empty trash problems

Tue Aug 20, 2013 5:30 pm

Hmm you need to show hidden files and open folder as root in file manager, then navigate to /root/.local/share/trash/files, but I have the problem, when you open a folder as root and delete a file it sends it to /root/.local/share/trash/files, so by deleting a file from the /root/.local/share/trash/files directory it sends it back there because you can only access it as root. I need to find out how to delete a file in root without it asking to send it to trash :?

Return to “Beginners”