This topic describes how to mount a NAS file system on an Elastic Compute Service (ECS) instance when you purchase the ECS instance.
A NAS file system is created. For more information, see Create a file system.
To mount a NAS file system, we recommend that you purchase an ECS instance after you create the file system. During the purchase process, you can mount the file system on the ECS instance. This topic describes how to mount one or more NAS file systems when you purchase an ECS instance. For more information about how to purchase an ECS instance, see Purchase an ECS instance. You can mount one or more file systems on an ECS instance when you create the ECS instance. You can mount a maximum of five NAS file systems on an ECS instance.
Mount a NAS file system
- Log on to the ECS console.
- On the Buy page, set the required parameters:
- Region: Select a region where the NAS file system resides. To achieve optimal performance, select a zone where the NAS file system resides.
- Instance Type: If you can specify a network type for the ECS instance in some regions, specify VPC. Specify other parameters based on your business requirements.
- Image: Select an image based on your business requirements. We recommend that you specify a Linux image of CentOS 7.6 and a Windows image of Windows Server 2019 Datacenter.
- Storage: Click Apsara File Storage NAS File System and click Add NAS File System. In the Add NAS File System section, set the required parameters. The following legends
show the parameters that you must specify.
The following table lists the parameters that are remarked by the legends.
Legend Parameter Description 3 File system ID
- Linux images support file systems only of the NFS type.
- Windows images support file systems only of the SMB type.
4 Mount target
- You can use the mount target to establish a connection between the NAS file system and the ECS instance. The mount target and the ECS instance must reside in the same VPC.
- If no mount target is available, add a mount target to the file system. For more information, see Create a mount target.
5 Local directory A local directory of the ECS instance on which you can mount the NAS file system.
- You can specify /mnt for a Linux image.
- You can specify Z for a Windows image.
6 Protocol type
- You can specify NFSv3.0 or NFSv4.0 for an NFS file system. If you do not use file locks, we recommend that you specify NFSv3.0.
- Only the SMB protocol is available for SMB file systems.
Mount multiple file systems
- Mount target:
- All mount targets must reside in the same VPC.
- If no mount target is available in the VPC where the ECS instance resides, add a mount target that matches the VPC. For more information, see Create a mount target.
- Local directory:
- Each local directory must be unique.
- You can use multilevel directories for Linux images, for example, /mnt and /mnt/sub.
- Image: You can mount NAS file systems only on official images. You cannot mount a NAS file system on a custom image that is created by using an ECS snapshot.
- Local directory: You can mount only the root directory of a NAS file system. You cannot mount the subdirectories of a NAS file system.
Verify the mount results
- Linux ECS instances
After you connect to an ECS instance, run the df -h command to view the details of the NAS file system that you specify.In the preceding figure,
Note Settings for an automatic mount are stored in the /etc/fstab file. You can change a local directory based on your business requirements. For more information, see Enable an automatic mount at startup for an NFS file system.
- Used indicates the used space.
- Size indicates the maximum size of the file system. You are not charged based on the maximum size of a NAS file system.
- Windows ECS instances
After you connect to an ECS instance, start File Explorer. The SMB file that you specify is mounted as a network drive.Note Settings for an automatic mount are stored in the c:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\my_mount.bat file. You can change these settings based on your business requirements.