mount a subdirectory without intermediate mount

Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
This is the result I'm looking for:
# mount /dev/node /mnt/intermediate
# mount --bind /mnt/intermediate/sub/dir /final/mountpoint
I'd like to do it in a single command, though, without use of the intermediate mount point, /mnt/intermediate. Is this possible?
mount
add a comment |
up vote
1
down vote
favorite
This is the result I'm looking for:
# mount /dev/node /mnt/intermediate
# mount --bind /mnt/intermediate/sub/dir /final/mountpoint
I'd like to do it in a single command, though, without use of the intermediate mount point, /mnt/intermediate. Is this possible?
mount
Perhaps a symlink could work?ln -s /mnt/intermediate/sub/dir /final/mountpoint(do this while the node is mounted at/mnt/intermediate). then you only need to mount the intermediate.
– Mioriin
Nov 25 at 10:41
@Mioriin no, the idea is not to have /mnt/intermediate at all.
– enigmaticPhysicist
Nov 25 at 13:00
Note that it is possible to 1) create a temporary directory withmktemp, 2) unmount the temporary after binding the sub-directory. Otherwise, you need the shiny new mount API which hasn't been merged so far. lore.kernel.org/lkml/… / lore.kernel.org/lkml/…
– sourcejedi
Nov 25 at 13:10
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
This is the result I'm looking for:
# mount /dev/node /mnt/intermediate
# mount --bind /mnt/intermediate/sub/dir /final/mountpoint
I'd like to do it in a single command, though, without use of the intermediate mount point, /mnt/intermediate. Is this possible?
mount
This is the result I'm looking for:
# mount /dev/node /mnt/intermediate
# mount --bind /mnt/intermediate/sub/dir /final/mountpoint
I'd like to do it in a single command, though, without use of the intermediate mount point, /mnt/intermediate. Is this possible?
mount
mount
asked Nov 25 at 6:56
enigmaticPhysicist
4671310
4671310
Perhaps a symlink could work?ln -s /mnt/intermediate/sub/dir /final/mountpoint(do this while the node is mounted at/mnt/intermediate). then you only need to mount the intermediate.
– Mioriin
Nov 25 at 10:41
@Mioriin no, the idea is not to have /mnt/intermediate at all.
– enigmaticPhysicist
Nov 25 at 13:00
Note that it is possible to 1) create a temporary directory withmktemp, 2) unmount the temporary after binding the sub-directory. Otherwise, you need the shiny new mount API which hasn't been merged so far. lore.kernel.org/lkml/… / lore.kernel.org/lkml/…
– sourcejedi
Nov 25 at 13:10
add a comment |
Perhaps a symlink could work?ln -s /mnt/intermediate/sub/dir /final/mountpoint(do this while the node is mounted at/mnt/intermediate). then you only need to mount the intermediate.
– Mioriin
Nov 25 at 10:41
@Mioriin no, the idea is not to have /mnt/intermediate at all.
– enigmaticPhysicist
Nov 25 at 13:00
Note that it is possible to 1) create a temporary directory withmktemp, 2) unmount the temporary after binding the sub-directory. Otherwise, you need the shiny new mount API which hasn't been merged so far. lore.kernel.org/lkml/… / lore.kernel.org/lkml/…
– sourcejedi
Nov 25 at 13:10
Perhaps a symlink could work?
ln -s /mnt/intermediate/sub/dir /final/mountpoint (do this while the node is mounted at /mnt/intermediate). then you only need to mount the intermediate.– Mioriin
Nov 25 at 10:41
Perhaps a symlink could work?
ln -s /mnt/intermediate/sub/dir /final/mountpoint (do this while the node is mounted at /mnt/intermediate). then you only need to mount the intermediate.– Mioriin
Nov 25 at 10:41
@Mioriin no, the idea is not to have /mnt/intermediate at all.
– enigmaticPhysicist
Nov 25 at 13:00
@Mioriin no, the idea is not to have /mnt/intermediate at all.
– enigmaticPhysicist
Nov 25 at 13:00
Note that it is possible to 1) create a temporary directory with
mktemp, 2) unmount the temporary after binding the sub-directory. Otherwise, you need the shiny new mount API which hasn't been merged so far. lore.kernel.org/lkml/… / lore.kernel.org/lkml/…– sourcejedi
Nov 25 at 13:10
Note that it is possible to 1) create a temporary directory with
mktemp, 2) unmount the temporary after binding the sub-directory. Otherwise, you need the shiny new mount API which hasn't been merged so far. lore.kernel.org/lkml/… / lore.kernel.org/lkml/…– sourcejedi
Nov 25 at 13:10
add a comment |
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
No, in general you can't mount a sub directory of a file system, unless that file system specifically supports it.
Support for sub directory mounting is sometimes found in network file systems, like NFS or SMB, where you can mount a sub directory of an exported file system.
BTRFS has the option subvol, but that is file system specific.
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
No, in general you can't mount a sub directory of a file system, unless that file system specifically supports it.
Support for sub directory mounting is sometimes found in network file systems, like NFS or SMB, where you can mount a sub directory of an exported file system.
BTRFS has the option subvol, but that is file system specific.
add a comment |
up vote
3
down vote
accepted
No, in general you can't mount a sub directory of a file system, unless that file system specifically supports it.
Support for sub directory mounting is sometimes found in network file systems, like NFS or SMB, where you can mount a sub directory of an exported file system.
BTRFS has the option subvol, but that is file system specific.
add a comment |
up vote
3
down vote
accepted
up vote
3
down vote
accepted
No, in general you can't mount a sub directory of a file system, unless that file system specifically supports it.
Support for sub directory mounting is sometimes found in network file systems, like NFS or SMB, where you can mount a sub directory of an exported file system.
BTRFS has the option subvol, but that is file system specific.
No, in general you can't mount a sub directory of a file system, unless that file system specifically supports it.
Support for sub directory mounting is sometimes found in network file systems, like NFS or SMB, where you can mount a sub directory of an exported file system.
BTRFS has the option subvol, but that is file system specific.
answered Nov 25 at 12:33
RalfFriedl
5,1073925
5,1073925
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f483993%2fmount-a-subdirectory-without-intermediate-mount%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Perhaps a symlink could work?
ln -s /mnt/intermediate/sub/dir /final/mountpoint(do this while the node is mounted at/mnt/intermediate). then you only need to mount the intermediate.– Mioriin
Nov 25 at 10:41
@Mioriin no, the idea is not to have /mnt/intermediate at all.
– enigmaticPhysicist
Nov 25 at 13:00
Note that it is possible to 1) create a temporary directory with
mktemp, 2) unmount the temporary after binding the sub-directory. Otherwise, you need the shiny new mount API which hasn't been merged so far. lore.kernel.org/lkml/… / lore.kernel.org/lkml/…– sourcejedi
Nov 25 at 13:10