swap(8) on Solnix vs Linux and the BSDs

swap is the illumos swap administrative interface at /usr/sbin/swap. One command adds (-a), deletes (-d), lists (-l) and summarises (-s) swap areas. Linux uses swapon/swapoff and FreeBSD uses swapon/swapoff/swapctl, so swapctl-style flags do not carry over: swap -a adds one area, and swap -d deletes it.

What Solnix runs

A default Solnix system runs the illumos swap at /usr/sbin/swap. No other variants are shipped. The page says swap areas listed in /etc/vfstab are added at startup by the /sbin/swapadd script.

Differences

Compared withTopicWhat differs
all fourcommand name and structureSolnix uses a single swap command with -a, -d, -l and -s. Linux uses swapon and swapoff. FreeBSD uses swapon, swapoff and swapctl. OpenBSD and NetBSD use swapctl, with swapon as a compatibility name.
Source: Solnix swap(8) SYNOPSIS; Linux swapon(8) SYNOPSIS; FreeBSD swapctl(8) SYNOPSIS; OpenBSD swapctl(8) SYNOPSIS; NetBSD swapctl(8) SYNOPSIS
all fourboot-time configuration fileSolnix adds swap areas at startup through /sbin/swapadd, which reads /etc/vfstab. Linux, FreeBSD, OpenBSD and NetBSD read /etc/fstab. Linux skips entries with noauto. OpenBSD and NetBSD use the sw type.
Source: Solnix swap(8) -a; Linux swapon(8) -a; FreeBSD swapctl(8) DESCRIPTION; OpenBSD swapctl(8) -A; NetBSD swapctl(8) -A
all fouradding all swap from the config fileSolnix swap -a takes a swapname and adds that one area. It cannot add everything from the config file. On Linux, swapon -a adds every swap entry in /etc/fstab. On OpenBSD and NetBSD, swapctl -A does this, and FreeBSD swapctl -A does too. FreeBSD swapctl -a means a specific list of devices.
Source: Solnix swap(8) -a; Linux swapon(8) -a; FreeBSD swapctl(8) DESCRIPTION (-a, -A); OpenBSD swapctl(8) -A, -a; NetBSD swapctl(8) -A, -a
Linuxremoving swapSolnix removes a swap area with swap -d swapname. Linux uses a separate command, swapoff, and swapoff -a disables all known swap devices. The Solnix page documents no delete-all option.
Source: Solnix swap(8) -d; Linux swapon(8) DESCRIPTION, SYNOPSIS (swapoff)
FreeBSD, OpenBSD, NetBSD-d takes a path, with optional swaplowSolnix swap -d takes swapname and an optional swaplow offset in 512-byte blocks. OpenBSD and NetBSD swapctl -d take only a path. Without swaplow, Solnix deletes starting at the second page.
Source: Solnix swap(8) -d; OpenBSD swapctl(8) -d; NetBSD swapctl(8) -d
Linux, OpenBSD, NetBSDswap prioritySolnix swap has no priority option. Linux swapon -p sets a priority from 0 to 32767. OpenBSD and NetBSD swapctl take -p priority, and -c changes the priority of an existing device. FreeBSD says there is no priority mechanism.
Source: Solnix swap(8) SYNOPSIS; Linux swapon(8) -p; OpenBSD swapctl(8) -p, -c; NetBSD swapctl(8) -p, -c; FreeBSD swapctl(8) DESCRIPTION
FreeBSD, OpenBSD, NetBSD-l list columns and unitsSolnix swap -l prints path, dev, swaplo, blocks and free, in 512-byte blocks. -k gives 1024-byte units and -h scales by 1024. A sixth column shows INDEL while an area is being deleted. The BSD pages document 512-byte default blocks. FreeBSD and NetBSD swapctl also have -m and -g, which Solnix lacks.
Source: Solnix swap(8) -l, -h, -k; FreeBSD swapctl(8) -h, -g, -k, -m; OpenBSD swapctl(8) -k, -l; NetBSD swapctl(8) -g, -k, -m
Linuxlisting and output controlSolnix swap -l and -s are fixed-format. Linux swapon --show has selectable columns, --noheadings, --raw and --bytes. Linux swapon -s is deprecated in favour of --show. The Solnix page documents no equivalent options.
Source: Solnix swap(8) -l, -s; Linux swapon(8) -s, --show, --noheadings, --raw, --bytes
FreeBSD, OpenBSD, NetBSD-s summary contentSolnix swap -s reports allocated, reserved, used and available swap in bytes. The totals include physical memory used as swap space, and -h scales them. The BSD pages describe -s only as a single-line or summary line of swap statistics.
Source: Solnix swap(8) -s; FreeBSD swapctl(8) -s; OpenBSD swapctl(8) -s; NetBSD swapctl(8) -s
all fourswap on regular files and ZFSOn Solnix with ZFS, swap must be a ZFS volume such as /dev/zvol/dsk/rpool/swap. A regular file is not supported for swap on ZFS. A ZFS volume cannot be both swap and dump device on a ZFS root. The other pages do not describe ZFS volumes.
Source: Solnix swap(8) -a
NetBSDdump device handlingNetBSD swapctl can set (-D) and show (-z) the kernel dump device. The Solnix swap page documents no dump-device option. It only says a ZFS volume cannot be both swap and dump on a ZFS root.
Source: NetBSD swapctl(8) -D, -z; Solnix swap(8) -a
all fourexit statusThe Solnix swap page has no EXIT STATUS section. Linux documents swapoff codes 0, 2, 4, 8, 16, 32 and 64. OpenBSD swapctl exits 0 or >0. NetBSD swapctl exits 0 or 1, and 2 when -A or -U finds no suitable swap device.
Source: Linux swapon(8) EXIT STATUS; OpenBSD swapctl(8) EXIT STATUS; NetBSD swapctl(8) EXIT STATUS; Solnix swap(8)

Everyday tasks

TaskSolnixLinuxFreeBSDOpenBSDNetBSD
add a swap areaswap -a swapnameswapon specialfileswapon file, or swapctl -a fileswapctl -a pathswapctl -a path
remove a swap areaswap -d swapnameswapoff specialfileswapoff file, or swapctl -d fileswapctl -d pathswapctl -d path
add all configured swap at boot/sbin/swapadd (reads /etc/vfstab)swapon -aswapon -a, or swapctl -Aswapctl -Aswapctl -A
list swap areasswap -lswapon --showswapctl -lswapctl -lswapctl -l
swap usage summaryswap -sswapon -s (deprecated)swapctl -s, or swapinfoswapctl -sswapctl -s
human-readable sizesswap -l -h—swapctl -h or swapinfo -h—swapctl -l -h
set swap priority—swapon -p priority—swapctl -a -p priority pathswapctl -a -p priority path

Standards

Writing portable scripts

  • Wrap swap operations in a function that checks which tool exists (swap, swapon/swapoff, swapctl). The flags mean different things: -a adds one area on Solnix and all fstab entries on Linux.
  • Do not parse swap -l or swapon -s output across systems. Columns, units and headings differ, and Solnix lists sizes in 512-byte blocks unless -k or -h is given.

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.