Problem
I would like to know a flexible way to set up my system to have it automount "on-the-fly" remote filesystems without having to define these remote systems and remote filesystems in advance.
Solution
This solution involves setting up an entry in the /etc/auto.master
file that includes the special "-hosts" option. Take these steps:1. Log in to your system as "root".
2. Change directory to /etc. Edit the file "auto.master"
(create this if it does not exist) and add the following
line:/net -hostsNOTE: This example uses the directory "/net". You may use a
different directory if you wish.3. Create the directory, with mkdir, "/net" (or whatever directory you chose to use in step 2).
4. If you are using OpenDesktop 3.0 or SCO TCP/IP 1.2.1,
you should tune the kernel parameter NMOUNT to allow
the maximum number of mount points (25). After doing
this, you will need to relink and reboot. For OpenServer
Release 5.0.X systems, this step is not required.# cd /etc/conf/cf.d
# ./configure
(Select 3. Files, Inodes, and Filesystems)
(press <enter> until you get to NMOUNT: maximum
number of mounted file systems.)
(enter New value is:25, press <enter> till main
menu returns)
(Select q to quit)
# ./link_unix
# shutdown -g0 -y
(Reboot)5. If the automount daemon is not already running, you will need to stop and restart NFS as follows:
# nfs stop
# nfs start6. Verify that the automount daemon is running by typing:
# ps -ef | grep automountThere should be an automount process running whose parent process id is 1.
The system is now ready to automount NFS-exported filesystems
from remote machines. Here are a couple of useful commands:1. "showmount" -- use this to see all of the NFS servers on your network that have exported filesystems available for mounting.
2. "showmount -e <server>" -- use this to see all of the NFS-exported filesystem available for mounting from <server>.
Once you have determined which remote filesystem you want to access, you can simply do a change directory command to access that filesystem.
For example, when you perform the showmount command, one of the
NFS servers it shows is "bozo". Then when you perform a
"showmount -e bozo", one of the NFS-exported filesystems available
to you from bozo is "circus". Now, to access this NFS-exported
filesystem, simply change directory to:# cd /net/bozo/circusThis will put you at the "root" of that NFS-exported filesystem. The general form of the directory path to specify is:
/<mntpnt>/<server>/<NFSfs>where:<mntpnt> = directory mount point that was specified
in the /etc/auto.master file,
<server> = the remote NFS-server system, and
<NFSfs> = the available NFS-exported filesystem from
that server.NOTES: Typing "mount" will show you that the remote filesystem has been
mounted. Note that is is normal for all of the NFS-exported
filesystems from that server to be accessed simply when one of
them has been accessed.You do not have to use the "cd" command to access the
NFS-exported filesystem. Any reference to a directory
or file within the NFS-exported filesystem that is prepended
with "/<mntpnt>/<server>/NFSfs>/" will automount the exported
filesystems from that server. As an example:# cp /net/bozo/circus/costumes/shoes /tmpwill automount "bozo:/circus" (and others) to your machine.
See also
automount(NADM), mount(ADM), mount(NADM), nfs(NADM), mkdir(C)