forker’s blog

プログラムとか メモ感覚で(マジでメモ)

CentOS7 nfs

Server

インストール

# yum -y install nfs-utils


共有ディレクトリ作成

# mkdir /home/nfs
# chmod 744 /home/nfs
# chown user:user /home/nfs


exportsファイルの設定

# vi /etc/exports
/home/nfs       192.168.1.0/24(rw,sync,wdelay,hide,no_subtree_check,sec=sys,secure,root_squash,no_all_squash)
# exportfs -a


firewallの設定

# firewall-cmd --add-port=2049/tcp --zone=public --permanent
# firewall-cmd --reload


起動

# systemctl start rpcbind
# systemctl start nfs-server
# systemctl enable rpcbind
# systemctl enable nfs-server


Client

インストール

# yum -y install nfs-utils


マウント先の作成

# mkdir /mnt/nfs
# chmod 744 /mnt/nfs
# chown user:user /mnt/nfs


起動

# systemctl start rpcbind


マウント

# mount -t nfs 192.168.1.10:/home/nfs /mnt/nfs