[linux] nfs 설치, 설정IT/linux2023. 3. 30. 13:22
Table of Contents
환경 : Ubuntu 20.04
# Server (10.109.0.2)
apt install nfs-utils
apt install nfs-kernel-server
# create share directory
mkdir /share
chmod 777 /share
# firewalld or ufw
ufw allow 2049/tcp,udp
firewall-cmd --permanent --add-service=nfs
firewall-cmd --permanent --add-port=2049/tcp
firewall-cmd --permanent --add-port=2049/udp
firewall-cmd --reload
# chage conf
vi /etc/exports
#####
# (mount point) (host, option)
# /appnas *(rw,sync,no_root_squash,no_subtree_check) # all open
/appnas 10.109.0.7(rw,sync,no_root_squash,no_subtree_check)
/appnas 10.109.0.3(ro,rw,sync,no_root_squash)
#####
# export command
exportfs -ra
exportfs -v
# hosts (10.109.0.x)
# ubuntu install
apt install nfs-common
# CentOS install
yum install nfs-utils
# create mount directory
mkdir /data/nfs
# nfs mount
mount -t nfs ${server_ip}:/${server mount point} /${host mount point}
mount -t nfs 10.109.0.2:/appnas /data/nfs
# fstab
vi /etc/fstab
#####
# ${server_ip}:/${server mount point} ${host mount point} ${mount type} ${option} ${dump option} ${filesystem}
10.117.2.17:/appnas /appnas/ nfs defaults,_netdev 0 0
#####
# error (nfs)
mount bad option; for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program
# solution
# ubuntu
apt install nfs-common
# CentOS
yum install nfs-utils
# error (mount, umount)
umount device is busy
# solution
umount -l /${directory}
umount -f /${directory}
'IT > linux' 카테고리의 다른 글
[linux] error: disk ‘lvmid/’ not found (1) | 2023.10.11 |
---|---|
[linux] contains a file system with errors, check forced. (1) | 2023.10.11 |
[linux] kernel: NMI watchdog: BUG: soft lockup - CPU#3 stuck for 82s! [pickup:18943] (0) | 2023.03.29 |
[linux] pam_tally2(login:account): unknown option: no_magic_root, reset (0) | 2023.03.29 |
[linux] ping: socket: Operation not permitted (0) | 2023.03.29 |
@주니- :: 주니
포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!