DragonFly On-Line Manual Pages
NEWFS_HAMMER2(8) DragonFly System Manager's Manual NEWFS_HAMMER2(8)
newfs_hammer2 - construct a new HAMMER2 file system
newfs_hammer2 [-b bootsize] [-r auxsize] [-V version] [-L label ...]
The newfs_hammer2 utility prepares a HAMMER2 volume on the specified
block device. HAMMER2 volumes can contain any number of named PFSs
(Pseudo FileSystems). Each named PFS can operate independently or be a
constituent of a larger cluster. Regardless, you must still format each
block device separately using this command.
The newfs_hammer2 program always creates a PFS called "LOCAL" which may
be used for device-specific configuration. This PFS should never be used
for generic data.
If no -L option is specified, newfs_hammer2 will use the partition id to
create a default label for you.
"BOOT" is created.
"ROOT" is created.
"DATA" is created.
You can override the default PFS name by specifying one or more -L
options. By default these PFSs all represent unclustered mount points.
You can specify -L none if you do not want newfs_hammer2 to create any
PFSs other than "LOCAL".
Generally speaking this command is not used to create clusters. It is
used to format volumes which are then made available for additional
clustering commands. Once formatted the device@LOCAL volume can be
mounted in order to make it and all other PFSs created on the volume
available to the cluster.
You can use hammer2(8) directives to construct your cluster, including
the creation of additional PFSs within various volumes. If you are
managing several machines, or a large number of machines, -L none is
typically specified to reduce clutter.
HAMMER2 file systems are sector-size agnostic, however the DragonFly
implementation requires the sector size to be no larger than 16K.
HAMMER2 file systems start at a relative offset of 0 and leave no room
for in-band disklabels (old, traditional BSD labels). They may only be
created using out-of-band disk labels, which is the default on DragonFly
via (disklabel(5) or gpt(8) labels), or with old style disklabels as long
as the partition does not overlap the label area (have a starting sector
greater than 16).
HAMMER2 file systems are designed for large storage systems, up to 1
Exabyte, and may not operate efficiently on small storage systems. The
minimum recommended file system size is 50GB. In addition, HAMMER2 file
systems operating normally, with automatic snapshots, do not immediately
reclaim space when files are deleted. A regular system maintenance job
runs once a day by periodic(8) to handle reclamation.
HAMMER2 works best when the machine's normal workload would not otherwise
fill the file system up in the course of 60 days of operation.
The options are as follows:
Specify a fixed area in which a boot related kernel and data can
be stored. The bootsize is specified in bytes. By default a
boot area of approximately 64MB will be created. This area is
not currently used for booting and may be repurposed in the
Specify a fixed area in which an aux related kernel and data can
be stored. The auxsize is specified in bytes. By default an aux
area of approximately 256MB will be created. This area is not
currently used and may be repurposed in the future.
Specify the HAMMER2 file system version to format. By default
newfs_hammer2 formats the file system using the highest
production version number supported by the HAMMER2 VFS by
checking the vfs.hammer2.supported_version sysctl. If you need
to maintain compatibility with an older version of HAMMER2 you
may specify the version with this option.
By default newfs_hammer2 always creates a local master PFSs on
the new volume called "LOCAL", and will conditionally also create
"BOOT", "ROOT", or "DATA" depending on the partition ('b' creates
"BOOT", 'd' creates "ROOT", and any other partition creates
If you specify one or more label options to create your own named
local PFSs, newfs_hammer2 will not create any conditional PFSs.
However, "LOCAL" is still always created and should not be
specified with this option. If you don't want any PFSs to be
created (other than "LOCAL"), use -L none.
Typically simple HAMMER2 filesystems just use the defaults and -L
none is used for more complex filesystem, followed by mounting
device@LOCAL and using hammer2 directives to create the desired
The bootsize and auxsize must be given with a suffix of K, M, G or T
meaning kilobyte, megabyte, gigabyte and terabyte. Lower case can also
be used for suffix. These options create reserved blocks of space on the
target volume but are not currently used by the filesystem for anything.
The newfs_hammer2 utility exits 0 on success, and >0 if an error occurs.
newfs_hammer2 -L SATURN-HOME /dev/ad0s1d
Create a file system named `SATURN-HOME' on /dev/ad0s1d.
disklabel32(5), disklabel64(5), HAMMER2(5), fdisk(8), gpt(8),
The newfs_hammer2 utility first appeared in DragonFly 3.1 but was not
enabled unconditionally until DragonFly 4.9.
Matthew Dillon <email@example.com>
DragonFly 5.9-DEVELOPMENT November 29, 2020 DragonFly 5.9-DEVELOPMENT