With the 64-bit HAMMER2 from Dragonfly BSD, NetBSD receives Matthew Dillon’s file system, which was specially developed for cluster operation. A port of the ZFS originally developed by Sun Microsystems based on the FreeBSD code has been available in NetBSD since version 8. ZFS runs fairly stable on NetBSD 9.3. The 128-bit ZFS is designed for large amounts of data and offers checksum-based protection against data loss, for example due to tipping of individual bits on data carriers.

HAMMER2 from Dragonfly BSD is the successor to the HAMMER file system, built from the ground up for improved clustering. HAMMER2 supports online and batch deduplication, snapshots, indexing of directory entries, multiple mountable root file systems, mountable snapshots, a – according to the project – small footprint, native compression, native encryption, checksums for data and metadata, and synchronization with other file systems or Node.

NetBSD normally uses the FFS file system (Fast File System) as is typical for BSD, especially on the many weak platforms. The fast in FFS refers to the previously used UFS (UNIX File System), which was simple and elegant, but also slow – the already low possible bandwidth of hard disks from the early 80s was only used to a small percentage. FFS was a big step forward and was primarily developed by Marshall Kirk McKusick. It’s simple, bug-free, and still the standard file system for BSDs today.

In his GitHub repository describes Tomohiro Kusumi the installation of HAMMER2. For a project of this size and complexity, the requirements and the build instructions seem extremely simple at first glance: You need a current NetBSD (currently version 9.3) with the source code installed (“fetch and unpack pkgsrc” during installation), Kusumi’s GitHub, of course -repo – and starts make.

An early read-only port of the HAMMER2 filesystem on NetBSD 9.3.

In practice, it gets stuck in a few places. A fresh NetBSD 9.3 install requires git, which also requires the root certificates for OpenSSL to avoid the “SSL certificate problem: unable to get local issuer certificate” error (as root):

sudo pkgin install git mozilla-rootcerts-openssl

Then the regular user has to open the SSL backend openssl switch:

git config --global http.sslBackend openssl

Now the Kusumi repository can be added via:

git clone https://github.com/kusumi/netbsd_hammer2

In addition, the complete source code of NetBSD is required:

sudo mkdir /usr/src
sudo chown <Benutzername> /usr/src
sudo mkdir /usr/xsrc
sudo chwon <Benutzername> /usr/xsrc

Now the user fetches the source code from NetBSD…

ftp -i ftp://ftp.NetBSD.org/pub/NetBSD/NetBSD-9.3/source/sets/
   ftp> mget *.tgz
   ftp> quit

and unpacks it:

for file in *.tgz
   do
   tar -xzf $file -C /
   done

Now change to the netbsd_hammer2 directory as Kusumi indicated and start make, there is an error linking xxhash. You can fix this by first copying the two files xxhash.c and xxhash.h from the directory netbsd_hammer2/src/sys/fs/hammer2/xxhash/ up one level

 cd ~netbsd_hammer2/src/sys/fs/hammer2
 cp xxhash/xxhash.* ..

and there in the Makefile in the line SRCS=... the path part xxhash/xxhash.c away:

SRCS= hammer2_lz4.c hammer2_subr.c hammer2_vfsops.c xxhash.c icrc32.c

On

cd ~/netbsd_hammer2
make

now runs clean. HAMMER2 can then

sudo mkdir /usr/local
sudo sh ./script/install.sh

installed once the hammer2.kmod kernel module has loaded:

modload src/sys/fs/hammer2/hammer2.kmod
modstat hammer2

The early port of HAMMER2 runs on NetBSD 9.3 or better -CURRENT in read-only mode, so it’s only useful for testing or development. Since the focus of NetBSD is actually on portability and many rather weak architectures are supposed to be supported, the ports of ZFS and HAMMER2 are not to be regarded as essential for the operation of NetBSD. Nevertheless, important development work is done here in both cases, because the ports, for example, API calls are examined more closely and partially cleaned up. So porting HAMMER2 to NetBSD will help get HAMMER2 running on FreeBSD as well. Other free operating systems that don’t attach much importance to the support of the BSDs can later reap the fruits of the HAMMER2 ports and integrate the interesting file system more easily.


More from iX Magazine

More from iX Magazine


More from iX Magazine

More from iX Magazine


(fo)

To home page

California18

Welcome to California18, your number one source for Breaking News from the World. We’re dedicated to giving you the very best of News.

Leave a Reply