我正在配置我的系统。我有一个 Ubuntu 分区,里面有 /home(不是 /home 的额外分区)。我想我可以将bind
同一驱动器上另一个分区中的一些文件夹移到我的 /home。我的 fstab 如下
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda6 during installation
UUID=34fefb4c-5d1f-4ea8-9a73-de0aeb6bf36d / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sda1 during installation
UUID=7C7D-5744 /boot/efi vfat umask=0077 0 1
# /media/data01 was on /dev/sda7 during installation
UUID=5bb5bb6e-5694-431f-b4f4-9b7c14fc3f56 /media/data01 ext4 defaults 0 2
# swap was on /dev/sda5 during installation
UUID=0df977ea-c9ee-4215-90a3-3b2f0d562b9d none swap sw 0 0
# /sdb1
UUID=256fcae8-8710-45e5-93d4-e91b1d05b9fe /media/data02 ext4 nosuid,nodev,nofail,x-gvfs-show 0 0
# bind mounts
/media/data01/Audio /home/luca/Audio bind defaults,user,bind 0 0
/media/data01/Cloud /home/luca/Cloud bind defaults,user,bind 0 0
/media/data01/Desktop /home/luca/Desktop bind defaults,user,bind 0 0
/media/data01/Documents /home/luca/Documents bind defaults,user,bind 0 0
media/data01/Downloads /home/luca/Downloads bind defaults,user,bind 0 0
media/data01/Library /home/luca/Library bind defaults,user,bind 0 0
media/data01/Pictures /home/luca/Pictures bind defaults,user,bind 0 0
media/data01/Programming /home/luca/Pictures bind defaults,user,bind 0 0
media/data01/Public /home/luca/Public bind defaults,user,bind 0 0
media/data01/Software /home/luca/Software bind defaults,user,bind 0 0
media/data01/SoftwareLibrary /home/luca/SoftwareLibrary bind defaults,user,bind 0 0
media/data01/Videos /home/luca/Videos bind defaults,user,bind 0 0
media/data01/Workspace /home/luca/Workspace bind defaults,user,bind 0 0
我最终得到了混合权限,但我不明白为什么,如下所示
drwxr-xr-x 3 luca luca 4096 gen 30 10:00 Audio
drwxr-xr-x 2 luca luca 4096 gen 30 09:59 Cloud
drwxr-xr-x 2 luca luca 4096 gen 31 12:02 Desktop
drwxr-xr-x 2 luca luca 4096 gen 30 09:59 Documents
drwxr-xr-x 2 root root 4096 gen 31 11:57 Downloads
-rw-r--r-- 1 luca luca 8980 gen 3 19:34 examples.desktop
drwxr-xr-x 2 root root 4096 gen 31 11:57 Library
drwxr-xr-x 2 luca luca 4096 gen 5 11:53 Music
drwxr-xr-x 2 root root 4096 gen 31 11:57 Pictures
drwxr-xr-x 2 luca luca 4096 gen 30 10:03 Programming
drwxr-xr-x 2 root root 4096 gen 31 11:57 Public
drwxr-xr-x 2 root root 4096 gen 31 11:57 Software
drwxr-xr-x 2 root root 4096 gen 31 11:57 SoftwareLibrary
drwxr-xr-x 2 luca luca 4096 gen 5 11:53 Templates
drwxr-xr-x 2 root root 4096 gen 31 11:57 Videos
drwxr-xr-x 2 root root 4096 gen 31 11:57 Workspace
请注意,一些默认文件夹(例如 Documents)归 luca 所有,其他默认文件夹(例如 Downloads)归 root 所有。我创建的一些文件夹(例如 Cloud)归 luca 所有,而我创建的其他文件夹(例如 Library)归 root 所有。这似乎是随机的。
我还尝试将该user
选项添加到 /media/data01 的 fstab 行,但没有成功。
如果我记得清楚的话,当我安装系统时,我的 data01 和 data02 最终归 拥有root:root
,而我将其更改为sudo chown -R luca:luca /media/data01
。这有意义吗?
这是由于defaults
选项还是其他 fstab 选项?我该如何修复此问题,以便将外部分区中的数据绑定到我的主文件夹并具有所有正确的权限?
谢谢,卢卡