Two distinct mount points with one device

Use a bind mount:

mount /dev/sda1 /home
mount -t none -o bind /home/projects /projects

You can also put these in /etc/fstab:

/dev/sda1       /home      ext4 defaults  1 2
/home/projects  /projects  none bind      0 0

The rbind option is needed to make submounts visible, for example because /projects/apollo is on a separate partition. ro can be used to mount it read-only.

More details are available in the mount(8) man page, in the "Bind mount operation" section.


Step 1) Create a projects directory in the home folder.

Step 2) Create a symlink to this new directory from root.

mkdir /home/projects
ln -s /home/projects /projects

Tags:

Linux

Mount