Questions tagged [bind-mount]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
4
votes
1answer
2k 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/...
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 ...
2
votes
0answers
43 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 ...
2
votes
0answers
444 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 ...
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@...
3
votes
2answers
638 views

How to split FHS read-only and read/write directories across two disks with Linux/systemd, without partitioning the raed/write disk?

My objective is to have the physical storage for the Linux FHS read/write directories (/home, /srv, /tmp, /var) on a separate (logical or physical) disk from the potentially read-only rest of the root ...
1
vote
1answer
99 views

migrating to systemd a startup-shutdown script that works with tmpfs and bindmounts

BACKGROUND INFORMATION : I have an init script that allows me to mount a folder to tmpfs, while bind-mounting the folder on drive to another location, so I can sync the contents (on startup, shutdown,...
1
vote
2answers
200 views

What link should i use for home- & owncloud-data?

the plan is to built a debian-based sever with owncloud for syncing addressbooks, calendars, files etc. and also access large video-files in the LAN via webdav from some kodi-clients (maybe also use ...
1
vote
1answer
1k views

How to hide original mount points with bind mount?

I use OpenMediaVault, a NAS software on top of Debian Wheezy. This system usually mounts the file systems at /media/, but that is cumbersome to type and to identify. As such, I've modified my fstab ...
3
votes
2answers
821 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 ...
1
vote
0answers
198 views

Is NFS file locking destroyed by the nfs server bind-mounting the directory being nfs shared?

I have a directory /persistent/pacmanPkgCache which is both: nfs-shared to other machines bind-mounted to /var/cache/pacman/pkg Does having this directory nfs-shared and bind-mounted at the same ...
1
vote
0answers
324 views

Linux shared mount point inconsistent between child and parent processes

Let me try to explain the background: In main bash: We use mount --bind /tmp/source /tmp/target mount --make-shared /tmp/target to create this shared mount point target And then we use unshare -...
1
vote
1answer
279 views

Recursively unmount Bind mount in both User and Mount namespace

I am trying to use recursive bind mount in a new user namespace and mount namespace. This is what I do. Assume /foo/bar/ and /foo are both mount points. Firstly I do mount --rbind /foo/bar/ /baz, and ...
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 ...
5
votes
3answers
4k 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
2answers
4k views

How to use bindfs to create a shared folder between a chroot environment and its host

I want to use bindfs (or any viable alternative) to solve the following problem: I have a local folder that contains a maven project I am working on. However I can only build in a chroot environment (...
7
votes
3answers
5k views

Mount directory onto root

I have a folder containing certain files. Is there a way to mount it onto /, so that the contents of a given directory appear in the corresponding locations in /? In my case, the directories contain ...
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.
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
1answer
1k views

Is it possible to mount a file with different ownership/permissions?

I have been experimenting with privilege escalation using the mount command and would like to know if it is possible to create a suid file owned by root without having access to any external device. i....
0
votes
1answer
626 views

How to mount multiple folders which share the same path pattern?

I have multiple folders that share the same path pattern which I would like to mount them all with a single command if possible. The command I tried is: sudo mount --bind /var/my/vendor /var/www/...
5
votes
1answer
3k views

Two *different* mountpoints 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/...
2
votes
1answer
983 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
2answers
884 views

Bind Mounting across different file systems

Does the command mount -o bind allow mounting a folder from a different file system (vfat, ntfs) to a folder in Linux native partition?
7
votes
1answer
6k views

bind mount /var with fstab

I'm messing around with having both /home and /var on a separate partition which will be mounted in /myhdd. Next, I use mount --bind to mount /var on /myhdd/var and /home on /myhdd/home. With this ...
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 ...
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 --...
3
votes
1answer
410 views

AppArmor and bind-mounts

Can someone outline the semantics of AppArmor with respect to bind-mounted folders? As I understand after reading the documentation (1, 2, 3, 4) - yes, I am using Ubuntu 12.04 with the 3.8 kernel - ...
4
votes
5answers
2k views

pwd: show mountpoint

I have mounted a directory to another directory using mount --bind so that an sftp user of my server can access this directory. mount --bind /path/share /path/home/user/stuff I have put this in /etc/...
7
votes
1answer
5k views

Umount device after bind mounting directories: is it safe?

I have a home partition which is shared by mulitple distros on the same box. I'm using bind mounts from fstab. Each Linux install has something like this: UUID=[...] /mnt/data ext4 nodev,...
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.