this post was submitted on 26 Jun 2026
6 points (100.0% liked)
linux4noobs
4242 readers
9 users here now
linux4noobs
Noob Friendly, Expert Enabling
Whether you're a seasoned pro or the noobiest of noobs, you've found the right place for Linux support and information. With a dedication to supporting free and open source software, this community aims to ensure Linux fits your needs and works for you. From troubleshooting to tutorials, practical tips, news and more, all aspects of Linux are warmly welcomed. Join a community of like-minded enthusiasts and professionals driving Linux's ongoing evolution.
Seeking Support?
- Mention your Linux distro and relevant system details.
- Describe what you've tried so far.
- Share your solution even if you found it yourself.
- Do not delete your post. This allows other people to see possible solutions if they have a similar problem.
- Properly format any scripts, code, logs, or error messages.
- Be mindful to omit any sensitive information such as usernames, passwords, IP addresses, etc.
Community Rules
- Keep discussions respectful and amiable. This community is a space where individuals may freely inquire, exchange thoughts, express viewpoints, and extend help without encountering belittlement. We were all a noob at one point. Differing opinions and ideas is a normal part of discourse, but it must remain civil. Offenders will be warned and/or removed.
- Posts must be Linux oriented
- Spam or affiliate links will not be tolerated.
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Followup: OP, based on your post update, you do indeed mean bind mounts. Okay.
As I said above, what I would probably do myself for most cases is to just use a symlink, not a bind mount. That's easy, doesn't require futzing around with the system, and in most cases probably does what you want, whereas a bind mount may not (e.g. if you have a filesystem indexer or backup system, they're not going to back the stuff up or index it twice).
That'd be something like:
That does mean that /home/user/folder will still be visible when you don't have the media inserted, though it'll just be a dangling symlink.
If you definitely do want to do it with bind mounts...hmm. It looks like there are some additional hurdles.
https://unix.stackexchange.com/questions/799166/linux-auto-mounting-usb-with-udev
According to a comment there, it looks like systemd-udev shouldn't run a
mountcommand directly, as it runs commands in a private namespace; it should usesystemd-mount --no-block, which will ask systemd to set this up. You could probably write a bash script that runs a series of commands, including thesystemd-mountcommand. It may be a bit involved for a linux4noobs solution, and I can't give an off-the-cuff answer from personal experience, but I'd guess that it may very well be technically possible, and that's probably what I'd be looking into if I were determined to specifically to use bind mounts.