Questions tagged [bind-mount]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-1
votes
0answers
35 views

Bind specific usb MAC address with laptop

I just wanted to ask that is there any way available to bind usb mac address with computer? I want to block all usb to connect with my system except some usb which I will bind with my laptop. Kindly ...
4
votes
1answer
198 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 ...
1
vote
0answers
12 views

How to extend an external storage device to a chrooted directory?

I run game servers that can generate a lot of data. So I purchased a couple of 12TB drives to store all the data. I've looked into how to link the storage of the drives to a location within a chrooted ...
1
vote
0answers
25 views

Bind mount but exclude a subdirectory

I'm using a chrooted Debian inside my router's base Linux OS. I want to move bind as many directories from the rootfs in the chroot as possible. All good so far. however, when it comes to the mnt ...
0
votes
1answer
30 views

unable to list/access files inside schroot from a `mount --bind`

I created the chroot with schroot following these instructions: https://wiki.winehq.org/Building_Wine#Chroot Then to test it I did: $ sudo mkdir /TestA $ echo abc |sudo tee /TestA/tst.txt $ cat /...
0
votes
0answers
135 views

How to map my host's to the container's user in docker-compose using the lebokus/docker-volume-bindfs plugin?

I have a php dev stack setup through Dockerfiles and docker-compose. I mount the source tree and composer vendor folder to the container. My host's local user philipp has id 1000 and my container uses ...
0
votes
1answer
36 views

Mounting successively in fstab: wait for partition to be mounted?

I mount successively two points using fstab in my linux system # Mounting apps drive UUID=c54ca7da-117d-4cb2-8897-019ba4f6f12d /media/user/apps ext4 defaults 0 2 # Mounting opt based on apps ...
0
votes
0answers
77 views

How to hide bind-mounts in GNOME 3.x?

I am using vanilla-gnome-desktop on Ubuntu 18.04 with gnome-shell version 3.28.4-0ubuntu18.04.3. I was under the impression that the x-gvfs-hide mount option would allow me to hide volumes from both ...
0
votes
1answer
88 views

What does the 4th column (root) in /proc/…/mountinfo mean?

From the proc manual it names the 4th column of mountinfo as "root", and describes it as "the pathname of the directory in the filesystem which forms the root of this mount". But how to understand it? ...
1
vote
1answer
35 views

How to mount (bind) in a one-way writing fashion

In case you needed to know, I'm on a GNU+Linux distro with kernel version 5.5.5. So, suppose I have a directory named base. Further suppose this directory only contains one empty file, named a. ...
0
votes
1answer
37 views

Force changes from the outside to propagate into the container

I have a Docker container based on the gitlab-ce/latest image. In order to allow certain additional operations with Ansible while being minimally invasive, I opted to bind-mount over the /assets/...
0
votes
0answers
72 views

Unable to bind mount in Arch linux

I tried the following: sudo mount --bind /dev/sda1 /path/to/a/directory sudo mount -o bind /Dec/sda1 /path/to/a/directory both gives an error message : mount(2): system call failed: Not a ...
0
votes
0answers
691 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 ...
1
vote
0answers
25 views

Is it safe to move a directory that has been bind mounted?

Say we have a directory that we bind mount to another directory like so mount --bind directory mount-point Later on we move or rename the directory mv directory directory-2 What happens when a ...
12
votes
1answer
699 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 ...
1
vote
1answer
66 views

does nosuid work on bind-mounts to suid partitions?

