今天遇到一個至關奇怪的問題,在windows 上mount LINUX NFS, powershell 腳本能夠成功, 用圖形界面也能夠成功,但BATCH就是不行。提示53網絡錯誤.php
http://www.ibm.com/support/knowledgecenter/SSFHJY_1.0.6/deploy/mount_the_nfs_share_on_windows_servers.htmlnode
- 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-Serviceslinux
- 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 stopshell
- Open Regedit and navigate to the following branch:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Defaultwindows
- 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 -krb5iless
- 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.
更多NFS troubleshooting 參考:ui
https://wiki.archlinux.org/index.php/NFS/Troubleshooting