Questions tagged [bind-mount]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
5k views

Proxmox LXC storage share, permission problems

I'm totally new in these enviroments but I'm trying to learn. I installed proxmox on a single SSD, then attached one HDD(/dev/sdb) to the system for media storage. The basic idea was to create one ...
5 votes
1 answer
6k views

Two *different* mount points having the *same* absolute path (bind-mount problem)

Scenario a NFS share is mounted on /mnt/temp/dir (and other shares are mounted in subdirectories), I umount everything there but supposedly, it doesn't work well (maybe I start with umount /mnt/temp/...
14 votes
1 answer
4k views

How can I make a device available inside a systemd-nspawn container with user namespacing?

I would like to mount an encrypted image file using cryptsetup inside a systemd-nspawn container. However, I get this error message: [root@container ~]# echo $key | cryptsetup -d - open luks.img luks ...
4 votes
1 answer
2k views

How to bind arduino as a fix block-device --- /dev/ttyACM0?

I want to bind my Arduino Mega as /dev/ttyACM0. Sometimes, it turns out to be /dev/ttyACM0 and sometimes as /dev/ttyACM1. I have taken help from this question and this tutorial Someone please help ...
1 vote
4 answers
2k views

How to edit fstab to mount bind a directory that have spaces in the PATH at start in wsl2

I am currently using wsl2 on windows and I use MS OneDrive locally in parallel for my studies. Actually I sync each file with my OneDrive account. AS my Onedrive folder's name is like : Onedrive - ...
1 vote
1 answer
512 views

How to bind mount a directory in .bashrc without sudo privilege

NOTE: I'm working in WSL2, but my issues lies entirely within the Linux side of things. Please let me know if this is not the right place for this. I am needing to mount --bind a directory whenever ....
0 votes
0 answers
27 views

Bind mount the Docker socket into Alpine chroot?

I configured an OpenWrt OS on my FriendlyElec NanoPi R6s but decided to add an Alpine chroot to run other stuff in that OpenWrt doesn't have and to isolate it a little bit away; it even lives on it's ...
2 votes
1 answer
2k views

Systemd BindPaths= not working

I am trying to test how the BindPaths= directive works on a Debian 8 system with systemd. Currently I have a basic unit file for a service: [Unit] Description="Simple Test Service" BindPaths=/path:/...
0 votes
1 answer
137 views

Do bind mounts from NFS path create additional connections to the underlying NFS server?

I am designing the following setup: NFSv3 server Centos7 Client The client mounts an NFS share from the server to /mnt/nfs_share Now I want to create many read only bind mounts from that mount to ...
9 votes
3 answers
7k views

Mount --bind in the same filesystem move files as in the same filesystem

If I mount --bind /a in /b and if I mv /a/bigfile /b/ it will take a lot of time (if the source file is big). This will actually copy the file and then delete the source file instead of simply ...
0 votes
0 answers
79 views

EOVERFLOW when opening any file for writing

I'm writing a custom container engine. When I attempt to open any file for writing somewhere in the container (as long as that place is writeable, permissions-wise), I get an EOVERFLOW error (Value ...
0 votes
0 answers
72 views

Immediately after 'fusermount -u; umount' sporadically fails with Target is Busy

I've a script pre-condition: lsof /dir1 clear #/bin/bash ... fusermount -u /dir1/dir2 # unbind dir2 umount /dir1 # sporadically fails with 'Target is Busy' ... Why do I get ...
0 votes
0 answers
50 views

Mount bind point to incorrect NVMe device after power off/on device

I am developing an all-flash storage application. I found that mount bind has strange behavior on NVMe device power off/on. Distro: SUSE Linux Enterprise Server 15 SP4 5.14.21-150400.24.46-default ...
3 votes
2 answers
1k views

Cannot umount /dev bind-mount

I made a script which (tries to) duplicate my live disk /dev/sdb to a second disk /dev/sda, one rsync per partition (full script). Last step is to install grub on /dev/sda. The method I use is ...
1 vote
0 answers
151 views

Differences between overloay and underlay in Apptainer

I'm trying to understand the differences between the two ways of bindings filesystems in Apptainer configuration. The documentation can be found here, but here are the confusing parts: enable overlay:...
0 votes
0 answers
207 views

Check if Docker volume-mounted path is on HDD or SSD?

In Linux, it is relatively easy to determine whether a drive is an HDD or SSD. However, is there a method to achieve the same result when you only have a path? I need to check, from within a Docker ...
3 votes
4 answers
303 views

