當我們雙系統共存的時候,往往需要在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就行了.