<s>
The	O
Unix	B-Operating_System
file	I-Operating_System
system	I-Operating_System
(	O
UFS	O
)	O
is	O
a	O
family	O
of	O
file	B-Application
systems	I-Application
supported	O
by	O
many	O
Unix	B-Application
and	O
Unix-like	B-Operating_System
operating	I-Operating_System
systems	I-Operating_System
.	O
</s>
<s>
It	O
is	O
a	O
distant	O
descendant	O
of	O
the	O
original	O
filesystem	B-Application
used	O
by	O
Version	B-Operating_System
7	I-Operating_System
Unix	I-Operating_System
.	O
</s>
<s>
Inodes	B-Application
are	O
numbered	O
sequentially	O
,	O
starting	O
at	O
0	O
.	O
</s>
<s>
Inode	B-Application
0	O
is	O
reserved	O
for	O
unallocated	O
directory	O
entries	O
,	O
inode	B-Application
1	O
was	O
the	O
inode	B-Application
of	O
the	O
bad	O
block	O
file	O
in	O
historical	O
UNIX	B-Application
versions	O
,	O
followed	O
by	O
the	O
inode	B-Application
for	O
the	O
root	B-Application
directory	I-Application
,	O
which	O
is	O
always	O
inode	B-Application
2	O
and	O
the	O
inode	B-Application
for	O
the	O
lost+found	O
directory	O
which	O
is	O
inode	B-Application
3	O
.	O
</s>
<s>
Directory	O
files	O
contain	O
only	O
the	O
list	O
of	O
filenames	O
in	O
the	O
directory	O
and	O
the	O
inode	B-Application
associated	O
with	O
each	O
file	O
.	O
</s>
<s>
All	O
file	O
metadata	O
are	O
kept	O
in	O
the	O
inode	B-Application
.	O
</s>
<s>
Early	O
Unix	B-Application
filesystems	B-Application
were	O
referred	O
to	O
simply	O
as	O
FS	O
.	O
</s>
<s>
FS	O
only	O
included	O
the	O
boot	O
block	O
,	O
superblock	O
,	O
a	O
clump	O
of	O
inodes	B-Application
,	O
and	O
the	O
data	B-General_Concept
blocks	I-General_Concept
.	O
</s>
<s>
This	O
worked	O
well	O
for	O
the	O
small	O
disks	O
early	O
Unixes	B-Application
were	O
designed	O
for	O
,	O
but	O
as	O
technology	O
advanced	O
and	O
disks	O
grew	O
larger	O
,	O
moving	O
the	O
head	O
back	O
and	O
forth	O
between	O
the	O
clump	O
of	O
inodes	B-Application
and	O
the	O
data	B-General_Concept
blocks	I-General_Concept
they	O
referred	O
to	O
caused	O
thrashing	O
.	O
</s>
<s>
Marshall	O
Kirk	O
McKusick	O
,	O
then	O
a	O
Berkeley	O
graduate	O
student	O
,	O
optimized	O
the	O
V7	O
FS	O
layout	O
to	O
create	O
BSD	B-Operating_System
4.2	O
'	O
s	O
FFS	O
(	O
Fast	O
File	B-Application
System	I-Application
)	O
by	O
inventing	O
cylinder	O
groups	O
,	O
which	O
break	O
the	O
disk	O
up	O
into	O
smaller	O
chunks	O
,	O
with	O
each	O
group	O
having	O
its	O
own	O
inodes	B-Application
and	O
data	B-General_Concept
blocks	I-General_Concept
.	O
</s>
<s>
The	O
intent	O
of	O
BSD	B-Operating_System
FFS	O
is	O
to	O
try	O
to	O
localize	O
associated	O
data	B-General_Concept
blocks	I-General_Concept
and	O
metadata	O
in	O
the	O
same	O
cylinder	O
group	O
and	O
,	O
ideally	O
,	O
all	O
of	O
the	O
contents	O
of	O
a	O
directory	O
(	O
both	O
data	O
and	O
metadata	O
for	O
all	O
the	O
files	O
)	O
in	O
the	O
same	O
or	O
nearby	O
cylinder	O
group	O
,	O
thus	O
reducing	O
fragmentation	B-Application
caused	O
by	O
scattering	O
a	O
directory	O
's	O
contents	O
over	O
a	O
whole	O
disk	O
.	O
</s>
<s>
To	O
combat	O
this	O
,	O
BSD	B-Operating_System
originally	O
increased	O
the	O
filesystem	B-Application
block	B-General_Concept
size	I-General_Concept
from	O
one	O
sector	O
to	O
1K	O
in	O
4.0	O
BSD	B-Operating_System
;	O
and	O
,	O
in	O
FFS	O
,	O
increased	O
the	O
filesystem	B-Application
block	B-General_Concept
size	I-General_Concept
from	O
1K	O
to	O
8K	O
.	O
</s>
<s>
However	O
,	O
with	O
larger	O
block	B-General_Concept
sizes	I-General_Concept
,	O
disks	O
with	O
many	O
small	O
files	O
will	O
waste	O
space	O
,	O
since	O
each	O
file	O
must	O
occupy	O
at	O
least	O
one	O
block	O
.	O
</s>
<s>
Because	O
of	O
this	O
,	O
BSD	B-Operating_System
added	O
block-level	O
fragmentation	B-Application
,	O
also	O
called	O
block	B-Application
suballocation	I-Application
,	I-Application
tail	I-Application
merging	I-Application
,	I-Application
or	I-Application
tail	I-Application
packing	I-Application
,	O
where	O
the	O
last	O
partial	O
block	O
of	O
data	O
from	O
several	O
files	O
may	O
be	O
stored	O
in	O
a	O
single	O
"	O
fragment	O
"	O
block	O
instead	O
of	O
multiple	O
mostly	O
empty	O
blocks	O
.	O
</s>
<s>
The	O
work	O
on	O
Berkeley	B-Operating_System
FFS	I-Operating_System
was	O
widely	O
adopted	O
by	O
other	O
Unix	B-Application
vendors	O
,	O
and	O
the	O
family	O
of	O
filesystems	B-Application
derived	O
from	O
it	O
are	O
collectively	O
known	O
as	O
UFS	O
.	O
</s>
<s>
Vendors	O
of	O
some	O
proprietary	O
Unix	B-Application
systems	I-Application
,	O
such	O
as	O
SunOS	B-Operating_System
/	O
Solaris	B-Application
,	O
System	B-Operating_System
V	I-Operating_System
Release	O
4	O
,	O
HP-UX	B-Application
,	O
and	O
Tru64	B-Operating_System
UNIX	I-Operating_System
,	O
and	O
open	O
Unix	B-Application
derived	O
systems	O
like	O
illumos	B-Application
,	O
have	O
adopted	O
UFS	O
.	O
</s>
<s>
Most	O
of	O
them	O
adapted	O
UFS	O
to	O
their	O
own	O
uses	O
,	O
adding	O
proprietary	O
extensions	O
that	O
may	O
not	O
be	O
recognized	O
by	O
other	O
vendors	O
 '	O
versions	O
of	O
Unix	B-Application
.	O
</s>
<s>
Many	O
have	O
continued	O
to	O
use	O
the	O
original	O
block	B-General_Concept
size	I-General_Concept
and	O
data	O
field	O
widths	O
as	O
the	O
original	O
UFS	O
,	O
so	O
some	O
degree	O
of	O
read	O
compatibility	O
remains	O
across	O
platforms	O
.	O
</s>
<s>
As	O
of	O
Solaris	B-Application
7	I-Application
,	O
Sun	O
Microsystems	O
included	O
UFS	O
Logging	O
,	O
which	O
brought	O
filesystem	B-Application
journaling	I-Application
to	O
UFS	O
,	O
which	O
is	O
still	O
available	O
in	O
current	O
versions	O
of	O
Solaris	B-Application
and	O
illumos	B-Application
.	O
</s>
<s>
Solaris	B-Application
UFS	O
also	O
has	O
extensions	O
for	O
large	O
files	O
and	O
large	O
disks	O
and	O
other	O
features	O
.	O
</s>
<s>
In	O
4.4BSD	O
and	O
BSD	B-Operating_System
Unix	I-Operating_System
systems	O
derived	O
from	O
it	O
,	O
such	O
as	O
FreeBSD	B-Operating_System
,	O
NetBSD	B-Device
,	O
OpenBSD	B-Operating_System
,	O
and	O
DragonFlyBSD	B-Application
,	O
the	O
implementation	O
of	O
UFS1	O
and	O
UFS2	O
is	O
split	O
into	O
two	O
layers	O
:	O
an	O
upper	O
layer	O
that	O
provides	O
the	O
directory	O
structure	O
and	O
supports	O
metadata	O
(	O
permissions	O
,	O
ownership	O
,	O
etc	O
.	O
)	O
</s>
<s>
in	O
the	O
inode	B-Application
structure	O
,	O
and	O
lower	O
layers	O
that	O
provide	O
data	O
containers	O
implemented	O
as	O
inodes	B-Application
.	O
</s>
<s>
This	O
was	O
done	O
to	O
support	O
both	O
the	O
traditional	O
FFS	O
and	O
the	O
LFS	B-Application
log-structured	B-Application
file	I-Application
system	I-Application
with	O
shared	O
code	O
for	O
common	O
functions	O
.	O
</s>
<s>
The	O
upper	O
layer	O
is	O
called	O
"	O
UFS	O
"	O
,	O
and	O
the	O
lower	O
layers	O
are	O
called	O
"	O
FFS	O
"	O
and	O
"	O
LFS	B-Application
"	O
.	O
</s>
<s>
In	O
some	O
of	O
those	O
systems	O
,	O
the	O
term	O
"	O
FFS	O
"	O
is	O
used	O
for	O
the	O
combination	O
of	O
the	O
FFS	O
lower	O
layer	O
and	O
the	O
UFS	O
upper	O
layer	O
,	O
and	O
the	O
term	O
"	O
LFS	B-Application
"	O
is	O
used	O
for	O
the	O
combination	O
of	O
the	O
LFS	B-Application
lower	O
layer	O
and	O
the	O
UFS	O
upper	O
layer	O
.	O
</s>
<s>
Kirk	O
McKusick	O
implemented	O
block	O
reallocation	O
,	O
a	O
technique	O
that	O
reorders	O
the	O
blocks	O
in	O
the	O
file	B-Application
system	I-Application
just	O
before	O
the	O
writes	O
are	O
done	O
to	O
reduce	O
fragmentation	B-Application
and	O
control	O
file	B-Application
system	I-Application
aging	I-Application
.	O
</s>
<s>
He	O
also	O
implemented	O
soft	B-Application
updates	I-Application
,	O
a	O
mechanism	O
that	O
maintains	O
the	O
file	B-Application
system	I-Application
consistency	O
without	O
limiting	O
the	O
performance	O
in	O
the	O
way	O
the	O
traditional	O
sync	O
mode	O
did	O
.	O
</s>
<s>
This	O
has	O
the	O
side	O
effect	O
of	O
reducing	O
the	O
requirement	O
of	O
file	B-Application
system	I-Application
checking	O
after	O
a	O
crash	O
or	O
power	O
failure	O
.	O
</s>
<s>
In	O
UFS2	O
,	O
Kirk	O
McKusick	O
and	O
Poul-Henning	O
Kamp	O
extended	O
the	O
FreeBSD	B-Operating_System
FFS	O
and	O
UFS	O
layers	O
to	O
add	O
64-bit	O
block	O
pointers	O
(	O
allowing	O
volumes	O
to	O
grow	O
up	O
to	O
8	O
zebibytes	O
)	O
,	O
variable-sized	O
blocks	O
(	O
similar	O
to	O
extents	B-Application
)	O
,	O
extended	O
flag	O
fields	O
,	O
additional	O
'	O
birthtime	O
 '	O
stamps	O
,	O
extended	O
attribute	O
support	O
and	O
POSIX1.e	O
ACLs	O
.	O
</s>
<s>
UFS2	O
became	O
the	O
supported	O
UFS	O
version	O
starting	O
with	O
FreeBSD	B-Operating_System
5.0	O
.	O
</s>
<s>
FreeBSD	B-Operating_System
also	O
introduced	O
soft	B-Application
updates	I-Application
and	O
the	O
ability	O
to	O
make	O
file	B-Application
system	I-Application
snapshots	B-Application
for	O
both	O
UFS1	O
and	O
UFS2	O
.	O
</s>
<s>
These	O
have	O
since	O
been	O
ported	O
to	O
NetBSD	B-Device
,	O
but	O
eventually	O
soft	B-Application
updates	I-Application
(	O
called	O
soft	B-Application
dependencies	I-Application
in	O
NetBSD	B-Device
)	O
was	O
removed	O
from	O
NetBSD	B-Device
6.0	O
in	O
favor	O
of	O
the	O
less	O
complex	O
file	B-Application
system	I-Application
journaling	I-Application
mechanism	O
called	O
WAPBL	B-Application
(	O
also	O
referred	O
as	O
logging	O
)	O
,	O
which	O
was	O
added	O
to	O
FFS	O
in	O
NetBSD	B-Device
5.0	O
.	O
</s>
<s>
OpenBSD	B-Operating_System
has	O
supported	O
soft	B-Application
updates	I-Application
since	O
version	O
2.9	O
and	O
has	O
had	O
UFS2	O
(	O
FFS2	O
)	O
support	O
(	O
no	O
ACLs	O
)	O
since	O
version	O
4.2	O
.	O
</s>
<s>
OpenBSD	B-Operating_System
has	O
now	O
made	O
UFS2	O
the	O
default	O
UFS	O
version	O
and	O
will	O
be	O
included	O
with	O
the	O
6.7	O
release	O
.	O
</s>
<s>
Since	O
FreeBSD	B-Operating_System
7.0	O
,	O
UFS	O
also	O
supports	O
filesystem	B-Application
journaling	I-Application
using	O
the	O
gjournal	O
GEOM	B-Application
provider	O
.	O
</s>
<s>
FreeBSD	B-Operating_System
9.0	O
adds	O
support	O
for	O
lightweight	O
journaling	O
on	O
top	O
of	O
soft	B-Application
updates	I-Application
(	O
SU+J	O
)	O
,	O
which	O
greatly	O
reduces	O
the	O
need	O
for	O
background	O
fsck	O
,	O
and	O
NFSv4	O
ACLs	O
.	O
</s>
<s>
FreeBSD	B-Operating_System
,	O
NetBSD	B-Device
,	O
OpenBSD	B-Operating_System
,	O
and	O
DragonFly	B-Application
BSD	I-Application
also	O
include	O
the	O
Dirhash	B-Application
system	O
,	O
developed	O
by	O
Ian	O
Dowse	O
.	O
</s>
<s>
Dirhash	B-Application
alleviates	O
a	O
number	O
of	O
performance	O
problems	O
associated	O
with	O
large	O
directories	O
in	O
UFS	O
.	O
</s>
<s>
Linux	B-Application
includes	O
a	O
UFS	O
implementation	O
for	O
binary	O
compatibility	O
at	O
the	O
read	O
level	O
with	O
other	O
Unixes	B-Application
,	O
but	O
since	O
there	O
is	O
no	O
standard	O
implementation	O
for	O
the	O
vendor	O
extensions	O
to	O
UFS	O
,	O
Linux	B-Application
does	O
not	O
have	O
full	O
support	O
for	O
writing	O
to	O
UFS	O
.	O
</s>
<s>
The	O
native	O
Linux	B-Application
ext2	B-Application
filesystem	B-Application
was	O
inspired	O
by	O
UFS1	O
but	O
does	O
not	O
support	O
fragments	O
and	O
there	O
are	O
no	O
plans	O
to	O
implement	O
soft	B-Application
updates	I-Application
.	O
</s>
<s>
(	O
In	O
some	O
4.4BSD-derived	O
systems	O
,	O
the	O
UFS	O
layer	O
can	O
use	O
an	O
ext2	B-Application
layer	O
as	O
a	O
container	O
layer	O
,	O
just	O
as	O
it	O
can	O
use	O
FFS	O
and	O
LFS	B-Application
.	O
)	O
</s>
<s>
NeXTStep	B-Application
,	O
which	O
was	O
BSD-derived	O
,	O
also	O
used	O
a	O
version	O
of	O
UFS	O
.	O
</s>
<s>
In	O
Apple	O
's	O
Mac	B-Application
OS	I-Application
X	I-Application
,	O
it	O
was	O
available	O
as	O
an	O
alternative	O
to	O
HFS+	B-Application
,	O
their	O
proprietary	O
filesystem	B-Application
.	O
</s>
<s>
However	O
,	O
as	O
of	O
Mac	B-Application
OS	I-Application
X	I-Application
Leopard	I-Application
,	O
it	O
was	O
no	O
longer	O
possible	O
to	O
install	O
Mac	B-Application
OS	I-Application
X	I-Application
on	O
a	O
UFS-formatted	O
volume	O
.	O
</s>
<s>
In	O
addition	O
,	O
one	O
cannot	O
upgrade	O
older	O
versions	O
of	O
Mac	B-Application
OS	I-Application
X	I-Application
installed	O
on	O
UFS-formatted	O
volumes	O
to	O
Leopard	B-Application
;	O
upgrading	O
requires	O
reformatting	O
the	O
startup	O
volume	O
.	O
</s>
<s>
There	O
was	O
a	O
4GB	O
file	O
limit	O
for	O
disks	O
formatted	O
as	O
UFS	O
in	O
Mac	B-Application
OS	I-Application
X	I-Application
.	O
</s>
<s>
As	O
of	O
Mac	B-Application
OS	I-Application
X	I-Application
Lion	I-Application
,	O
UFS	O
support	O
was	O
completely	O
dropped	O
.	O
</s>
