Linux 下mount ntfs 分区没有权限无法chown/chmod解决办法

默认 Linux 下挂载的ntfs分区,会出现chown,chmod都无效,且默认都是root用户。需要采用ntfs-3g方式挂载后,支持权限。图形界面下点击磁盘管理,修改挂载参数即可。命令行界面需要直接先mount.ntfs-3g /dev/sdb2 /data ntfs-3g 测试下,然后修改/etc/fstab,然后运行mount -a

解决办法

首先,让我们看一下完全的挂载参数:

~ >>> cat /etc/fstab

/dev/sdb2 /data ntfs-3g permissions,users,auto,exec,uid=ning,gid=ning 0 0

参数说明

  • permissions: (NTFS-3G option) Set standard permissions on created files and use standard access control.
  • auto: Will be mounted at boot and from mount -a
  • user: Allow an ordinary user to mount the filesystem
  • users: Allow every user to mount and unmount the filesystem

By default, ntfs-3g mounts the partition noexec, nosuid, and nodev.

  • noexec: Do not allow direct execution of any binaries on the mounted filesystem.
  • nosuid: Do not allow set-user-identifier or set-group-identifier bits to take effect.
  • nodev: Do not interpret character or block special devices on the file system.

参考

发表评论