You are not logged in.

#1 2016-01-02 22:31:17

Only1KW
Member
Registered: 2015-12-14
Posts: 17

[SOLVED] Enable trash on non-root drives

I am currently using PCManFM on LXDE.  When I delete a file from any of my hard drives, I would like it to go to the trash.  When I actually try this from my drive mounted on / (/dev/sda2), it is successful.  For all other partitions on all other drives, if I delete a file, I get the following message:

Some files cannot be moved to trash can because the underlying file systems don't support this operation.
Do you want to delete them instead?

I've tried this on partitions of all different file formats, including ext4 (/dev/sdb1), and with a mix of internal and external drives.  I can't find anything online about how to fix this except for some really old posts from 2010-2011 that reference files that no longer exist.  Any ideas on what I need to do?

[username@host ~]$ sudo pacman -Qs gvfs
[sudo] password for username: 
local/gvfs 1.26.2-1 (gnome)
    Userspace virtual filesystem implemented as a pluggable module for gio
[username@host ~]$ sudo pacman -Qs udisks
local/udiskie 1.3.2-1
    Removable disk automounter using udisks
local/udisks2 2.1.6-1
    Disk Management Service, version 2
[username@host ~]$ mount | grep /dev/sd
/dev/sda2 on / type ext4 (rw,relatime,data=ordered)
/dev/sdc5 on /run/media/username/1C9C-1800 type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)
/dev/sdc3 on /run/media/username/0e94010a-1d5c-443b-871f-c7907e6a2360 type ext4 (rw,nosuid,nodev,relatime,data=ordered,uhelper=udisks2)
/dev/sdc2 on /run/media/username/FreeAgent Drive type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
/dev/sdb1 on /run/media/username/6c485f74-be65-484e-a4c9-8793c6a2e5ad type ext4 (rw,relatime,data=ordered)

Last edited by Only1KW (2016-01-03 05:51:01)

Offline

#2 2016-01-02 23:12:34

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Enable trash on non-root drives


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2016-01-02 23:29:54

Only1KW
Member
Registered: 2015-12-14
Posts: 17

Re: [SOLVED] Enable trash on non-root drives

That isn't working for me.   I have the following directory structure currently for /dev/sdb1:

[username@host ~]$ ls -la /run/media/username/6c485f74-be65-484e-a4c9-8793c6a2e5ad 
total 24
drwxr-xr-x  4 username username  4096 Jan  2 17:26 .
drwxr-x---+ 6 root     root       120 Jan  2 16:10 ..
drwx------  2 root     root     16384 Jan  2 16:08 lost+found
-rw-r--r--  1 username username     0 Jan  2 17:26 New
drwxrwxrwx  2 username username  4096 Jan  2 17:20 .Trash-1000

However, if I try and delete "New", I continue to get the same error.

The UID is correct:

[username@host ~]$ id username
uid=1000(username) gid=1000(username) groups=1000(username),10(wheel),90(network)

Offline

#4 2016-01-03 05:27:47

Only1KW
Member
Registered: 2015-12-14
Posts: 17

Re: [SOLVED] Enable trash on non-root drives

Something else I've learned from additional reading/testing: gvfs-trash works fine from command line.

[username@host ~]$ cd /run/media/username/6c485f74-be65-484e-a4c9-8793c6a2e5ad
[username@host 6c485f74-be65-484e-a4c9-8793c6a2e5ad]$ ls .Trash-1000/files/
[username@host 6c485f74-be65-484e-a4c9-8793c6a2e5ad]$ touch New
[username@host 6c485f74-be65-484e-a4c9-8793c6a2e5ad]$ gvfs-trash New 
[username@host 6c485f74-be65-484e-a4c9-8793c6a2e5ad]$ ls .Trash-1000/files/
New
[username@host 6c485f74-be65-484e-a4c9-8793c6a2e5ad]$ 

I'm not sure what PCManFM is doing during delete, but is there a way for me to tell it to use gvfs-trash when deleting?

Offline

#5 2016-01-03 05:50:35

Only1KW
Member
Registered: 2015-12-14
Posts: 17

Re: [SOLVED] Enable trash on non-root drives

I think I just fixed my problem.  In Preferences -> General in PCManFM, there is a checkbox called "Erase files on removable media instead of 'trash can' creation".  My guess is that by mounting the partition on the internal hard drive in /run/media, PCManFM considered that partition to be media and so wouldn't place the file in the trash.  I've verified that doing either of the following fixes my issue:

  1. Uncheck "Erase files on removable media instead of 'trash can' creation"

  2. Unmount the partition from /run/media/username and instead mount it in /mnt

Option 2 seems to be a cleaner option as I don't want anything else considering the drive to be removable media, but unfortunately mounting the drive under /mnt doesn't list the drive in "Places" in the left side of PCManFM (and other application save dialog boxes).  However, this is easy to work around simply by creating a bookmark instead.  I am considering this solved.

Offline

Board footer

Powered by FluxBB