我有很多可用空间/home
df -h
输出
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 8,9G 2,1G 6,4G 25% /
tmpfs 499M 4,0K 499M 1% /dev/shm
/vol/home 2,7T 2,3T 403G 86% /home
我里面/home/user/project
有以下目录:
$ ls /home/user/project
log data bin
是否可以“挂载”这个目录?
我想实现这个目标:
$ df -h
/dev/sda2 8,9G 2,1G 6,4G 25% /
tmpfs 499M 4,0K 499M 1% /dev/shm
/vol/home 2,7T 2,3T 403G 86% /home
/vol/home/user 2,7T 2,3T 403G 86% /project/data
/vol/home/user 2,7T 2,3T 403G 86% /project/log
答案1
符号链接可用于实现文件系统映射:
cd /
ln -s home/user/project
答案2
您可以使用mount --bind
。但是,我不相信它会出现在df -h
mount --bind /vol/home /home
mount --bind /vol/home/user /project/data
mount --bind /vol/home /project/log
。
-B, --bind
Remount a subtree somewhere else (so that its contents are
available in both places). See above.-