Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

UFS1 vs UFS2

170 views
Skip to first unread message

Wojciech Puchar

unread,
Dec 30, 2012, 8:21:45 AM12/30/12
to freebsd...@freebsd.org
OpenBSD by default use UFS1 for partitions smaller than 1TB.

FreeBSD use always UFS2. UFS2 uses double the amount of space for inodes.
basic operation seems the same.

Does it make sense to use UFS1 for small filesystem (on SSD) that would
have few millions of files. It will take less space for inodes, but how
about performance?

_______________________________________________
freebsd...@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hacke...@freebsd.org"

Quentin SCHWERKOLT

unread,
Dec 30, 2012, 10:39:09 AM12/30/12
to Wojciech Puchar, freebsd...@freebsd.org
Since FreeBSD 9.0, you can choose between UFS1 and UFS2 in bsdinstall(8) when creating a new freebsd-ufs partition.

Q. Schwerkolt

> Date: Sun, 30 Dec 2012 14:21:26 +0100
> From: woj...@wojtek.tensor.gdynia.pl
> To: freebsd...@freebsd.org
> Subject: UFS1 vs UFS2

Paul Schenkeveld

unread,
Dec 30, 2012, 2:39:54 PM12/30/12
to freebsd...@freebsd.org
On Sun, Dec 30, 2012 at 02:21:26PM +0100, Wojciech Puchar wrote:
> OpenBSD by default use UFS1 for partitions smaller than 1TB.
>
> FreeBSD use always UFS2. UFS2 uses double the amount of space for inodes.
> basic operation seems the same.
>
> Does it make sense to use UFS1 for small filesystem (on SSD) that would
> have few millions of files. It will take less space for inodes, but how
> about performance?

UFS2 became necessary when disk got bigger and sizes and block pointers
in metadata on UFS1 became too small to fully utilize the larger disks.

Because of the larger sizes and pointers UFS2 broke binary compatibility
with UFS1 unavoidably, the switch to UFS2 opened the way for other binary
incompatilble enhancements to the file system like inode birth times and
extended attributes (used by ACL's for example).

It makes perfect sense to use UFS1 on systems where space savings matter
unless your application requires any of the new features that are not
present in UFS1.

Nanobsd(8) for example uses UFS1 by default too.

HTH

Paul Schenkeveld

Wojciech Puchar

unread,
Dec 30, 2012, 2:41:56 PM12/30/12
to Quentin SCHWERKOLT, freebsd...@freebsd.org
i chose with newfs as i don't use installer :)

anyway - it is not an answer to the question.

Wojciech Puchar

unread,
Dec 30, 2012, 2:43:22 PM12/30/12
to Paul Schenkeveld, freebsd...@freebsd.org
> It makes perfect sense to use UFS1 on systems where space savings matter
> unless your application requires any of the new features that are not
> present in UFS1.
>
> Nanobsd(8) for example uses UFS1 by default too.
thank you for answering. i don't need any new extra features, just plain
filesystem on 60GB filesystem. But question is - will performance be the
same, slower or faster?

Paul Schenkeveld

unread,
Dec 30, 2012, 3:03:30 PM12/30/12
to freebsd...@freebsd.org
On Sun, Dec 30, 2012 at 08:42:27PM +0100, Wojciech Puchar wrote:
> > It makes perfect sense to use UFS1 on systems where space savings matter
> > unless your application requires any of the new features that are not
> > present in UFS1.
> >
> > Nanobsd(8) for example uses UFS1 by default too.
> thank you for answering. i don't need any new extra features, just plain
> filesystem on 60GB filesystem. But question is - will performance be the
> same, slower or faster?

I don't think performance will be much different but if so, UFS1 would
be (sightly) faster than UFS2 because one page read will get more inodes
from disk and 32 bit (UFS1) arithmetic may be slightly faster than 64 bit
(UFS2).

If performance is an issue, consider turning off atime updates or even
mount the filesystem read-only if possible.

HTH

Paul Schenkeveld

Wojciech Puchar

unread,
Dec 30, 2012, 3:29:47 PM12/30/12
to Paul Schenkeveld, freebsd...@freebsd.org
>
> I don't think performance will be much different but if so, UFS1 would
> be (sightly) faster than UFS2 because one page read will get more inodes
> from disk and 32 bit (UFS1) arithmetic may be slightly faster than 64 bit
> (UFS2).

thanks for answer i was looking for! i will rebuild FS to UFS1, saving ca
1GB for inodes.

> If performance is an issue, consider turning off atime updates or even
> mount the filesystem read-only if possible.
i always turn off atime and use softupdates.

it cannot be readonly.

Paul Schenkeveld

unread,
Dec 30, 2012, 3:48:20 PM12/30/12
to Wojciech Puchar, freebsd...@freebsd.org
On Sun, Dec 30, 2012 at 09:29:27PM +0100, Wojciech Puchar wrote:
> >
> > I don't think performance will be much different but if so, UFS1 would
> > be (sightly) faster than UFS2 because one page read will get more inodes
> > from disk and 32 bit (UFS1) arithmetic may be slightly faster than 64 bit
> > (UFS2).
>
> thanks for answer i was looking for! i will rebuild FS to UFS1, saving ca
> 1GB for inodes.

Also, look at the -i option of newfs, for many purposes the default
number of inodes it allocates is far more than sufficient

Joerg Sonnenberger

unread,
Dec 30, 2012, 8:57:30 PM12/30/12
to freebsd...@freebsd.org
On Sun, Dec 30, 2012 at 08:39:26PM +0100, Paul Schenkeveld wrote:
> On Sun, Dec 30, 2012 at 02:21:26PM +0100, Wojciech Puchar wrote:
> > OpenBSD by default use UFS1 for partitions smaller than 1TB.
> >
> > FreeBSD use always UFS2. UFS2 uses double the amount of space for inodes.
> > basic operation seems the same.
> >
> > Does it make sense to use UFS1 for small filesystem (on SSD) that would
> > have few millions of files. It will take less space for inodes, but how
> > about performance?
>
> UFS2 became necessary when disk got bigger and sizes and block pointers
> in metadata on UFS1 became too small to fully utilize the larger disks.

There is also the possible concern of Extended Attributes. If you use
them, you might be a lot more happy with UFS2.

Joerg
0 new messages