Before you can access the data in Apsara File Storage 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. This topic also describes how to 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.
Step 1: Create an SMB file system and create a mount target for the file system
- Log on to the NAS console.
- In the File System Selection Guide section of the Overview page, click Create a General Purpose NAS File System.
- On the buy page of General-purpose NAS file systems, set the required parameters. The following table describes the parameters. For other
parameters, select values based on your business requirements or use the default values.
Parameter |
Description |
Region |
Select China (Hangzhou).
|
Zone |
Select Hangzhou Zone B. 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. |
- Click Buy Now and follow the on-screen instructions to complete the payment.
Step 2: Mount the file system
- Connect to the ECS instance. For more information, see Connection methods.
- Open the command-line interface and run the following command to allow anonymous access
from the client:
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanWorkstation\Parameters /f /v AllowInsecureGuestAuth /t REG_DWORD /d 1
- Enable the Workstation service.
- Press
Win+R
. In the Run dialog box, enter services.msc
and click OK.
- Make sure that the Workstation service is in the Started state and the startup type is Automatic.
- Enable the TCP/IP NetBIOS Helper service.
- Open Control Panel, choose , and then click the network that is connected to your host.
- In the Status dialog box, click Properties. In the Properties dialog box, double-click Internet Protocol Version 4 (TCP/IPv4).
- In the Internet Protocol Version 4 (TCP/IPv4) Properties dialog box, click Advanced.
- In the Advanced TCP/IP Settings dialog box, click the WINS tab, select Enable NetBIOS over TCP/IP, and then click OK.
- Press
Win+R
. In the Run dialog box, enter services.msc
and click OK.
- Make sure that the TCP/IP NetBIOS Helper service is in the Started state and the startup type is Automatic.
- Open the command-line interface and run the following command to mount the SMB file
system:
net use D: \\file-system-id.region.nas.aliyuncs.com\myshare
The syntax of
D: \\file-system-id.region.nas.aliyuncs.com\myshare is
<Letter of the local drive>\\<Domain name of the mount target>\myshare
. Replace the parameters with the actual values.
Note
- Make sure that <Letter of the local drive> is not set to an existing drive.
myshare
is the name of the shared SMB directory. You cannot change the name.
- Run the
net use
command to check the mount result.
The command output in the following figure indicates a successful mount.
If the file system fails to be mounted, troubleshoot the issue. For more information,
see
Fix mount issues.
Step 3: Upload data to or download data from the file system
After you mount the file system on the ECS instance, you can use the file system in
the same way as a local directory. The following figure shows an example.