Mount File System (Windows)
NFS
Step 1. Install the NFS client
-
Log in to the Windows cloud host.
-
Click the
Start
button in the lower left corner to open theServer Manager
. -
Select
Add roles and features
. -
Follow the prompts to install the NFS client. a. For
Before start
,Installation type
,Server selection
, keep the default selection and click next.
b. In theServer Roles
tab, checkFiles and Storage Services->Files and iSCSI Services-> NFS Server
and click next.
c. In theFeatures
tab, checkNFS Client
and click next.
d. Click Install. -
Restart the cloud host.
-
Open the
Command Prompt
window, enter the commandmount
, if the following information is outputted, it means the NFS client is installed.
Step 2. Mount the NFS file system
-
Open the
Command Prompt
window and enter the following command to mount the NFS file system.mount -o nolock -o mtype=hard -o timeout=10 \\mountpoint_ip\! Z:
Please replace the
mountpoint_ip
in the command according to the actual situation of the NFS file system mount point information on the console, and the local drive letterZ
can also be replaced according to the actual demand. -
After the mount is successful, execute the
mount
command again to check the mount result.Check if the mount type in the properties is
hard
,timeout
time is10.0
or above, andlocking
isno
. If not, it means the mount is abnormal, please useumount Z:
(modify the disk letter according to the actual situation) to unmount the file system, and refer to the above steps to re-mount. -
Double-click
This PC
icon to view the shared file system. Create and delete files/folders in the shared file system to confirm its normal use.
Step 3. Set the NFS file system to auto-mount
-
Create a mount script
auto_mount.bat
in theC:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
directory of the cloud host, with the following script content.mount -o nolock -o mtype=hard -o timeout=10 \\mountpoint_ip\! Z:
Please replace
mountpoint_ip
in the command with the actual NFS file system mount point information on the console, and the local drive letterZ
can also be replaced as needed. -
Create a mount task.
a. Click theStart
button in the lower left corner to open theControl Panel
.b. Click
System and Security
and selectScheduled Tasks
.c. Click
Create Task
in the operation tab.
Set theName
inGeneral
tab, checkRun whether user is logged on or not
(if you are using Windows Server 2016, checkRun only when user is logged in
), and checkRun with the highest privileges
.Click
New
in theTriggers
tab, setBegin the task
toAt log on
, and checkEnabled
inAdvanced settings
.Click
New
in theActions
tab, setAction
toStart a program
, select the scriptauto_mount.bat
created in step 1 inProgram or script
, and click okay.Check
Start the task only if the following network connection is available
in theConditions
tab, and selectAny connection
in the drop-down options.In the
Settings
tab, uncheckAllow task to be run on demand
andIf the task runs for a period longer than this, stop the task
. CheckIf the task is still running when requested to stop, force it to stop
. SelectDo not start a new instance
in the drop-down ofIf the task is already running, the following rule applies
. Click ok. -
Restart the cloud host and verify the result. a. Check the scheduled task status. If the following information is displayed, it means the task is executing normally.
b. Execute the
mount
command in theCommand Prompt
window and check the mount information. Confirm whether themount
type ishard
,locking
isno
,timeout
is10
or above. If the mount is normal, the parameters should look as follows.
SMB
Step 1. Environment preparation
-
Log in to the Windows cloud host.
-
For systems above Windows 2016, you need to configure to allow client anonymous access, and execute the following command.
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanWorkstation\Parameters /f /v AllowInsecureGuestAuth /t REG_DWORD /d 1
Step 2. Mount the SMB file system
Command line mount
-
Log in to the windows host, open the CMD command line window, and execute the following command to mount the SMB file system.
net use Z: \\18.0.0.1\share
The meanings of each parameter in the mount command are as follows:
Parameter/Option Name | Description |
---|---|
Z | The target disk letter to be mounted on the current Windows system, if there is a conflict, or if multiple NAS file systems are mounted, the disk letters will decrease in alphabetical order. |
- After the mount is successful, execute the
net use
command to check the mount information.