Help Center> Scalable File Service> Getting Started> Step 3: Mount a File System> Mounting an NFS File System to ECSs (Windows)

Mounting an NFS File System to ECSs (Windows)

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. For other versions, perform the steps based on the actual situation.

An SFS Capacity-Oriented file system can support either the NFS or CIFS protocol.

Operations on BMSs and containers (CCE and CCI) are the same as those on ECSs.

Prerequisites

  • You have created a file system and have obtained the mount point of the file system.
  • At least one ECS that belongs to the same VPC as the file system exists.
  • The IP address of the DNS server for resolving the domain names of the file systems has been configured on the ECS. For details, see Configuring DNS.

Limitations and Constraints

You are advised to use CIFS file systems in Windows OS.

Procedure

  1. Go to the ECS console and log in to the ECS running Windows Server 2012.
  2. Install the NFS client.

    1. Click Server Manager in the lower left corner. The Server Manager window is displayed, as shown in Figure 1.
      Figure 1 Server Manager
    2. Click Add Roles and Features. See Figure 2.
      Figure 2 Wizard for adding roles and features
    3. Click Next as prompted. On the Server Roles page, select Server for NFS, as shown in Figure 3.
      Figure 3 Selecting the server for NFS
    4. 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 the NFS client

  3. Modify the NFS transfer protocol.

    1. Choose Control Panel > System and Security > Administrative Tools > Services for Network File System (NFS), as shown in Figure 5.
      Figure 5 Administrative tools
    2. Right-click Client for NFS, choose Properties, change the transport protocol to TCP, and select Use hard mounts, as shown in Figure 6 and Figure 7.
      Figure 6 Services for NFS
      Figure 7 Client for NFS properties

  4. Check that the IP address of the DNS server for resolving the domain names of the file systems has been configured on the ECS before mounting the file system. For details, see Configuring DNS. SFS Turbo file systems do not require domain name resolution.
  5. Run the following command in the Command Prompt of the Windows Server 2012 (X is the drive letter of the free disk). Select the ECS that belongs to the same VPC as the file system to mount the file system.

    For SFS Capacity-Oriented file systems: mount -o nolock mount point X:

    For SFS Turbo file systems: mount -o nolock -o casesensitive=yes IP address! X:

    • Drive letter of the free disk: A disk that is not in use, such as disk E or X.
    • The mount point of an SFS Turbo file system is the root directory. Ensure that an English exclamation mark (!) is added to the mount point, for example, 127.0.0.1:/!.
    • casesensitive=yes indicates that file names are case sensitive during file search. If this parameter is not added, the performance of creating files in a large directory will deteriorate.

    You can move the cursor to the mount point and click next to the mount point to copy the mount point. For details, see Figure 8. If the information shown in Figure 9 is displayed, the mounting is successful.

    Figure 8 Mount point
    Figure 9 Running the command

  6. After the file system is mounted successfully, you can view the mounted file system on the This PC page, as shown in Figure 10.

    If the mounting fails or times out, rectify the fault by referring to Troubleshooting.

    Figure 10 Successful mounting

Troubleshooting

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 values of UID and GID of the Windows user accessing NFS to 0. This section uses Windows Server 2012 as an example. Do as follows:

  1. Choose Start > Run and enter regedit to open the registry.
  2. Enter the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ClientForNFS\CurrentVersion\Default directory. See Figure 11.

    Figure 11 Entering the directory

  3. 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

  4. After modifying the registry, restart the server for the modification to take effect.