if i have /target mounted with suid and then make a bind-mount on /bound with mount -o bind,nosuid /target /bound, will nosuid take effect on /bound ? (imo it should take effect but i'd still like a ...
0
votes
0answers
212 views

Why is nofail ignored for bind mounts in /etc/fstab?

I have added the following line to /etc/fstab (don't ask for a reason, it is a completely separate discussion that does not affect this question): /nonexistent /bin none ro,bind,nofail 0 0 On boot I ...
0
votes
0answers
18 views

Is it possible for a filesystem/directory to be mounted as temporarily writable so that all changes made are discarded on unmounting?

Specifically my use case is that I am using ostree to deploy specific folders of the filesystem to some systems I manage. Because overwriting the original directories of the system is risky in case of ...
0
votes
1answer
233 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:/...
1
vote
0answers
61 views

How do I rmdir a directory after umount?

When I mount --bind a directory, chroot to a directory that contains it, and then unmount it, I am then unable to remove the directory. sudo mount --bind /usr/ /home/ubuntu/Code/conversations/jail/...
0
votes
1answer
99 views

forwarding avahi-daemon socket to chroot

I have a raspberry pi 3b+ installed with raspbian stretch and I have installed an i386 chroot. The problem is the CUPS server require avahi-daemon for printer discovery and I haven't been able to ...
4
votes
1answer
588 views

What is the purpose of bind mounting (rbind specifically) /sys?

I was going through the Gentoo Handbook in preparation for installing Gentoo on my system. In the Chrooting section, these commands are given: mount --rbind /sys /mnt/gentoo/sys mount --make-rslave ...
4
votes
3answers
497 views

Why does bind mounting a file after unlink fail with ENOENT?

I do not understand why I get ENOENT when bind-mounting after unlink: kduda@penguin:/tmp$ echo hello > a kduda@penguin:/tmp$ touch b c kduda@penguin:/tmp$ sudo unshare -m root@penguin:/tmp# mount -...
3
votes
1answer
418 views

Why can I not bind a mount namespace to a file

I observe the following: As unprivileged user in shell No 1: user@box:~$ sysctl kernel.unprivileged_userns_clone kernel.unprivileged_userns_clone = 1 user@box:~$ unshare --mount --user nobody@box:~$ ...
3
votes
1answer
4k views

How to get mount information of host inside a docker container

I need the mountpoints of all disks attached to a host inside a docker container. The mount information is available in /proc/1/mounts file, but I cannot access that file on all OS. When I run the ...
3
votes
0answers
79 views

Is linux mount propagation asynchronous to the mount call?

I have two processes in different mount namespaces. They have a shared directory bind mounted to /mnt/share. The "master" uses MS_SHARED propagation for the mount, while the "slave" uses MS_SLAVE. ...
0
votes
1answer
94 views

Data partition and IntelliJ IDEA external file sync speed

I recently reconfigured the filesystem on my laptop so I can share my data with a second Linux. The Linux used in this matter is Fedora 28, 64-bit. My disks are now laid out like so: /dev/sda: /dev/...
2
votes
1answer
85 views

Mounting is slow after 4000 mounts

I have a need to create about 10,000 total bind mounts for various chroots. After about 3000-4000 mounts, it slows down significantly from 100/s to about 5-10/s. I'm assuming it's hitting some weird ...
1
vote
1answer
2k views

Mounting using alternate fstab file

I need to use an alternative fstab file for mounting a folder in another folder, like the command mount --bind /folder1 /folder2 I tried the command mount --fstab /pathToFile.fstab as stated in the ...
3
votes
1answer
2k views

/etc/fstab fails to bind mount on boot, but running mount -a works correctly

I'm running a modified WD MyCloud (Gen 1) NAS with Debian 8 (Jessie) installed on it. Due to the nuances of the device, I can't resize the root partition, and am struggling with space on it. To ...
-1
votes
1answer
143 views

Copy dir and its contents in RAM and backup on the original dir

I'd like to copy a dir and its contents in RAM, do my routines and periodically make some backups/sync on my original dir. So if I have a dir mydir/ with 2 files: $ ls mydir/ file1.tex file2.tex I ...
1
vote
0answers
88 views

Bind mounts within bind mounts

I am trying to bind mount one file over another file, then remove the file that is now hidden from access. I'm trying to go about this as follows: folder1# echo a > a folder1# echo b > b ...
1
vote
0answers
182 views

What exactly happens behind a bind mount? (Linux 4.x)

From the answer to What is a bind mount?, It is possible to unmount /some/where, in which case /else/where remains mounted. I checked the output of mount after performing a bind mount. The ...
0
votes
2answers
76 views

Bind mounted /var to /raid5/var and CentOS fails to boot

System Background: I am running CentOS 7 in a VM (in VirtualBox) on a host computer running Windows 10. My /dev/sda is on an SSD and then I have three 1TB HDDs /dev/sdb, /dev/sdc, and /dev/sdd ...
3
votes
1answer
238 views

Why do repeated bind mounts create entries for the source directory?

Why does a repeated bind mount create multiple entries in /proc/mounts? # md -p /mnt/test-mount/{source,target} # mount --bind /mnt/test-mount/{source,target} # grep test-mount /proc/mounts /dev/...
1
vote
1answer
42 views

How to See Bound Folders and Release Them

This morning I noticed someone had stuck a USB Drive in the back of the server. (I'll have to end that practice later). For some reason CentOS 7 mounted that disk /dev/sdc1 under /run/media//. I also ...
0
votes
2answers
411 views

Calculating directory size without subdirectories bind-mounted from the same device

I want to calculate a directory size with all its subdirectories. But I had made some of the subdirectories to mount from a mount point. (using mount -B/--bind) when I use du -hks the returned size ...
1
vote
1answer
713 views

How to tell systemd to create a bind mount when plugging in an automounted drive?

I have the following mount and automount units enabled for my external USB drive. Mount Unit: [Unit] Description=Time Machine Drive Mount Service [Mount] What=/dev/disk/by-uuid/some-uuid Where=/...
13
votes
1answer
1k views

Why can't I bind-mount “/” inside a user namespace?

Why doesn't this work? $ unshare -rm mount --bind / /mnt mount: /mnt: wrong fs type, bad option, bad superblock on /, missing codepage or helper program, or other error. These work ok: $ unshare -...
1
vote
0answers
61 views

Multiple network shares to single mount point?

How would I mount multiple network shares to single mount point? Example //10.50.154.6/data 42T 22T 21T 51% /mnt/data6 //10.50.154.7/data 8.1T 6.2T 1.9T 77% /mnt/data7 //10.50.154.8/...
0
votes
1answer
1k views

How to unmount a recursive bind mount - safely [duplicate]

Please take care that you have no unsaved work if you test this. I ran this command as an experiment, but how can I undo it without rebooting? # mount --rbind / /mnt What I have tried # umount /...
0
votes
1answer
184 views

Lazy unmount root jail drives

I have created a root jail containing rpm and yum (centos 7.5) to install some software on the original system. Workflow Mount sys, proc, dev to the root jail Mount root of the original system "/" ...
1
vote
2answers
322 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 ...
1
vote
1answer
731 views

Shadow bind mount in fstab

I have a custom, non-default Ubuntu installation, where I use my other Linux distro's boot manager (rEFInd). As such, I don't want Ubuntu to see my EFI partition, on the principle that it has no ...
1
vote
1answer
1k views

How to create a mount --bind when root does not have permission to access the source directory?

While trying to create a test environment using mount --bind I was surprised to find that it sometimes fails with permissions errors because root cannot access the source directory. This only appears ...
3
votes
1answer
645 views

How to exclude bind mounts from findmnt results list?

In a bash script I have the following lines: TARGETS="$(findmnt -n -v -t btrfs -o TARGET --list)" UUIDS="$(findmnt -n -v -t btrfs -o UUID --list)" I run this script on some servers (running Arch ...
1
vote
0answers
303 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 ...
5
votes
2answers
382 views

Meaning of statement that 'getcwd functions work correctly' in FreeBSD man page for mount_nullfs?

In FreeBSD, man mount_nullfs states that: The primary differences between a virtual copy of the file system and a symbolic link are that the getcwd(3) functions work correctly in the virtual ...
5
votes
1answer
2k views

bind mounting source to itself

What does mount --bind /dir1 /dir1 do? I've read https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt however it doesn't give a clear explanation. Looks like it is valid not only for ...
7
votes
1answer
981 views

why do Linux bind mounts disappear if the mount point's inode changes?

In summary: if you bind mount a file /tmp/a on top of /tmp/b in a new mount namespace, but then the inode of /tmp/b changes in the parent namespace, the bind mount disappears in the child namespace. I'...