[SOLVED] Can't find or create trash folder error

Hello everyone

I’m a new user. I installed the alternative version of lubuntu. The version is 18.04.2 LTS 64-bit. Everything works fine. My PC is very fast again.
The default file browser is PCManFM. I have 2 automounted NTFS partitions. The problem is that I can’t delete files from these partitions. The shift+delete is working but I can’t delete files to the trash folder. I get an error can’t find or create trash folder. (Or something like that, the system is not English)

I searched for a solution. I found these:

https://askubuntu.com/questions/262817/unable-to-find-or-create-trash-directory

https://forum.xfce.org/viewtopic.php?id=6910

But I don’t understand these posts. I tried to edit fstab but still can’t delete into trash. I found other topics where they said that create .Trash-1000 folder. It didn’t work.

When I use PCManFM as root I can delete files and there is a .Trash-0 folder.

My fstab file:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sdb2 during installation
UUID=a3f352e1-bcf5-48ba-a11a-0a9c3de56ee6 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sdb6 during installation
UUID=1a8eb5f9-83ad-4e82-afb0-6c8aa52748f4 none            swap    sw              0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0       0
/dev/disk/by-uuid/FE48F25348F20A63 /mnt/FE48F25348F20A63 auto nosuid,nodev,nofail,x-gvfs-show 0 0
/dev/disk/by-uuid/68EC6E5AEC6E2294 /mnt/68EC6E5AEC6E2294 auto nosuid,nodev,nofail,x-gvfs-show 0 0

So what should I do? I don’t want to install another file browser.

Without knowing that exact error, this is going to be a bit hard to track down.

These are for Xubuntu which has a different file manager and, as such, are totally irrelevant.

That said, in an attempt to reproduce this, I used the live version of Bionic to boot a virtual machine with a fresh hard drive attached to it. Using Disks, I formatted this to ntfs (and gave it the label ntfs) and mounted it. The results:

$ mount | grep ntfs
/dev/sda on /media/lubuntu/ntfs type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)

I then opened pcmanfm and created a few new files and could use Delete to send them to the Trash, or right click and select “Move to Trash,” or drag and drop them on the Trash.

That said, I can’t reproduce your issue, but it’s quite possible that adding all of those additional flags on the mounting (i.e. you would add it to /etc/fstab) would make for a difference, especially the ones related to permissions or ids.

Without knowing that exact error, this is going to be a bit hard to track down.

The exact error is Unable to find or create trash directory for /mnt/directory name/folder name/file name

I have two ntfs partitions on different HDDs. The first one is /dev/sda(1) It’s the whole disk. The second one is /dev/sdb6 (this is a shrinked disk). How should I use your command? I’m not familiar with terminal.

And I’ve found out that I can delete without problem if I turn that thing on in the disks program like in the picture.

Before I posted here I turned that off and I let everything on default. But after that I wasn’t able to delete files. I would like automount disks but I don’t know what should I do right now.
Sorry for that and thanks for the reply.

Edit /etc/fstab and where you see:

nosuid,nodev,nofail,x-gvfs-show

change it to:

nosuid,nodev,nofail,x-gvfs-show,rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2

After doing that, unmount your drives and then do sudo mount -a in the terminal do simulate your normal automount.

In other words, you select the default mount options. Let’s see what the difference is. First do this in terminal after the automount:

mount | grep -e sda -e sdb

and show us the results.

Then unmount and try remounting using Disks and do the same thing so we can compare the difference.

I tried to edit fstab and unmount then mount -a without any success. I get the same error every time in PCManFM. :frowning_face:

I can’t use this command mount | grep -e sda -e sdb

I don’t have -e as an option.

That’s strange. This command should work. Can you post the entire command and response?

I’m also seeing two potential problems here:

  1. You say you can’t handle some sort of thing with the mounting
  2. You say you can’t do the command I gave to check the mounting options

About the first one:

  • Let’s see what the relevant lines of /etc/fstab look like.
  • Did the unmount work? If not, what was the error?
  • Did you sudo the mount -a? Won’t work if not.
  • If you had an error with the mount -a, what was the error?

About the second one:

  • If you do man grep you will most certainly see the -e option under the “Matching Control” section, so I’m not sure why you think that’s not an option.
  • Perhaps rather than trimming the output of mount, you should just do it by itself and ignore the grep bit. Just give us the results of that and we’ll figure it out.

About the first one:

  • Let’s see what the relevant lines of /etc/fstab look like.
  • Did the unmount work? If not, what was the error?
  • Did you sudo the mount -a ? Won’t work if not.
  • If you had an error with the mount -a , what was the error?

