Caja cannot find .Trash-1000

When I attempt to move a file to trash I get the following error message:

Cannot move file to trash, do you want to delete immediately?
details Unable to find or create trash directory for /media/robert/Shared/Users/Shared...

/media/robert/Shared/.Trash-1000 exists
/media/robert/Shared/.Trash-0 exists

Permissions for .Trash-1000 are root:root Cannot change them to robert:robert. Not in Caja. Not in Caja as administrator. chown robert:robert .Trash-1000 claims to have made the changes, but ls -l .Trash-1000 shows that they are still root:root.

Move to Trash works on external volumes (NTFS or Ext4) and other partition (Ext4) on internal drive.

Please help.

Cannot "upgrade" from 18.04 MATE to 20.04 MATE because 20.04 HDMI sound is too distorted and noisy (unusable).

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: caja 1.20.2-4ubuntu1
ProcVersionSignature: Ubuntu 4.15.0-153.160-generic 4.15.18
Uname: Linux 4.15.0-153-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.24
Architecture: amd64
CurrentDesktop: MATE
Date: Sun Aug 8 16:56:41 2021
InstallationDate: Installed on 2019-12-22 (594 days ago)
InstallationMedia: Ubuntu-MATE 18.04 LTS "Bionic Beaver" - Release amd64 (20180426)
SourcePackage: caja
UpgradeStatus: No upgrade log present (probably fresh install)

The files shouldn't be owned by root if you mounted the file system using the Disks tool or Caja.

FAT and NTFS filesystems should not have any real file permissions, and if you want to change the owner of the files on such a filesystem, you need to specify that user at the time the filesystem is mounted. But Disks and Caja specify that for you.

This sounds similar to I want write access to ntfs mounted drives. Unfortunately, we never got a reply to the original issue. What I do know is that when I tried mounting an NTFS and a FAT filesystem on a Debian Buster system just a few minutes ago, the files on both filesystems were owned by the user that mounted the filesystem. (Debian Buster has very similar packages to Ubuntu MATE 18.04, and I had Debian Buster handy at the time.)

How did you mount this filesystem?

Show us the contents of /etc/fstab (you can remove any irrelevant entries from the file if you don't want us to see them).

Finally, run the mount -l command as a normal user so we can see who actually mounted the Shared data partition.

Thank you for responding! This is the first time in three years that a bug report from me has gotten a useful reply!

Drive auto mounted

mount -l
mount -l
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=15891012k,nr_inodes=3972753,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=3184700k,mode=755)
/dev/sda2 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,name=systemd)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=25,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=14923)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
configfs on /sys/kernel/config type configfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
/var/lib/snapd/snaps/ubuntu-mate-welcome_626.snap on /snap/ubuntu-mate-welcome/626 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/software-boutique_54.snap on /snap/software-boutique/54 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/software-boutique_39.snap on /snap/software-boutique/39 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/core18_2066.snap on /snap/core18/2066 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/core18_2074.snap on /snap/core18/2074 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/ubuntu-mate-welcome_622.snap on /snap/ubuntu-mate-welcome/622 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/core20_1081.snap on /snap/core20/1081 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/wine-platform-3-stable_10.snap on /snap/wine-platform-3-stable/10 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/pulsemixer_283.snap on /snap/pulsemixer/283 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/wine-platform-3-stable_11.snap on /snap/wine-platform-3-stable/11 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/curl_47.snap on /snap/curl/47 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/curl_233.snap on /snap/curl/233 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/pulsemixer_250.snap on /snap/pulsemixer/250 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/gtk-common-themes_1515.snap on /snap/gtk-common-themes/1515 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/core_11316.snap on /snap/core/11316 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/dotnet-sdk_129.snap on /snap/dotnet-sdk/129 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/anbox_186.snap on /snap/anbox/186 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/wine-platform-runtime_231.snap on /snap/wine-platform-runtime/231 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/core_11420.snap on /snap/core/11420 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/dotnet-sdk_132.snap on /snap/dotnet-sdk/132 type squashfs (ro,nodev,relatime,x-gdu.hide)
/var/lib/snapd/snaps/gtk-common-themes_1514.snap on /snap/gtk-common-themes/1514 type squashfs (ro,nodev,relatime,x-gdu.hide)
/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
tmpfs on /run/snapd/ns type tmpfs (rw,nosuid,noexec,relatime,size=3184700k,mode=755)
nsfs on /run/snapd/ns/anbox.mnt type nsfs (rw)
/dev/sda4 on /media/robert/Shared type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096,x-gvfs-show)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=3184696k,mode=700,uid=1000,gid=1000)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
/dev/sdd2 on /media/robert/8TB Seagate 1 type ext4 (rw,nosuid,nodev,relatime,stripe=8191,data=ordered,x-gvfs-show)
/dev/sdc6 on /media/robert/4TB g-drive type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2) [4TB g-drive]
/var/lib/snapd/snaps/wine-platform-runtime_232.snap on /snap/wine-platform-runtime/232 type squashfs (ro,nodev,relatime,x-gdu.hide)

