Mounting the NFS share on a Windows server
2016-08-24 18:57 梁小白 阅读(1180) 评论(0) 编辑 收藏 举报今天遇到一个相当奇怪的问题,在windows 上mount LINUX NFS, powershell 脚本可以成功, 用图形界面也可以成功,但BATCH就是不行。提示53网络错误.
不过公司已经有人踩过这个坑了看起来:)
原文在此:
http://www.ibm.com/support/knowledgecenter/SSFHJY_1.0.6/deploy/mount_the_nfs_share_on_windows_servers.html
- Ensure that you are logged into the Windows server as an administrator.
- Start the command console as the administrator (Click
- Right-click the Windows Powershell or Command Prompt, and select Note: Ensure to select Windows Powershell, not Windows Powershell(x86).
- Run the following command to install FS-NFS-Services:
servermanagercmd.exe -install FS-NFS-Services
- Open a command prompt with administrative rights. Run the following command:
- For IBM Docs: umount –f W:
- For File Viewer: umount –f Y:
- Run:
nfsadmin client stop
- Open Regedit and navigate to the following branch:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default
- In the main window, right-click and select
- Right-click and select
- Double-click on AnonymousGID and AnonymousUID, set the value as 0 and the base as Decimal respectively.
- Click OK.
- Close Regedit.
- In the command prompt, run:
nfsadmin client start
- Close the Windows Powershell Console.
- Open a command prompt.
- Run the following command in a command prompt (not Powershell) to set the NFS configuration:
nfsadmin client localhost config fileaccess=755 SecFlavors=+sys -krb5 -krb5i
- Run the following commands to mount the share:
- For IBM Docs: mount -o mtype=soft retry=10 timeout=6 casesensitive=yes anon DocsLab01.renovations.com:/nfs/docs_data W:
- For File Viewer: mount -o mtype=soft retry=10 timeout=6 casesensitive=yes anon DocsLab01.renovations.com:/nfs/viewer_data Y:
Note: If you do not mount successfully, run umount –f W: or umount –f Y: and then repeat again. - In order to mount the share automatically with windows restart:
- Create a batch file, for example, c:\IBMConversionNFS\nfsmount.bat, and type:
mount -o mtype=soft retry=10 timeout=6 casesensitive=yes anon DocsLab01.renovations.com:/nfs/docs_data W: mount -o mtype=soft retry=10 timeout=6 casesensitive=yes anon DocsLab01.renovations.com:/nfs/viewer_data Y:
- Click
- Click Create Task in Task Scheduler (Local).
- Click General, and type nfs_auto_mount for Name. In Security options, click
- Click
- Click
- Click OK.
Note:- If the node and server are configured to start automatically along with the Windows Operating System, they will be system services running with a user name of SYSTEM. Looking at the services with the Task Manager, the user name for java.exe will show SYSTEM. In this case, the mount must also be done with a user of SYSTEM (as previously shown) or the NFS shares will not be able to be accessed from the node or server.
- If the mount action is done using a user name of SYSTEM, the NFS shares will be able to be accessed regardless of what user name the node or server is running as.
- Create a batch file, for example, c:\IBMConversionNFS\nfsmount.bat, and type:
更多NFS troubleshooting 参考:
https://wiki.archlinux.org/index.php/NFS/Troubleshooting
本文为原创内容,转载请注明出自 梁小白博客(http://biangbiang.cnblogs.com)