This episode covers the foundations of DragonFlyBSD storage: comparing HAMMER2, UFS, tmpfs, and mfs; mount and umount operations; disk management with disklabel and newfs_hammer2; laying out /etc/fstab; checking with fsck; and swap configuration.

In episode 6 you set up services and boot order through the rc system. Now we go down to the most physical layer: disks and filesystems. All data — packages, logs, configuration, databases — ultimately lives on a filesystem. Understanding how filesystems are chosen, formatted, mounted, and maintained is a core administrator skill.
This episode is the foundation of storage. Here you'll get to know HAMMER2 as the primary filesystem, UFS as the classic alternative, tmpfs for fast storage in RAM, and mfs for memory-mapped filesystems. In episodes 8 and 9 we'll build this foundation into advanced HAMMER2 management.
HAMMER2 is DragonFlyBSD's default filesystem. It's designed for modern workloads: copy-on-write, per-block checksums, cheap snapshots, deduplication, compression, and encryption. For almost every need — root, data, snapshots — HAMMER2 is the first choice.
UFS is the mature, lightweight classic BSD filesystem. It doesn't have snapshot and checksum features like HAMMER2, but it's very stable and tested over decades. Use UFS for small partitions that don't need advanced features, or when compatibility with legacy tooling is a priority.
Both of these filesystems live in memory, so they're very fast but their contents disappear on reboot:
| Filesystem | Characteristics | Use cases |
|---|---|---|
tmpfs | RAM-based filesystem with a size limit | /tmp, cache, build areas |
mfs | Memory filesystem that can be mounted | Similar to tmpfs, from classic BSD |
Common uses: putting /tmp on tmpfs to speed up temporary file access, or pointing the DPorts build area at tmpfs so it doesn't wear down your disk.
Mounting is the process of attaching a filesystem to the directory hierarchy. The basic commands:
mount /dev/da1s1a /mnt/data
mount -t tmpfs tmpfs /tmp
umount /mnt/dataWithout specifying a filesystem, mount guesses from the disk's contents. For known filesystems, just name the device and the mount point. umount detaches the filesystem; you must make sure no process is using the mount point.
Show all mounted filesystems along with their options:
mount
df -hdf -h shows space usage in human-readable units — a command that will become your daily companion.
disklabel splits a disk into partitions. After plugging in a new disk, the steps are: initialize the label, create partitions, then format:
disklabel -r -w da1 auto
disklabel -e da1
newfs_hammer2 -L data /dev/da1s1ddisklabel -r -w da1 auto creates an automatic label; disklabel -e opens an editor to adjust the partitions. Once the layout is done, the partition is formatted with newfs_hammer2.
newfs_hammer2 formats a partition into a HAMMER2 filesystem. Important options worth knowing:
| Option | Purpose |
|---|---|
-L label | Sets the filesystem label |
-s size | Volume size |
-c 0/1 | Enables checksum (on by default) |
newfs_hammer2 -L data -s 10G /dev/da1s1dThis label is what you'll use for mounting in /etc/fstab — a more stable way to mount than remembering device names.
Filesystems you want always mounted at boot must be recorded in /etc/fstab. The format is: device/label, mount point, filesystem, options, dump, pass. Example:
# Device Mountpoint FSType Options Dump Pass
/dev/da0s1a / hammer2 rw 0 0
/dev/da0s1b none swap sw 0 0
/dev/da1s1d /data hammer2 rw 0 0
tmpfs /tmp tmpfs rw,mode=1777 0 0You can put all your HAMMER2 filesystems in one line with many mount points, or write one line per entry as above. After editing, test with mount -a to mount every entry without needing a reboot.
When the system doesn't shut down cleanly, the filesystem may need checking. fsck checks and repairs the filesystem structure:
fsck -t hammer2 /dev/da1s1dWith its copy-on-write design, HAMMER2 is fairly crash-tolerant, but periodic checking is still a healthy habit. For HAMMER2, the dedicated tools fsck_hammer2 and hammer2 offer deeper insight into filesystem health — we'll cover them in episode 11.
Swap is disk space used when RAM is full. Enabling swap on a prepared partition:
swapon /dev/da0s1b
swapinfoDragonFlyBSD also supports swapcache — using swap as a cache for rarely accessed HAMMER2 file data, reducing pressure on the main disk. This is an advanced setting useful for storage workloads (we'll touch on it in episode 19).
Warning
Pay attention to mount order: filesystems that hold other mount points must be mounted first. mount -a will fail if a parent entry is missing. Always test /etc/fstab changes with mount -a from single-user mode before rebooting, to avoid a system that can't boot.
In this episode 7 you understood the foundations of DragonFlyBSD storage: the comparison between HAMMER2, UFS, tmpfs, and mfs; mount and umount operations; disk management with disklabel and newfs_hammer2; laying out /etc/fstab for permanent mounts; checking with fsck; and swap configuration with swapon.
Key takeaways:
disklabel arranges partitions, newfs_hammer2 -L data /dev/da1s1d formats them./etc/fstab makes mounts permanent; test with mount -a before rebooting.fsck checks filesystems; swapon and swapinfo manage swap.df -h and mount are the two diagnostic commands you'll use most often.In the next episode, episode 8, we enter the heart of this series: HAMMER2 fundamentals. You'll learn the concepts of PFS and datasets, how to mount with mount_hammer2, adding volumes with hammer2 volume-add for multi-volume disk spanning, plus the compression properties (zstd, lz4), checksums, and mount options.