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.
One or more NAS file systems are created. For more information, see Create a General-purpose NAS file system.
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.
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: 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 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 1 File system ID
- Linux images support only NFS file systems.
- Windows images support only SMB file systems.
2 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.
3 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. 4 Protocol
- 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.
- 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.
Check the mount result
- ECS Linux instances
Connect to the ECS instance and run the
df -hcommand to view the details of the mounted NAS file system. In the command output, Used indicates the used space. Size indicates the maximum size of the file system. The billing of the file system is not related to the maximum size.
- ECS Windows 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.