There is one internal hard drive with a UEFI Partition, a
I tried to change the owner of /media/robert/Shared/.Trash-1000 using Caja, Caja as administrator, chown, and sudo chown. Caja immediately changes it back to root. chown claims it succeeds but ls -l /media/robert/Shared/.Trash-1000 still shows root. The tools do not work!

Not the same problem as I want write access to ntfs mounted drives. I have always had access to the NTFS. That is why it is still NTFS and not Ext4. NTFS on other external drives work fine. It seems to be just this one partition.

Please refer me to info on how to control automatic mounting of drives and updating fstab. I am a Linux newbie (but an expert rogrammer).

Robert Pearson

(Attachment fstab is missing)

I think I see the problem.

In the first screenshot you attached, you checked the option "Mount at system startup". This does not do what you might expect. When you instruct UDisks to mount a partition at system startup, UDisks literally mounts the disk at system startup, i.e. before you log in. UDisks can't know ahead of time which user you're going to log in as, so UDisks will mount the partition on root's behalf. This explains why the following appears in the mount -l output you attached (thank you):

(I added emphasis to the relevant section of the output.)

The user_id=0,group_id=0 tells the NTFS filesystem driver to set the owner of all files to root. You may wonder why you can't set ownership on specific files on NTFS volumes on Linux; for a multi-page diatribe about the reason for that, please see my post at Pi4 Mate 20.10 Gpart format ntfs partition on SDcard cannot uncheck "run as executable" in Caja - #2 by gordon. (Short answer: NTFS is not a UNIX-aware filesystem; therefore it lacks the ability to store UNIX ownership and permissions data on the filesystem, and due to a bug the NTFS driver doesn't return an outright error when you try to set UNIX-style permissions.)

TL;DR: There are several ways to fix / work around the issue. I haven't verified any of them to completion, however; if I wanted to really test them I'd have to reboot, and due to some processes that I have running that can't be interrupted, I can't reboot to test them right now. But here's the checklist anyway (in no particular order):

  • In the Disks utility, in the Mount Options dialog that you screenshotted above, in the field of mount options just above the field for the mount point: append ,user_id=1000,group_id=1000 to the list of mount options, to ensure the volume gets mounted on behalf of your user account every time the system boots. Oh yeah, and reboot the system right after making this change; the change won't take effect until you reboot next!

    This method requires the least changes to your current setup (among the other options listed here), but has one caveat: If you boot up and immediately log in as a user different from your normal user account (user 1000, named robert), then the user you log in to will not have ownership of the files on the partition. (However, that user will be able to read files since your mount options also include the allow_other option, which gives everybody read access to everything on the partition.)

  • If the multi-user-unfriendlyness of the above option turns you off, you can disable "Mount at system startup" and add this to each user's list of startup applications (search under the Brisk menu for Startup Applications):
    udisksctl mount -b /dev/sda2
    I got that command from 11.10 - Automatically mount NTFS drive when I login - Ask Ubuntu, though I have not verified myself that this works. Theoretically, it certainly should (but when was the last time that theory bought you a sandwich? :grin:).

  • I don't really understand how the following answer works, but it sounds intriguing anyway:
    raspberry pi - How can I make udisks-glue run at startup and mount drives as particular user? - Unix & Linux Stack Exchange

I hope that helps you in some way or another. I'm sorry I can't be of much more help than that right now.

I'm also sorry if the mass of information I just provided to you overwhelms you; I'd be overwhelmed right now if I were on the receiving end!

have added ,user_id=1000,group_id=1000 to the mount options. No one else uses this computer but if they did they would have read access.

Very helpful! Unfortunately, I also cannot reboot at this time. I have had programs that take two weeks to run. Will test mount when I am forced to reboot.

