This topic describes how to mount one or more NAS file systems on an Elastic Compute Service (ECS) instance when you purchase the ECS instance.
Prerequisites
One or more NAS file systems are created. For more information, see Create a General-purpose NAS file system in the NAS console.
Background information
After you create NAS file systems, you can purchase an ECS instance and mount the NAS file systems on the ECS instance on the buy page. This is the easiest way to mount NAS file systems. The following steps show you how to mount NAS file systems when you purchase an ECS instance. You can mount one or more NAS file systems on an ECS instance when you create the ECS instance. You can mount up to five NAS file systems on an ECS instance.
Limits
- Image: You can mount NAS file systems only on official images. You cannot mount NAS file systems on a custom image that is created by using an ECS snapshot.
- Local directory: You can specify only the root directory of NAS file systems. You cannot specify the subdirectories of NAS file systems.
Mount a NAS file system
- Log on to the ECS console.
- Create an ECS instance. For more information, see Create an instance by using the wizard. On the buy page, set the following 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: Select an instance 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 or a Windows image of Windows Server 2019 Datacenter.
- Storage: Click NAS File System, click Add NAS File System, and then set the parameters. The following table describes the parameters.
Legend Parameter Description ① File system ID - Linux images support only NFS file systems.
- Windows images support only SMB file systems.
② 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, create a mount target for the file system. For more information, see Create a mount target.
③ Local directory A local directory of the ECS instance on which you can mount the NAS file system. For example, you can enter /mnt for a Linux image or Z for a Windows image. ④ 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.
- For an SMB file system, select SMB.
Mount multiple NAS 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.
Check the mount result
- Linux ECS instances Connect to the ECS instance and run the
df -h
command to view the details of the mounted NAS file system.In the command output, Used indicates the used space, and Size indicates the maximum size of the file system. The billing of the file system is not related to the maximum size.
Note- The 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 Mount an NFS file system on a Linux ECS instance.
- For information about how to connect to an ECS instance, see Guidelines on instance connection.
- Windows ECS instances Connect to the ECS instance and start File Explorer. The SMB file that you specify is mounted as a network drive.Note The 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.