You are not logged in.

#1 2014-01-09 22:06:24

vibee
Member
Registered: 2013-06-15
Posts: 38

[Solved] Trash folder for ext4 partition not working

Hi,

besides the partitions for / and /home, I am using a hard disk with one ext4 partition, mounted to /mnt/serverdisk. My DE is gnome and I use nautilus as file manager.

Unfortunately, the trash folder does not work correctly for this partition. Here is what I did so far:

 $mkdir /mnt/serverdisk/.Trash
 $chown vibee:users /mnt/serverdisk/.Trash
 $chmod 770 /mnt/serverdisk/.Trash
 $chmod +T /mnt/serverdisk/.Trash #set sticky bit as supposed in FreeDesktop trash specification

Nautilus recognizes the trash folder, as I can now move files to trash. After moving a file to trash, it is visible in trash. Unfortunately, restoring files fails without an error message. It just disappears from Trash and won't appear in originate folder again.

Any suggestion what I might have done wrong?

Last edited by vibee (2014-01-11 19:21:38)

Offline

#2 2014-01-11 16:28:02

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: [Solved] Trash folder for ext4 partition not working

I am not familiar with Nautilus, but shouldn't the trash end up in .Trash-uid instead? Otherwise trash would be shared between users. Google seems to confirm this

Offline

#3 2014-01-11 16:32:07

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,643
Website

Re: [Solved] Trash folder for ext4 partition not working

Spider.007 wrote:

I am not familiar with Nautilus, but shouldn't the trash end up in .Trash-uid instead? Otherwise trash would be shared between users. Google seems to confirm this

This is how it is on my xfce4 system [thunar].


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#4 2014-01-11 16:52:29

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] Trash folder for ext4 partition not working

It has been a long time since I have used a file manager.  But I do recall there being something like ~/.local/share/Trash for your home directory, and within that were two more directories, one for the files themselves and one for the metadata associated with the deletion (previous location, deletion date, and so forth).

Again, it has been a long time since I have used a file manager or any kind of trash system.  So this may or may not be correct today.  It is just what I remember.

Offline

#5 2014-01-11 19:15:51

vibee
Member
Registered: 2013-06-15
Posts: 38

Re: [Solved] Trash folder for ext4 partition not working

Hi guys,

here is the FreeDesktop Trash Specification: (source: http://www.ramendik.ru/docs/trashspec.html)

I will try to create a .Trash-1000 folder then and see if it's working. Although it should, according to the Trash Specification, also work with one .Trash folder and correct permissions / sticky bit.

Edit: Created a .Trash-1000 in partition/mount root, chowned it and it seems to be working.

It may also choose to provide trashing in the “top directories” of some or all mounted resources. This trashing is done in two ways, described below as (1) and (2).

(1) An administrator can create an $topdir/.Trash directory. The permissions on this directories should permit all users who can trash files at all to write in it.; and the “sticky bit” in the permissions must be set, if the file system supports it.

When trashing a file from a non-home partition/device4 , an implementation (if it supports trashing in top directories) MUST check for the presence of $topdir/.Trash.

When preparing a list of all trashed files (i.e. to show to the user), an implementation also MUST check for .Trash in all top directories that are known to it.

If this directory is present, the implementation MUST, by default, check for the “sticky bit”. (It MAY provide a way for the administrator, and only the administrator, to disable this checking for a particular top directory, in order to support file systems that do not have the “sticky bit”).

...
(2) If an $topdir/.Trash directory is absent, an $topdir/.Trash-$uid directory is to be used as the user's trash directory for this device/partition. $uid is the user's numeric identifier.

The following paragraph applies ONLY to the case when the implementation supports trashing in the top directory, and a $topdir/.Trash does not exist or has not passed the checks:

When trashing a file, if an $topdir/.Trash-$uid directory does not exist, the implementation MUST immediately create it, without any warnings or delays for the user.

When trashing a file, if this directory does not exist for the current user, the implementation MUST immediately create it, without any warnings or delays for the user.

Last edited by vibee (2014-01-11 19:19:55)

Offline

Board footer

Powered by FluxBB