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.
The manual pages
- Solnix: fmthard(8) from
pkgs.solnix.illumos-world-man· illumos.org - Linux: sfdisk(8) util-linux-2.42.3 (different command, similar job)
- FreeBSD: gpart(8) 15.1-RELEASE (different command, similar job)
- OpenBSD: disklabel(8) 8.0 (different command, similar job)
- NetBSD: disklabel(8) 11.0 (different command, similar job)
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 with | Topic | What differs |
|---|---|---|
| all four | label model | fmthard 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 four | device argument | fmthard 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 flag | Solnix 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 four | dry run and output | fmthard -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 flag | Solnix 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 four | slice 2 whole-disk entry | Every 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 |
| OpenBSD | slice numbering | fmthard 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 four | unlabeled disks | For 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, FreeBSD | backup and restore | fmthard 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 |
| NetBSD | size limit | The 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
| Task | Solnix | Linux | FreeBSD | OpenBSD | NetBSD |
|---|---|---|---|---|---|
| write a label from a file | fmthard -s datafile /dev/rdsk/c?[t?]d?s2 | sfdisk device (script on stdin) | gpart restore provider | disklabel -R disk protofile | disklabel -R disk protofile |
| preview without writing | fmthard -i -s datafile /dev/rdsk/c?[t?]d?s2 | sfdisk -n device | — | disklabel -n | disklabel -n |
| print the current label | prtvtoc (see prtvtoc(8)) | — | gpart show | disklabel disk | disklabel disk |
| dump a label for later reuse | prtvtoc output saved to a file | sfdisk -b | gpart backup geom | disklabel -t disk | disklabel -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.