Again. Thank you very much! So far you are the only one in the community to help fix a problem. (I'm still using Ubuntu MATE 18.04 because all later releases break code that works in 18.04.)

Chrome crashed Ubuntu MATE 18.04. When I rebooted the situation was unchanged. What do I do now?

Robert Pearson

I'm going to assume that you meant to write "EDIT:" Before the "Chrome crashed Ubuntu MATE ..." stuff. As such I'm going to assume that my suggestion didn't work.

Well, if that's the case then it's time to get down and dirty. Let's edit the /etc/fstab file ourselves -- maybe that'll work!

  1. Open a terminal. (In case you don't know how to do so: Go to the Brisk menu on the top panel and type "terminal" into the search box. Chances are, there's only one terminal installed, so click that to launch it.)

  2. Type the command: sudo pluma /etc/fstab, and press Enter to execute the command. This should open a text editor to the /etc/fstab file.

  3. Using the Find command in Pluma (Ctrl-F), search for the entry for your shared data partition (I'd suggest looking for "Shared" -- you may want to turn on Match case to ensure quicker matching).

  4. When you find the line in question, close the Find dialog.

  5. Search on that line for user_id=.

  6. Delete any duplicate pairs of user_id= and group_id= settings, if there are any duplicates.

  7. Change the remaining user_id=0 to a user_id=1000, and the group_id=0 to a group_id=1000.

  8. Save the fstab file.

  9. Close Pluma.

  10. If you can, reboot. If you can't, try running sudo mount -a to remount the shared data partition with the new settings.

I can't guarantee that'll work either, but I'm willing to find out. Thanks.

Thank you yet again for responding. This is the first time ever that I have a response to a problem report.

The current setting is
/dev/disk/by-partlabel/Shared /media/robert/Shared auto nosuid,nodev,nofail,x-udisks-auth,x-gvfs-show,user_id=1000,group_id=1000,noauto 0 0

That is what it was the last time I rebooted (Chrome crashed again and took Ubuntu with it - that is not supposed to happen!).

Ownership is still root. When I try and change the ownership Ubuntu immediately turns it back to root. Why does Ubuntu insist the the owner of .Trash-1000 be root?

P.S. Thanks for showing me the command line for starting Pluma on a system file!

1 Like

Proof Ubuntu does not insist on trash being root:

I would suggest making a new custom user, giving that user sudo privileges,
then check your permissions for trash, that the new user is the owner.
user name> .local> share> trash
Then moving your files to the new custom user and deleting your current user name (eventually). I can't guarantee that will work, but it seems something is mis-configured in your current user. If all goes well keep the current user for a bit, just to make sure you didn't forget something like your email address book or calendar events. Then if all is well you can delete the old account but there is no hurry to do that.

The only trash problems I have had is moving root files to my user trash, and then being unable to clear my trash file. If that happens I open Caja as root, and then navigate to trash and delete the files.

Before you try @jymm's suggestion above :point_up:, I'd suggest you try my revised suggestion, as follows.

I searched the various documentation for the NTFS filesystem driver, and finally found an answer. Sorry, I had given you the wrong options.

Open the /etc/fstab back up, and replace user_id=1000,group_id=1000 with uid=1000,gid=1000. Save the file, close the editor, and do sudo mount -a. It worked for me on my own NTFS filesystem here.

Note that if the above fails, try unmounting the NTFS filesystem first:

sudo umount /media/robert/Shared
sudo mount -a

I would have believed you without the picture. I checked the permissions on the external drive and they were all robert. I agree that the user "robert" probably has bad data. That would explain why Ubuntu changes the owner back to root when I try and change it.

How do I create a new user? (I am a Linux newbie)

I would prefer to clean up the data for user robert than to move everything to a new user. What data does Ubuntu use to change the owner? How do I edit the user data?

If this were Windows "support" they would just have me reformat the disk and reinstall the OS.

Robert Pearson

I'm confused. Were you replying to @jymm's post or mine?

To be perfectly honest, I'd hate to say it, but... I don't think @jymm quite knows what he's talking about here. Maybe he does, or maybe not.

Select but do not open the .Trash-1000 folder on /media/robert/Shared, right-click it and choose Properties at the bottom of the menu that pops up. Click over to the Permissions section of the dialog that pops up, then screenshot the Properties section and show us that screenshot.

Also, have you tried my updated reply yet:

Yes I think he was replying to me. I should have said as a last resort option.
rpearsonii - If you choose to go that route, go to System>Administration>Users and Groups
click the add button enter a name and password.
Then give the new user sudo rights
usermod -a -G sudo (user name)
You also have to reboot for the sudo rights to be in place for the new user.

Again I would try Gordon's method first, even creating a new user is a lot of work, transfering files, setting up bookmarks and addons in browsers and redoing your email and calendars, plus redoing your desktop.

Changed user_id=1000,group_id=1000 to uid=1000,gid=1000. Then sudo mount -a. No improvement.

Again thanks for the help. This is totally unprecedented in my Ubuntu experience. None of my other problem reports resulted in any action and all bug reports were deleted without any fix.

Screenshot at 2021-08-13 16-05-27.png

Screenshot at 2021-08-13 16-09-54.png

Are you opening Caja as root? sudo caja
That way you would have root privileges. Then the permissions shouldn't be grayed out.

I had to reboot after Chrome crashed the system (again).

The good news is that when the partition was mounted, .Trash-1000 had the correct permissions. The bad news is that it did mount automatically. I had to mound it manually. I am studying the mounting process to see it I can get it to auto-mount. But it is great having Trash actually work.

I believe in separating code and data. That is why I have separate partitions for the OS and my date. I can reinstall Linux without wiping all my data. Ubuntu coders believe that code and data should be jammed together. When installing Ubuntu there should be a question asking me where I want my home directory to be. Instead, it forces it to be in the OS partition. Hence my Shared partition and all the problems in mounting it. (bad design - but not as bad as Windows)

Robert Pearson