Bind-Mount a Directory to a Second Path
Make a directory appear elsewhere without symlinks or copies.
Run sudo mount --bind /source /target to expose the same files at both paths.
01Command
Command
$ sudo mkdir -p /srv/data && sudo mount --bind /home/user/data /srv/data02What it does
A bind mount shares the same underlying files at a second mount point, which is how containers and chroots give processes a restricted view of a tree. Unlike symlinks it affects all processes and survives path-relative access, making it a precise administration tool.
03Risk
!Warning: Bind mounts are not persistent unless added to fstab and are easy to forget; unmount with umount when done.
04Undo
Undo
$ sudo umount /srv/data05Sources
- mount(8) manual page (Debian bookworm)Evidence: Documents the bind mount operation and its effect.
Last verified: 2026-10-13 · Category: System & Settings
06Related solutions
Search text recursively in a directory with grep
Find every occurrence of a pattern across all files in a tree, printed as file:line:number matches.
Extract a .tar.gz archive with tar
Unpack a gzipped tarball into the current directory while printing each file as it is extracted.
Check free disk space on each filesystem with df
Show total, used, and available space plus usage percentage for every mounted filesystem in human-readable units.