Why can I still write to /dev/null even after /dev is mounted read-only?

I was surprised to discover that I can still write to /dev/null even after remounting /dev to be read-only. Here is a demonstration: # echo foo > /dev/null # echo foo > /dev/foo # mount -o ...
1 vote
0 answers
178 views

Ubuntu NFS mount bind failing

This should be a rather simple question, but all my googlefu has failed me so far. I have an nfs server with a share mounted to my local machine in dir /share/ (rw,sync,no_subtree_check) from there I ...
1 vote
3 answers
1k views

Making a bind-mount take effect only in the context of the current process and its descendants

I have 2 files: /MyDir/a and /MyDir/MySubDir/b and am running a bash script, to which I want to add code to make file /a point to file /b, but only in the current process and its descendants. In ...
2 votes
0 answers
1k views

Docker cannot mount to a directory from nfs share

I have an nfs share setup from my NAS with the docker host. 10.237.1.128:/mnt/storage/media 15T 47G 15T 1% /storage I am trying to mount a container in /storage/media/library but I get. ...
1 vote
0 answers
262 views

Can lsof display the real path instead the bind mount path of a docker container?

I try to find out which files are in use in a specific path: lsof /mnt/cache This returns for example: COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME Plex\x20S 338 nobody cwd ...
577 votes
3 answers
497k views

What is a bind mount?

What is a “bind mount”? How do I make one? What is it good for? I've been told to use a bind mount for something, but I don't understand what it is or how to use it.
22 votes
1 answer
13k views

mount --bind other user as myself

I'm using fstab to bind a folder that belongs to another user in one of my own directories. I know that I can map users when I mount an SSHFS, I've been doing some research and I can't find a mount --...
6 votes
1 answer
3k views

Using bind mounts with Overlayfs

I am attempting to create a virtual mount using bind mounts in combination with OverlayFS. What would be most optimal is as follows: The root folder is bind-mounted to a new sub-folder, and used as ...
1 vote
0 answers
70 views

Slackware(64) 14.2 + Xephyr using chroot, umount partitions

This Exact Same Question i first time i do was ib -> https://www.linuxquestions.org/questions/showthread.php?p=6366697#post6366697 i need improve my script : For close the Xephyr window ...
1 vote
2 answers
421 views

Can a file that's being supplied by bind-mount support overwriting via `mv`?

Suppose I bind-mount file a atop file b... $ echo 'line 1' > a $ touch b $ mount --bind a b The initial file contents will be mirrored at both paths, as expected: $ cat a line 1 $ cat b line 1 ...
0 votes
0 answers
1k views

What is a move mount and how is it different from a bind mount?

I've been using bind mounts for 20 years, they're pretty simple. Now I see there is also a move mount, The move operation Move a mounted tree to another place (atomically). The call is: mount --move ...
8 votes
3 answers
13k views

How do I set up bind mounts on startup correctly in the systemd world?

systemd, trying to be smart, parallelizes mounting entries of /etc/fstab. Unfortunately, this randomly messes up bind mounts: A look at my fstab, cleaned up a bit: $ grep -Ev 'ntfs|swap|#' /etc/...
1 vote
0 answers
169 views

Show bind mounts as a separate filesystem

I'm designing something that uses a lot of bind mounts. However, bind mounts show up as the same type as the host filesystem. This is bad as backup programs (like rsync) will read all the bind mounts. ...
1 vote
0 answers
677 views

How do I mount a file on top of a broken symbolic link?

In preparation of a chroot I'm doing an mount --bind /etc/resolv.conf ${MOUNTPOINT}/etc/resolv.conf. I need this because the ${MOUNTPOINT} contains a broken etc/resolv.conf. However, mount is ...
0 votes
1 answer
307 views

Bind mounts for renaming

Can I do a bind mount on file "b" from file "a" such that file b also adapts the name of file "a"? Ex: ls / a foo/b mount --bind a foo/b ls / a foo/a
1 vote
0 answers
87 views

Why `mount --bind ` allows to access shadowed mount point if run after shadowing, but not before?

I've tried to follow the answer to Accessing contents on the underlying mount point path some time ago, it did not work. But recently I've found out it works if mount --bind is executed after ...
0 votes
1 answer
342 views

How to get mount --bind from Tomcat to effect the whole system?

I have a folder with a file /path/to/data/one/it_works.txt And I have an empty folder: /path/to/user/bob I have a script which should be executed by a web app in Tomcat which is: #!/bin/sh Source=&...
2 votes
0 answers
873 views

