fstyp(8) on Solnix vs Linux and the BSDs

On Solnix, fstyp is the illumos fstyp at /usr/sbin/fstyp. It runs one heuristic module per file system type, and its options (-a, -v) are unrelated to the -l, -s and -u of FreeBSD and NetBSD. The Solnix page says its results should not be used to make decisions about a device.

What Solnix runs

A default Solnix system runs the illumos fstyp at /usr/sbin/fstyp. No other variants are shipped. The synopsis also accepts an optional :logical-drive after the special argument.

Differences

Compared withTopicWhat differs
FreeBSD, NetBSDoption sets differSolnix fstyp takes -a and -v only. FreeBSD and NetBSD take -l, -s and -u only. A script using any of those BSD flags fails on Solnix, and the reverse also holds.
Source: Solnix fstyp(8) SYNOPSIS, OPTIONS; FreeBSD fstyp(8) SYNOPSIS; NetBSD fstyp(8) SYNOPSIS
FreeBSD, NetBSDprinting the labelOn FreeBSD and NetBSD, -l prints the file system label after the type. On Solnix, -a prints name-value attributes, and the generic attribute gen_volume_label holds the volume label if the file system provides one.
Source: FreeBSD fstyp(8) -l; NetBSD fstyp(8) -l; Solnix fstyp(8) -a, gen_volume_label
FreeBSD, NetBSDoutput formatThe BSDs print the type name, plus the label with -l. Solnix -a adds one 'name: value' pair per line after the type. Strings are in single quotes, and nested lists are indented four spaces. Parse these differently.
Source: Solnix fstyp(8) -a; FreeBSD fstyp(8) DESCRIPTION; NetBSD fstyp(8) DESCRIPTION
FreeBSD, NetBSDexit statusSolnix exits 0 on a match, 1 with 'unknown_fstyp (no matches)', and 2 with 'unknown_fstyp (multiple matches)'. FreeBSD and NetBSD document only 0 on success and >0 on error or unrecognised type.
Source: Solnix fstyp(8) DESCRIPTION; FreeBSD fstyp(8) EXIT STATUS; NetBSD fstyp(8) EXIT STATUS
FreeBSD, NetBSDrecognised file systemsSolnix runs a module per file system type. The page names ufs as an identifier example and refers to hsfs(4FS), pcfs(4FS) and ufs(4FS) in SEE ALSO, but does not list the full set. FreeBSD and NetBSD list the types they recognise and the names printed, such as cd9660, msdosfs, ntfs, ufs and zfs.
Source: Solnix fstyp(8) DESCRIPTION, SEE ALSO; FreeBSD fstyp(8) DESCRIPTION; NetBSD fstyp(8) DESCRIPTION
FreeBSD, NetBSD-u and non-mountable formatsOn FreeBSD and NetBSD, -u adds formats mount(8) cannot handle, such as ZFS pools (and geli on FreeBSD). Solnix has no -u, and its page does not say which types it detects or whether ZFS is among them.
Source: FreeBSD fstyp(8) -u; NetBSD fstyp(8) -u; Solnix fstyp(8) OPTIONS
FreeBSD, NetBSDfile type restrictionOn FreeBSD and NetBSD, fstyp works only on regular files and disk-like device nodes unless -s is given. The Solnix page documents no such restriction and no -s.
Source: FreeBSD fstyp(8) -s; NetBSD fstyp(8) -s; Solnix fstyp(8) OPTIONS
FreeBSD, NetBSDverbose outputSolnix -v prints superblock information that varies by file system type, with details in ufs(4FS), mkfs_ufs(8) and tunefs(8). FreeBSD and NetBSD have no -v.
Source: Solnix fstyp(8) -v; FreeBSD fstyp(8) SYNOPSIS; NetBSD fstyp(8) SYNOPSIS
FreeBSDsandboxingFreeBSD fstyp runs sandboxed using capsicum(4). The Solnix and NetBSD pages do not mention sandboxing.
Source: FreeBSD fstyp(8) DESCRIPTION; Solnix fstyp(8); NetBSD fstyp(8)
FreeBSD, NetBSDreliability statementThe Solnix page twice says fstyp is unreliable and its results should not drive decisions about using a device or partition. The FreeBSD and NetBSD pages carry no such warning.
Source: Solnix fstyp(8) DESCRIPTION, NOTES; FreeBSD fstyp(8); NetBSD fstyp(8)
FreeBSD, NetBSDclean-state checkWith -a, Solnix reports gen_clean. If it is false, the file system is damaged or was not cleanly unmounted and fsck(8) must be run before mounting. The BSD pages document no equivalent.
Source: Solnix fstyp(8) -a gen_clean; FreeBSD fstyp(8); NetBSD fstyp(8)

Standards

  • POSIX: fstyp is not a POSIX.1-2024 utility.
  • Solnix: The Solnix page names attributes(7) and largefile(7) in SEE ALSO, but the bundle text has no ATTRIBUTES or stability section.

Writing portable scripts

  • Do not rely on fstyp options in portable scripts: Solnix has -a and -v, while FreeBSD and NetBSD have -l, -s and -u. Use a bare 'fstyp special' and read only the first line of output.
  • Treat any non-zero exit as 'unknown'. Solnix uses 1 and 2, the BSDs only say >0. Do not use the result alone to decide whether to mount or reformat a device.

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.