<chapter id="fsoverview-38559"><title>Managing File Systems (Overview)</title><highlights><para>Managing file systems is one of your most important system administration
tasks.</para><para>This is a list of the overview information in this chapter.</para><itemizedlist><listitem><para><olink targetptr="fsoverview-63" remap="internal">What's New in File Systems?</olink></para>
</listitem><listitem><para><olink targetptr="fsoverview-62" remap="internal">Where to Find File System
Management Tasks</olink></para>
</listitem><listitem><para><olink targetptr="fsoverview-51" remap="internal">Overview of File Systems</olink></para>
</listitem><listitem><para><olink targetptr="fsoverview-20860" remap="internal">Types of File Systems</olink></para>
</listitem><listitem><para><olink targetptr="fsoverview-95856" remap="internal">Commands for File System
Administration</olink></para>
</listitem><listitem><para><olink targetptr="fsoverview-43247" remap="internal">Default Solaris File Systems</olink></para>
</listitem><listitem><para><olink targetptr="fsoverview-42137" remap="internal">Swap Space</olink></para>
</listitem><listitem><para><olink targetptr="fsoverview-12343" remap="internal">UFS File System</olink></para>
</listitem><listitem><para><olink targetptr="fsoverview-30598" remap="internal">Mounting and Unmounting
File Systems</olink></para>
</listitem><listitem><para><olink targetptr="fsoverview-28729" remap="internal">Determining a File System's
Type</olink></para>
</listitem>
</itemizedlist>
</highlights><sect1 id="fsoverview-63"><title>What's New in
File Systems?</title><para>This section describes new file system features in the Solaris Solaris
Express release.</para><itemizedlist><listitem><para><olink targetptr="gcdye" remap="internal">File System Monitoring Tool (fsstat)</olink></para>
</listitem><listitem><para><olink targetptr="gbsdd" remap="internal">Solaris ZFS File System</olink></para>
</listitem><listitem><para><olink targetptr="gagar" remap="internal">Enhancements to UFS File System Utilities
(fsck, mkfs, and newfs)</olink></para>
</listitem>
</itemizedlist><para>For a complete listing of new Solaris features and a description of
Solaris releases, see <olink targetdoc="solwhatsnew" remap="external"><citetitle remap="book">Solaris Express Developer Edition What&rsquo;s New</citetitle></olink>.</para><sect2 id="gcdye"><title>File System Monitoring Tool (<command>fsstat</command>)</title><para><emphasis role="strong">Solaris Express 4/06</emphasis>: A new file system monitoring
tool, <command>fsstat</command>, is available to report file system operations.
You can use several options to report activity, such as by mount point or
by file system type. </para><para>For example, the following <command>fsstat</command> command displays
all ZFS file system operations since the ZFS module was loaded:</para><screen>$ <userinput>fsstat zfs</userinput>
 new  name   name  attr  attr lookup rddir  read read  write write
 file remov  chng   get   set    ops   ops   ops bytes   ops bytes
 268K  145K 93.6K 28.0M 71.1K   186M 2.74M 12.9M 56.2G 1.61M 9.46G zfs</screen><para>For example, the following <command>fsstat</command> command displays
all file system operations since the <filename>/export/ws</filename> file
system mounted.</para><screen>$ <userinput>fsstat /export/ws</userinput>
new  name   name  attr  attr lookup rddir  read read  write write
file remov  chng   get   set    ops   ops   ops bytes   ops bytes
   0     0     0 18.1K     0  12.6M    52     0     0     0     0 /export/ws</screen><para>The default form is to report statistical information in easy to understand
values, such as Gbytes, Kbytes, and Mbytes.</para><para>For more information, see <olink targetdoc="refman1m" targetptr="fsstat-1m" remap="external"><citerefentry><refentrytitle>fsstat</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink>.</para>
</sect2><sect2 id="gbsdd"><title>Solaris ZFS File System</title><para><emphasis role="strong">Solaris Express 12/05</emphasis>: ZFS, a revolutionary new
file system, provides simple administration, transactional semantics, end-to-end
data integrity, and immense scalability. In addition, ZFS provides the following
administration features:</para><itemizedlist><listitem><para>Backup and restore capabilities</para>
</listitem><listitem><para>Device management support</para>
</listitem><listitem><para>GUI administration tool</para>
</listitem><listitem><para>Persistent snapshots and cloning features</para>
</listitem><listitem><para>Quotas that can be set for file systems</para>
</listitem><listitem><para>RBAC-based access control</para>
</listitem><listitem><para>Storage pool space reservations for file systems</para>
</listitem><listitem><para>Support for Solaris systems that have zones installed</para>
</listitem>
</itemizedlist><para>You can set up both ZFS and UFS file systems on the same Solaris system.
However, you cannot use ZFS as a root file system. For information about additional
limitations when using ZFS, see <olink targetdoc="solwhatsnew" targetptr="gbjpv" remap="external"><citetitle remap="section">The ZFS File System</citetitle> in <citetitle remap="book">Solaris Express Developer Edition What&rsquo;s New</citetitle></olink>.</para><para>For more information about using ZFS, see <olink targetdoc="zfsadmin" remap="external"><citetitle remap="book">ZFS Administration Guide</citetitle></olink>.</para>
</sect2><sect2 id="gagar"><title>Enhancements to UFS File System Utilities (<command>fsck</command>, <command>mkfs</command>, and <command>newfs</command>)</title><para><emphasis role="strong">Solaris Express 12/05</emphasis>: The file system check utility, <command>fsck</command>, has been enhanced to include features from the FreeBSD 4.9
version of the <command>fsck</command> program, as well as other enhancements.</para><para>The <command>fsck</command> utility in this Solaris release includes
the following improvements:</para><itemizedlist><listitem><para>Checks and repairs file systems more thoroughly and provides
improved error messages. For example, in some scenarios, <command>fsck</command> determines
what structures are missing and replaces them appropriately.</para>
</listitem><listitem><para>Automatically searches for backup superblocks.</para>
</listitem><listitem><para>Reports when <command>fsck</command> needs to be rerun.</para>
</listitem><listitem><para>When clearing directories, <command>fsck</command> now attempts
to recover directory contents immediately and therefore, reduces the time
spent rerunning this utility.</para>
</listitem><listitem><para>If <command>fsck</command> finds duplicate blocks, and not
all files that reference the duplicate blocks were cleared, <command>fsck</command> reports
the inode numbers at the end of the <command>fsck</command> run. Then, you
can use the <command>find</command> command to review the inodes that are
damaged.</para>
</listitem><listitem><para>Improved error messages regarding the status of extended attributes
and other special files, such as device files and ACL entries, are included.</para>
</listitem><listitem><para>Includes a <option>v</option> option to enable more verbose
messages.</para>
</listitem>
</itemizedlist><para>In addition, the <command>newfs</command> and <command>mkfs</command> commands
have been updated to include new options for displaying a file system's superblock
information in text or dumping the superblock information in binary format.</para><screen>newfs [ -S or -B ] <replaceable>/dev/rdsk/...</replaceable></screen><variablelist><varlistentry><term><option>S</option></term><listitem><para>Displays the file system's superblock in text</para>
</listitem>
</varlistentry><varlistentry><term><option>B</option></term><listitem><para>Dumps the file system's superblock in binary</para>
</listitem>
</varlistentry>
</variablelist><screen>mkfs [ -o calcsb or -o calcbinsb ] <replaceable>/dev/rdsk/... size</replaceable></screen><variablelist><varlistentry><term><option>o calcsb</option></term><listitem><para>Displays the file system's superblock in text</para>
</listitem>
</varlistentry><varlistentry><term><option>o calcbinsb</option></term><listitem><para>Dumps the file system's superblock in binary</para>
</listitem>
</varlistentry>
</variablelist><para>The <command>fsck</command> utility uses this superblock information
to search for backup superblocks.</para><para>The following sections describe specific <command>fsck</command> enhancements
and their corresponding error messages. For step-by-step instructions on using
the <command>fsck</command> utility to repair a damaged superblock, see <olink targetptr="galyo" remap="internal">How to Restore a Bad Superblock ( Solaris Express Release)</olink>.</para><sect3 id="gagby"><title>Automatic Search for Backup Superblocks</title><para>The following <command>fsck</command> error message examples illustrate
the automatic backup superblock discovery feature.</para><caution><para>If a file system has a damaged superblock and it was created
with <command>newfs</command> or <command>mkfs</command> customized parameters,
such as <literal>ntrack</literal> or <literal>nsect</literal>, using <command>fsck</command>'s automatically discovered superblock for the repair process could
damage your file system.</para><para>In the case of a file system that was
created with customized parameters and it has a bad superblock, <command>fsck</command> provides
the prompt to cancel the <command>fsck</command> session:</para><screen>CANCEL FILESYSTEM CHECK?</screen>
</caution><itemizedlist><listitem><para>If the file system was created with the <command>newfs</command> command
and <command>fsck</command> responds that just the primary superblocks are
corrupted, then consider letting <command>fsck</command> restore the superblock.</para><screen># <userinput>fsck /dev/dsk/c1t2d0s0</userinput>
** /dev/rdsk/c1t2d0s0
BAD SUPERBLOCK AT BLOCK 16: BLOCK SIZE LARGER THAN MAXIMUM SUPPORTED

LOOK FOR ALTERNATE SUPERBLOCKS WITH MKFS? <userinput>no</userinput>


LOOK FOR ALTERNATE SUPERBLOCKS WITH NEWFS? <userinput>yes</userinput>

FOUND ALTERNATE SUPERBLOCK 32 WITH NEWFS

USE ALTERNATE SUPERBLOCK? <userinput>yes</userinput>

FOUND ALTERNATE SUPERBLOCK AT 32 USING NEWFS
If filesystem was created with manually-specified geometry, using
auto-discovered superblock may result in irrecoverable damage to
filesystem and user data.

CANCEL FILESYSTEM CHECK? <userinput>no</userinput>

** Last Mounted on
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3a - Check Connectivity
** Phase 3b - Verify Shadows/ACLs
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cylinder Groups
CORRECT GLOBAL SUMMARY
SALVAGE? <userinput>y</userinput>


