Beruflich Dokumente
Kultur Dokumente
Overview
Whatistheautomounter?
Automaticallymountandunmountfilesystems
Why?
Manageability! ThisgoalisnotachievedbythecurrentLinuxautomounter.
ConfigurationTheMasterMap
auto.master(Linux)orauto_master(UNIX) Sourceofallfurtherconfiguration
mountpoint
fullpathtothedirectoryusedasamountpoint ifitdoesnotexist,itiscreated
'+'ifthemapisanincludedmap. '/'ifthisisadirectmap
TheMasterMap(cont'd)
mapname
Mapfiletoread
'hosts'ifthemapistobeaslashnetmap 'null'ifwewanttooverrideaspecificmapentry
Usefulwhenusedinconjunctionwithincludedmaps
mountoptions
Justwhatitsays,optionswhicharepassedtothemountcommand
+auto_master
MountMaps
IndirectMaps
DirectMaps
Format:key[mountoptions]location
key
MountMaps(cont'd)
mountoptions
location
ReplicatedServerEntries
lowestweight closestnetworkproximity
/usr/share/manroserver1,server2,server3:/export/share/man /usr/share/docroserver1(50):/export/share/doc,server2:/export/share/doc
UNIXautomounterimplementationsprovidemultipleserverstothemount command.NFStakescareofswitchingserverswhenonedoesn'trespond.
MultimountMaps
MultiMountMaps(cont'd)
autofs4limitations
putspressureonreservedportspace
WildCardKeys
Examplemountmap,auto.misc:
music * myserver:/export/music myserver:/export/&
SpecialCharacters
NameServiceSwitch
Exception:
SpecialMaps
hosts
null
IncludedMaps
Incorporatesthecontentsofanothermapfileintothecurrentmap
auto_master: /site RESULT: /home /site /nfs auto.home auto.site auto.nfs auto.site
MultiMapEntries
Onlysupportedinauto.master,andonlysupportedunderLinux
/home fileauto.homeypauto_home
Usethefirstinstanceofthekeywefind
Submountmaps
/etc/auto.lanhosts: server1 fstype=autofs server2fstype=autofs auto.server1: foo bar baz server1:/export/foo server1:/export/bar server1:/export/share/baz file:auto.server1 file:auto.server2
SubmountMaps(cont'd)
/lanhosts<fstype=autofs /server1<fstype=autofs /foo<fstype=nfs /bar /baz /server2<fstype=autofs #mount|greplanhosts automount(pid10523)on/lanhoststypeautofs (rw,fd=5,pgrp=10523,minproto=2,maxproto=4) automount(pid10532)on/lanhosts/server1typeautofs (rw,fd=5,pgrp=10523,minproto=2,maxproto=4) server1:/export/fooon/lanhosts/server1/footypenfs(rw) ...
Autofsv4DirectMaps
Implementedassubmountmaps
2keyproblemswiththis
Autofs4DirectMapExample
auto.direct: /nfs/os/linux/usr /nfs/os/linux/bin /nfs/os/linux/local /nfs2/foo /nfs<fstype=autofs /os<fstype=autofs /linux<fstype=autofs /usr<fstype=nfs /bin<fstype=nfs /local<fstype=nfs /nfs2<fstype=autofs /foo<fstype=nfs linuxserver:/export/usr linuxserver:/export/bin linuxserver:/export/local fileserver:/export/foo
Autofs4DirectMapExample(cont'd)
automount(pid13258)on/nfstypeautofs (rw,fd=4,pgrp=13252,minproto=2,maxproto=4) automount(pid13262)on/nfs2typeautofs (rw,fd=4,pgrp=13252,minproto=2,maxproto=4) automount(pid13270)on/nfs/ostypeautofs (rw,fd=4,pgrp=13252,minproto=2,maxproto=4) automount(pid13276)on/nfs/os/linuxtypeautofs (rw,fd=4,pgrp=13252,minproto=2,maxproto=4) root132520.00.21808720?Ss12:100:00 /usr/sbin/automounttimeout=60/file/etc/auto.direct root132580.00.21808736?S12:100:00 /usr/sbin/automountsubmounttimeout=60/nfsfile/etc/auto.direct root132620.00.21808728?S12:100:00 /usr/sbin/automountsubmounttimeout=60/nfs2file/etc/auto.direct root132980.00.21812736?S12:120:00 /usr/sbin/automountsubmounttimeout=60/nfs/osfile/etc/auto.direct root133070.00.21808728?S12:120:00 /usr/sbin/automountsubmounttimeout=60/nfs/os/linuxfile /etc/auto.direct
AutomountArchitecture
UserspaceDaemon
Autofsfilesystem
AutomountLoadableModules
Loadablemodules
lookup
parse
mount
AutofsLoadableModules
Benefits
Drawbacks
Autofs4FileSystem
Virtualfilesystem Registertriggersfor
MountDiagram
ExpiryDiagram
AutofsInherentRaceConditions
Expiry
Isthisabigdeal?
Autofs5
Goal:100%compatibility Bigticketitems
Autofs5DirectMaps
Needtoinstallhooksinthefilesystemwhichtriggeranautomount,without mountinganautofsfilesystem
filesystemstackingwasconsideredtobetoocomplex Hackeryensues...
>follow_linkisneverfilledinforadirectoryinode,wecanusethat!
Settingupadirectmounttriggernowlookslikethis:
Createtherequireddirectoryinthehierarchy
Installourownfollow_linkroutine
Autofs5DirectMaps(cont'd)
Autofs5Lazymount/unmount
Autofs5Features(cont'd)
Utilizethenameserviceswitch
Supportincludedmaps
detectrecursion integrationofmodules
Summary
Added
Missing
Different
lazymountingandunmountingisnotimplemented
Contributing
MasterMapUtility
CIFS!
LDAP
Interactionwithnewbindmountsemantics(orold) Realreplicatedserversupport
changestomount,nfsclientcode,minimalchangestoautofs
Bugwhacking Testing
MoreInformation
autofsmailinglist
mypeoplepage
officialautofsdistribution
RelatedProjects
References
[1]LinuxKernelsource,Version2.4and2.6,http://www.kernel.org/. [2]HalStern,MikeEislerandRichardoLabiaga,ManagingNFSandNIS,2nd Edition,O'Reilly,June2001 [3]W.RichardStevens,BillFenner,andAndrewM.Rudoff,UNIXNetwork Programming,TheSocketsNetworkingAPI,Volume1,ThirdEdition, AddisonWesleyProfessionalComputingPress,2004. [4]TravisBar,NicolaiLangfeldt,SethVidalandTomMcNeal,LinuxNFSHOWTO, http://nfs.sourceforge.net/nfshowto/,20020825. [5]FiST:StackableFileSystemLanguageandTemplates,ErazZadoketal., http://www.filesystems.org/. [6]SunTMMicrosystemsNFSAdministrationGuide,Chapter5,http://docs.sun.com/, 1995. [7]RobertLove,LinuxKernelDevelopment,SecondEdition,NovellPress,2005.