- Print
- PDF
NFS volume mount (Linux)
- Print
- PDF
Available in VPC.
You can mount the NFS protocol-based NAS volume that was created in NAVER Cloud Platform on the Linux server and use it.
The following describes the procedure of mounting the NAS volume on the Linux server.
1.Accessing the server
2.Installing the NFS-related package
3.Start NFS-related daemon
4.Execute mounting
5.Mount information retention settings (fstab settings)
1. Access the server
Before accessing the server, check server access preparations by referring to Prepare for server access. Once you complete the preparations for accessing the server, access the Linux server using the terminal program.
- This guide explains how to access the server using PuTTY client software.
- How to access the server may differ depending on the type and version of terminal connection software in use. For more information on the usage, refer to the guide provided with software.
- Run the PuTTY.
- Enter or select the following information and click the [Open] button.
- Host Name (or IP address): enter the public IP of server
- Port: 22 (default set value for SSH connection)
- Connection type: SSH, Telnet optional (default set value)
- When the PuTTY Security Alert pop-up window appears, click the [Accept] button.
- When the log-in screen is displayed, enter the account name (
root
) and password that were checked in the Get Admin password menu in the server (See Get Admin password).
2. Installing the NFS-related package
The following describes how to install the NFS-related package.
Use the commands suitable for the OS type and version of the server. The installation commands differ depending on the OS type and version.
CentOS 6.x and above: Download
nfs-utils
packageyum install nfs-utils
Ubuntu server: Download
nfs-common
packageapt-get install nfs-common
3. Start NFS-related daemon
The following describes how to start the RPC daemon by entering the NFS start command.
- Use the commands suitable for the OS type and version of the server. The start commands differ depending on the OS type and version.
Start the RPC daemon by entering the following command.
CentOS 6.x and above: Start
rpcbind
/etc/rc.d/init.d/rpcbind start
CentOS 7.x and above: Start
rpcbind
service rpcbind start
or
systemctl start rpcbind.service
Register the service so that
rpcbind
is automatically started when booting.CentOS 6.x and above
chkconfig rpcbind on
CentOS 7.x and above
systemctl enable rpcbind.service
4. Mounting
Take the following steps to mount the NFS volume after starting the NFS-related daemon.
Enter the following command to create a mounting point (
/mnt/nas
).mkdir /mnt/nas
Mount the volume on the mount point with NFS v3 (
/mnt/nas
) using the mount information(<Example>10.00.00.00:/n0000000_volume1
) given at the time of volume creation (Refer to the Mount information item of the Detailed NAS volume page).mount -t nfs -o vers=3 10.00.00.00:/n0000000_volume1 /mnt/nas
Note- When mounting NFS volume, you can do it by using NFS v3 by the below method as well.
- In the Editor, open the
/etc/nfsmount.conf
file, and release the annotation and set the version value to be 3 for the volume mount version settings (Nfsvers) as below.
Nfsvers=3
- Mount by using mount commands.
mount -t nfs 10.00.00.00:/n0000000_volume1 /mnt/nas
5. Mount information retention settings (fstab settings)
To make the Linux server maintain the mount information after rebooting the server, add the volume information to the /etc/fstab
file.
The /etc/fstab
file stores the volume information to be mounted when the server boots up. When mounting NFS volume, you must set to NFS v3.
When the mount information of the NFS NAS volume is 10.00.00.00:/n0000000_volume1
and the server mount point is /mnt/nas
, take the following steps to add the mount information to the /etc/fstab
file.
Open the
/etc/fstab
file in the editor.vi /etc/fstab
Press the [a] key in the editing page to enter
INSERT
mode and add the mount information of the volume.10.00.00.00:/n0000000_volume1 /mnt/nas nfs vers=3,defaults 0 0
- Editing page example
# /etc/fstab # Created by anaconda on Mon Oct 12 19:30:22 2020 # # Accessible filesystems, by reference, are maintained under '/dev/disk' # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info # UUID=79ec23f4-ea9a-4f2c-a2da-xxxxxxxxxxx / xfs defaults 0 0 # Add volume mount information ---------------------------------------- 10.00.00.00:/n0000000_volume1 /mnt/nas vers=3,defaults 0 0 # ------------------------------------------------------------- -- INSERT --
- Editing page example
Press the [Esc] key to stop
INSERT
mode and enter:wq
to save changes, and then close the editor.- Editing page example
# /etc/fstab # Created by anaconda on Mon Oct 12 19:30:22 2020 # # Accessible filesystems, by reference, are maintained under '/dev/disk' # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info # UUID=79ec23f4-ea9a-4f2c-a2da-xxxxxxxxxxx / xfs defaults 0 0 10.00.00.00:/n0000000_volume1 /mnt/nas nfs vers=3,defaults 0 0 :wq
Note- You can set for mounting also by NFS v3 by the below method as well.
- In the Editor, open the
/etc/nfsmount.conf
file, and release the annotation and set the version value to be 3 for the volume mount version settings (Nfsvers) as below.
Nfsvers=3
- In the Editor, open the
/etc/fstab
file to add volume mount information.
10.00.00.00:/n0000000_volume1 /mnt/nas nfs defaults 0 0
NoteThe following section describes each setting value of the volume mount information in detail.
(1)10.00.00.00:/n0000000_volume1 (2)/mnt/nas (3)nfs (4)defaults (5)0 (6)0
Number Settings Description (1) 10.00.00.00:/n0000000_volume1
Volume mount information (2) /mnt/nas
Server mount point (3) nfs
File system type ext4
: CentOS 6.x, Ubuntu Serverxfs
: CentOS 7.x, Rocky 8.x(4) defaults
Optional features defaults
: Apply all 5 options belowauto
: Mount automatically when bootingrw
: Mount with read and write supportnouser
: Enable only the root account to mountexec
: Allow file executionsuid
: Allow SetUID and SetGID(5) 0
Dump settings 0
: File system that does not support dumping1
: File system that supports dumping(6) 0
fsck
Settings0
: when booting,fsck
is not conducted.1
: when booting,root
file system is checked first2
: when booting, file systems other thanroot
are checked first- Editing page example