UPDATE STANDARD SUPERBLOCK? <userinput>y</userinput>

81 files, 3609 used, 244678 free (6 frags, 30584 blocks, 0.0% 
fragmentation)

***** FILE SYSTEM WAS MODIFIED *****</screen>
</listitem><listitem><para>If the file system was created with the <command>mkfs</command> command
and <command>fsck</command> responds that just the primary superblocks are
corrupted, then consider letting <command>fsck</command> restore the superblock.</para><screen># <userinput>fsck /dev/dsk/c1t2d0s0</userinput>
** /dev/rdsk/c1t2d0s0
BAD SUPERBLOCK AT BLOCK 16: BLOCK SIZE LARGER THAN MAXIMUM SUPPORTED

LOOK FOR ALTERNATE SUPERBLOCKS WITH MKFS? <userinput>yes</userinput>

FOUND ALTERNATE SUPERBLOCK 32 WITH MKFS

USE ALTERNATE SUPERBLOCK? <userinput>yes</userinput>

FOUND ALTERNATE SUPERBLOCK AT 32 USING MKFS
If filesystem was created with manually-specified geometry, using
auto-discovered superblock may result in irrecoverable damage to
filesystem and user data.

CANCEL FILESYSTEM CHECK? <userinput>no</userinput>

** Last Mounted on
** Phase 1 - Check Blocks and Sizes
** Phase 2 - Check Pathnames
** Phase 3a - Check Connectivity
** Phase 3b - Verify Shadows/ACLs
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cylinder Groups
CORRECT GLOBAL SUMMARY
SALVAGE? <userinput>y</userinput>


UPDATE STANDARD SUPERBLOCK? <userinput>y</userinput>

81 files, 3609 used, 243605 free (117 frags, 30436 blocks, 0.0% 
fragmentation)

***** FILE SYSTEM WAS MODIFIED *****</screen>
</listitem>
</itemizedlist><para>The following example illustrates what would happen if you specified <command>fsck</command>'s <option>y</option> option in a damaged superblock scenario.
You are automatically dropped out of the <command>fsck</command> session.
A message is displayed to rerun it with the alternate superblock. </para><screen># <userinput>fsck -y /dev/dsk/c1t2d0s0</userinput>
# 
** /dev/rdsk/c1t2d0s0
BAD SUPERBLOCK AT BLOCK 16: BLOCK SIZE LARGER THAN MAXIMUM SUPPORTED

LOOK FOR ALTERNATE SUPERBLOCKS WITH MKFS?  yes


LOOK FOR ALTERNATE SUPERBLOCKS WITH NEWFS?  yes

SEARCH FOR ALTERNATE SUPERBLOCKS FAILED.

USE GENERIC SUPERBLOCK FROM MKFS?  yes

CALCULATED GENERIC SUPERBLOCK WITH MKFS
If filesystem was created with manually-specified geometry, using
auto-discovered superblock may result in irrecoverable damage to
filesystem and user data.

CANCEL FILESYSTEM CHECK?  yes

Please verify that the indicated block contains a proper
superblock for the filesystem (see fsdb(1M)).

