Previous Table of Contents Next

Mounting a Single File System (mount)

Follow these steps f to mount a single file system that has an entry in the /etc/vfstab file:

1.  Become superuser.
2  .Type mount mount-point and press Return.

The file system is mounted, as shown in this example:

oak% su
# mount /opt

Remounting a UFS File System Without Large Files (mount)

After you mount a fil fe system with the default largefiles mount option and large files have been created, you cannot remount the file system with the nolargefiles option until you remove any large files and run fsck to reset the state to nolargefiles.

The nolargefiles mount option provides total compatibility with previous file system behavior and enforces the 2 Gbyte maximum file size limit.

Follow these steps to remount a UFS file system without large files:

1.  Become superuser.
2.  Type cd /filesystem and press Return.
3.  Type find . -xdev -size +2000000 -exec ls -l {} ; and press Return.
4.  Remove any large files listed as the result of the find command.
5.  Type umount /filesystem and press Return.
6.  Type fsck /dev/rdsk/device-name and press Return.
7.  Type mount -o nolargefiles /dev/rdsk/device-name and press Return. The file system is mounted.

In the following example, the directory /files1 is searched for large files, unmounted, fscked, and mounted again with the nolargefiles option:

oak% su
# cd /files1
# find . -xdev -size +2000000 -exec ls -l {} ;
# umount /files1
# fsck /dev/rdsk/c0t3dos7 /files1
# mount -o nolargefiles /dev/dsk/c0t3d0s7 /files1

Unmounting All Remote File Systems (umountall - F nfs)

Follow thes fe steps to unmount all remote file systems:

1.  Become superuser.
2.  Type umountall -F nfs and press Return.

All the remote file systems in the local /etc /vfstab file are unmounted:

oak% su
umountall -F nfs

CAUTION! If you unmount all file systems (umountall without any arguments), the system may be unusable and you may need to reboot it.

Unmounting Individual File Systems (umount)

You cannot unmount a fdirectory that is being used. If you want to unmount a directory that is being used, all users must change out of the directory:

1.  Become superuser.
2.  If necessary, have users change out of the directory you want to unmount.
3.  Type umount mount-point and press Return.

The file system you specify is unmounted.

In this example, the mount command is used first to find the mount point for the file system to be unmounted:

oak% mount
/ on /dev/dsk/cØtØdØsØ read/write/setuid on Wed Oct 23 1Ø:Ø8:5Ø 1991

/usr on /dev/dsk/cØtØdØs6 read/write/setuid on Wed Oct 23 1Ø:Ø8:5Ø 1991

/proc on /proc read/write/setuid on Wed Oct 23 1Ø:Ø8:5Ø 1991

/tmp on swap on Wed Oct 23 1Ø:Ø8:52 1991

/usr/openwin on cheers:/export/openwin hard/remote on Wed Oct 23
1Ø:11:Ø8 1991

/home on blowup:(pid136) read only/intr/map=auto.home/indirect on Wed
Oct 23 1Ø:11:1Ø 1991

/vol on blowup:(pid136) read only/intr/map=auto.vol/indirect on Wed
Oct 23 1Ø:11:1Ø 1991

/nse on blowup:(pid136) read only/intr/map=/etc/auto.nse /indirect on
Wed Oct 23 1Ø:11:1Ø 1991
[41]oak% su
# cd /
# umount /home

Automounting Directories

You can mount file systems shared through NFS using a method called automounting. The AutoFS program runs in the background and mounts and unmounts remote directories as they are needed. Whenever a user on a client system running AutoFS accesses a remote file or directory available through the automounter, AutoFS mounts the file system on the user's system. The remote file system remains mounted as long as the user remains in the directory and is using a file. If the remote file system is not accessed for a certain period of time, it is automatically unmounted. AutoFS mounts and unmounts file systems, as required without any intervention on the part of the user other than changing into or out of a directory.

You can mount some file hierarchies with AutoFS and you can change others using the /etc/vfstab file and the mount command. A diskless machine must have entries for / (root), /usr, and /usr/kvm in the /etc/vfstab file.

CAUTION! Because shared file systems should always remain available, do not use AutoFS to mount /usr/share.

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, the automounter can try to mount from another machine.

You can specify which servers are preferred for each resource in the maps by assigning each server a weighting factor. AutoFS starts automatically when a system enters run level 3. You can also start it from a command line. ( Describing how to set up and administer the automounter is beyond the scope of this book.) By default, the SunOS 5.x system software automounts /home.

Previous Table of Contents Next