Create a shared mount point duplicate
Duplicate a mount point as a shared mount. File systems that you later mount under the original directory or the duplicate are always reflected in the other.
Procedure
Duplicating /media into /mnt as a shared mount point
To make the /media and /mnt directories share the same content:
- Create a VFS node from the
/mediadirectory:# mount --bind /media /media - Mark the
/mediadirectory as shared:# mount --make-shared /media - Create its duplicate in
/mnt:# mount --bind /media /mnt - It is now possible to verify that a mount within
/mediaalso appears in/mnt. For example, if the CD-ROM drive contains non-empty media and the/media/cdrom/directory exists, use:# mount /dev/cdrom /media/cdrom# ls /media/cdromEFI GPL isolinux LiveOS# ls /mnt/cdromEFI GPL isolinux LiveOS - Similarly, it is possible to verify that any file system mounted in the
/mntdirectory is reflected in/media. For example, if a non-empty USB flash drive that uses the/dev/sdc1device is plugged in and the/mnt/flashdisk/directory is present, use:# mount /dev/sdc1 /mnt/flashdisk# ls /media/flashdisken-US publican.cfg# ls /mnt/flashdisken-US publican.cfg