On Tue, May 20, 2025 at 6:00 AM Jonathan Dowland wrote: > > On Tue May 20, 2025 at 6:41 AM BST, Kamil Jońca wrote: > > why not > > if ! mountpoint /mnt/usb-drive-b ; then ... > > ? > > I'd not heard of either `mountpoint` or `findmnt` before. I see they're > both part of util-linux, so I guess as likely as each other to be > available (which is one criterion I would use for choosing) > > The approach I would have used (and it's not infallible) is > > test -f /mnt/usb-drive-b/.some-file > > where '.some-file' exists on the device but not on the empty mount > point.
If we're continuing this thread, why would one want to use /mnt/usb-drive-b for mounting a usb drive instead of automatically mounting to /media/$USER/filesystem-UUID ? Thanks Lee