Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [bind-mount]

The tag has no usage guidance.

1
vote
1answer
24 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
31 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 ...
0
votes
0answers
26 views

mount --bind failed “No Space Left on Device”

I'm creating a FTP server for a school and I'm using the mount --bind command to link directories on a disk to student directories. But I've about 250000-300000 directories at the end and, after few ...
1
vote
0answers
27 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
27 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
33 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 ...
0
votes
0answers
10 views

ecryptfs mounted twice - wil this cause problems?

I have a setup in which I have a small root partition (~30 GB) and another partition that I've called my "data_partition" (The rest of the disk). Items that are traditionally placed under the root ...
3
votes
1answer
46 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
0answers
27 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
41 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
99 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=/...
12
votes
1answer
595 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
41 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
160 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
61 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 "/" ...
0
votes
2answers
63 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 ...
0
votes
1answer
244 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 ...
0
votes
1answer
287 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 ...
2
votes
1answer
181 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 ...
0
votes
0answers
109 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
313 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 ...
3
votes
1answer
485 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 ...
4
votes
1answer
373 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'...
0
votes
1answer
93 views

`umount -R` on bind mounts takes a non-neglible amount of time, why?

Why does umount -R take 0.2s to unmount this subtree of bind mounts? It only took 0.02s to mount the subtree, and 0.00s to change its propagation flags. (I was looking at cloning the current set of ...
0
votes
1answer
8k views

Editing /etc/fstab to permanently bind mount directory

I wish to make the following mount permanent: [michael@devserver ~]$ findmnt | grep public └─/home/jail/home/public/repo /dev/mapper/centos-root[/home/michael/testing/gateway/repo] xfs ...
0
votes
0answers
123 views

XFCE desktop icon for bind mounts

I have my home on a SSD and my downloads-folder on a HDD, and instead of using a symbolic link, I use a bind mount to get the storage-home into the normal home. The only drawback: XFCE desktop shows ...
2
votes
2answers
857 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 type (if the origin file is big). This will actually copy the file and then delete from the origin instead of simple update ...
1
vote
1answer
290 views

How to unmount a mountpoint with rbind and rslave?

Trying to use a chrooted system via mount -B stage3 gentoo mount -t sysfs none gentoo/sys mount -t proc none gentoo/proc mount -R /dev gentoo/dev mount --make-rslave gentoo/dev unshare --fork chroot ...
0
votes
0answers
269 views

how could the df command show the right mounts?

Under redhat 7, given this fstab where a "bind mount" across file systems is defined: /dev/mapper/datab_vg-lv_db /appli/postgres xfs defaults 0 0 /appli/postgres/var /var/...
1
vote
2answers
66 views

Why are these mounts needed before updating initramfs?

After reading this answer on bind mount, I got the idea that a bind-mount in Linux is to reproduce part or an entire filesystem under another point in the directory tree. So when we write the ...
7
votes
2answers
1k views

Why can't I create a `hardlink` to a file from a “mount --bind” directory on the same filesystem?

Original Problem I have a file on one filesystem: /data/src/file and I want to hard link it to: /home/user/proj/src/file but /home is on one disk, and /data is on another so I get an error: $ cd /...
1
vote
0answers
46 views

Making root being bind mounted

I have XUbuntu and Arch on a laptop, I'm sharing /boot partition between these distros mounting it on /mnt/boot and bind-mounting /mnt/boot/xubuntu or /mnt/boot/arch onto /boot; it works fine even ...
3
votes
5answers
904 views

Link 2 existing files

I have 2 existing files : abcd and xyz. $ cat abcd abcd $ cat xyz xyz Now, when I try to softlink these files, I get this message : ln: cannot create xyz: File exists I do not want to use ln -sf ...
3
votes
1answer
280 views

ls -la doesn't display correct permission for a mount --bind folder

Please read the following steps to understand my problem, Execute following commands mkdir ~/src mkdir ~/destination sudo mount ~/src ~/destination --bind -o ro src folder has been bind mounted to ...
2
votes
1answer
421 views

Mounting two folders to corresponding directories within external volume?

I'm trying to mount /etc/folder and /var/folder to the same external volume UUID=xyz. This external volume already has subdirectories etc_folder and var_folder and has been formatted and available to ...
1
vote
1answer
1k views

Bind USB drive to home directory on demand

I was trying to attach specific USB drive to home folder of the user. I have installed vsftpd, but Kodi can't move on upper hierarchy. So he can't access /media folder, but FileZilla can. My USB is ...
1
vote
0answers
243 views

Debian install, mounting /var /tmp /home in the same partition

I'm making a new Debian install. I have a SSD and an HDD. My idea was to put /home, /var and /tmp on the same partition in the HDD, and the rest (/) in a tiny partition in the SSD. I followed this ...
4
votes
0answers
175 views

openvpn route-up script no mount permissions

I'm trying to mount a couple of nfs shares after my openvpn tunnel is up. Previously this worked on ubuntu 12.04 and ubuntu 14.04. I made a clean install with ubuntu 16.04 and can't get it to work. ...
4
votes
1answer
567 views

How can I automatically make ZFS filesyatems mount shared / rshared?

I have a number of ZFS sub-filesystems (so that I can granularly manage snapshots and ZFS options) like so: tank/media tank/media/pictures tank/media/pictures/photos tank/media/movies tank/media/...
1
vote
1answer
110 views

/root as bind mount?

I am migrating my system from Debian 32 bit to Debian 64 bit. It is installed on /dev/sda2, so I created /dev/sda3, installed the new system there, synched installed packages and configuration files ...
1
vote
1answer
248 views

find: fts_read: Permission denied through mount_nullfs

I have the following set-up: FreeBSD 10.3 with ZFS on root. A ZFS volume hierarchy (multiple volumes nested in each other, for lack of a better name) is duplicated using mount_nullfs in order to ...
8
votes
2answers
2k views

How is findmnt able to list bind mounts?

Note for moderators: Do not close this as a duplicate. I am NOT looking for information on how to list bind mounts. I am asking how the kernel maintains this information and how findmnt is able to ...
2
votes
0answers
947 views

CentOS 7 - Can't mount /var/tmp as bind

I'm working on a freshly installed CentOS7 with LVM. I want to bind mount /var/tmp to /tmp and added the following to /etc/fstab. /tmp /var/tmp none rw,nodev,noexec,nosuid,bind 0 0 ...
2
votes
1answer
344 views

use a different socket than /dev/log, system-wide

Is there a way to make a whole Debian (Jessie) installation use a different syslog socket than /dev/log (like, for example, /tmp/my-other-log) ? Reason: I'm running Debian Jessie in a chroot ...
4
votes
2answers
478 views

Mounting new filesystem affects non-recursive bind mounts?

It hasn't always behaved this way, but nowadays I get this inconsistent behaviour. Bind mounts don't copy existing mounts (unless you use --rbind), but new mounts (and unmounts) get copied. So it ...
4
votes
0answers
207 views

Workaround for mount -bind behavior change between wheezy and jessie?

I recently upgraded a system from wheezy to jessie that makes use of bind mounts. But with the update the behavior of the bind mount has changed, and now acts as bind one filesystem will recursively ...
2
votes
1answer
1k views

CentOS 7 unable to cleanly umount a bind mount using rbind and rslave

The following sequence of commands will fail on CentOS 7 (kernel version: 3.10.0-327.10.1.el7.x86_64): [hidden]$ mkdir -p A B/a C/b [hidden]$ sudo mount --bind A B/a [hidden]$ sudo mount --rbind B C/...
9
votes
1answer
2k views

Unmount a rbind mount without affecting the original mount

Asked on serverfault but didn't get enough attention, so reposted here, with the hope some people here know the answer. There is another question discussing about umounting rbind mounts, but the ...
1
vote
0answers
34 views

Does the Linux kernel have knowledge of bind mounts? [duplicate]

I've been looking for a way to list bind mounts or at least determine if a particular mount is a bind mount. Several answers on this website say that because it is a parameter of a mount operation it ...
1
vote
0answers
357 views

How to 'snapshot' a chroot?

I want to perform something similar to a 'clone' on vmware fusion/virtualbox/a VM manager. Host and chroot are both ubuntu. One complicating factor may be that this chroot may have one or more child ...