this post was submitted on 28 Jan 2025
23 points (100.0% liked)
Linux
49393 readers
1748 users here now
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
~~You can only mount into an empty directory.~~ (Edit: Ok that is not really correct. You can mount into directories with content, but then the content will no longer be accessible from that point.) You cannot mix two directories with mount.
Edit: You could have two points using one Mountpoint at a time maybe. With a script you unmount the fallback, and if you connect the new drive you mount it with the script. And if you are done, use your unmount script to reverse it. Just an idea.
Some more Edit: In short you create an empty directory that is the Mountpoint, lets say "/home/user/Apple". Now your real local files are at "/home/user/folderApple". You mount folderApple to Apple. This is your fallback. Then if you connect the other drive, with your script you unmount that and mount your "/mnt/drive/Banana" to "/home/user/Apple", which is empty again after the unmount. And reverse it if you want to unplug.
Well that's bullshit, I can mount to directories with contents
Alright, I didn't know you can mount "over" a directory. But my point was, you cannot mix them, you do not mount into the directly. It just replaces it. Which also would make this directory no longer accessible, but he wants both accessible at the same time.
Yes
Ideally I'd like to avoid a script because my experience is they aren't very durable. I make mistakes and they are difficult to troubleshoot. So I am trying to just use the tools that are already available in the system.
But maybe there is something in the idea of using a second mount, like if
/home/user/folderApple
is always empty/home/user/folderApple-original
mounts ontop of/home/user/folderApple
at boot/mnt/drive/folderBanana
also mounts ontop of/home/user/folderApple
when/if it becomes available (later in the order)