NFS 관련 명령어 및 파일들

2010.05.12 03:18

조인상 조회 수:8394

원문 : http://www.ischo.net -- 조인상 // 시스템 엔지니어

Writer : http://www.ischo.net -- ischo // System Engineer in Replubic Of Korea

+++++++++++++++++++++++++++++++++++++++++++++++++++++++

 

본문 : http://www.ischo.net -- 조인상 //시스템 엔지니어

+++++++++++++++++++++++++++++++++++++++++++++++++++++++


NFS 환경을 설정하기 위해서는 다음과 같이 각각 서버와 클라이언트 환경을 정의한다 

1.서버쪽 셋업
1) share할 파일시스템을 정의한다.
/etc/dfs/dfstab
2) nfs관련 데몬을 기동하기 위해서 리부팅한다.
3) 리부팅 하지 않고 데몬을 기동하는 방법
# /etc/init.d/nfs.client start
--> /usr/lib/nfs/statd, /usr/lib/nfs/lockd 기동
# /etc/init.d/nfs.server start
--> /usr/lib/nfs/mountd, /usr/lib/nfs/nfsd 기동

2.클라이언트 셋업
1)mount할 리모트 파일 시스템을 정의한다.
/etc/vfstab
2) 리부팅하거나 다음과 같은 방법으로 mount한다.
# mountall
(혹은 mount 명령어를 써서 개별 mount.
예. mount server:/export/home /home1)

3.NFS관련 Daemon
1)NFS Server를 위한 daemon
/usr/lib/nfs/mountd : client에서 mount 요청을 처리하는 데몬
/usr/lib/nfs/nfsd : clinet의 read/write 요청을 처리하는 데몬
이상의 두 데몬은 시스템 기동시 /etc/dfs/sharetab에 share할 자원이 있으면 자동으로 뜨게 된다.
/etc/init.d/nfs.server를 수동으로 기동시켜도 된다.
2)NFS Server 및 Client를 위한 daemon
/usr/lib/nfs/lockd : client가 server의 특정 file system에 대한 locking 을할 수 있도록함
/usr/lib/nfs/statd : server와 client의 crash/recovery에 관련한 데몬(server에 crash가 있을 경우 이를 관찰하고 있다가 재기동되면 이전의 client locking 상태를 재유지시키고, clinet가 crash를 일으킬 경우 server에 걸린 client의 locking을 해제한다.)

4.NFS관련 files
/etc/vfstab : Defines file systems to be mounted locally
/etc/mnttab : Lists file systems that are currently mounted.
/etc/rmtab : Lists file systems remotely mounted by NFS clients.
/etc/default/fs : Lists the default file system type for local file systems
/etc/dfs/dfstab : Lists the local resources to be shared
/etc/dfs/fstypes : Lists the default file system types for remote file systems
/etc/dfs/sharetab : Lists the resources (local and remote) that are shared

5.NFS관련 command
mount
mountall - /etc/vfstab 에 기술된 모든 file system을 mount
share
shareall - /etc/dfs/sharetab에 있는 모든 자원을 share
umount
umountall - /etc/vfstab 에 기술된 모든 file system을 un-mount
unshare
unshareall - /etc/dfs/sharetab에 있는 모든 자원을 un-share

6.mount command

mount -F nfs [generic option] [-o specific option] source:/path /mountpoint

generic option
-m Mounts without creating an entry in /etc/mnttab
-r Mounts read-only
-o Includes FSType-specific options in a comma separated list
-O Overlays mount on top of file system already mounted

specific option
ro | rw read only|read,write
soft | hard soft : 서버가 응답이 없으면 error 메시지를 보냄
hard : 서버가 응답이 없으면 응답이 올때까지 계속 try.
rsize=# read buffer size. version2의 default는 8K. version3의 default는 32K
wsize=# write buffer size, rsize와 default값 동일.
bg | fg 첫 번째 서버접속시도가 실패할 경우 재접속 시도를 foreground 로 하는냐 background로 하는냐 하는 선택
intr|nointr hard옵션으로 mount된 경우 키보드 입력으로 interupt할 수 있 는지 여부

예) # mount -F nfs -r netra:/export/share/man /usr/man
# mount -F nfs -o -rw=test netra:/export/share/man /usr/man

7.share command

mount -F nfs [-o specific option] [-d description] sahred-file-system-path

예) # share -F nfs -o ro,rw=rose:lilac /usr/src
# share -F nfs -o ro=eng,rw=rose /usr/src
# share -F nfs -o rw=rose:lilac:tulip,root=rose:tulip /usr/src
번호 제목 글쓴이 날짜 조회 수
공지 [공지] 게시자료 열람자유. 불펌금지입니다. 조인상 2010.12.07 20128
53 ethernet speed 및 mode 변경방법 조인상 2010.05.12 9300
52 스카시 인터페이스 설명 조인상 2010.05.12 8036
51 cpio를 이용하여 증분백업하기 조인상 2010.05.12 6414
50 CDE 로그인이 안될때 조인상 2010.05.12 8106
49 센드메일 에러 config error: mail loops back to me (MX problem?) 조인상 2010.05.12 10243
48 솔라리스에서의 디스크 이름 조인상 2010.05.12 6095
47 Sun Explorer Data Collector [version 3.5.3.1] file 조인상 2010.05.12 8283
46 sendmail multi que setting 조인상 2010.05.12 5781
45 SUN 장비 CPU on/offline 확인하고 고치기. 조인상 2010.05.12 6369
44 ECC 메모리와 registered 메모리의 의미 조인상 2010.05.12 8638
» NFS 관련 명령어 및 파일들 조인상 2010.05.12 8394
42 CDE에서 한글이 안나올 경우 조인상 2010.05.12 5917
41 [HP] HP-UX 기본관리방법 조인상 2010.05.12 7776
40 sendmail relay test site 조인상 2010.05.12 6319
39 솔라리스 DVD 파일 합치기 조인상 2010.05.12 8671
38 qlogic 2300 SAN FC카드 드라이버 설치 하기 file 조인상 2010.05.12 8578
37 하드 디스크 모델넘버 읽는 법 조인상 2010.05.12 8849
36 vi에서 ^M 표시 없애는 방법 조인상 2010.05.12 6520
35 tape 인식이 안될때 재인식시키는 방법 조인상 2010.05.12 16042
34 터미널 접속방법 및 tip command 정리 조인상 2010.05.12 7453
서버에 요청 중입니다. 잠시만 기다려 주십시오...