fmthard(8) on Solnix vs Linux and the BSDs

fmthard is the illumos command at /usr/sbin/fmthard that writes or changes the VTOC (Volume Table of Contents) label on a disk. It is a different tool from sfdisk, gpart and disklabel: it takes a datafile or a part:tag:flag:start:size string rather than an interactive editor or partitioning actions, and it works only on the raw slice-2 device.

What Solnix runs

A default Solnix system runs the illumos fmthard at /usr/sbin/fmthard. No other variants are shipped. To print a label, use prtvtoc(8). On x86, run fdisk(8) before fmthard.

Differences

Compared withTopicWhat differs
all fourlabel modelfmthard edits a VTOC and takes one of -s datafile, -d data or -n volume_name. sfdisk handles MBR, GPT, SUN and SGI labels. gpart works on GEOM partitioning schemes. OpenBSD and NetBSD disklabel handle BSD disk labels.
Source: Solnix fmthard(8) DESCRIPTION; Linux sfdisk(8) DESCRIPTION; FreeBSD gpart(8) DESCRIPTION; OpenBSD disklabel(8) DESCRIPTION; NetBSD disklabel(8) DESCRIPTION
all fourdevice argumentfmthard must be given the character special file of slice 2, /dev/rdsk/c?[t?]d?s2. sfdisk takes a block device, gpart a geom or provider, and OpenBSD disklabel accepts abbreviated names such as wd0.
Source: Solnix fmthard(8) DESCRIPTION; Linux sfdisk(8) SYNOPSIS; FreeBSD gpart(8) SYNOPSIS; OpenBSD disklabel(8) disk
Linux, OpenBSD, NetBSD-n flagSolnix fmthard -n sets a volume name of up to 8 characters. Linux sfdisk -n (--no-act) and OpenBSD and NetBSD disklabel -n do not write the label, or make no permanent change. The dry-run option on Solnix is -i.
Source: Solnix fmthard(8) -n, -i; Linux sfdisk(8) -n, --no-act; OpenBSD disklabel(8) -n; NetBSD disklabel(8) -n
all fourdry run and outputfmthard -i builds the VTOC and prints it to standard output without changing the disk. sfdisk and OpenBSD disklabel do a dry run with -n, and disklabel -n is for debugging.
Source: Solnix fmthard(8) -i; Linux sfdisk(8) --no-act; OpenBSD disklabel(8) -n
FreeBSD, OpenBSD, NetBSD-s flagSolnix fmthard -s datafile (or - for standard input) fills the VTOC from a file. It also sets all partition timestamp fields to zero. FreeBSD gpart create -s selects a partitioning scheme, and gpart add -s sets a partition size.
Source: Solnix fmthard(8) -s; FreeBSD gpart(8) create -s scheme, add -s size
all fourslice 2 whole-disk entryEvery VTOC written by fmthard has partition 2 as the whole disk. If the datafile has no entry for it, fmthard adds one with tag V_BACKUP and the full disk size. sfdisk does not create such system partitions for SGI and SUN labels. OpenBSD documents a kernel-created c partition for the whole disk.
Source: Solnix fmthard(8) -s; Linux sfdisk(8) DESCRIPTION; OpenBSD disklabel(8) DESCRIPTION
OpenBSDslice numberingfmthard numbers partitions from 0 and allows 0-7 on SPARC and 0-15 on x86. OpenBSD disklabel uses letters a to p, leaving out c.
Source: Solnix fmthard(8) partition; OpenBSD disklabel(8) DESCRIPTION
all fourunlabeled disksFor disks under two terabytes, fmthard cannot write a VTOC on an unlabeled disk; use format(8) first. OpenBSD disklabel -w and NetBSD disklabel -w write a standard label on a disk.
Source: Solnix fmthard(8) NOTES; OpenBSD disklabel(8) -w; NetBSD disklabel(8) -w
Linux, FreeBSDbackup and restorefmthard has no backup option. Its NOTES advise saving the old VTOC first, and the output of prtvtoc(8) can be edited and reused as a datafile. sfdisk has -b/--backup, and gpart has backup and restore actions.
Source: Solnix fmthard(8) NOTES, -s; Linux sfdisk(8) -b, --backup; FreeBSD gpart(8) backup, restore
NetBSDsize limitThe NetBSD disklabel BUGS section says its on-disk label cannot handle partitions or disks over 2TB; use gpt(8) and dkctl(8). The fmthard page limits only the case of writing a VTOC to an unlabeled disk under two terabytes.
Source: NetBSD disklabel(8) BUGS; Solnix fmthard(8) NOTES

Everyday tasks

TaskSolnixLinuxFreeBSDOpenBSDNetBSD
write a label from a filefmthard -s datafile /dev/rdsk/c?[t?]d?s2sfdisk device (script on stdin)gpart restore providerdisklabel -R disk protofiledisklabel -R disk protofile
preview without writingfmthard -i -s datafile /dev/rdsk/c?[t?]d?s2sfdisk -n device—disklabel -ndisklabel -n
print the current labelprtvtoc (see prtvtoc(8))—gpart showdisklabel diskdisklabel disk
dump a label for later reuseprtvtoc output saved to a filesfdisk -bgpart backup geomdisklabel -t diskdisklabel -t disk

Standards

  • POSIX: fmthard is not a POSIX.1-2024 utility.

Writing portable scripts

  • Label tools are not interchangeable: branch on the tool present (fmthard, sfdisk, gpart, disklabel) and keep a per-OS datafile format.
  • Always save the existing label before writing (prtvtoc on Solnix), as the fmthard NOTES advise.

Every difference here is taken from the manual pages linked above: Solnix's published page, Linux (man-pages and the GNU and util-linux manuals), FreeBSD, OpenBSD and NetBSD. Each row names its source. Where a manual is silent, this page is too. Compiled 2026-10-26. Found a mistake? Mail hackers@lists.solnix.io.