System/Linux

NFS 관련 명령어 Command about NFS (exportfs, export, showmount)

JJuno 2018. 3. 28.

NFS 관련 명령어 (Command about NFS)

 

 

서버 설정 (NFS server)

export 하고 있는 NFS 디렉토리 확인 (Check exporting nfs directory)

[root@JJuno ~]# cat /etc/exports
/tftpboot *(rw,no_root_squash,sync,no_subtree_check)
/install *(rw,no_root_squash,sync,no_subtree_check)
 
[root@JJuno ~]# exportfs
/tftpboot     	<world>
/install      	<world>

※ exports 파일에 등록된 디렉토리가 안보일 경우 nfs 서비스 재시작 (when no match exports file with exportfs. restart nfs service)

 

 

클라이언트 설정 (NFS client)

export 중인 NFS 디렉토리 확인 (Check exported nfs directory)

[root@JJuno ~]# showmount -e (NFS Server IP)
Export list for JJuno:
/install              *
/tftpboot             *

 

 

NFS 디렉토리 fstab 파일에 등록 (add nfs directory line in fstab file)

[root@JJuno ~]# tail -1 /etc/fstab
192.168.255.254:/install    /install    nfs    defaults    0 0
 

마운트 (mount)

[root@JJuno ~]# mount -a
 

※ 마운트 전 마운트 포인트 디렉토리 생성해야 함 (before mount, create mount point directory)

 

NFS 마운트 확인 (verify nfs mount)

[root@JJuno ~]# df -h | grep /install
 

 

 

 

 

 

 

 

 

728x90

댓글

💲 추천 글