Solaris Transition Guide

Mounting File Systems and autofs

The biggest change to the mounting capability is automatic mounting or autofs. The autofs program automatically mounts directories when you access them using, for example cd(1) or ls(1). This capability includes file hierarchies, CD-ROM, and diskette file systems.

autofs starts automatically when the system enters run level 3, or you can invoke it from a shell command line.

autofs works with the file systems specified in maps. These maps can be maintained as NIS, NIS+, or local files. The autofs maps can specify several remote locations for a particular file. This way, if one of the servers is down, autofs can try to mount from another system. You can specify in the maps which servers are preferred for each resource by assigning each server a weighting factor.

Mounting some file hierarchies with autofs does not exclude the ability to mount others with the mount command. A diskless system must have entries for / (root), /usr, and /usr/kvm in the /etc/vfstab file. Because shared file systems should always remain available, do not use autofs to mount /usr/share.

The following example shows how to manually mount a file system listed in the /etc/vfstab file using the mount command.

  1. Change to the directory in which you want to create the mount point.

  2. Create the mount-point directory.

  3. Specify either the mount point or the block device.

    Specifying the mount point is usually easier. The rest of the information is read from /etc/vfstab.

  4. Become root and type the mount command, specifying either the mount point or the block device.

    Specifying the mount point is usually easier. The rest of the information is read from /etc/vfstab.


    # mount mount-point
    

    The file system is now mounted.

    For instructions showing how to mount different types of file systems using mount with or without options, see System Administration Guide, Volume I.

Changes to the mount Command

Some of the names and forms of the mount commands are different, as listed in Table 9-13.

Table 9-13 mount Command Differences

SunOS release 4 

SunOS release 5.7 

mount

mount

mount -a

mountall

umount

umount

umount -a

umountall

exportfs

share

exportfs -u

unshare

showmount -a

dfmounts

showmount -e

dfshares

See Appendix A, Commands Reference Table, for more information on changes to these commands.

Automatic Mounting of /cdrom and /floppy

In this release, the CD-ROM and diskette file systems are automatically mounted in /cdrom and /floppy when removable media are inserted into these drives. Since these file systems are now managed by the Volume Management daemon, vold(1M), you cannot mount these devices yourself. See "Using Volume Management" for more information.

Specifying File Systems in the /etc/vfstab File

In the SunOS release 5.7 system, you need to list file systems that you want mounted at system startup in your /etc/vfstab, instead of in the /etc/fstab file. The format of /etc/vfstab differs from that of /etc/fstab. For a discussion of the /etc/vfstab file, see "/etc/vfstab File ".