5

I've got two machines running same Ubuntu 18.10. On both of them I have several bind mounts in /etc/fstab as shown below:

# file system      mount point      type  options           dump  pass
  /mnt/hdd/folder  /home/user/data  none  bind,x-gvfs-hide  0     0

After I upgraded one of these machines to 19.04 I got two following errors:

  1. I cannot move files from bind mounts to trash (neither using Nautilus GUI, nor via gio trash):

    $ gio trash file.txt
    gio: file:///home/user/data/file.txt: 
    Trashing on system internal mounts is not supported
    
  2. In Nautilus, the last item from fstab isn't hidden and displays as a mounted partition

How do I fix that? Or where do I submit a bugreport? Or is there a workaround? (Several months have been passed since 19.04 released after all.) Especially non-working trash is annoying.

2 Answers 2

3

I realize some time has passed since your post, but the issue remains on Ubuntu 19.10, so this answer might still be informative to some.

  1. For your first problem, it has been discussed a bit more thoroughly there: https://unix.stackexchange.com/questions/115757/unable-to-delete-files-to-trash-in-a-bind-mounted-filesystem/115811 . In a nutshell, there is no current solution, at least for GUI experience. But one of the answers suggests that you can use the trash command from the command-line package trash-cli and that it works fine with bind mounts (However not an ideal solution for a desktop computer, I suppose).

On a side note, I personally also have the issue on my computer with Ubuntu (and also previously on Fedora, if I recall correctly), but I don't seem to encounter this problem on Manjaro (using Deepin DE at least, I haven't tried on another desktop environment and don't know if it could be related to it). I guess it would be interesting to investigate how those two different systems handle the trash to spot where the problem is on Ubuntu (and other distros having the same issue).

  1. As for your second problem, I have to admit that I don't understand what is not working, since you are already using the option x-gvfs-hide. In my case, the only difference I can spot is that I also have the defaults option. So it would give the following with your example:
# file system      mount point      type  options                  dump  pass
  /mnt/hdd/folder  /home/user/data  none  defaults,bind,x-gvfs-hide  0     0
2
  • thx for the reply. btw, another workaround for 1st question is to delete the file using its primary, device-mounted path, not a bind-mounted one.
    – whyer
    Dec 21, 2019 at 14:24
  • thx on the tip, I did a nemo alternative on my answer Aug 30, 2021 at 0:04
0

in case you moved from nautilus to nemo (like I did), you can use this:
place this file at:
~/.local/share/nemo/actions/trash.nemo_action

[Nemo Action]
Active=true
Name=Move to Tra_sh(cli)
Comment=Trash even on mount binds
Exec=xterm -title "Trashing(cli)" -e trash -v %F
Selection=any
Extensions=any
EscapeSpaces=true

you can remove the xterm part and keep just the command.
you can change the shortcut but I suggest just pressing the context menu key over the files and just hit 's'.
I tested it with 1 file, many files, 1 folder and many folders selected, all worked!
I am quite sure this can work on nautilus too, I just dont remember where you should place an equivalent action.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.