9. Automaount
Automount의 특징
- 필요에의해서 file system이 마운트된다.
- File system은 보다 효과적으로 자동 마운트되어질 수있다.
- File system은 자동으로 unmount된다.
- File system은 쓰는 동안에는 마운드 되어서 있고, 5분동안 안쓰면 자동으로 unmount된다.
Automount는 어떻게 작동하는가?
- The client autofs file system
- Autofs 화일 시스템은 client system의 /etc 디렉토리에있는 automount maps에 정의되어
있다. Automounting을 모니터링하는 프로그램인 automount는 현재 마운트되어 있지 않은
화일시스템을 사용하려하는 요청을 받으면 automountd를 부르고, 그것은 요청된 화일
시스템을 실제로 마운트 한다. 시스템 부팅시에 불리어지는 automount 프로그램은 autofs
mount의 초기설정을 생성하기 위해서 auto_master file의 master map을 읽는다. Automountd
daemon은 automount 프로그램에 의해서 시작되고 요청에 의해서 화일 시스템을 마운트한다.
Automount daemon은 automount 명령으로 부터 완전히 독립적이다. 그래서 automountd
daemon을 시작하거나 stop 없이 맵정보를 변환하거나 삭제, 추가가 가능하다.
Automount 명령어
- direct map을 생성하거나 master map을 변환할 때, automount 명령어를 실행함으로써 효과를
볼 수 있다.
- Command Format
automount [-t duration] [-v]
-t duration, 초단위로 시간을 설정, 사용하지않는 시간, defualt 5분
-v verbose mode
The Three autofs Maps
- Master map - automount 명령어에 의해서 사용되어지는 file. 이 map의 기능은 autofs file
system을 설치하기 위해서 사용되어 지는 다른 map이 기록되어 있다.
- Direct map - mount point가 full path name으로 적혀있는 map. 이 map의 기능은 client상에
mount point를 지적한다.
- Indirect map - 상대 path로 mount point가 구성되어있고, 이 map의 기능은 client상의
mount를 설립하기 위해서 사용되어 지는 상대 path를 사용한다.
The Three autofs Maps-Examples
* Master Map
/etc/auto_master
# Master map for automaster
#
+auto_master
/- auto_direct
/net -hosts -nosuid
/home auto_home
/xfn -xfn
* Direct Map
/etc/auto_direct
# Superuser-created direct map for automounter
#
/usr/frame -ro,soft mars:/export/framemaker,v4.0
/usr/local -ro,soft jupiter:/export/unbundled
/usr/share/man -ro,soft sun,moon,stars:/usr/share/man
* Indirect Map
/etc/auto_home
# Home directory map for automounter
#
+auto_home
stevenu starbug:/export/home/stevenu
johnnyd comet:/export/home/johnnyd
wkd mars:/export/home/wkd
JTkirk reddwarf:/export/home/JTkirk
The Master Map
- mount_point : 이것은 directory의 full path name이고, 만약 rm directory가 존재하지 않으면
autofs는 가능하면 그것을 생성한다.
- map_name : direct map 또는 indirect map의 이름, 이것은 mounting 정보에 대한 방향이다.
- mount-option : 이것은 NFS mount에 대한 option과 동일하다.
Direct Map Entries
/- entry는 direct map에 대한 mount point이다.
/-는 /etc/auto_direct file에 정의된 full path name이다.
Indirect Map Entries
/net, /home, /xfn entris는 indirect map에 대한 mount point이다.
-host, auto_home, and -xfn map에는 단지 상대 path만 적혀있다.
Indirect map은 master map으로부터 초기 mount point만 얻는다.
host map
/etc/inet/hosts file에 적혀있는 각 NFS server로부터 모든 share된 정보를 /net/host directory에
만든다.
Direct map
- key : mount point의 full path name
- options : The specific option for a given entry
- location : The location of the resource specified in server:/pathname notation
Indirect map
- key : /etc/auto_master map에 정해져 있는 path name을 처음으로 삼는다.
- option : The specific options for given entry
- location : The location of the file resource specified in server:/pathname notation
The Substitution String for an Indirect map
* mars:/export/home/
NFS server로 부터 /export/home/loginID directory mars의 /home/login ID로 마운트하려고
할때 사용
How to set up a direct map
automount daemon을 이용해서 Solaris 2.x man page를 어떻게 setup하는지 설명
- /etc/master file 에서 +auto_master entry앞에 # 처리
- /etc/master file에 /- auto_direct entry를 추가
- /etc/auto_direct file을 만들고, 원하는 entry를 추가한다.
/usr/share/man -ro server:/usr/share/man
How to setup an indirect map
- /etc/auto_master file을 수정
+auto_master를 # 처리 patch directory를 추가
/services auto_patch
patch mars:/export/patch
Example
# pkginfo SUNWman
# pkgrm SUNWman
# man ls
# edit /etc/auto_master
#+auto_master
(/etc/auto_master에 다음 라인을 추가)
/- /etc/auto_direct
(/etc/auto_direct에 다음 라인을 추가)
/usr/share/man -ro server:/usr/share/man
# automount -v
# man ls -> 확인 |