2002-03-14 21:58:58 +00:00
|
|
|
.\" Copyright (c) 2001 Networks Associates Technology, Inc.
|
2001-12-27 03:05:44 +00:00
|
|
|
.\" All rights reserved.
|
2002-01-18 16:46:43 +00:00
|
|
|
.\"
|
2001-12-27 03:05:44 +00:00
|
|
|
.\" This software was developed for the FreeBSD Project by Chris
|
|
|
|
.\" Costello at Safeport Network Services and NAI Labs, the Security
|
|
|
|
.\" Research Division of Network Associates, Inc. under DARPA/SPAWAR
|
|
|
|
.\" contract N66001-01-C-8035 ("CBOSS"), as part of the DARPA CHATS
|
|
|
|
.\" research program.
|
2002-01-18 16:46:43 +00:00
|
|
|
.\"
|
2001-12-27 03:05:44 +00:00
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
2002-01-18 16:46:43 +00:00
|
|
|
.\"
|
2001-12-27 03:05:44 +00:00
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
2002-01-18 16:46:43 +00:00
|
|
|
.\"
|
2001-12-27 03:05:44 +00:00
|
|
|
.\" $FreeBSD$
|
2002-01-18 16:46:43 +00:00
|
|
|
.\"
|
2001-12-27 03:05:44 +00:00
|
|
|
.Dd December 26, 2001
|
2002-03-24 10:25:21 +00:00
|
|
|
.Dt FFS 7
|
2002-12-11 15:55:29 +00:00
|
|
|
.Os
|
2001-12-27 03:05:44 +00:00
|
|
|
.Sh NAME
|
|
|
|
.Nm ffs
|
2002-12-12 17:26:04 +00:00
|
|
|
.Nd Berkeley fast file system
|
2001-12-27 03:05:44 +00:00
|
|
|
.Sh SYNOPSIS
|
2002-01-05 20:18:35 +00:00
|
|
|
In the kernel configuration file:
|
2002-01-18 16:46:43 +00:00
|
|
|
.Cd "options FFS"
|
|
|
|
.Cd "options QUOTA"
|
|
|
|
.Cd "options SOFTUPDATES"
|
|
|
|
.Cd "options SUIDDIR"
|
|
|
|
.Cd "options UFS_ACL"
|
|
|
|
.Cd "options UFS_DIRHASH"
|
|
|
|
.Cd "options UFS_EXTATTR"
|
|
|
|
.Cd "options UFS_EXTATTR_AUTOSTART"
|
2002-01-05 20:18:35 +00:00
|
|
|
.Pp
|
|
|
|
In
|
2002-01-18 16:46:43 +00:00
|
|
|
.Xr fstab 5 :
|
|
|
|
.Bd -literal -compact
|
|
|
|
/dev/disk0a /mnt ufs rw 1 1
|
|
|
|
.Ed
|
2001-12-27 03:05:44 +00:00
|
|
|
.Sh DESCRIPTION
|
2002-12-12 17:26:04 +00:00
|
|
|
The Berkeley fast file system
|
|
|
|
provides facilities to store file system data onto a disk device.
|
2002-01-18 16:46:43 +00:00
|
|
|
.Nm
|
2001-12-27 03:05:44 +00:00
|
|
|
has been optimized over the years
|
|
|
|
for speed and reliability
|
2002-01-05 20:18:35 +00:00
|
|
|
and is the default
|
|
|
|
.Fx
|
2002-12-12 17:26:04 +00:00
|
|
|
file system.
|
2002-01-05 20:18:35 +00:00
|
|
|
.Ss Quotas
|
|
|
|
.Bl -tag -width 2n
|
2002-01-18 16:46:43 +00:00
|
|
|
.It Cd "options QUOTA"
|
2002-01-05 20:18:35 +00:00
|
|
|
This option allows system administrators
|
|
|
|
to set limits on disk usage
|
|
|
|
on a per-user basis.
|
2002-12-12 17:26:04 +00:00
|
|
|
Quotas can be used only on file systems
|
2002-01-05 20:18:35 +00:00
|
|
|
mounted with the
|
2002-01-18 16:46:43 +00:00
|
|
|
.Cm quota
|
2002-01-05 20:18:35 +00:00
|
|
|
option;
|
|
|
|
see
|
|
|
|
.Xr quota 1
|
|
|
|
and
|
|
|
|
.Xr edquota 8 .
|
|
|
|
.El
|
|
|
|
.Ss Soft Updates
|
|
|
|
.Bl -tag -width 2n
|
2002-01-18 16:46:43 +00:00
|
|
|
.It Cd "options SOFTUPDATES"
|
2001-12-27 03:05:44 +00:00
|
|
|
The soft updates feature tracks writes to the disk
|
2002-01-09 12:34:01 +00:00
|
|
|
and enforces metadata update dependencies
|
2002-01-18 16:46:43 +00:00
|
|
|
(e.g., updating free block maps)
|
2002-12-12 17:26:04 +00:00
|
|
|
to ensure that the file system remains consistent.
|
2001-12-27 03:05:44 +00:00
|
|
|
.Pp
|
|
|
|
To enable soft updates on an
|
|
|
|
.Em unmounted
|
2002-12-12 17:26:04 +00:00
|
|
|
file system, use the following command:
|
2001-12-27 03:05:44 +00:00
|
|
|
.Pp
|
2002-01-18 16:46:43 +00:00
|
|
|
.D1 Nm tunefs Fl n Cm enable Ar fs
|
2001-12-27 03:05:44 +00:00
|
|
|
.Pp
|
2002-01-18 16:46:43 +00:00
|
|
|
.Ar fs
|
2001-12-30 03:47:06 +00:00
|
|
|
can be either a mount point listed in
|
2002-01-18 16:46:43 +00:00
|
|
|
.Xr fstab 5
|
|
|
|
(e.g.,
|
2001-12-27 03:05:44 +00:00
|
|
|
.Pa /usr ) ,
|
|
|
|
or a disk device
|
2002-01-18 16:46:43 +00:00
|
|
|
(e.g.,
|
|
|
|
.Pa /dev/da0a ) .
|
2002-01-05 20:18:35 +00:00
|
|
|
.El
|
|
|
|
.Ss File Ownership Inheritance
|
|
|
|
.Bl -tag -width 2n
|
2002-01-18 16:46:43 +00:00
|
|
|
.It Cd "options SUIDDIR"
|
2002-01-05 20:18:35 +00:00
|
|
|
For use in file sharing environments
|
2002-01-18 16:46:43 +00:00
|
|
|
on networks including
|
|
|
|
.Tn "Microsoft Windows"
|
|
|
|
and
|
|
|
|
.Tn "Apple Macintosh"
|
|
|
|
computers,
|
2002-12-12 17:26:04 +00:00
|
|
|
this option allows files on file systems
|
2002-01-05 20:18:35 +00:00
|
|
|
mounted with the
|
2002-01-18 16:46:43 +00:00
|
|
|
.Cm suiddir
|
2002-01-05 20:18:35 +00:00
|
|
|
option
|
|
|
|
to inherit the ownership of its directory,
|
2002-01-18 16:46:43 +00:00
|
|
|
i.e.,
|
|
|
|
.Dq "if it's my directory, it must be my file."
|
2002-01-05 20:18:35 +00:00
|
|
|
.El
|
|
|
|
.Ss Access Control Lists
|
|
|
|
.Bl -tag -width 2n
|
2002-01-18 16:46:43 +00:00
|
|
|
.It Cd "options UFS_ACL"
|
2002-01-05 20:18:35 +00:00
|
|
|
Access control lists allow the association of
|
2002-01-09 12:34:01 +00:00
|
|
|
fine-grained discretionary access control information
|
2002-01-05 20:18:35 +00:00
|
|
|
with files and directories.
|
|
|
|
This option requires the presence of the
|
|
|
|
.Dv UFS_EXTATTR
|
|
|
|
option, and it is recommended that
|
|
|
|
.Dv UFS_EXTATTR_AUTOSTART
|
|
|
|
is included as well,
|
2002-12-12 17:26:04 +00:00
|
|
|
so that ACLs are enabled atomically upon mounting the file system.
|
2002-01-05 20:18:35 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
In order to enable support for ACLs,
|
|
|
|
two extended attributes must be available in the
|
|
|
|
.Dv EXTATTR_NAMESPACE_SYSTEM
|
|
|
|
namespace:
|
2002-01-18 16:46:43 +00:00
|
|
|
.Pa posix1e.acl_access ,
|
2002-01-05 20:18:35 +00:00
|
|
|
which holds the access ACL,
|
|
|
|
and
|
2002-01-18 16:46:43 +00:00
|
|
|
.Pa posix1e.acl_default ,
|
2002-01-05 20:18:35 +00:00
|
|
|
which holds the default ACL for directories.
|
2002-12-12 17:26:04 +00:00
|
|
|
If you are using file system extended attributes,
|
2002-01-05 20:18:35 +00:00
|
|
|
the following commands may be used to
|
|
|
|
allocate space for and create the necessary EA backing files
|
2002-12-12 17:26:04 +00:00
|
|
|
for ACLs in the root of each file system.
|
|
|
|
In these examples, the root file system is used;
|
2002-01-05 20:18:35 +00:00
|
|
|
see
|
|
|
|
.Sx "Extended Attributes"
|
|
|
|
for more details.
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
mkdir -p /.attribute/system
|
|
|
|
cd /.attribute/system
|
|
|
|
extattrctl initattr -p / 388 posix1e.acl_access
|
|
|
|
extattrctl initattr -p / 388 posix1e.acl_default
|
|
|
|
.Ed
|
|
|
|
.Pp
|
2002-12-12 17:26:04 +00:00
|
|
|
On the next mount of the root file system,
|
2002-01-05 20:18:35 +00:00
|
|
|
the attributes will be automatically started
|
2002-01-18 16:46:43 +00:00
|
|
|
(if
|
|
|
|
.Dv UFS_EXTATTR_AUTOSTART
|
|
|
|
is included in the kernel configuration),
|
2002-01-05 20:18:35 +00:00
|
|
|
and ACLs will be enabled.
|
|
|
|
.Ss Directory Hashing
|
|
|
|
.Bl -tag -width 2n
|
2002-01-18 16:46:43 +00:00
|
|
|
.It Cd "options UFS_DIRHASH"
|
2002-01-05 20:18:35 +00:00
|
|
|
Implements a hash-based lookup scheme for directories
|
|
|
|
in order to speed up accesses to very large directories.
|
|
|
|
.El
|
|
|
|
.Ss Extended Attributes
|
|
|
|
.Bl -tag -width 2n
|
2002-01-18 16:46:43 +00:00
|
|
|
.It Cd "options UFS_EXTATTR"
|
2002-01-05 20:18:35 +00:00
|
|
|
Extended attributes allow the association of
|
|
|
|
additional arbitrary metadata with files and directories,
|
|
|
|
which can be assigned and retrieved from userland
|
|
|
|
as well as from within the kernel; see
|
|
|
|
.Xr extattrctl 8 .
|
2002-01-18 16:46:43 +00:00
|
|
|
.It Cd "options UFS_EXTATTR_AUTOSTART"
|
2002-01-05 20:18:35 +00:00
|
|
|
If this option is defined,
|
2002-01-18 16:46:43 +00:00
|
|
|
.Nm
|
2002-01-05 20:18:35 +00:00
|
|
|
will search for a
|
2002-01-18 16:46:43 +00:00
|
|
|
.Pa .attribute
|
2002-12-12 17:26:04 +00:00
|
|
|
subdirectory of the file system root during the mount operation.
|
2002-01-05 20:18:35 +00:00
|
|
|
If found, extended attribute support will be
|
2002-12-12 17:26:04 +00:00
|
|
|
automatically started for that file system.
|
2002-01-05 20:18:35 +00:00
|
|
|
.El
|
2001-12-27 03:05:44 +00:00
|
|
|
.Pp
|
|
|
|
The following
|
|
|
|
.Xr sysctl 8
|
|
|
|
MIBs are defined for use with
|
2002-01-18 16:46:43 +00:00
|
|
|
.Nm :
|
|
|
|
.Bl -hang -width ".Va vfs.ffs.doreallocblk"
|
|
|
|
.It Va vfs.ffs.doasyncfree
|
2002-01-09 12:34:01 +00:00
|
|
|
Asynchronously write out modified i-node and indirect blocks
|
2002-12-12 17:26:04 +00:00
|
|
|
upon reallocating file system blocks to be contiguous.
|
2001-12-27 03:05:44 +00:00
|
|
|
(Default: 1.)
|
2002-01-18 16:46:43 +00:00
|
|
|
.It Va vfs.ffs.doreallocblks
|
2001-12-27 03:05:44 +00:00
|
|
|
Enable support for the rearrangement of blocks
|
|
|
|
to be contiguous.
|
|
|
|
(Default: 1.)
|
|
|
|
.El
|
|
|
|
.Sh SEE ALSO
|
2002-01-05 20:18:35 +00:00
|
|
|
.Xr quota 1 ,
|
|
|
|
.Xr acl 3 ,
|
|
|
|
.Xr extattr 3 ,
|
|
|
|
.Xr edquota 8 ,
|
|
|
|
.Xr extattrctl 8 ,
|
2002-01-18 16:46:43 +00:00
|
|
|
.Xr sysctl 8
|
2001-12-27 03:05:44 +00:00
|
|
|
.Rs
|
|
|
|
.%A M. McKusick
|
|
|
|
.%A W. Joy
|
2005-07-23 15:09:27 +00:00
|
|
|
.%A S. Leffler
|
2001-12-27 03:05:44 +00:00
|
|
|
.%A R. Fabry
|
|
|
|
.%D August 1984
|
|
|
|
.%T "A Fast File System for UNIX"
|
|
|
|
.%J "ACM Transactions on Computer Systems"
|
|
|
|
.%N 2
|
|
|
|
.%V 3
|
|
|
|
.%P 181-197
|
|
|
|
.Re
|
|
|
|
.Rs
|
|
|
|
.%A M. McKusick
|
|
|
|
.%D June 2000
|
|
|
|
.%T "Soft Updates: A Technique for Eliminating Most Synchronous Writes in the Fast Filesystem"
|
|
|
|
.%J "Proceedings of the Freenix Track at the 1999 Usenix Annual Technical Conference"
|
|
|
|
.%P 71-84
|
|
|
|
.Re
|