Frank DENIS random thoughts.

OpenBSD finally got UFS2

Finally, OpenBSD-current has support for UFS2. Wonderful screenshot as a proof:

<pre> $ mount /dev/wd2a on / type ffs (local, noatime, softdep) /dev/wd2d on /mnt/ufs2 type ffs2 (local, noatime, softdep) </pre>

I played a bit with it on an amd64 test box, and it seems to work fine so far. The only minor issue I had with it was df -h saying that 8 terabytes (!) were free while the sad truth is that the partition was only 20 gigabytes long.

But no crash and no file corruption.

Here’s a first benchmark, but keep in mind that the filesystem hackathon is not over and there will probably be some other important code changes in the next days, probably some work on the buffer cache (UBC and a better elevator would really be a step forward for OpenBSD).

  • Blogbench (default configuration), UFS : Final score for writes: 64 Final score for reads : 4846
  • Blogbench (default configuration), UFS2 : Final score for writes: 60 Final score for reads : 4934

The buffer cache was intentionnaly as low as possible (1%) during the test, and of course both filesystems were freshly created on the same partition.

As you can see, there’s no real speed difference between UFS and UFS2.

If you want to play with UFS2, upgrade to -current and recompile your kernel with that line added to your config:

<pre> option UFS2 </pre>

Then, format a partition with something like (adjust /dev/rwd2d for your needs) :

<pre> newfs -O 2 /dev/rwd2d </pre>

The mount the partition as usual:

<pre> mount -o softdep,noatime /dev/wd2d /mnt/ufs2 </pre>