Questions tagged [bind-mount]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
6 views

How to get thunar 1.8.4 to show bind mounts?

I am setting up a bind mount for a user : mount --bind /some/path /media/$user/test With Thunar 4.16.8 (XFCE 4.16, debian 11), this causes a nice test entry to be displayed in the devices panel. With ...
user avatar
  • 307
1 vote
0 answers
33 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. ...
user avatar
1 vote
1 answer
76 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 ...
user avatar
  • 145
0 votes
0 answers
16 views

Recursive bind mount not working android x86 7.1.1

I have 3 directories: a, b and c. Directory 'a' contains the subdirectories '1' and '2', and these sud-directories both contain files 'foo' and 'bar'. Directory 'b' also has subdirectories with the ...
user avatar
0 votes
3 answers
216 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 - ...
user avatar
0 votes
1 answer
14 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
user avatar
1 vote
0 answers
29 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 ...
user avatar
0 votes
1 answer
74 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=&...
user avatar
2 votes
0 answers
165 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/...
user avatar
  • 81.4k
-1 votes
1 answer
156 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 ...
user avatar
1 vote
0 answers
47 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 ...
user avatar
  • 221
0 votes
0 answers
35 views

How to bind mount paths once pivot root is done

Background: I am setting up a pivot root environment for my process successfully, using minijail library. This puts my process in its own mount namespace. Problem: Once the process is pivot-rooted, is ...
user avatar
  • 1
0 votes
0 answers
25 views

Mountpoints on fileserver are being duplicated and nested. Can't find the cause

I have a Linux fileserver on my LAN. Recently some (but not all) mountpoints that are NFS shares are being duplicated, as shown by findmnt. This duplication occurs over a period of days after the ...
user avatar
  • 15.4k
0 votes
1 answer
65 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 ...
user avatar
  • 35
0 votes
0 answers
144 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 ....
user avatar
0 votes
0 answers
34 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?? ...
user avatar
  • 1
0 votes
0 answers
34 views

Bind mount with mindepth option?

Is there a way to use something similar to the "mindepth" option of the find command with a bind mount ? Here is my directories and files structure : level 0 directory ├── level 1 directory ...
user avatar
  • 1
2 votes
1 answer
100 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 ...
user avatar
  • 1,226
0 votes
2 answers
168 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 ...
user avatar
0 votes
1 answer
145 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 (...
user avatar
  • 125
2 votes
0 answers
178 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]=...
user avatar
5 votes
1 answer
3k 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 ...
user avatar
  • 3,408
1 vote
1 answer
40 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 ...
user avatar
0 votes
1 answer
138 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 ...
user avatar
  • 1
2 votes
0 answers
620 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 ...
user avatar
0 votes
1 answer
98 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 ...
user avatar
  • 413
4 votes
1 answer
377 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 ...
user avatar
1 vote
0 answers
221 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 ...
user avatar
0 votes
1 answer
64 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 /...
user avatar
1 vote
0 answers
2k 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 ...
user avatar
  • 13.2k
1 vote
1 answer
342 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 ...
user avatar
0 votes
1 answer
197 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? ...
user avatar
1 vote
1 answer
127 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. ...
user avatar
  • 33
0 votes
1 answer
153 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/...
user avatar
  • 15.1k
0 votes
0 answers
286 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 ...
user avatar
0 votes
1 answer
2k 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 ...
user avatar
1 vote
0 answers
79 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 ...
user avatar
12 votes
1 answer
2k 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 ...
user avatar
  • 736
1 vote
1 answer
183 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 ...
user avatar
0 votes
0 answers
488 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 ...
user avatar
0 votes
0 answers
22 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 ...
user avatar
0 votes
1 answer
841 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:/...
user avatar
  • 745
1 vote
0 answers
168 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/...
user avatar
  • 3,715
0 votes
1 answer
228 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 ...
user avatar
  • 101
5 votes
1 answer
2k 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 ...
user avatar
4 votes
3 answers
843 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 -...
user avatar
6 votes
1 answer
985 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:~$ ...
user avatar
  • 1,011
3 votes
1 answer
5k 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 ...
user avatar
3 votes
0 answers
125 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. ...
user avatar
0 votes
1 answer
132 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/...
user avatar
  • 323