FSCK was running in YES mode.  If you wish to run in that mode using
the alternate superblock, run `fsck -y -o b=453920 /dev/rdsk/c1t2d0s0'.</screen><para>The following <command>fsck</command> error message scenario illustrates
the new prompts for the backup superblock, but the <command>fsck</command> run
is not canceled, in this example. Canceling the <command>fsck</command> session
would be an appropriate response if this file system was created with customized
parameters or if there is some other concern about running <command>fsck</command> on
this file system.</para><para>The various superblock error conditions are provided in <emphasis>italics</emphasis> as
follows:</para><screen># <userinput>fsck /dev/rdsk/c0t1d0s0</userinput>

** /dev/rdsk/c0t1d0s0

<replaceable>BAD SUPERBLOCK AT BLOCK 16: BLOCK SIZE LARGER THAN MAXIMUM SUPPORTED</replaceable>
<replaceable>BAD SUPERBLOCK AT BLOCK 16: NUMBER OF DATA BLOCKS OUT OF RANGE</replaceable>
<replaceable>BAD SUPERBLOCK AT BLOCK 16: INODES PER GROUP OUT OF RANGE</replaceable>
<replaceable>BAD SUPERBLOCK AT BLOCK 16: MAGIC NUMBER WRONG</replaceable>
<replaceable>BAD SUPERBLOCK AT BLOCK 16: BAD VALUES IN SUPER BLOCK</replaceable>
<replaceable>BAD SUPERBLOCK AT BLOCK 16: NCG OUT OF RANGE</replaceable>
<replaceable>BAD SUPERBLOCK AT BLOCK 16: CPG OUT OF RANGE</replaceable>
<replaceable>BAD SUPERBLOCK AT BLOCK 16: NCYL IS INCONSISTENT WITH NCG*CPG</replaceable>
<replaceable>BAD SUPERBLOCK AT BLOCK 16: SIZE OUT OF RANGE</replaceable>
<replaceable>BAD SUPERBLOCK AT BLOCK 16: NUMBER OF DIRECTORIES OUT OF RANGE</replaceable>
<replaceable>BAD SUPERBLOCK AT BLOCK 16: ROTATIONAL POSITION TABLE SIZE OUT OF RANGE</replaceable>
<replaceable>BAD SUPERBLOCK AT BLOCK 16: SIZE OF CYLINDER GROUP SUMMARY AREA WRONG</replaceable>
<replaceable>BAD SUPERBLOCK AT BLOCK 16: INOPB NONSENSICAL RELATIVE TO BSIZE</replaceable>

LOOK FOR ALTERNATE SUPERBLOCKS WITH MKFS? <userinput>yes</userinput>

FOUND ALTERNATE SUPERBLOCK 32 WITH MKFS

USE ALTERNATE SUPERBLOCK? <userinput>yes</userinput>

FOUND ALTERNATE SUPERBLOCK AT 32 USING MKFS
If filesystem was created with manually-specified geometry, using
auto-discovered superblock may result in irrecoverable damage to
filesystem and user data.

CANCEL FILESYSTEM CHECK? <userinput>no</userinput>

** Last Mounted on 
** Phase 1 - Check Blocks and Sizes
** Phase 2a - Check Duplicated Names
** Phase 2b - Check Pathnames
** Phase 3a - Check Connectivity
** Phase 3b - Verify Shadows/ACLs
** Phase 4 - Check Reference Counts
** Phase 5 - Check Cylinder Groups

SALVAGE? <userinput>yes</userinput>


UPDATE STANDARD SUPERBLOCK? <userinput>yes</userinput>

82 files, 3649 used, 244894 free (6 frags, 30611 blocks, 0.0% 
fragmentation)

***** FILE SYSTEM WAS MODIFIED *****</screen>
</sect3><sect3 id="gagch"><title><command>fsck</command> Reports When it Needs to
be Rerun</title><para>Better reporting by <command>fsck</command> about when it needs to be
rerun should alleviate the time and necessity of running it multiple times,
which can be particularly time consuming on large file systems.</para><para>The following new messages prompt you to rerun the <command>fsck</command> utility
at the end of an error scenario:</para><screen>***** PLEASE RERUN FSCK *****</screen><para>Or:</para><screen>Please rerun fsck(1M) to correct this.</screen><para>These new prompts resolve the previous difficulty in determining whether <command>fsck</command> should be rerun or not.</para><para>Unless you are prompted to rerun <command>fsck</command> as in the above
messages, there is no need to run <command>fsck</command>, even after you
see the following message:</para><screen>***** FILE SYSTEM WAS MODIFIED *****</screen><para>However, it doesn't harm the file system to rerun <command>fsck</command> after
this message. This message is just informational about <command>fsck</command>'s
corrective actions.</para>
</sect3><sect3 id="gagay"><title>New <command>fsck</command> Messages Regarding Extended
Attributes</title><para>New <command>fsck</command> messages are included that report on and
repair files with extended attributes. For example:</para><screen>BAD ATTRIBUTE REFERENCE TO I=1 FROM I=96</screen><screen>Attribute directory I=97 not attached to file I=96
  I=96  OWNER=root MODE=40755
SIZE=512 MTIME=Jul 21 16:23 2005 
DIR= &lt;xattr> 

FIX?  <userinput>yes</userinput></screen><screen>ZERO LENGTH ATTR DIR I=12  OWNER=root MODE=160755
SIZE=0 MTIME=Jul 21 16:25 2005 
CLEAR?  <userinput>yes</userinput></screen><screen>File should BE marked as extended attribute
  I=22  OWNER=root MODE=100644
SIZE=0 MTIME=Jul 21 16:36 2005 
FILE=  &lt;xattr>

FIX?  <userinput>yes</userinput></screen><screen>UNREF ATTR DIR  I=106  OWNER=root MODE=160755
SIZE=512 MTIME=Jul 21 16:36 2005 
RECONNECT?  <userinput>yes</userinput></screen><screen>File I=107 should NOT be marked as extended attribute
  I=107  OWNER=root MODE=100644
SIZE=0 MTIME=Jul 21 16:36 2005 
FILE=?/attfsdir-7-att

FIX?  <userinput>yes</userinput>
DIR I=106 CONNECTED.</screen>
</sect3><sect3 id="gagbr"><title>Better Handling of Duplicate Blocks or Fragments</title><para>The <command>fsck</command> error messages now reports information about
blocks, fragments, or a LFNs, which are the logical fragment numbers from
the start of the file. For example, you might see output similar to the following:</para><screen>** Phase 1 - Check Blocks and Sizes
FRAGMENT 784 DUP I=38 LFN 0
FRAGMENT 785 DUP I=38 LFN 1
FRAGMENT 786 DUP I=38 LFN 2
.
.
.</screen><para><command>fsck</command> processes objects as fragments, but in previous
Solaris releases, only reported object information as blocks. It now correctly
reports as fragments.</para><para>If <command>fsck</command> finds error conditions that involve duplicate
blocks or fragments, <command>fsck</command> offers to display the uncleared
files at end of the <command>fsck</command> output. For example, you might
see output similar to the following:</para><screen>LIST REMAINING DUPS?  <userinput>yes</userinput>

Some blocks that were found to be in multiple files are still
assigned to file(s).
Fragments sorted by inode and logical offsets:
Inode 38:
  Logical Offset  0x00000000               Physical Fragment  784
  Logical Offset  0x00000800               Physical Fragment  786
  Logical Offset  0x00001000               Physical Fragment  788
  Logical Offset  0x00001800               Physical Fragment  790</screen><para>Then, you can use the <command>find -i</command> <replaceable>inode-number</replaceable> command
to identify the name of inode 38, in this example.</para>
</sect3>
</sect2>
</sect1><sect1 id="fsoverview-62"><title>Where to Find File System Management Tasks</title><para>Use these references to find step-by-step instructions for managing
file systems.</para><informaltable frame="topbot"><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="colspec0" colwidth="50*"/><colspec colname="colspec1" colwidth="50*"/><thead><row rowsep="1"><entry><para>File System Management Task</para>
</entry><entry><para>For More Information</para>
</entry>
</row>
</thead><tbody><row><entry><para>Create new file systems.</para>
</entry><entry><para><olink targetptr="fscreate-96442" remap="internal">Chapter&nbsp;17, Creating UFS, TMPFS,
and LOFS File Systems (Tasks)</olink> and <olink targetptr="fscachefs-70682" remap="internal">Chapter&nbsp;19,
Using The CacheFS File System (Tasks)</olink></para>
</entry>
</row><row><entry><para>Make local and remote files available to users.</para>
</entry><entry><para><olink targetptr="fsmount-42780" remap="internal">Chapter&nbsp;18, Mounting and Unmounting
File Systems (Tasks)</olink></para>
</entry>
</row><row><entry><para>Connect and configure new disk devices.</para>
</entry><entry><para><olink targetptr="disksconcepts-29477" remap="internal">Chapter&nbsp;10, Managing Disks
(Overview)</olink></para>
</entry>
</row><row><entry><para>Design and implement a backup schedule and restore files and file systems,
as needed.</para>
</entry><entry><para><olink targetptr="bkupconcepts-57422" remap="internal">Chapter&nbsp;23, Backing Up and
Restoring File Systems (Overview)</olink></para>
</entry>
</row><row><entry><para>Check for and correct file system inconsistencies.</para>
</entry><entry><para><olink targetptr="fstroublefsck-61446" remap="internal">Chapter&nbsp;21, Checking UFS
File System Consistency (Tasks)</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect1><sect1 id="fsoverview-51"><title>Overview of File Systems</title><para>A file system is a structure of directories that is used to organize
and store files. The term <replaceable>file system</replaceable> is used to
describe the following:</para><itemizedlist><listitem><para>A particular type of file system:  disk-based, network-based,
or virtual</para>
</listitem><listitem><para>The entire file tree, beginning with the root (<filename>/</filename>)
directory</para>
</listitem><listitem><para>The data structure of a disk slice or other media storage
device</para>
</listitem><listitem><para>A portion of a file tree structure that is attached to a mount
point on the main file tree so that the files are accessible</para>
</listitem>
</itemizedlist><para>Usually, you know from the context which meaning is intended.</para><para>The Solaris OS uses the <emphasis>virtual file system</emphasis> (VFS)
architecture, which provides a standard interface for different file system
types. The VFS architecture enables the kernel to handle basic operations,
such as reading, writing, and listing files. The VFS architecture also makes
it easier to add new file systems.</para><sect2 id="fsoverview-20860"><title>Types of File Systems</title><para>The Solaris OS supports three types of file systems:</para><itemizedlist><listitem><para>Disk-based</para>
</listitem><listitem><para>Network-based</para>
</listitem><listitem><para>Virtual</para>
</listitem>
</itemizedlist><para>To identify the file system type, see <olink targetptr="fsoverview-28729" remap="internal">Determining
a File System's Type</olink>.</para><sect3 id="fsoverview-1"><title>Disk-Based File Systems</title><para><emphasis>Disk-based file systems</emphasis> are stored on physical
media such as hard disks, CD-ROMs, and diskettes. Disk-based file systems
can be written in different formats. The available formats are described in
the following table.</para><informaltable frame="topbot"><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="colspec0" colwidth="27.47*"/><colspec colname="colspec1" colwidth="72.53*"/><thead><row rowsep="1"><entry><para>Disk-Based File System</para>
</entry><entry><para>Format Description</para>
</entry>
</row>
</thead><tbody><row><entry><para>UFS</para>
</entry><entry><para>UNIX file system (based on the BSD Fat Fast File system that was provided
in the 4.3 Tahoe release).  UFS is the default disk-based file system for
the Solaris OS.</para><para>Before you can create a UFS file system on a disk, you must format the
disk and divide it into slices. For information on formatting disks and dividing
disks into slices, see <olink targetptr="disksconcepts-29477" remap="internal">Chapter&nbsp;10,
Managing Disks (Overview)</olink>.</para>
</entry>
</row><row><entry><para>ZFS</para>
</entry><entry><para>The ZFS file system is new in the  Solaris
Express release. For more information, see the <olink targetdoc="zfsadmin" remap="external"><citetitle remap="book">ZFS Administration Guide</citetitle></olink>.</para>
</entry>
</row><row><entry><para>HSFS</para>
</entry><entry><para>High Sierra, Rock Ridge, and ISO 9660 file system. High Sierra is the
first CD-ROM file system. ISO 9660 is the official standard version of the
High Sierra file system. The HSFS file system is used on CD-ROMs, and is a
read-only file system. Solaris HSFS supports Rock Ridge extensions to ISO
9660. When present on a CD-ROM, these extensions provide all UFS file system
features and file types, except for writability and hard links.</para>
</entry>
</row><row><entry><para>PCFS</para>
</entry><entry><para>PC file system, which allows read- and write- access to data and programs
on DOS-formatted disks that are written for DOS-based personal computers.</para>
</entry>
</row><row><entry><para>UDFS</para>
</entry><entry><para>The Universal Disk Format (UDFS) file system, the industry-standard
format for storing information on the optical media technology called DVD
(Digital Versatile Disc or Digital Video Disc). </para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable><para>Each type of disk-based file system is customarily associated with a
particular media device, as follows:</para><itemizedlist><listitem><para>UFS with hard disk</para>
</listitem><listitem><para>HSFS with CD-ROM</para>
</listitem><listitem><para>PCFS with diskette</para>
</listitem><listitem><para>UDF with DVD</para>
</listitem>
</itemizedlist><para>However, these associations are not restrictive. For example, CD-ROMs
and diskettes can have UFS file systems created on them.</para><sect4 id="fsoverview-8"><title>The Universal Disk Format (UDFS) File System</title><para>For information about creating a UDFS file system on removable media,
see <olink targetptr="medintro-57" remap="internal">How to Create a File System on Removable
Media</olink>.</para><para>The UDF file system is the industry-standard format for storing information
on <emphasis>DVD</emphasis> (Digital Versatile Disc or Digital Video Disc)
optical media.</para><para>The UDF file system is provided as dynamically loadable 32-bit and 64-bit
modules, with system administration utilities for creating, mounting, and
checking the file system on both SPARC and x86 platforms. The Solaris UDF
file system works with supported ATAPI and SCSI DVD drives, CD-ROM devices,
and disk and diskette drives. In addition, the Solaris UDF file system is
fully compliant with the UDF 1.50 specification.</para><para>The UDF file system provides the following features:</para><itemizedlist><listitem><para>Ability to access the industry-standard CD-ROM and DVD-ROM
media when they contain a UDF file system</para>
</listitem><listitem><para>Flexibility in exchanging information across platforms and
operating systems</para>
</listitem><listitem><para>A mechanism for implementing new applications rich in broadcast-quality
video, high-quality sound, and interactivity using the DVD video specification
based on UDF format</para>
</listitem>
</itemizedlist><para>The following features are not included in the UDF file system:</para><itemizedlist><listitem><para>Support for write-once media, (CD-RW), with either the sequential
disk-at-once recording and incremental recording</para>
</listitem><listitem><para>UFS components such as quotas, ACLs, transaction logging,
file system locking, and file system threads, which are not part of the UDF
1.50 specification</para>
</listitem>
</itemizedlist><para>The UDF file system requires the following:</para><itemizedlist><listitem><para>At least the Solaris 7 11/99 release</para>
</listitem><listitem><para>Supported SPARC or x86 platform</para>
</listitem><listitem><para>Supported CD-ROM or DVD-ROM device</para>
</listitem>
</itemizedlist><para>The Solaris UDF file system implementation provides the following:</para><itemizedlist><listitem><para>Support for industry-standard read/write UDF version 1.50</para>
</listitem><listitem><para>Fully internationalized file system utilities</para>
</listitem>
</itemizedlist>
</sect4>
</sect3><sect3 id="fsoverview-2"><title>Network-Based File Systems</title><para><emphasis>Network-based file systems</emphasis> can be accessed from
the network. Typically, network-based file systems reside on one system, typically
a server, and are accessed by other systems across the network.</para><para>With NFS, you can administer distributed <emphasis>resources</emphasis> (files
or directories) by exporting them from a server and mounting them on individual
clients. For more information, see <olink targetptr="fsoverview-78649" remap="internal">The
NFS Environment</olink>.</para>
</sect3><sect3 id="fsoverview-3"><title>Virtual File Systems</title><para><emphasis>Virtual file systems</emphasis> are memory-based file systems
that provide access to special kernel information and facilities. Most virtual
file systems do not use file system disk space. However, the CacheFS file
system uses a file system on the disk to contain the cache. Also, some virtual
file systems, such as the temporary file system (TMPFS), use the swap space
on a disk.</para><sect4 id="fsoverview-4"><title>CacheFS File System</title><para>The <trademark>CacheFS</trademark> file system can be used to improve
the performance of remote file systems or slow devices such as CD-ROM drives.
When a file system is cached, the data that is read from the remote file system
or CD-ROM is stored in a cache on the local system.</para><para>If you want to improve the performance and scalability of an NFS or
CD-ROM file system, you should use the CacheFS file system. The CacheFS software
is a general purpose caching mechanism for file systems that improves NFS
server performance and scalability by reducing server and network load. </para><para>Designed as a layered file system, the CacheFS software provides the
ability to cache one file system on another. In an NFS environment, CacheFS
software increases the client per server ratio, reduces server and network
loads, and improves performance for clients on slow links, such as Point-to-Point
Protocol (PPP). You can also combine a CacheFS file system with the AutoFS
service to help boost performance and scalability.</para><para>For detailed information about the CacheFS file system, see <olink targetptr="fscachefs-70682" remap="internal">Chapter&nbsp;19, Using The CacheFS File System
(Tasks)</olink>.</para>
</sect4><sect4 id="fsoverview-67"><title>NFS Version 4 and CacheFS Compatibility Issues</title><para>If both the CacheFS client and the CacheFS server are running NFS version
4, files are no longer cached in a front file system. All file access is provided
by the back file system. Also, since no files are being cached in the front
file system, CacheFS-specific mount options, which are meant to affect the
front file system, are ignored. CacheFS-specific mount options do not apply
to the back file system.</para><note><para>The first time you configure your system for NFS version 4, a
warning appears on the console to indicate that caching is no longer performed.</para>
</note><para>If you want to implement your CacheFS mounts as in previous Solaris
releases, then specify NFS version 3 in your CacheFS <command>mount</command> commands.
For example:</para><screen>mount -F cachefs -o backfstype=nfs,cachedir=/local/mycache,vers=3 
starbug:/docs /docs</screen>
</sect4><sect4 id="fsoverview-99307"><title>Temporary File System</title><para>The temporary file system (TMPFS) uses local memory for file system
reads and writes. Typically, using memory for file system reads and writes
is much faster than using a UFS file system. Using TMPFS can improve system
performance by saving the cost of reading and writing temporary files to a
local disk or across the network.  For example, temporary files are created
when you compile a program. The OS generates a much disk activity or network
activity while manipulating these files. Using TMPFS to hold these temporary
files can significantly speed up their creation, manipulation, and deletion.</para><para>Files in TMPFS file systems are not permanent. These files are deleted
when the file system is unmounted and when the system is shut down or rebooted.</para><para>TMPFS is the default
file system type for the <filename>/tmp</filename> directory in the Solaris OS.
You can copy or move files into or out of the <filename>/tmp</filename> directory,
just as you would in a UFS file system.   </para><para>The TMPFS file system uses swap space as a temporary backing store.
If a system with a TMPFS file system does not have adequate swap space, two
problems can occur:</para><itemizedlist><listitem><para>The TMPFS file system can run out of space, just as regular
file systems do.</para>
</listitem><listitem><para>Because TMPFS allocates swap space to save file data (if necessary),
some programs might not execute because of insufficient swap space.</para>
</listitem>
</itemizedlist><para>For information about creating TMPFS file systems, see <olink targetptr="fscreate-96442" remap="internal">Chapter&nbsp;17, Creating UFS, TMPFS, and LOFS
File Systems (Tasks)</olink>.  For information about increasing swap space,
see <olink targetptr="fsswap-14677" remap="internal">Chapter&nbsp;20, Configuring Additional
Swap Space (Tasks)</olink>.</para>
</sect4><sect4 id="fsoverview-5"><title>The Loopback File System</title><para>The loopback file system (LOFS) lets you create a new virtual file system
so that you can access files by using an alternative path name.  For example,
you can create a loopback mount of the root <filename>(/)</filename> directory
on <filename>/tmp/newroot</filename>. This loopback mounts make the entire
file system hierarchy appear as if it is duplicated under <filename>/tmp/newroot</filename>,
including any file systems mounted from NFS servers. All files will be accessible
either with a path name starting from root (<filename>/</filename>), or with
a path name that starts from <filename>/tmp/newroot</filename>.</para><para>For information on how to create LOFS file systems, see <olink targetptr="fscreate-96442" remap="internal">Chapter&nbsp;17, Creating UFS, TMPFS, and LOFS
File Systems (Tasks)</olink>.</para>
</sect4><sect4 id="fsoverview-6"><title>Process File System</title><para>The process file system (PROCFS) resides in memory and contains
a list of active processes, by process number, in the <filename>/proc</filename> directory.
Information in the <filename>/proc</filename> directory is used by commands
such as <command>ps</command>. Debuggers and other development tools can also
access the address space of the processes by using file system calls.</para><caution><para>Do not delete files in the <filename>/proc</filename> directory.  The deletion of processes from the <filename>/proc</filename> directory
does not kill them. <filename>/proc</filename> files do not use disk space,
so there is no reason to delete files from this directory. </para>
</caution><para>The <filename>/proc</filename> directory does not require administration.</para>
</sect4><sect4 id="fsoverview-7"><title>Additional Virtual File Systems</title><para>These additional types of virtual file systems are listed for your information.
They do not require administration.</para><informaltable frame="topbot"><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="colspec0" colwidth="36.36*"/><colspec colname="colspec1" colwidth="63.64*"/><thead><row rowsep="1"><entry><para>Virtual File System</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para>CTFS</para>
</entry><entry><para>CTFS (the contract file system) is the interface for creating, controlling,
and observing contracts. A contract enhances the     relationship between
a process and the system resources it depends on by providing richer error
reporting and (optionally) a means of     delaying the removal of a resource.</para><para>The service management facility (SMF) uses process contracts (a type
of contract) to track the processes which compose a service, so that a failure
in a part of a multi-process service can be identified as a failure of that
service.</para>
</entry>
</row><row><entry><para>FIFOFS (first-in first-out)</para>
</entry><entry><para>Named pipe files that give processes common access to data </para>
</entry>
</row><row><entry><para>FDFS (file descriptors)</para>
</entry><entry><para>Provides explicit names for opening files by using file descriptors</para>
</entry>
</row><row><entry><para>MNTFS</para>
</entry><entry><para>Provides read-only access to the table of mounted file systems for the
local system</para>
</entry>
</row><row><entry><para>NAMEFS</para>
</entry><entry><para>Used mostly by STREAMS for dynamic mounts of file descriptors on top
of files</para>
</entry>
</row><row><entry><para>OBJFS</para>
</entry><entry><para>The OBJFS (object) file system describes the state of all modules currently
loaded by the kernel. This file system is used by debuggers to access information
about kernel symbols without having to access the kernel directly.</para>
</entry>
</row><row><entry><para>SPECFS (special)</para>
</entry><entry><para>Provides access to character special devices and block devices</para>
</entry>
</row><row><entry><para>SWAPFS</para>
</entry><entry><para>Used by the kernel for swapping</para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect4><sect4 id="gdsgm"><title><filename>libc_hwcap</filename></title><para>The mount output on an x86 system might include a loopback mount of
a <filename>libc_hwcap</filename> library, a hardware-optimized implementation
of <filename>libc</filename>.  This <filename>libc</filename> implementation
is intended to optimize the performance of 32-bit applications.</para><para>This loopback mount requires no administration and consumes no disk
space.</para>
</sect4>
</sect3><sect3 id="fsoverview-61"><title>Extended File Attributes</title><para>The UFS, NFS, and TMPFS file systems have been enhanced to include extended
file attributes. Extended file attributes enable application developers to
associate specific attributes to a file. For example, a developer of an application
used to manage a windowing system might choose to associate a display icon
with a file. Extended file attributes are logically represented as files within
a hidden directory that is associated with the target file.</para><para>You can use the <command>runat</command> command to add attributes and
execute shell commands in the extended attribute namespace. This namespace
is a hidden attribute directory that is associated with the specified file. </para><para>To use the <command>runat</command> command to add attributes to a file,
you first have to create the attributes file.</para><screen>$ <userinput>runat filea cp /tmp/attrdata attr.1</userinput></screen><para>Then, use the <command>runat</command> command to list the attributes
of the file.</para><screen>$ <userinput>runat filea ls -l</userinput></screen><para>For more information, see the <olink targetdoc="refman1" targetptr="runat-1" remap="external"><citerefentry><refentrytitle>runat</refentrytitle><manvolnum>1</manvolnum></citerefentry></olink> man page.</para><para>Many Solaris file system commands have been modified to support file
system attributes by providing an attribute-aware option. Use this option
to query, copy, or find file attributes. For more information, see the specific
man page for each file system command.</para>
</sect3><sect3 id="fsoverview-42137"><title>Swap Space</title><para>The Solaris OS uses some disk slices for temporary storage rather than
for file systems. These slices are called <emphasis>swap</emphasis> slices,
or <emphasis>swap space</emphasis>. Swap space is used for virtual memory
storage areas when the system does not have enough physical memory to handle
current processes. </para><para>Since many applications rely on swap space, you should know how to plan
for, monitor, and add more swap space, when needed. For an overview about
swap space and instructions for adding swap space, see <olink targetptr="fsswap-14677" remap="internal">Chapter&nbsp;20, Configuring Additional Swap Space
(Tasks)</olink>.</para>
</sect3>
</sect2>
</sect1><sect1 id="fsoverview-95856"><title>Commands for File System Administration</title><para>Most
commands for file system administration have both a generic component and
a file system&ndash;specific component. Whenever possible, you should use
the generic commands, which call the file system&ndash;specific component.
The following table lists the generic commands for file system administration.
These commands are located in the <filename>/usr/sbin</filename> directory.</para><table frame="topbot" id="fsoverview-66302"><title>Generic  Commands for File
System Administration</title><tgroup cols="3" colsep="0" rowsep="0"><colspec colname="colspec5" colwidth="108.00*"/><colspec colname="colspec4" colwidth="251.00*"/><colspec colname="colspec0" colwidth="108.00*"/><thead><row rowsep="1"><entry><para>Command</para>
</entry><entry><para>Description</para>
</entry><entry><para>Man Page</para>
</entry>
</row>
</thead><tbody><row><entry><para><command>clri</command></para>
</entry><entry><para>Clears inodes</para>
</entry><entry><para><olink targetdoc="refman1m" targetptr="clri-1m" remap="external"><citerefentry><refentrytitle>clri</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><command>df</command></para>
</entry><entry><para>Reports the number of free disk blocks and files</para>
</entry><entry><para><olink targetdoc="refman1m" targetptr="df-1m" remap="external"><citerefentry><refentrytitle>df</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><command>ff</command></para>
</entry><entry><para>Lists file names and statistics for a file system</para>
</entry><entry><para><olink targetdoc="refman1m" targetptr="ff-1m" remap="external"><citerefentry><refentrytitle>ff</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><command>fsck</command></para>
</entry><entry><para>Checks the integrity of a file system and repairs any damage found</para>
</entry><entry><para><olink targetdoc="refman1m" targetptr="fsck-1m" remap="external"><citerefentry><refentrytitle>fsck</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><command>fsdb</command></para>
</entry><entry><para>Debugs the file system</para>
</entry><entry><para><olink targetdoc="refman1m" targetptr="fsdb-1m" remap="external"><citerefentry><refentrytitle>fsdb</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><command>fstyp</command></para>
</entry><entry><para>Determines the file system type</para>
</entry><entry><para><olink targetdoc="refman1m" targetptr="fstyp-1m" remap="external"><citerefentry><refentrytitle>fstyp</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><command>labelit</command></para>
</entry><entry><para>Lists or provides labels for file systems when they are copied to tape
(for use only by the <command>volcopy</command> command)</para>
</entry><entry><para><olink targetdoc="refman1m" targetptr="labelit-1m" remap="external"><citerefentry><refentrytitle>labelit</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><command>mkfs</command></para>
</entry><entry><para>Creates a new file system</para>
</entry><entry><para><olink targetdoc="refman1m" targetptr="mkfs-1m" remap="external"><citerefentry><refentrytitle>mkfs</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><command>mount</command></para>
</entry><entry><para>Mounts local and remote file systems</para>
</entry><entry><para><olink targetdoc="refman1m" targetptr="mount-1m" remap="external"><citerefentry><refentrytitle>mount</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><command>mountall</command></para>
</entry><entry><para>Mounts all file systems that are specified in the virtual file system table (<filename>/etc/vfstab</filename>)</para>
</entry><entry><para><olink targetdoc="refman1m" targetptr="mountall-1m" remap="external"><citerefentry><refentrytitle>mountall</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><command>ncheck</command></para>
</entry><entry><para>Generates a list of path names with their inode numbers</para>
</entry><entry><para><olink targetdoc="refman1m" targetptr="ncheck-1m" remap="external"><citerefentry><refentrytitle>ncheck</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><command>umount</command></para>
</entry><entry><para>Unmounts local and remote file systems</para>
</entry><entry><para><olink targetdoc="refman1m" targetptr="mount-1m" remap="external"><citerefentry><refentrytitle>mount</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><command>umountall</command></para>
</entry><entry><para>Unmounts all file systems that are specified in the virtual file system table (<filename>/etc/vfstab</filename>)</para>
</entry><entry><para><olink targetdoc="refman1m" targetptr="mountall-1m" remap="external"><citerefentry><refentrytitle>mountall</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row><row><entry><para><command>volcopy</command></para>
</entry><entry><para>Creates an image copy of a file system</para>
</entry><entry><para><olink targetdoc="refman1m" targetptr="volcopy-1m" remap="external"><citerefentry><refentrytitle>volcopy</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink></para>
</entry>
</row>
</tbody>
</tgroup>
</table><sect2 id="fsoverview-10"><title>How File System Commands Determine the File
System Type</title><para>The generic file system commands determine the file system type by following
this sequence:</para><orderedlist><listitem><para>From the <option>F</option> option, if supplied.</para>
</listitem><listitem><para>By matching a special device with an entry in the <filename>/etc/vfstab</filename> file (if the <replaceable>special</replaceable> device is supplied).
 For example, <command>fsck</command> first looks for a match against the <filename>fsck device</filename> field. If no match is found, the command then checks
the <replaceable>special</replaceable> device field.</para>
</listitem><listitem><para>By using the default specified in the <filename>/etc/default/fs</filename> file
for local file systems and in the <filename>/etc/dfs/fstypes</filename> file
for remote file systems.</para>
</listitem>
</orderedlist>
</sect2><sect2 id="fsoverview-11"><title>Manual Pages for Generic and Specific File
System Commands</title><para>Both the generic commands and specific commands have manual pages in
the <olink targetdoc="refman1m" remap="external"><citetitle remap="book">man pages section 1M: System Administration Commands</citetitle></olink>. The manual pages for
the generic file system commands provide information about generic command
options only. The manual page for a specific file system command has information
about options for that file system. To look at a manual page for a specific
file system, append an underscore and the abbreviation for the file system
type to the generic command name. For example, to see the specific manual
page for mounting a UFS file system, type the following:</para><screen>$ <userinput>man mount_ufs</userinput></screen>
</sect2>
</sect1><sect1 id="fsoverview-43247"><title>Default Solaris File Systems</title><para>The Solaris UFS file system is hierarchical, starting with the root
directory (<filename>/</filename>) and continuing downwards through a number
of directories. The Solaris installation process enables you to install a
default set of directories and uses a set of conventions to group similar
types of files together.</para><para>For a description of the contents of Solaris file systems and directories,
see <olink targetdoc="refman5" targetptr="filesystem-5" remap="external"><citerefentry><refentrytitle>filesystem</refentrytitle><manvolnum>5</manvolnum></citerefentry></olink>.</para><para>The following table provides a summary of the default Solaris file systems.</para><table frame="topbot" id="fsoverview-47519"><title>The Default Solaris
File Systems</title><tgroup cols="3" colsep="0" rowsep="0"><colspec colname="column1" colwidth="79*"/><colspec colname="column2" colwidth="64*"/><colspec colname="column3" colwidth="215*"/><thead><row rowsep="1"><entry><para>File System or Directory</para>
</entry><entry><para>File System Type</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para>root
(<filename>/</filename>)  </para>
</entry><entry><para>UFS</para>
</entry><entry><para>The top of the hierarchical file tree. The root (<filename>/</filename>)
directory contains the directories and files that are critical for system
operation, such as the kernel, the device drivers, and the programs used to
boot the system.  The root (<filename>/</filename>) directory also contains
the mount point directories where local and remote file systems can be attached
to the file tree.</para>
</entry>
</row><row><entry><para><filename>/usr</filename></para>
</entry><entry><para>UFS</para>
</entry><entry><para>System files and directories that can be shared with other users. Files
that run only on certain types of systems are in the <filename>/usr</filename> file
system (for example, SPARC executables). Files that can be used on all types
of systems, such as the man pages, are in the <filename>/usr/share</filename> directory.</para>
</entry>
</row><row><entry><para><filename>/export/home</filename> or <filename>/home</filename></para>
</entry><entry><para>NFS, UFS</para>
</entry><entry><para>The mount point for user home directories, which store user work files.
By default, the <filename>/home</filename> directory is an automounted file
system. On stand-alone systems, the <filename>/home</filename> directory might
be a UFS file system on a local disk slice.</para>
</entry>
</row><row><entry><para><filename>/var</filename></para>
</entry><entry><para>UFS</para>
</entry><entry><para>System files and directories that are likely to change or grow over
the life of the local system. These include system logs, <command>vi</command> and <command>ex</command> backup files, and <command>uucp</command> files.</para>
</entry>
</row><row><entry><para><filename>/opt</filename>  </para>
</entry><entry><para>NFS, UFS</para>
</entry><entry><para>Optional mount point for third-party software. On some systems, the <filename>/opt</filename> directory might be a UFS file system on a local disk slice.</para>
</entry>
</row><row><entry><para><filename>/tmp</filename> </para>
</entry><entry><para>TMPFS</para>
</entry><entry><para>Temporary files, which are removed each time the system is booted or
the <filename>/tmp</filename> file system is unmounted.</para>
</entry>
</row><row><entry><para><filename>/proc</filename>  </para>
</entry><entry><para>PROCFS</para>
</entry><entry><para>A list of active processes, by process number.</para>
</entry>
</row><row><entry><para><filename>/etc/mnttab</filename></para>
</entry><entry><para>MNTFS</para>
</entry><entry><para>A virtual
file system that provides read-only access to the table of mounted file systems
for the local system.</para>
</entry>
</row><row><entry><para><filename>/var/run</filename></para>
</entry><entry><para>TMPFS</para>
</entry><entry><para>A memory-based file system for storing temporary files that are not
needed after the system is booted.</para>
</entry>
</row><row><entry><para><filename>/system/contract</filename></para>
</entry><entry><para>CTFS</para>
</entry><entry><para>A virtual file system that maintains contract information.</para>
</entry>
</row><row><entry><para><filename>/system/object</filename></para>
</entry><entry><para>OBJFS</para>
</entry><entry><para>A virtual file system that is used by debuggers to access information
about kernel symbols without having to access the kernel directly. </para>
</entry>
</row>
</tbody>
</tgroup>
</table><para>The root (<filename>/</filename>) and <filename>/usr</filename> file
systems are required to run a system. Some of the most basic commands in the <filename>/usr</filename> file system (like <command>mount</command>) are also included
in the root (<filename>/</filename>) file system. As such, they are available
when the system boots or is in single-user mode, and <filename>/usr</filename> is
not mounted. For more detailed information on the default directories for
the root (<filename>/</filename>) and <filename>/usr</filename> file systems,
see <olink targetptr="fsfilesysappx-94408" remap="internal">Chapter&nbsp;22, UFS File System
(Reference)</olink>.</para>
</sect1><sect1 id="fsoverview-12343"><title>UFS File System</title><para>UFS is the default disk-based file system in Solaris OS. Most often,
when you administer a disk-based file system, you are administering UFS file
systems. UFS provides the following features.</para><informaltable frame="topbot"><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="colspec0" colwidth="36.36*"/><colspec colname="colspec1" colwidth="63.64*"/><thead><row rowsep="1"><entry><para>UFS Feature</para>
</entry><entry><para>Description</para>
</entry>
</row>
</thead><tbody><row><entry><para>Extended fundamental types (EFT)</para>
</entry><entry><para>Provides 32-bit user ID (UID), group ID (GID), and device numbers.
 </para>
</entry>
</row><row><entry><para>Large file systems</para>
</entry><entry><para>Allows files of about
1 terabyte in size in a file system that can be up to 16 terabytes in size.
You can create a multiterabyte UFS file system on a disk with an EFI disk
label.</para>
</entry>
</row><row><entry><para>Logging</para>
</entry><entry><para></para><para>UFS logging bundles the multiple metadata changes that comprise a complete
UFS operation into a transaction. Sets of transactions are recorded in an
on-disk log and are applied to the actual UFS file system's metadata.</para>
</entry>
</row><row><entry><para>Multiterabyte file systems</para>
</entry><entry><para>A multiterabyte file system enables creation
of a UFS  file system up to  approximately 16 terabytes of usable space, minus
approximately one percent overhead</para>
</entry>
</row><row><entry><para>State flags</para>
</entry><entry><para>Shows
the state of the file system: clean, stable, active, logging, or unknown.
 These flags eliminate unnecessary file system checks.  If the file system
is &ldquo;clean,&rdquo; &ldquo;stable,&rdquo; or &ldquo;logging,&rdquo; file
system checks are not run.  </para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable><para>For detailed information about the UFS file system structure, see <olink targetptr="fsfilesysappx-94408" remap="internal">Chapter&nbsp;22, UFS File System (Reference)</olink>.</para><sect2 id="fsoverview-46"><title>Planning UFS File Systems</title><para>When laying out file systems, you need to consider possible conflicting
demands.  Here are some suggestions:</para><itemizedlist><listitem><para>Distribute the workload as evenly as possible among different
I/O systems and disk drives. Distribute the <filename>/export/home</filename> file
system and swap space evenly across disks.</para>
</listitem><listitem><para>Keep pieces of projects or members of groups within the same
file system.</para>
</listitem><listitem><para>Use as few file systems per disk as possible. On the system
(or boot) disk, you should have three file systems: root (<filename>/</filename>), <filename>/usr</filename>, and swap space. On other disks, create one or at most two
file systems, with one file system preferrably being additional swap space.
Fewer, roomier file systems cause less file fragmentation than many small,
over crowded file systems. Higher-capacity tape drives and the ability of
the <command>ufsdump</command> command to handle multiple volumes make it
easier to back up larger file systems.</para>
</listitem><listitem><para>If you have some users who consistently create very small
files, consider creating a separate file system with more inodes. However,
most sites do not need to keep similar types of user files in the same file
system.</para>
</listitem>
</itemizedlist><para>For information on default file system parameters as well as procedures
for creating new UFS file systems, see <olink targetptr="fscreate-96442" remap="internal">Chapter&nbsp;17,
Creating UFS, TMPFS, and LOFS File Systems (Tasks)</olink>.</para>
</sect2><sect2 id="fsoverview-18" wordsize="bits64"><title>Support of Multiterabyte
UFS File Systems</title><para>This
Solaris release provides support for multiterabyte UFS file systems on systems
that run a 64-bit Solaris kernel.</para><para>Previously, UFS file systems were limited to approximately 1 terabyte
on both 64-bit and 32-bit systems. All UFS file system commands and utilities
have been updated to support multiterabyte UFS file systems.</para><para>For example, the <command>ufsdump</command> command has been updated
with a larger block size for dumping large UFS file systems:</para><screen># <userinput>ufsdump 0f /dev/md/rdsk/d97 /dev/md/rdsk/d98</userinput>
  DUMP: Date of this level 0 dump: Tue Jan 07 14:23:36 2003
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping /dev/md/rdsk/d98 to /dev/md/rdsk/d97.
  DUMP: Mapping (Pass I) [regular files]
  DUMP: Mapping (Pass II) [directories]
  DUMP: Forcing larger tape block size (2048).
  DUMP: Writing 32 Kilobyte records
  DUMP: Estimated 4390629500 blocks (2143862.06MB).
  DUMP: Dumping (Pass III) [directories]
  DUMP: Dumping (Pass IV) [regular files]</screen><para>Administering UFS file systems that are less than 1 terabyte remains
the same. No administration differences exist between UFS file systems that
are less than one terabyte and file systems that are greater than 1 terabyte.</para><para>You can initially create a UFS file system that is less than 1 terabyte
and specify that it can eventually be expanded into a multiterabyte file system
by using the <command>newfs</command> <option>T</option> option. This option
sets the inode and fragment density to scale appropriately for a multiterabyte
file system.</para><para>Using the <command>newfs</command> <option>T</option> option when you
create a UFS file system less than 1 terabyte on a system running a 32-bit
kernel enables you to eventually expand this file system by using the <command>growfs</command> command when you boot this system under a 64-bit kernel. For more
information, see <olink targetdoc="refman1m" targetptr="newfs-1m" remap="external"><citerefentry><refentrytitle>newfs</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink>.</para><para>You can use the <command>fstyp</command> <option>v</option> command
to identify whether a UFS file system has multiterabyte support by checking
the following value in the magic column:</para><screen># <userinput>/usr/sbin/fstyp -v /dev/md/rdsk/d3 | head -5</userinput>
ufs
magic   decade  format  dynamic time    Fri May 21 11:10:10 2004</screen><para>A UFS file system with no multiterabyte support has the following <command>fstyp</command> output:</para><screen># <userinput>/usr/sbin/fstyp -v /dev/md/rdsk/d0 | head -5</userinput>
ufs
magic   11954   format  dynamic time    Fri May 21 11:46:40 2004</screen><para>You can use the <command>growfs</command> command to expand a UFS file
system to the size of the slice or the volume without loss of service or data.
For more information, see <olink targetdoc="refman1m" targetptr="growfs-1m" remap="external"><citerefentry><refentrytitle>growfs</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink>.</para><para>Two new related features are multiterabyte volume support with the EFI
disk label and multiterabyte volume support with Solaris Volume Manager. For
more information, see <olink targetptr="disksconcepts-14" remap="internal">EFI Disk Label</olink> and
the <olink targetdoc="logvolmgradmin" remap="external"><citetitle remap="book">Solaris Volume Manager Administration Guide</citetitle></olink>.</para><sect3 id="fsoverview-19"><title>Features of Multiterabyte UFS File Systems</title><para>Multiterabyte UFS file systems include the following features:</para><itemizedlist><listitem><para>Provides the ability to create a UFS file system up to 16
terabytes in size.</para>
</listitem><listitem><para>Provides the ability to create a file system less than 16
terabytes that can later be increased in size up to 16 terabytes.</para>
</listitem><listitem><para>Multiterabyte file systems can be created on physical disks,
Solaris Volume Manager's logical volumes, and Veritas' VxVM logical volumes.</para>
</listitem><listitem><para>Multiterabyte file systems benefit from the performance improvements
of having UFS logging enabled. Multiterabyte file systems also benefit from
the availability of logging because the <command>fsck</command> command might
not have to be run when logging is enabled.</para>
</listitem><listitem><para>When you create a partition for your multiterabyte UFS file
system, the disk will be labeled automatically with an EFI disk label. For
more information on EFI disk labels, see <olink targetptr="disksconcepts-14" remap="internal">EFI
Disk Label</olink>.</para>
</listitem><listitem><para>Provides the ability to snapshot a multiterabyte file system
by creating multiple backing store files when a file system is over 512 Gbytes.</para>
</listitem>
</itemizedlist>
</sect3><sect3 id="fsoverview-9"><title>Limitations of Multiterabyte UFS File Systems</title><para>Limitations of multiterabyte UFS file systems are as follows:</para><itemizedlist><listitem><para>This feature is not supported on 32-bit systems.</para>
</listitem><listitem><para>You cannot mount a file system greater than 1 terabyte on
a system that is running a 32-bit Solaris kernel.</para>
</listitem><listitem><para>You cannot boot from a file system greater than 1 terabyte
on a system that is running a 64-bit Solaris kernel. This limitation means
that you cannot put a root (<literal>/</literal>) file system on a multiterabyte
file system.</para>
</listitem><listitem><para>There is no support for individual files greater than 1 terabyte.</para>
</listitem><listitem><para>The maximum number of files is 1 million files per terabyte
of a UFS file system. For example, a 4-terabyte file system can contain 4
million files.</para><para>This limit is intended to reduce the time it takes
to check the file system with the <command>fsck</command> command.</para>
</listitem><listitem><para>The maximum quota that you can set on a multiterabyte UFS
file system is 2 terabytes of 1024-byte blocks.</para>
</listitem>
</itemizedlist>
</sect3><sect3 id="fpypq"><title>Where to Find Multiterabyte UFS Tasks</title><para>Use these references to find step-by-step instructions for working with
multiterabyte UFS file systems.</para><informaltable frame="topbot"><tgroup cols="2" colsep="0" rowsep="0"><colspec colname="colspec0" colwidth="50*"/><colspec colname="colspec1" colwidth="50*"/><thead><row rowsep="1"><entry><para>Multiterabyte UFS Task</para>
</entry><entry><para>For More Information</para>
</entry>
</row>
</thead><tbody><row><entry><para>Create multiterabyte UFS file systems</para>
</entry><entry><para><olink targetptr="fsoverview-14" remap="internal">How to Create a Multiterabyte UFS File
System</olink></para><para><olink targetptr="fsoverview-17" remap="internal">How to Expand a Multiterabyte UFS File
System</olink></para><para><olink targetptr="fsoverview-13" remap="internal">How to Expand a UFS File System to
a Multiterabyte UFS File System</olink></para>
</entry>
</row><row><entry><para>Create a multiterabyte UFS snapshot</para>
</entry><entry><para><olink targetptr="fpypp" remap="internal">Example&nbsp;25&ndash;2</olink></para>
</entry>
</row><row><entry><para>Troubleshoot multiterabyte UFS problems</para>
</entry><entry><para><olink targetptr="fsoverview-15" remap="internal">Troubleshooting Multiterabyte UFS File
System Problems</olink></para>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</sect3>
</sect2><sect2 id="fsoverview-43"><title>UFS Logging</title><para>UFS logging
bundles the multiple metadata changes that comprise a complete UFS operation
into a transaction. Sets of transactions are recorded in an on-disk log. Then,
they are applied to the actual UFS file system's metadata.</para><para>At reboot, the system discards incomplete transactions, but applies
the transactions for completed operations. The file system remains consistent
because only completed transactions are ever applied. This consistency remains
even when a system crashes. A system crash might interrupt system calls and
introduces inconsistencies into a UFS file system.</para><para>UFS logging provides two advantages:</para><itemizedlist><listitem><para>If the file system is already consistent due to the transaction
log, you might not have to run the <command>fsck</command> command after a
system crash or an unclean shutdown. For more information on unclean shutdowns,
see <olink targetptr="fstroublefsck-51788" remap="internal">What the fsck Command Checks and
Tries to Repair</olink>.</para>
</listitem><listitem><para>Starting in the Solaris 9 12/02 release, the performance of
UFS logging improves or exceeds the level of performance of non logging file
systems. This improvement can occur because a file system with logging enabled
converts multiple updates to the same data into single updates. Thus, reduces
the number of overhead disk operations required.</para>
</listitem>
</itemizedlist><para>Logging is enabled by default for all UFS file systems, except under
the following conditions:</para><itemizedlist><listitem><para>When logging is explicitly disabled.</para>
</listitem><listitem><para>If there is insufficient file system space for the log.</para>
</listitem>
</itemizedlist><para>In previous Solaris releases, you had to manually enable UFS logging.</para><para>Keep the following issues in mind when using UFS logging:</para><itemizedlist><listitem><para>Ensure that you have enough disk space for your general system
needs, such as for users and applications, and for UFS logging.</para>
</listitem><listitem><para>If you don't have enough disk space for logging data, a message
similar to the following is displayed:</para><screen># <userinput>mount /dev/dsk/c0t4d0s0 /mnt</userinput>
/mnt: No space left on device
Could not enable logging for /mnt on /dev/dsk/c0t4d0s0.
#</screen><para>However, the file system is still mounted. For example:</para><screen># <userinput>df -h /mnt</userinput>
Filesystem             size   used  avail capacity  Mounted on
/dev/dsk/c0t4d0s0      142M   142M     0K   100%    /mnt
#</screen>
</listitem><listitem><para>A UFS file system with logging enabled that is generally empty
will have some disk space consumed for the log.</para>
</listitem><listitem><para>If you upgrade to this Solaris release from a previous Solaris
release, your UFS file systems will have logging enabled, even if the <command>logging</command> option was not specified in the <filename>/etc/vfstab</filename> file.
To disable logging, add the <command>nologging</command> option to the UFS
file system entries in the <filename>/etc/vfstab</filename> file.</para>
</listitem>
</itemizedlist><para>The UFS transaction log has the following characteristics:</para><itemizedlist><listitem><para>Is allocated from free blocks on the file system</para>
</listitem><listitem><para>Sized at approximately 1 Mbyte per 1 Gbyte of file system,
up to a maximum of 64 Mbytes</para>
</listitem><listitem><para>Continually flushed as it fills up</para>
</listitem><listitem><para>Also flushed when the file system is unmounted or as a result
of any <command>lockfs</command> command.</para>
</listitem>
</itemizedlist><para>If you need to enable UFS logging, specify the <option>o logging</option> option
with the <command>mount</command> command in the <filename>/etc/vfstab</filename> file
or when you manually mount the file system. Logging can be enabled on any
UFS file system, including the root (<filename>/</filename>) file system.
Also, the <command>fsdb</command> command has new debugging commands to support
UFS logging.</para><para>In some operating systems, a file system with logging enabled is known
as a <emphasis>journaling</emphasis> file system.</para>
</sect2><sect2 id="fsoverview-57"><title>UFS Snapshots</title><para>You can use the <command>fssnap</command> command to create a read-only
snapshot of a file system. A <emphasis>snapshot</emphasis> is a file system's
temporary image that is intended for backup operations.</para><para>See <olink targetptr="bkupsnapshot-2" remap="internal">Chapter&nbsp;25, Using UFS Snapshots
(Tasks)</olink> for more information.</para>
</sect2><sect2 id="fsfilesysappx-17"><title>UFS Direct Input/Output (I/O)</title><para>Direct I/O is intended to boost bulk I/O operations.
Bulk I/O operations use large buffer sizes to transfer large files (larger
than 256 Kbytes).  </para><para>Using UFS direct I/O might benefit applications, such as database engines,
that do their own internal buffering. Starting with the Solaris 8 1/01 release,
UFS direct I/O has been enhanced to allow the same kind of I/O concurrency
that occurs when raw devices are accessed. Now you can get the benefit of
file system naming and flexibility with very little performance penalty. Check
with your database vendor to see if it can enable UFS direct I/O in its product
configuration options.</para><para>Direct I/O can also be enabled on a file system by using the <literal>forcedirectio</literal> option to the <command>mount</command> command. Enabling direct
I/O is a performance benefit only when a file system is transferring large
amounts of sequential data. </para><para>When a file system is mounted with this option, data is transferred
directly between a user's address space and the disk. When forced direct I/O
is not enabled for a file system, data transferred between a user's address
space and the disk is first buffered in the kernel address space.</para><para>The default behavior is no forced direct I/O on a UFS file system. For
more information, see <olink targetdoc="refman1m" targetptr="mount-ufs-1m" remap="external"><citerefentry><refentrytitle>mount_ufs</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink>.</para>
</sect2>
</sect1><sect1 id="fsoverview-30598"><title>Mounting and Unmounting File Systems</title><para>Before you can access the files on a file system, you need to mount
the file system. When you mount a file system, you attach that file system
to a directory (<emphasis>mount point</emphasis>) and make it available to
the system. The root (<filename>/</filename>) file system is always mounted.
Any other file system can be connected or disconnected from the root (<filename>/</filename>) file system.</para><para>When you mount a file system, any files or directories in the
underlying mount point directory are unavailable as long as the file system
is mounted. These files are not permanently affected by the mounting process.
They become available again when the file system is unmounted.  However, mount
directories are typically empty because you usually do not want to obscure
existing files.  </para><para>For example, the following figure shows a local file system, starting
with a root (<filename>/</filename>) file system and the <filename>sbin</filename>, <filename>etc</filename>, and <filename>opt</filename> subdirectories.</para><figure id="fsoverview-fig-24"><title id="fsoverview-89893">Sample root (<filename>/</filename>) File System</title><mediaobject><imageobject><imagedata entityref="fig2702.epsi"/>
</imageobject><textobject><simpara>Diagram shows sample root (/) file system with partial
entries from the sbin, etc, and opt directories listed.</simpara>
</textobject>
</mediaobject>
</figure><para>To access a local file system from the <filename>/opt</filename> file
system that contains a set of unbundled products, you must do the following:</para><itemizedlist><listitem><para>First, you must create a directory to use as a mount point
for the file system you want to mount, for example, <filename>/opt/unbundled</filename>. </para>
</listitem><listitem><para>Once the mount point is created, you can mount the file system
by using the <command>mount</command> command. This command makes all of the
files and directories in <filename>/opt/unbundled</filename> available, as
shown in the following figure.</para>
</listitem>
</itemizedlist><figure id="fsoverview-fig-25"><title id="fsoverview-17289">Mounting a File
System</title><mediaobject><imageobject><imagedata entityref="fig2703.epsi" width="100"/>
</imageobject><textobject><simpara>Diagram shows mounting a file system on the /opt/unbundled
mount point with a listing of the newly accessible items in the /opt/unbundled
directory.</simpara>
</textobject>
</mediaobject>
</figure><para>For step-by-step instructions on how to mount file systems, see <olink targetptr="fsmount-42780" remap="internal">Chapter&nbsp;18, Mounting and Unmounting File Systems
(Tasks)</olink>.</para><sect2 id="fsoverview-53"><title>The Mounted File System Table</title><para>Whenever you mount or unmount
a file system, the <filename>/etc/mnttab</filename> (mount table) file is
modified with the list of currently mounted file systems. You can display
the contents of this file by using the <command>cat</command> or <command>more</command> commands.
However, you cannot edit this file. Here is an example of an <filename>/etc/mnttab</filename> file:</para><screen width="100">$ <userinput>more /etc/mnttab</userinput>
/dev/dsk/c0t0d0s0       /       ufs     rw,intr,largefiles,logging,xattr,onerror
=panic,dev=2200008      1093882623
/devices        /devices        devfs   dev=4340000     1093882603
ctfs    /system/contract        ctfs    dev=4380001     1093882603
proc    /proc   proc    dev=43c0000     1093882603
mnttab  /etc/mnttab     mntfs   dev=4400001     1093882603
swap    /etc/svc/volatile       tmpfs   xattr,dev=4440001       1093882603
/dev/dsk/c0t0d0s6       /usr    ufs     rw,intr,largefiles,logging,xattr,onerror
=panic,dev=220000e      1093882623
objfs   /system/object  objfs   dev=44c0001     1094150403
fd      /dev/fd fd      rw,dev=45c0001  1093882624
swap    /var/run        tmpfs   xattr,dev=4440002       1093882625
swap    /tmp    tmpfs   xattr,dev=4440003       1093882625
/dev/dsk/c0t0d0s7       /export/home    ufs     rw,intr,largefiles,logging,xattr
,onerror=panic,dev=220000f      1093882637
$</screen>
</sect2><sect2 id="fsoverview-42092"><title>The Virtual File System Table</title><para>Manually mount file systems every time you wanted to access them would
be a very time-consuming and error-prone. To avoid these problems, the virtual file system table (the <filename>/etc/vfstab</filename> file) provides a list of file systems and information
on how to mount them.</para><para>The <filename>/etc/vfstab</filename> file provides two important features:</para><itemizedlist><listitem><para>You can specify file systems to automatically mount when the
system boots.</para>
</listitem><listitem><para>You can mount file systems by using only the mount point name.
The <filename>/etc/vfstab</filename> file contains the mapping between the
mount point and the actual device slice name. </para>
</listitem>
</itemizedlist><para>A default <filename>/etc/vfstab</filename> file is created when
you install a system, depending on the selections during installation. However,
you can edit the <filename>/etc/vfstab</filename> file on a system whenever
you want. To add an entry, the information you need to specify is as follows:</para><itemizedlist><listitem><para>The device where the file system resides</para>
</listitem><listitem><para>The file system mount point</para>
</listitem><listitem><para>File system type</para>
</listitem><listitem><para>Whether you want the file system to mount automatically when
the system boots (by using the <command>mountall</command> command)</para>
</listitem><listitem><para>Any mount options</para>
</listitem>
</itemizedlist><para>The following is an example of an <filename>/etc/vfstab</filename> file.
Comment lines begin with <literal>#</literal>. This example shows an <filename>/etc/vfstab</filename> file for a system with two disks (<literal>c0t0d0</literal> and <literal>c0t3d0</literal>).</para><screen width="100">$ <userinput>more /etc/vfstab</userinput>
#device           device              mount            FS      fsck    mount   mount
#to mount         to fsck             point            type    pass    at boot options
#
fd                 -                  /dev/fd          fd      -       no      -
/proc              -                  /proc            proc    -       no      -
/dev/dsk/c0t0d0s1  -                  -                swap    -       no      -
/dev/dsk/c0t0d0s0  /dev/rdsk/c0t0d0s0 /                ufs     1       no      -
/dev/dsk/c0t0d0s6  /dev/rdsk/c0t0d0s6 /usr             ufs     1       no      -
/dev/dsk/c0t0d0s7  /dev/rdsk/c0t0d0s7 /export/home     ufs     2       yes     -
/dev/dsk/c0t0d0s5  /dev/rdsk/c0t0d0s5 /opt             ufs     2       yes     -
/devices           -                  /devices         devfs   -       no      -
ctfs               -                  /system/contract ctfs    -       no      -
objfs              -                  /system/object   objfs   -       no      -
swap               -                  /tmp             tmpfs   -       yes     -
$</screen><para>In this example, the UFS file system entry for <literal>/export/home</literal> on
the <filename>/dev/dsk/c0t0d0s7</filename> slice will be automatically mounted
on the <filename>/test</filename> mount point when the system boots. Note
that, for root (<filename>/</filename>) and <filename>/usr</filename>, the <literal>mount at boot</literal> field value is specified as <literal>no</literal>.
These file systems are mounted by the kernel as part of the boot sequence
before the <command>mountall</command> command is run.</para><para>For descriptions of each <filename>/etc/vfstab</filename> field and
information on how to edit and use the file, see <olink targetptr="fsmount-42780" remap="internal">Chapter&nbsp;18, Mounting and Unmounting File Systems (Tasks)</olink>.</para>
</sect2><sect2 id="fsoverview-78649"><title>The NFS Environment</title><para><emphasis>NFS</emphasis> is a distributed file system service that can
be used to share <emphasis>resources</emphasis> (files or directories) from
one system, typically a server, with other systems on the network. For example,
you might want to share third-party applications or source files with users
on other systems.</para><para>NFS makes the actual physical location of the resource
irrelevant to the user. Instead of placing copies of commonly used files on
every system, NFS allows you to place one copy on one system's disk and let
all other systems access it from the network. Under NFS, remote files are
virtually indistinguishable from local files.</para><para>For more information, see <olink targetdoc="sysadv4" targetptr="rfsintro-2" remap="external">Chapter 4, <citetitle remap="chapter">Managing Network File Systems (Overview),</citetitle> in <citetitle remap="book">System Administration Guide: Network Services</citetitle></olink>.</para><para>A system becomes an NFS server if it has
resources to share on the network. A server keeps a list of currently shared
resources and their access restrictions (such as read/write or read-only access). </para><para>When you share a resource, you make it available for mounting by remote
systems.</para><para>You can share a resource in these ways:</para><itemizedlist><listitem><para>By using the <command>share</command> or <command>shareall</command> command  </para>
</listitem><listitem><para>By adding an entry to the <filename>/etc/dfs/dfstab</filename> (distributed
file system table) file and rebooting the system</para>
</listitem>
</itemizedlist><para>For information on how to share resources, see <olink targetptr="fsmount-42780" remap="internal">Chapter&nbsp;18, Mounting and Unmounting File Systems
(Tasks)</olink>. For a complete description of NFS, see <olink targetdoc="sysadv4" targetptr="rfsintro-2" remap="external">Chapter 4, <citetitle remap="chapter">Managing Network File Systems (Overview),</citetitle> in <citetitle remap="book">System Administration Guide: Network Services</citetitle></olink>.</para><sect3 id="gdsfn"><title>NFS Version 4</title><para>Sun's implementation of the NFS version 4 distributed file access protocol
is included in the Solaris release.</para><para>NFS version 4 integrates file access, file locking, and mount protocols
into a single, unified protocol to ease traversal through a firewall and improve
security. The Solaris implementation of NFS version 4 is fully integrated
with Kerberos V5, also known as SEAM, thus providing authentication, integrity,
and privacy. NFS version 4 also enables the negotiation of security flavors
to be used between the client and the server. With NFS version 4, a server
can offer different security flavors for different file systems.</para><para>For more information about NFS Version 4 features, see <olink targetdoc="sysadv4" targetptr="ewbds" remap="external"><citetitle remap="section">What&rsquo;s New With the NFS Service</citetitle> in <citetitle remap="book">System Administration Guide: Network Services</citetitle></olink>.</para>
</sect3>
</sect2><sect2 id="fsoverview-26"><title>Automounting or AutoFS</title><para>You can mount NFS file system resources by using a client-side service
called <emphasis>automounting</emphasis> (or <emphasis>AutoFS</emphasis>).
AutoFS enables a system to automatically mount and unmount NFS resources whenever
you access them. The resource remains mounted as long as you remain in the
directory and are using a file within that directory. If the resource is not
accessed for a certain period of time, it is automatically unmounted. </para><para>AutoFS provides the following features:</para><itemizedlist><listitem><para>NFS resources don't need to be mounted when the system boots,
which saves booting time.</para>
</listitem><listitem><para>Users don't need to know the root password to mount and unmount
NFS resources.</para>
</listitem><listitem><para>Network traffic might be reduced because NFS resources are
mounted only when they are in use.</para>
</listitem>
</itemizedlist><para>The AutoFS service is initialized by the <command>automount</command> utility, which runs automatically when a system is booted. The <command>automountd</command> daemon runs continuously and is responsible for the mounting
and unmounting of NFS file systems on an as-needed basis. By default, the <filename>/home</filename> file system is mounted by the <command>automount</command> daemon. </para><para>With AutoFS, you can specify multiple servers to provide the same file
system. This way, if one of these servers is down, AutoFS can try to mount
the file system from another machine.</para><para>For complete information on how to set up and administer AutoFS, see <olink targetdoc="sysadv3" remap="external"><citetitle remap="book">System Administration Guide: IP Services</citetitle></olink>.</para>
</sect2>
</sect1><sect1 id="fsoverview-28729"><title>Determining a File System's Type</title><para>You can determine a file system's type by using one of the following:</para><itemizedlist><listitem><para>The <literal>FS type</literal> field in the virtual file system table (the <filename>/etc/vfstab</filename> file) </para>
</listitem><listitem><para>The <filename>/etc/default/fs</filename> file for local file systems</para>
</listitem><listitem><para>The <filename>/etc/dfs/fstypes</filename> file for NFS file systems</para>
</listitem>
</itemizedlist><sect2 id="fsoverview-27"><title>How to Determine a File System's Type</title><para>This procedure works whether
or not the file system is mounted.</para><para>Determine a file system's type by using the <command>grep</command> command.</para><screen>$ <userinput>grep</userinput> <replaceable>mount-point</replaceable> <replaceable>fs-table</replaceable></screen><variablelist><varlistentry><term><replaceable>mount-point</replaceable></term><listitem><para>Specifies the mount point name of the file system for which
you want to know the file system type. For example, the <filename>/var</filename> directory.</para>
</listitem>
</varlistentry><varlistentry><term><replaceable>fs-table</replaceable></term><listitem><para>Specifies the absolute path to the file system table in which
to search for the file system's type. If the file system is mounted, <replaceable>fs-table</replaceable> should be <filename>/etc/mnttab</filename>. If the
file system isn't mounted, <replaceable>fs-table</replaceable> should be <filename>/etc/vfstab</filename>.</para>
</listitem>
</varlistentry>
</variablelist><para>Information for the mount point is displayed.</para><note><para>If you have the raw device name of a disk slice, you can use the <command>fstyp</command> command to determine a file system's type (if the disk slice
contains a file system).  For more information, see <olink targetdoc="refman1m" targetptr="fstyp-1m" remap="external"><citerefentry><refentrytitle>fstyp</refentrytitle><manvolnum>1M</manvolnum></citerefentry></olink>.</para>
</note><example id="fapcc"><title>Determining a File System's Type</title><para>The following example uses the <filename>/etc/vfstab</filename> file
to determine the file system type for the <filename>/export</filename> file
system.</para><screen>$ <userinput>grep /export /etc/vfstab</userinput>
/dev/dsk/c0t3d0s6   /dev/rdsk/c0t3d0s6  /export ufs   2       yes    -
$ </screen><para>The following example uses the <filename>/etc/mnttab</filename> file
to determine the file system type of the currently mounted diskette. The diskette
was previously mounted by <command>vold</command>.</para><screen remap="wide">$ <userinput>grep floppy /etc/mnttab</userinput>
/dev/diskette0  /media/floppy   ufs     rw,nosuid,intr,largefiles,logging,xattr,onerror=panic,dev=900002 
       1165251037</screen>
</example>
</sect2>
</sect1>
</chapter>