Questions tagged [bind-mount]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
313
votes
1answer
234k 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.
23
votes
5answers
25k views

List only bind mounts

Rather than using mount | grep, I'd like to use mount -l -t bind, but that doesn't work, and -t none shows all mounts.
33
votes
3answers
18k views

Why doesn't mount respect the read only option for bind mounts?

On my Arch Linux system (Linux Kernel 3.14.2) bind mounts do not respect the read only option # mkdir test # mount --bind -o ro test/ /mnt # touch /mnt/foo creates the file /mnt/foo. The relevant ...
4
votes
2answers
661 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 ...
10
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 ...
9
votes
2answers
3k views

How is findmnt able to list bind mounts?

A lot of people keep saying that Linux does not keep information about bind mounts, so there is no way to get a list of them and their sources. Here are some examples: from one of the the comments ...
8
votes
2answers
2k 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 /...
14
votes
1answer
5k 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 --...
12
votes
2answers
2k 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@...
13
votes
1answer
818 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 -...
3
votes
1answer
967 views

bind mounts by systemd don't magically work with systemd-tmpfiles?

I have an weird challenge from on my Debian 8 box. The background is I want to mount some directories as tmpfs, to avoid physical IO (disk wakeup / flash wear). Probably I should just mount a ...
4
votes
0answers
228 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. ...
1
vote
0answers
303 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 ...
3
votes
0answers
53 views

how to see original and --bind mountpoints [duplicate]

Lest say I mount a usb drive to /mnt and next I run this... mount --bind /mnt /tmp/test.d It's a successful bind, but now when I run lsblk only the bind point shows. How can I get all bound and ...
1
vote
2answers
102 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 ...
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 ...
0
votes
1answer
168 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 ...