主题 : LINUX挂载FAT分区普通用户无写权限的解决办法
有钱安装正版,没钱使用原版;远离论坛糙版;不买地摊盗版。
级别: 七朵秋菊
UID: 32943
精华: 0
发帖: 10160
威望: 21387 点
无痕币: 2623 WHB
贡献值: 0 点
在线时间: 5047(时)
注册时间: 2008-05-26
最后登录: 2022-04-11

0 LINUX挂载FAT分区普通用户无写权限的解决办法

当我们双系统共存的时候,往往需要在LINUX下挂载WIN的FAT分区。默认情况下,挂载的分区只有root用户可以读写.
         而在LINUX平台下,一直使用root用户并不是一个好习惯.
         有没有办法让挂载的FAT分区能让普通用户也可以正常读写呢?
         man mount发现如下一段话:
         uid=value and gid=value
              Set  the owner and group of the root of the file system (default: uid=gid=0, but with option uid or gid without specified value, the uid and gid of the current process are taken).
         原来在挂载时加上这两个选项就可以了,如下:
         mount -t vfat -o iocharset=utf8,uid=500,gid=500 /dev/hda2 /mnt/D/
         (500是需要读写该分区的普通用户的UID和GID)
         再用UID为500的用户登录后测试发现在该FAT分区读写正常了.
         当然,如果你用/etc/fstab文件配置的话,直接在defaults后面加上,uid=500,gid=500就行了.
Total 0.046303(s) query 3, Time now is:05-17 11:49, Gzip enabled 粤ICP备07514325号-1
Powered by PHPWind v7.3.2 Certificate Code © 2003-13 秋无痕论坛