@(#)automounter howto 04 AUG 1997 Rob Thomas robt@cymru.com How to setup automounter under Solaris 2.5.1 Why automount? Well, NFS has quite a bit of overhead. In Solaris 2.5.1, NFS has changed to version 3. Although there are quite a few improvements, one major change is that NFS now defaults to TCP, whereas it was once strictly UDP. This means more bandwidth can be eaten up. Additionally, mounted filesystems (whether local or remote) require attention from the kernel from time to time. Thus, if a remotely mounted filesystem is unused, we are wasting bandwidth, kernel time, and kernel table space. Not Good Karma[tm]. Automounter allows us to access the filesystem when we need it. After five minutes of no use, the filesystem is automagically unmounted. If needed again, it is simply remounted. This is done with very little impact on the user. In fact, with the exception of the initial mount and the timeout unmount, there is no difference between automounter and stock NFS manual mounts. This is how to setup direct maps under Solaris 2.5.1. 1. Determine what you want to automount. Let's go with this: We want to automount /jaz from host jupiter to venus, mars, and mercury. I did this today, so it makes a fine example... ;-) We want the mount point to be the same everywhere, /jaz. 2. Next, be sure that jupiter has: A. Actually mounted /jaz. B. Is exporting /jaz. 1. Check /etc/dfs/dfstab for the share entry. 2. Execute share(1M) with no options to see that /jaz is indeed exported to all the necessary hosts. If /jaz is not exported, consult my soon to be published "Howto to setup NFS serving in 3 easy steps", coming soon... ;-) 3. This is a good case for a direct map. Because /jaz is a single mount point, and because I will likely need access to ALL of /jaz (instead of just one or two subdirs under /jaz), a direct map is best. So, we choose a direct map. 4. Add this line to /etc/auto_master on your client hosts: /- auto_direct This tells the automountd(1M) to look in /etc/auto_direct for any direct mount points. 5. Next, create /etc/auto_direct with the following entry: /jaz jupiter:/jaz Simple, right? We're just saying "take /jaz from jupiter and mount it under /jaz locally". 6. Now you need to create the mount point. Simply use mkdir(1) to create our new mount point, /jaz. hostname# mkdir /jaz NOTE: Once you create the mount point, stay out of it! Some very Goofy Things can happen if you are under the mount point when auto- mounter attempts to mount the remote filesystem. At best, the mount will silently fail, leaving you scratching your head. 7. OK, your maps are done, but automountd is still clueless about the changes. DO NOT KILL automountd! This is certifiably Bad Karma[tm], especially if done with a SIGKILL (kill -9). Lucky for us, Sun makes it easy to give automountd a clue. Simply run automount(1M) with no options: hostname# automount. And that's it! 8. Now cd down to /jaz on the client. You should see the same contents as seen under /jaz on jupiter. However, things can go wrong. Here are some common mistakes: A. Spelling/syntax errors in your auto_direct or auto_master map. B. automountd was not running. C. The remote filesystem is not exported, or is exported but excludes the client you are on. Check /etc/dfs/dfstab on the remote host. Enjoy! Questions/comments/bugs to: robt@cymru.com Famous Unix quote: "Unix was never designed with any security in mind." -- Dennis Ritchie, on Unix security Rob Thomas, robt@cymru.com http://www.enteract.com/~robt