Mount a NFS file system on an ECS instance
Procedure
- Log in to ECS (Linux system).
- Install Client for NFS.
- If you use CentOS, Redhat , and Aliyun Linux operating systems, run the command: sudo yum install nfs -utils
- If you use the Ubuntu or Debian operating system, run the command:
- sudo apt-get update
- sudo apt-get install nfs -common
Mount the NFS file system.
You can refer to the command to mount the NFS file system, where " file-system-id.region.nas.aliyuncs.com :/ / mnt " should be replaced according to the actual situation.
- If you want to mount the NFSv4 file system, refer to the command:
- sudo mount -t nfs -o vers= 4.0,minorversion =0,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport file-system-id.region.nas.aliyuncs.com : // mnt.
- If you want to mount the NFSv3 file system, refer to the command:
- sudo mount -t nfs -o vers= 3,nolock ,proto=tcp,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport file-system-id.region.nas.aliyuncs.com : // mnt.
- Execute the mount -l command to view the mount results.
If the echo contains similar information as follows, the mount is successful.
After the mount is successful, you can also view the current capacity information of the file system through the df -h command. - After the mount is successful, you can access the NAS file system on ECS to perform read or write operations.
You can access and use the NAS file system as a common directory, for example: