<s>
UBIFS	B-Application
(	O
UBI	O
File	O
System	O
,	O
more	O
fully	O
Unsorted	O
Block	O
Image	O
File	O
System	O
)	O
is	O
a	O
flash	B-Application
file	I-Application
system	I-Application
for	O
unmanaged	O
flash	B-Device
memory	I-Device
devices	O
.	O
</s>
<s>
UBIFS	B-Application
works	O
on	O
top	O
of	O
an	O
UBI	O
(	O
unsorted	O
block	O
image	O
)	O
layer	O
,	O
which	O
is	O
itself	O
on	O
top	O
of	O
a	O
memory	B-Application
technology	I-Application
device	I-Application
(	O
MTD	O
)	O
layer	O
.	O
</s>
<s>
Two	O
major	O
differences	O
between	O
UBIFS	B-Application
and	O
JFFS2	B-Application
are	O
that	O
UBIFS	B-Application
supports	O
write	O
caching	O
,	O
and	O
UBIFS	B-Application
errs	O
on	O
the	O
pessimistic	O
side	O
of	O
free	O
space	O
calculation	O
.	O
</s>
<s>
UBIFS	B-Application
tends	O
to	O
perform	O
better	O
than	O
JFFS2	B-Application
for	O
large	O
NAND	O
flash	B-Device
memory	I-Device
devices	O
.	O
</s>
<s>
This	O
is	O
a	O
consequence	O
of	O
the	O
UBIFS	B-Application
design	O
goals	O
:	O
faster	O
mounting	O
,	O
quicker	O
access	O
to	O
large	O
files	O
,	O
and	O
improved	O
write	O
speeds	O
.	O
</s>
<s>
UBIFS	B-Application
also	O
preserves	O
or	O
improves	O
upon	O
JFFS2	B-Application
's	O
on-the-fly	O
compression	O
,	O
recoverability	O
and	O
power	O
fail	O
tolerance	O
.	O
</s>
<s>
UBIFS	B-Application
's	O
on-the-fly	O
data	O
compression	O
allows	O
zlib	B-Language
(	O
deflate	B-Algorithm
algorithm	O
)	O
,	O
LZO	B-Language
or	O
Zstandard	B-Language
.	O
</s>
<s>
UBIFS	B-Application
stores	O
indexes	O
in	O
flash	O
whereas	O
JFFS2	B-Application
stores	O
filesystem	O
indexes	O
in	O
memory	O
.	O
</s>
<s>
This	O
directly	O
impacts	O
the	O
scalability	O
of	O
JFFS2	B-Application
as	O
the	O
tables	O
must	O
be	O
rebuilt	O
every	O
time	O
the	O
volume	O
is	O
mounted	O
.	O
</s>
<s>
Also	O
,	O
the	O
JFFS2	B-Application
tables	O
may	O
consume	O
enough	O
system	O
RAM	O
that	O
some	O
images	O
may	O
be	O
unusable	O
.	O
</s>
<s>
UBI	O
(	O
Unsorted	O
Block	O
Images	O
)	O
is	O
an	O
erase	O
block	O
management	O
layer	O
for	O
flash	B-Device
memory	I-Device
devices	O
.	O
</s>
<s>
UBI	O
serves	O
two	O
purposes	O
,	O
tracking	O
NAND	O
flash	B-Device
memory	I-Device
bad	O
blocks	O
and	O
providing	O
wear	B-Application
leveling	I-Application
.	O
</s>
<s>
Wear	B-Application
leveling	I-Application
spreads	O
the	O
erases	O
and	O
writes	O
across	O
the	O
entire	O
flash	O
device	O
.	O
</s>
<s>
UBI	O
was	O
written	O
specifically	O
for	O
UBIFS	B-Application
so	O
that	O
UBIFS	B-Application
does	O
not	O
have	O
to	O
deal	O
with	O
wear	B-Application
leveling	I-Application
and	O
bad	O
blocks	O
.	O
</s>
<s>
However	O
,	O
UBI	O
may	O
also	O
be	O
useful	O
with	O
squashfs	B-Application
and	O
NAND	O
flash	O
;	O
squashfs	B-Application
is	O
not	O
aware	O
of	O
NAND	O
flash	O
bad	O
blocks	O
.	O
</s>
<s>
Although	O
a	O
FTL	O
also	O
handles	O
bad	O
blocks	O
and	O
wear	B-Application
leveling	I-Application
,	O
the	O
interface	O
a	O
FTL	O
provides	O
is	O
a	O
block	O
device	O
with	O
small	O
(	O
typically	O
512	O
bytes	O
)	O
sectors	O
that	O
can	O
be	O
written	O
completely	O
independently	O
.	O
</s>
<s>
UBI	O
is	O
in	O
some	O
ways	O
analogous	O
to	O
a	O
Logical	B-Application
Volume	I-Application
Manager	I-Application
.	O
</s>
<s>
This	O
allows	O
wear-leveling	B-Application
to	O
be	O
spread	O
across	O
the	O
whole	O
flash	O
,	O
even	O
if	O
some	O
volumes	O
are	O
written	O
more	O
frequently	O
than	O
others	O
.	O
</s>
<s>
The	O
only	O
filesystem	O
that	O
directly	O
supports	O
UBI	O
is	O
UBIFS	B-Application
,	O
but	O
using	O
gluebi	O
it	O
's	O
possible	O
to	O
emulate	O
a	O
MTD	O
device	O
,	O
which	O
can	O
then	O
be	O
used	O
to	O
run	O
other	O
flash	O
filesystems	O
like	O
JFFS2	B-Application
and	O
YAFFS	O
,	O
and	O
using	O
ubiblk	O
it	O
's	O
possible	O
to	O
emulate	O
block	O
devices	O
,	O
which	O
can	O
run	O
common	O
filesystems	O
like	O
Ext4	O
.	O
</s>
<s>
UBI	O
was	O
augmented	O
in	O
Linux	B-Operating_System
3.7	O
with	O
fastmap	O
support	O
.	O
</s>
