edit-icon download-icon

Mount NAS on Windows

Last Updated: Apr 08, 2018

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.

Prerequisites

Before you can mount a NAS file system to a Windows instance, you must complete the following actions:

  1. 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.
  2. Create a file system and add a mount point.

    1. Activate the NAS service.

    2. Log on to the NAS console.

    3. Buy a storage package. Follow these steps:

      1. In the left-side navigation pane, click Storage Package.

      2. Click Buy Storage Package.

        BuyStoragePackage

      3. On the NAS Storage Package page, select the Region (EU Central 1 is selected in this example), Capacity, and the duration of the package.

        Specify the configuraitons of the storage package

    4. Create a file system. Follow these steps:

      1. In the NAS console, from the left-side navigation pane, click File System List.

      2. Select the EU Central 1 (Frankfurt) region.

      3. Click Create File System.

      4. Specify the specifications of the file system and bind the storage package to it.

        Specify the configurations of the file system

      5. Click OK.

    5. Add a mount point.

      In this example, select VPC as the mount point type.

      Add a mount point

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

      View mount address

Procedure

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.

  1. Connect to the Windows instance.

  2. Install the NFS Client on the instance.

    1. Click the Server Manager icon.

    2. From the upper menu, select Manage > Add Roles and Features.

    3. Follow the Add Roles and Features Wizard to finish the installation.

      • Under the Server Roles tab, select Server For NFS.

        Server Roles_Server for NFS

      • Under the Features tab, select Client for NFS.

        Features_Client for NFS

    4. Restart the server within the guest operating system.

    5. Start Command Prompt and run mount.

      If the following result is returned, the Client for NFS has been installed.

      Client for NFS _ Successfully installed

  3. Run the following command to mount the NFS mount point as a drive.

    1. mount -o nolock \\11xxxxxxxx9-wxx88.eu-central-1.nas.aliyuncs.com\! h:

    Where 11xxxxxxxx9-wxx88.eu-central-1.nas.aliyuncs.com is the mount address that we have created.

    mount

  4. Check the shared drive from the This PC of the instance.

    Check the shared drive

  5. Test creation of a folder and a text file inside the newly created folder.

    Test

Troubleshooting

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.

Configure Locking

You can also set GID and UID by creating the Registry entries:

  1. Go to HKEY_LOCAL_MACHINE > SOFTWARE > Microsoft > ClientForNFS - CurrentVersion > Default.

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

      Create GID and UID

  3. Start Command Prompt and run mount to check the UID and GID.

    Check the UID and GID

Thank you! We've received your feedback.