Mount only a part of a disk to a folder
Hi have the following problem.
I have a disk /dev/sda1
mounted on /
. The same disk contains a /home
directory and I want to mount only that directory on a /backup
mount-point because I have a third party script that require to read data in /backup
In the /etc/fstab
the string that mount the disk to the root /
is the following:
UUID=a72d084b-4bd2-4f05-a223-4e94ca2349aa / ext4 errors=remount-ro 0 1
I think it does not make sense to mount a subfolder of a disk to another folder inside the same disk and that a symlink should do the work, but is there a way to do this with mount
?
You can use "mount --bind" to meet your requirements. for example:
sudo mkdir /media/bin sudo mount --bind /bin /media/bin
In your case:
sudo mkdir /backup sudo mount --bind /home /backup