All Products
Search
Document Center

Apsara File Storage NAS:Mount a file system on a Windows ECS instance

Last Updated:Jan 09, 2024

Before you can access data in Apsara File Storage NAS (NAS), you must create a NAS file system and mount the file system on an Elastic Compute Service (ECS) instance. This topic describes how to create a Server Message Block (SMB) file system in the NAS console and mount the SMB file system on an ECS instance. In this example, the ECS instance is deployed on Windows Server 2019 in a virtual private cloud (VPC). After you mount the file system on the ECS instance, you can upload data to or download data from the file system.

Prerequisites

  • NAS is activated.

    The first time you visit the product page of NAS, follow the instructions to activate the NAS service.

  • An ECS instance is created in the China (Hangzhou) region. The operating system of the instance is Windows Server 2019. For more information, see Create an ECS instance.

Step 1: Create an SMB file system and create a mount target for the file system

  1. Log on to the NAS console.

  2. On the Overview page, click Create General-purpose NAS File System.

  3. On the General-purpose NAS (Pay-as-you-go) page, configure the parameters. The following table describes the parameters. For the parameters that are not described in the following table, select values based on your business requirements or use the default values.

    For more information, see Create a file system.

    Parameter

    Description

    Region

    Select China (Hangzhou).

    Zone

    Select Hangzhou Zone F. Select the zone where the ECS instance resides.

    Protocol Type

    Select SMB.

    Network Type

    Select VPC.

    VPC

    Select the VPC where the ECS instance resides.

    VSwitch

    Select a vSwitch that resides in the VPC.

  4. Click Buy Now and follow the instructions to complete the payment.

    After you purchase the file system, a mount target is automatically generated for the file system and a permission group named "VPC default permission group (all allowed)" is attached to the mount target. You can also create permission groups and add mount targets based on your business scenarios. For more information, see Create a permission group and add rules to the permission group and Create a mount target.

  5. Go to the NAS console. In the left-side navigation pane, choose File System > File System List. Then, click the file system that you created.

  6. On the details page of the file system, click Mount Targets.

  7. In the Mount Command column of the Mount Target section, copy the mount command for later use.

    image.png

Step 2: Mount the file system

  1. Connect to the ECS instance. For more information, see Connection methods.

  2. Open the Command Prompt and run the following command to grant the client anonymous access permissions:

    REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanWorkstation\Parameters /f /v AllowInsecureGuestAuth /t REG_DWORD /d 1
  3. Enable the Workstation service.

    1. Press Win+R. In the Run dialog box, enter services.msc and click OK.

    2. Make sure that the Workstation service is in the Started state and the startup type is Automatic.

      Workstation

  4. Enable the TCP/IP NetBIOS Helper service.

    1. Open Control Panel, choose Network and Internet > Network and Sharing Center, and then click the network that is connected to your host.

    2. In the Status dialog box, click Properties. In the Properties dialog box, double-click Internet Protocol Version 4 (TCP/IPv4).

    3. In the Internet Protocol Version 4 (TCP/IPv4) Properties dialog box, click Advanced.

    4. In the Advanced TCP/IP Settings dialog box, click the WINS tab, select Enable NetBIOS over TCP/IP, and then click OK.

      启用 TCP/IP 上的 NetBIO

    5. Press Win+R. In the Run dialog box, enter services.msc and click OK.

    6. Make sure that the TCP/IP NetBIOS Helper service is in the Started state and the startup type is Automatic.

      TCP/IP NetBIOS Helpe

  5. Open the Command Prompt and run the mount command that you copied in Step 1.

  6. After the mount command is executed, run the net use command to view the mount result.

    If an output similar to the following example appears, the mount is successful.

    查看挂载结果If the file system failed to be mounted, troubleshoot the issue. For more information, see Fix mount issues.

Step 3: Verify the mount result

After you mount the file system on the ECS instance, you can access the file system the same way you access a local directory. The following figure shows an example.

  1. Remotely connect to the ECS instance by referring to Connection methods, and run the following commands to access the file system.

  2. Run the following commands to access the file system. In the following commands, drive Z is the mount path of the file system. Replace the drive letter Z based on your business requirements.

    Z:
    mkdir dir1
    mkdir dir2
    echo 'some file content' > file2
    dir
  3. If an output similar to the following example appears, you have accessed the SMB file system.

    1