在Windows2008系統下設置掛載Linux服務器磁盤
一、系統環境
系統平台:CentOS release 5.8 (Final)
NFS Server IP:X....X...153.157
防火牆已關閉
[root@htuidc ~]# setenforce 0
[root@htuidc ~]# service iptables stop
/iptables: Firewall is not running.
SELINUX=disabled
二、安裝NFS服務
[root@htuidc ~]# yum install nfs-utils-* portmap-*
rpcbind
-y
[root@htuidc ~]# vi /etc/exports
/aaa *(rw,no_root_squash)
/aaa 42.51.0.0/16(rw)
[root@htuidc aaa]# /etc/init.d/rpcbind restart
Stopping rpcbind: [ OK ]
Starting rpcbind: [ OK ]
[root@htuidc aaa]# /etc/init.d/nfs restart
Shutting down NFS daemon: [ OK ]
Shutting down NFS mountd: [ OK ]
Shutting down NFS services: [ OK ]
Shutting down RPC idmapd: [ OK ]
Starting NFS services: [ OK ]
Starting NFS mountd: [ OK ]
Starting NFS daemon: [ OK ]
Starting RPC idmapd: [ OK ]
設置NFS服務器的自動啟動狀態

可以看到UID=-2由於在存儲設備上共享出來的NFS文件系統歸屬於root權限,並且無法修改該所屬用戶,而Windows通過UID=-2的用戶去寫,肯定寫不進去。
解決辦法就是讓Windows 7在掛載NFS的時候將UID和GID改成0即可:打開注冊表:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default,增加兩項:AnonymousUid,AnonymousGid,如圖:
解決辦法就是讓Windows 7在掛載NFS的時候將UID和GID改成0即可:打開注冊表:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default,增加兩項:AnonymousUid,AnonymousGid,如圖: