我有一个双引导设置,Ubuntu和Windows之间共享了几个NTFS分区。我希望这些分区在启动时自动挂载,但作为普通用户,因为作为根的挂载有时会给我带来像这这样的问题。我尝试用fstab挂载,但它将分区挂载为根。实用程序pmount仅适用于可移动驱动器。
是否有任何实用工具或脚本可用于在启动时作为普通用户(如文件管理器)挂载这些分区?
发布于 2020-04-24 15:22:08
阅读man mount.ntfs,它将告诉您如何将分区挂载为用户(带有uid=和gid参数)。来自man mount.ntfs页面:
Access Handling and Security
By default, files and directories are owned by the effective user and group of the mounting process, and everybody has
full read, write, execution and directory browsing permissions. You can also assign permissions to a single user by
using the uid and/or the gid options together with the umask, or fmask and dmask options.
Doing so, Windows users have full access to the files created by ntfs-3g.
But, by setting the permissions option, you can benefit from the full ownership and permissions features as defined by
POSIX. Moreover, by defining a Windows-to-Linux user mapping, the ownerships and permissions are even applied to Windows
users and conversely.
If ntfs-3g is set setuid-root then non-root users will be also able to mount volumes.但是,root仍然存在(因为“挂载”是一个系统级别的事情),而不可挂载的NTFS驱动器将导致它挂起--它们是自动安装的,所以不要在/etc/fstab条目中使用auto。
阅读man mount,特别是有关user参数的内容:
The non-superuser mounts.
Normally, only the superuser can mount filesystems. However, when fstab contains the user option on a line, any‐
body can mount the corresponding filesystem.https://askubuntu.com/questions/1230170
复制相似问题