You are not logged in.

#1 2012-10-26 20:20:08

Xi0N
Member
From: Bilbao - Spain
Registered: 2007-11-29
Posts: 832
Website

Trash folder

I have a mass storage raid system mounted under /media/Storage
/home is in a different partition.

The problem now is: Whenever I delete a file (send it to trash from dolphin, kde's file manager), the file gets moved to /home/user/.Trash
How can I control this so there is a separate trash folder under the /media/Storage filesystem?

Offline

#2 2012-10-27 03:53:31

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

Re: Trash folder

symlink maybe?  or a bind mount... I have no idea about kde programs, so I am not sure if there is internal functionality.  But those are a couple DE independent options.

Offline

#3 2012-10-27 04:19:46

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Trash folder

I did some googling and found that, at least at some point in the past, kde did what you want.  Are you absolutely certain it's moving the file to your home, and not moving it to a trash folder on the raid volume and symlinking to that?


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#4 2012-10-27 06:40:57

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: Trash folder

Try deleting something bigger. Do you see the HDD activity light blinking or hear anything? Because that would indicate that it's being moved to a different partition. Are you accessing the files from a symlink in the user dir (i.e. Music, Videos, "My Documents" sort of thing) ? Because that could be it. On my PC, Dolphin moves the files to a ".Trash-1000" folder on the top level directory of the drive, not to the user dir. But then again, I don't have a RAID setup... You should probably specify this in the title.


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#5 2012-10-27 07:07:59

Xi0N
Member
From: Bilbao - Spain
Registered: 2007-11-29
Posts: 832
Website

Re: Trash folder

Ok,
The raid 5 is basically 3 x 2 Tb disks controlled by mdadm, giving me a partition of ~3,7Tb
This partition is mounted like this (/etc/fstab)

UUID=8ba68634-8c54-44c3-a420-912de43bdb4a /media/Storage ext4 defaults,user_xattr 0 1

The other partitions are on a 128 SSD disk:
/: 20 Gb
/home: ~100 Gb (The rest of the 128 Gb disk)

I'm positive that whenever I erase anything under, i.e.: /media/Storage/foo it gets MOVED to /home/user/.local/share/Trash/ - I tested it again

This is a pain in many ways:
1: Wears of the SSD
2: Fills the SSD Up, since the contents under /media/Storage are usually HD movies and Stuff... and erasing a couple of them is already 16Gb of transfer between disks

Of course, when I delete, I get a message on the status bar like then I'm performing moving operation with my files

sad

EDIT: A solution could be to use the entire raid partition as /home: That way, the filles would just get moved inside of the same partition - I had this setup before swiching to SSD, but I think this (Keep /home on HDDs - system on a SSD) won't make the system any slower... what do you think, people?

Last edited by Xi0N (2012-10-27 07:21:46)

Offline

#6 2012-10-27 14:45:01

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,138
Website

Re: Trash folder

This page describes how filemanagers should be implementing the trash.
http://standards.freedesktop.org/trash- … c-0.8.html
"The implementation MAY also support trashing files from the rest of the system (including other partitions, shared network resources, and removable devices) into the “home trash” directory . This is a “failsafe” method: trashing works for all file locations, the user can not fill up any space except the home directory, and as other users generally do not have access to it, no security issues arise."

However, this solution leads to costly file copying (between partitions, over the network, from a removable device, etc.) A delay instead of a quick “delete” operation can be unpleasant to users.

An implementation may choose not to support trashing in some of these cases (notably on network resources and removable devices). This is what some well known operating systems do.

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”).

The implementation also MUST check that this directory is not a symbolic link.

If any of these checks fail, the implementation MUST NOT use this directory for either trashing or undeleting files, even is an appropriate $uid directory (see below) already exists in it. Besides, the implementation SHOULD report the failed check to the administrator, and MAY also report it to the user.

I hope this helps.

tl,dr: Create $topdir/.Trash directory as explained above.

Last edited by teateawhy (2012-10-27 14:46:35)

Offline

Board footer

Powered by FluxBB