After creating a file system, you need to mount the file system to ECSs so that ECSs can share the file system.
This section uses Windows Server 2012 as an example to describe how to mount an NFS file system.
- You have created a file system and have obtained the shared path of the file system.
- The ECSs to which a file system is mounted belong to the same VPC as the file system.
- The IP address of the DNS server for resolving the domain name of the file systems has been configured on the ECS. For details, see Configuring DNS.
- Go to the ECS Console and log in to the ECS running Windows 2012.
- Install the NFS client.
- Click Server Manager in the lower left corner. The Server Manager window is displayed, as shown in Figure 1.
Figure 1 Server Manager
- Click Add Roles and Features. See Figure 2.
Figure 2 Add roles and features wizard
- Click Next as prompted. On the Server Roles page, select Server for NFS, as shown in Figure 3.
Figure 3 Selecting Server for NFS
- Click Next. In the Features page, select Client for NFS and click Next, as shown in Figure 4. Confirm the settings and then click Install. If you install the NFS client for the first time, after the installation is complete, restart the client and log in to the ECS again as prompted.
Figure 4 Selecting Client for NFS
- Modify the NFS transfer protocol.
- Choose Figure 5.
, as shown in
Figure 5 Administrative tools
- Right-click Client for NFS, choose Properties, change the transport protocol to TCP, and select Use hard mount, as shown in Figure 6 and Figure 7.
Figure 6 Services for NFS
Figure 7 Client for NFS properties
- Run the following command in the CMD window of the Windows Server 2012 (X is the drive letter of the free disk):
mount -o nolock shared path X:
To obtain the shared path, move the cursor to the shared path and click
next to the shared path, as shown in
. If the information shown in
is displayed, the mounting is successful.
Figure 8 Shared path
Figure 9 Running the command
- After the file system is mounted successfully, you can view the mounted file system on the This PC page, as shown in Figure 10.
Figure 10 Successful mounting
If a file system is mounted to an ECS running Linux and an ECS running Windows, on the ECS running Windows, data cannot be written to the files created on the ECS running Linux. To address this problem, you need to modify the registry and change both the UID and GID of the Windows user accessing NFS to 0. Detailed operations are as follows:
- Choose Start > Run and enter regedit to open the registry.
- Enter the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default directory. Figure 11 shows an example of the directory.
Figure 11 Entering the directory
- Right-click the blank area and choose New > QWORD Value from the shortcut menu. Set AnonymousUid and AnonymousGid to 0. Figure 12 shows a successful operation.
Figure 12 Adding values
To cancel the mounting, right-click the mounted file system and choose Disconnect.