bind mount with changed mount options from fstab

If you mount a filesystem at /foo with the mount option noexec and want the /foo/bar subtree to use exec instead, this can be achieved by bind mounting /foo/bar on itself mount --bind /foo/bar /foo/...
0 votes
1 answer
952 views

To persist a namespace, create a bind mount point on which /proc/PID?

From https://man7.org/linux/man-pages/man1/n.1.html : By default, a new namespace remains in existence only as long as it has at least one member process. A namespace can be made persistent— that ...
1 vote
0 answers
169 views

Bind mount in an encrypted systemd-homed

I use to have a directory, lets call it F, in my home directory, so I normally did cd /home/me/F. (or variants) My home directory is encrypted with luks using systemd-homed. Since F grew too much, I ...
0 votes
1 answer
528 views

Create another symbolic link from symbolic link in Debian by mount --bind ... command

I have got question how to create symbolic link from another symbolic link (with mount --bind command) under Debian. They are two cases: First case: I have got core data in /main/data. And in the ...
12 votes
4 answers
5k views

Unable to delete files to trash in a bind-mounted filesystem

I'm trying to set up shared home directory for two Linux installations and thus I'm using bind-mounts. My user is named dbz and his home directory is /home/dbz. I also have shared directory /home/...
13 votes
1 answer
12k views

What is the point of btrfs subvolumes?

The system administrator guide of the Btrfs wiki (here) says: A Btrfs subvolume can be thought of as a POSIX file namespace. I remember at first it saying that a subvolume is, as opposed to being ...
0 votes
0 answers
122 views

How to prevent block device like hdisk to mount, using ibudev

It is possible to prevent USB device to be bound using libudev (udev interface in c). Now I want to prevent other devices like block devices to mount using it. Is it possible?? and how to do it?? ...
14 votes
3 answers
3k views

Why is my bind mount visible outside its mount namespace?

So I'm trying to get a handle on how Linux's mount namespace works. So, I did a little experiment and opened up two terminals and ran the following: Terminal 1 root@goliath:~# mkdir a b root@...
2 votes
1 answer
378 views

In a user namespace as non-root, on a nosuid,nodev filesystem, why does a bind mount succeed but a remount fails?

In a Linux user namespace, as non-root, I bind mount /tmp/foo to itself. This succeeds. Then, I try to remount /tmp/foo to be read-only. If /tmp is mounted with nosuid or nodev, then the remount ...
0 votes
2 answers
738 views

autofs mount local directory when nfs unavailable

I want to have my home directory be an NFS mount when it's available, or a local directory when it's not. Think of a laptop that I might want to take somewhere off of my normal network. What I have ...
0 votes
1 answer
377 views

Linking a dropbox business acccount from “~/Dropbox (firm-name)” to “~/Dropbox”, with "mount --bind" or symlink or something else?

Been using my Dropbox account for years on a Lubuntu system. Now, my new company has made a Business account available to me. However, Dropbox insists that this folder should be called: ~/Dropbox (...
2 votes
0 answers
1k views

Unable to chroot mount point?

# cd /mnt # file $(which chroot) /usr/bin/chroot: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64-ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=...
1 vote
1 answer
103 views

Bind-mount and cryptsetup result in truncated root-path in /proc/self/mountinfo

I have an encrypted container containing an ext4 filesystem with a subdirectory which is bind-mounted at a later point in time. If I take look at /proc/self/mountinfo, the root-directory for the mount ...
9 votes
2 answers
3k views

Directly mount btrfs subvolume or bind mount if already visible

If /dev/sda1 is a btrfs filesystem with subvol's root and persistent And I've set the default subvol to root Also, I've mounted /dev/sda1 (again root is default) to / And I've mounted /dev/sda1 ...
0 votes
1 answer
473 views

Determine available space on bind mount from inside a Docker container

I have an application inside a Docker container running Debian that has a feature that can import a lot of big files. The application stores the files in a folder on the host that is accessible via a ...
0 votes
1 answer
465 views

bind mount: reproduce, fstab-style

How can I generate a bind-mount entry for fstab, given an existing (mounted) mountpoint? Neither findmnt nor mount produce a fstab-style entry. I suppose one can parse findmnt and figure out SOME of ...
7 votes
1 answer
861 views

Why do bind mounts of device nodes break with EACCES in root of a tmpfs?

A common scenario for setting up a container/sandbox is wanting to create a minimal set of device nodes in a new tmpfs (rather than exposing the host /dev), and the only (unprivileged) way I know to ...