Solaris Automounter

Whenever you’re using NFS mount points, it’s really nice to use some type of automounter. Linux and FreeBSD use AMD to accomplish this, but Solaris uses automountd, and it’s fun and easy to use… Here is an example of a configuration that will automatically mount an NFS share and unmount it after 5 minuets of inactivity.

We have a system called micky which has an NFS point shared to a system called minny as /shareme.
We can see that it is set up in the /etc/dfs/dfstab file on micky:

share -F nfs -o ro=minny.yourdomain.com -d “NFS ShareMe” /shareme

The above will share the directory read-only. If you would like to map the directory as root and be able to write to it, the command would look more like this:

share -F nfs -o rw,root=minny.yourdomain.com -d “NFS ShareMe” /shareme

You can run the share command on micky to check to make sure it is shared:

# share
– /shareme ro=minny.yourdomain.com “NFS ShareMe”

If it’s not shared, run shareall to share it:

# shareall

Now, jump on over to minny and add the following line to /etc/auto_master:

/- auto_direct

Automountd will now look in /etc/auto_direct for direct mount points.

Next edit /etc/auto_direct and add the following line:

/micky-shareme micky:/shareme

Now, create the directory for the NFS mount point on minny:

# mkdir /micky-shareme

Finally, run the auromount command on minny to inform the daemon of the changes:

# automount

That should do it… Have fun with your new automount NFS share.

More information on this can be found here

Solaris Systems With Multiple Names Have Trouble Mounting CD’s

If you have a Solaris box with multiple names, you might have trouble mounting CD’s if the primary name is different from the one you gave the machine at install time. This is because of the CRAZY way Solaris goes about auto-mounting its optical media.

Here is a 10,000 foot view of how Solaris automounts a CD:

The disk is inserted
vold checks and sees that there is a disk inserted
vold connects to inetd, which in turn, starts smserverd
smserverd mounts the disk and all is right with the world

All this depends, however, that:

1) Vold is running
# /etc/init.d/volmgt start

2) This line is not commented in /etc/inetd.conf
100155/1 tli rpc/ticotsord wait root /usr/lib/smedia/rpc.smserverd rpc.smserverd

And 3) The current hostname of the machine is listed in /etc/net/ticotsord/hosts.

This file should looks something like this:

——-SNIP——
#ident “@(#)hosts 1.2 92/07/14 SMI” /* SVr4.0 1.2 */
# RPC Hosts
micky micky
minny minny
——/SNIP——

Micky and minny, of course are the hostnames you have given the machine. You can pretty much just make it mirror the /etc/hosts file.

Once these three criteria are met, a machine with multiple names should be able to automount a CD with no problems.