I have a FUSE mount located in
/media/writable, however, sometimes this FUSE mount disconnects, but some programs will still attempt to write to
When I restart the FUSE mount service, it will fail to mount because the directory is non-empty.
How can I use
--one-file-system argument to ensure that when I rm
/media/writable, it will only delete files located on the local filesystem, as opposed to the fuse mounted filesystem? There are other folders located in
/media/ so I am unable to run
rm in the parent folder.
Am I better off moving the folder one layer down (eg.
/media/writable/mount) so I can rm the parent folder, or is there a way of selecting which filesystem I wish to delete from?
I'm running Ubuntu 18.04.1 LTS with coreutils 8.28.
Edit: My current method is this, but I'd like to see if there's a better way to do it:
ExecStartPre=-/bin/mountpoint /media/writable/ || /usr/bin/stat /media/writable/MOUNTED || /bin/rm/ --one-file-system -rf /media/writable/*