My fstab:

/dev/sda1 /mnt/sda1 auto nosuid,nodev,nofail,x-gvfs-show,rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2 0 0
/dev/sdb5 /mnt/sdb5 auto nosuid,nodev,nofail,x-gvfs-show,rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2 0 0

The unmount worked. The sudo mout -a worked too. I didn’t have any errors.

About the second one:

  • If you do man grep you will most certainly see the -e option under the “Matching Control” section, so I’m not sure why you think that’s not an option.
  • Perhaps rather than trimming the output of mount , you should just do it by itself and ignore the grep bit. Just give us the results of that and we’ll figure it out.

You had written mount grep and your last post you wrote man grep. Mount grep -e command doesn’t exist. How should I use the man grep -e option? Because on my sdb there is a swap directory and an ext4 directory too. Is it a problem?

Mount results:

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=998680k,nr_inodes=249670,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=204184k,mode=755)
/dev/sdb2 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)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
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/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,rdma)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=39,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=12622)
mqueue on /dev/mqueue type mqueue (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
configfs on /sys/kernel/config type configfs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
/dev/sda1 on /mnt/sda1 type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,x-gvfs-show,uhelper=udisks2)
/dev/sdb5 on /mnt/sdb5 type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,x-gvfs-show,uhelper=udisks2)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=204180k,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)

Yes, they have different purposes. man is short for “manual” and provides instructions.

That is absolutely correct. However, if you look carefully, I did not say to do mount grep -e but to do mount | grep -e, the important difference being the pipe character (|). This is something heavily used in the Linux world, so keep an eye out for it to eliminate the possibility of similar confusion. This is all irrelevant now, though.

It shouldn’t be, but weird.

Your mount looks exactly like mine did when I tested this. So it should work.

Interestingly, if one does do what I suggested in /etc/fstab, it oddly does not work.

That is ridiculous, but it’s because I guess the .Trash folder is created at mount and it’s created by the “owner” of the mounting, which with /etc/fstab is root. When successfully mounted as a user through Disks (and where the user is id 1000), there is a .Trash-1000 folder in the root of the mount (so that would be /mnt/sda1 or mnt/sdb5 in your case) that is owned by my user/group and with permissive access (077/drwxrwxrwx). If I trash a file on the filesystem, it goes in the files directory under that folder. Ownership and permissions change when running through /etc/fstab, though!

Looking at the man page for ntfs-3g, it looks like the key option that is missing is permissions. So remove the user_id=0,group_id=0 bits and replace it with that. Also get rid of blksize=4096 as it’s unnecessary as it will be calculated at time of mount. Do keep rw (read/write; should be default but it doesn’t hurt to be explicit) and allow_other (which also does something with permissions). I didn’t try it but you probably don’t need nosuid. Similarly, I doubt default_permissions is helping and I can’t actually find it documented anywhere. You don’t need nofail as I always find error messages to be useful. You could accept the defaults for nodev (although it makes sense for NTFS to use it rather than the default dev) and relatime. In the end, I’d probably suggest:

rw,permissions,allow_other,x-gvfs-show,uhelper=udisks2

Change your options in /etc/fstab to that and you should be good.

I guess one could consider this a bug, but restricting permissions as much as possible is actually a feature.

I’d say in general it’s true that when dealing with file systems, it is assumed you know what you’re doing, which is where you can get into some crazy trouble. This is especially true when you’re using a Windows-based file system that has a whole different concept of permissions than the Linux world.

Finally it works. :heart_eyes::smile:

rw,permissions,allow_other,x-gvfs-show,uhelper=udisks2

That didn’t work :disappointed: But I’ve found a post about changing the owner of ntfs partitions.

https://forums.linuxmint.com/viewtopic.php?t=201904

With these changes in /etc/fstab I became the owner of the disks and I can delete files.

defaults,noatime,utf8,dmask=002,fmask=111,uid=1000,gid=1000

So now my specific lines are these:

LABEL=Belső\040disk\040400GB /mnt/Belső\040disk\040400GB auto defaults,noatime,utf8,dmask=002,fmask=111,uid=1000,gid=1000,x-gvfs-show 0 0
LABEL=Hordozható /mnt/Hordozható auto defaults,noatime,utf8,dmask=002,fmask=111,uid=1000,gid=1000,x-gvfs-show 0 0

I used label option. It’s better than numbers for me. Thank you for your help. Without you I would have not been able to solve this problem. Thank you.