Linux bind mounts
Linux bind mounts
Posted Mar 19, 2025 14:24 UTC (Wed) by andrejp (guest, #47396)In reply to: Linux bind mounts by farnz
Parent article: Fedora discusses Flatpak priorities
> You can bind-mount files as well as directories, under Linux
Really? Well that's new lol. Lemme check.
# cd /tmp
# touch sfile; mkdir sdir
# mount --bind sfile sbox
mount: /tmp/sbox: mount system call failed: Not a directory.
Hm. It does say "Not a dir". Perhaps I'm not doing it right?
# mount --bind sfile sbox/sfile
mount: sbox/sfile: mount point does not exist.
Hm. Perhaps the file must exist before?
# touch sbox/sfile
# mount --bind sfile sbox/sfile
#
Yup. Indeed.
Tnx, I just learned something new :)
