A Linux bind mount lets an existing directory appear at a second path without copying data or moving the original tree. This helps when an application expects files under a fixed directory, a chroot needs a narrow filesystem view, or a migration needs a temporary path while the real data stays in place.
The mount command with the --bind option attaches the source directory to an empty target directory as another mount point for the same underlying filesystem subtree. Programs that read the target path see normal files and directories, while findmnt can show which source subtree is attached there.
A manual bind mount lasts only until it is unmounted or the system reboots. Save the entry in /etc/fstab only after testing the direct mount, because a bad saved mount can delay boot or leave an application path missing until the file is corrected.
$ sudo mkdir -p /srv/app-data /srv/app-view
The target directory should be empty before mounting. Files already under the target path stay hidden while the bind mount is active.
$ printf 'Bind mount source data\n' | sudo tee /srv/app-data/status.txt Bind mount source data
Use an existing harmless file instead when the source directory already contains production data.
$ sudo mount --bind /srv/app-data /srv/app-view
$ findmnt --mountpoint /srv/app-view --output TARGET,FSROOT,FSTYPE,OPTIONS TARGET FSROOT FSTYPE OPTIONS /srv/app-view /srv/app-data ext4 rw,relatime
FSROOT identifies the source subtree exposed through the bind mount. FSTYPE and OPTIONS come from the underlying filesystem and may differ on the local host.
$ cat /srv/app-view/status.txt Bind mount source data
For a runtime-only bind mount, stop after this check and unmount it when the second path is no longer needed.
Related: How to unmount a disk in Linux
$ sudo cp --archive /etc/fstab /etc/fstab.bak
A malformed /etc/fstab entry can delay boot or leave the target path unmounted. Keep console or recovery access available before changing boot-time mounts.
$ sudoedit /etc/fstab
/srv/app-data /srv/app-view none bind 0 0
The fields are the source path, target path, filesystem type, mount options, dump flag, and filesystem-check order. The none type and bind option are the standard fstab form for this directory-to-directory mount.
$ sudo findmnt --verify --verbose /srv/app-view /srv/app-view [ ] target exists [ ] VFS options: bind [ ] do not check /srv/app-data source (pseudo/net) [ ] do not check /srv/app-data FS type (pseudo/net) Success, no errors or warnings detected
Correct any reported error before mounting the saved entry or rebooting.
$ sudo umount /srv/app-view
$ sudo mount /srv/app-view
$ findmnt --mountpoint /srv/app-view --output TARGET,FSROOT,FSTYPE,OPTIONS TARGET FSROOT FSTYPE OPTIONS /srv/app-view /srv/app-data ext4 rw,relatime
$ sudo rm /srv/app-data/status.txt