默认 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.

参考

本条目发布于[2020年9月25日](https://c4ys.com/archives/2367 "20:27")。属于[Linux](https://c4ys.com/archives/category/linux)分类,被贴了 [ntfs](https://c4ys.com/archives/tag/ntfs) 标签。