NAS is a storage service that offers you a distributed file system and shared storage across multiple ECS instances. This topic describes the process of mounting an NAS file system on Windows Server 2012 R2. For the process of mounting an NAS file system on Linux, see Mount a file system.
Before you can mount a NAS file system to a Windows instance, you must complete the following actions:
Create a Windows ECS instance. In this example:
- The region is EU Central 1 (Frankfurt).
- The image is Windows 2012 R2 Data Centre Edition.
- The network type must be VPC.
Create a file system and add a mount point.
Log on to the NAS console.
Buy a storage package. Follow these steps:
In the left-side navigation pane, click Storage Package.
Click Buy Storage Package.
On the NAS Storage Package page, select the Region (EU Central 1 is selected in this example), Capacity, and the duration of the package.
Create a file system. Follow these steps:
In the NAS console, from the left-side navigation pane, click File System List.
Select the EU Central 1 (Frankfurt) region.
Click Create File System.
Specify the specifications of the file system and bind the storage package to it.
In this example, select VPC as the mount point type.
In the file system list, click the file system ID, and view the Mount Address of the new mount point. You will use the mount address to mount the file system on the Windows instance.
You can now mount the mount point on a server with Windows 2012 R2 Data Centre Edition. This solution works for most versions of Windows with NFS Client installed.
Install the NFS Client on the instance.
Click the Server Manager icon.
From the upper menu, select Manage > Add Roles and Features.
Follow the Add Roles and Features Wizard to finish the installation.
Under the Server Roles tab, select Server For NFS.
Under the Features tab, select Client for NFS.
Restart the server within the guest operating system.
Start Command Prompt and run
If the following result is returned, the Client for NFS has been installed.
Run the following command to mount the NFS mount point as a drive.
mount -o nolock \\11xxxxxxxx9-wxx88.eu-central-1.nas.aliyuncs.com\! h:
11xxxxxxxx9-wxx88.eu-central-1.nas.aliyuncs.comis the mount address that we have created.
Check the shared drive from the This PC of the instance.
Test creation of a folder and a text file inside the newly created folder.
If you get a
file handle error, check the Registry entries in HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > ClientForNFS > CurrentVersion > User > Default > Mount. The value of Locking must be 1.
You can also set GID and UID by creating the Registry entries:
Go to HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > ClientForNFS - CurrentVersion > Default.
Right-click a blank area, and then select New > DWORD(32bit) to add the following Registry entries.
AnonymousGID: Set the value to 0.
AnonymousUID: Set the value to 0.
Start Command Prompt and run
mountto check the UID and GID.