Previous Table of Contents Next


Using Mount and Unmount File System Commands

Table 4-5 lists the commands in the /usr/sbin directory that you use to mount and unmount file systems.

Table 4-5 Commands for Mounting and Unmounting File Systems

Command Description
mount(1M) Mounts file systems and remote resources.
mountall(1M) Mounts all file systems specified in a file system table.
umount(1M) Unmounts file systems and remote resources.
umountall(1M) Unmounts all file systems specified in a file system table.

The mount commands will not mount a read/write file system that has inconsistencies. If you receive an error message from the mount or mountall command, you may need to check the file system.

The umount command will not unmount a file system that is busy. A file system is considered busy if a user is in a directory in the file system or if a program has a file open in that file system.

Table 4-6 describes the general mount options that you can specify with the -o option of the mount command. If you specify multiple options, separate them with commas (no spaces). For example, -o ro,nosuid.

Table 4-6 Commands for Mounting and Unmounting File Systems

Option File System Description
-rw | ro CacheFS, NFS, PCFS, UFS, S5FS Specifies read/write or read-only. If you do not specify this option, the default is read/write.
-nosuid HSFS, NFS, UFS Prevents setuid execution and prevents devices on the file system from being opened. The default is to enable setuid execution and enable devices to be opened.
-remount NFS, UFS, S5FS With rw, remounts a file system with read/write access.
-f UFS, S5FS Fakes an entry in /etc/mnttab, but does not really mount any file systems.
-n UFS, S5FS Mounts the file system without making an entry in /etc/mnttab.
-bg | fg NFS If the first attempt fails, retries in the background (bg) or in the foreground (fg). The default is fg.
-soft | hard NFS Specifies the procedure if the server does not respond. soft indicates that an error is returned. hard indicates that the retry request is continued until the server responds. The default is hard.
—intr | nointr NFS Specifies whether keyboard interrupts can be used to kill a process hung while waiting for a response on hard-mounted file systems. The default is intr (interrupts allowed).
-retry=n NFS Retries the mount operations when it fails.
-largefiles NFS A file system mounted using this option may contain files larger than 2 Gbyte, but it is not a requirement. This option is the default.
-nolargefiles NFS Disables the -largefiles mount option to provide backward compatibility with previous file system behavior and enforcing the 2 Gbyte maximum file size limit.
-index filename NFS URL Automatically loads a file matching filename if it is found in a directory referenced by an NFS URL.
-public NFS URL Resets the public file handle to the current directory to enable you to access an NFS URL even if the file system cannot be mounted in the usual way.

Finding the Mounted File Systems

To display a list of f mounted file systems, type mount and press Return. All the file systems currently mounted are displayed:

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
oak%

Mounting All File Systems in the /etc/vfstab File

Follow these steps to mount all ffile systems in the /etc /vfstab file:

1.  Become superuser.
2.  Type mountall and press Return.

All the file systems in the local /etc /vfstab file are mounted:

oak% su
Password:
mountall
oak#

Mounting All File Systems of a Specific Type

Follow these steps to mount all f file systems of a specific type that are in the /etc/vfstab file. The most common file system types are ufs for local disk slices and NFS for network file systems. See “Types of File Systems” early in the chapter for a complete list of file system types.

1.  Become superuser.
2.  Type mountall -F filesystem-type and press Return.

All the file systems of the type you specify that are in the local /etc/vfstab file are mounted.

In this example, all NFS file systems are mounted:

oak% su
Password:
mountall -F nfs
oak#

With the Solaris 2.6 release, the -largefiles mount option is used as the default for mounting UFS file systems. If you want to prevent users from mounting file systems that contain files larger than 2 Gbyte, you must explicitly use the nolargefiles mount option to disable the default behavior.


Previous Table of Contents Next