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
- /etc/auto_patch map À» »ý¼º
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 -> È®ÀÎ |