PROPHET/OS
NAME
pfs: pFS is the file system of this machine and carries the root
SYNOPSIS
pfs <command> ...
DESCRIPTION
PFS is the file system of this machine and carries the root. pfs without a command shows the state of the mounted one: block size, how much is in use, how many datasets and snapshots stand on it.
The group says what you name
Four groups, and the rule is the one of the calls: **the group says what you have to name.** Sixteen commands used to stand flat beside each other, and three levels lay mixed up in them: format wanted a drive number, snap a dataset, stat a path, and nothing about the name said which of the three was meant (R9-PFS-30).
pfs the state of the mounted one
pfs help the commands, as the program knows them
pfs disk ... you name a DRIVE NUMBER
list which drives carry a PFS
status [drive] what the machine already knows
format <drive> <name> create, and that erases
mount <drive> mount
umount unmount
check <drive> the structure, fast
scrub <drive> read every block, recompute its sum
expand-partition <drive> the table takes the whole drive
expand <drive> the filesystem takes the rest
pfs dataset ... you name a DATASET
list datasets and snapshots with their numbers
status <ds> what the record keeps about one
new <ds> [cow=off] create, cow=on is the default
remove <ds> remove
get <ds> <name> read a property
set <ds> <name> <value> set one
attributes which there are, with valid values
pfs snapshot ... you name a SNAPSHOT
list [ds] all of them, or those of one dataset
new <ds> <name> create
clone <ds@name> <new> a writable dataset out of it
remove <ds@name> remove
pfs file ... you name a PATH
info <path> everything about the entry
rights <path> [octal] read without a value, set with one
owner <path> [user group] the same
time <path> [which value] the same; which is created, changed or read
sync [path] write everything through to the disk
**There are no old names beside the new ones.** Two names for one thing are two paths that drift apart, so the renames are renames: stat is file info, mode is file rights, snap and snaprm are snapshot new and snapshot remove, rm is dataset remove, set with no argument is dataset attributes.
sync names none of the four groups and it takes a path, so it stands with the other path commands.
pfs disk format writes over the whole drive without asking. The drive numbers come from disks, and drive 0 is the image the machine started from.
Copy on write is fixed when a dataset is created and cannot be switched later: a dataset that was written in place has no older blocks to point a snapshot at. The other attributes can be changed at any time and apply to what is written from then on, not to what already lies there.
A snapshot is read, a clone is written
pfs snapshot clone root@yesterday rescue makes rescue a dataset of its own that starts out of root@yesterday. It costs no block: both point at the same blocks, and the barrier of copy on write means every write into rescue lands on a new place, so the snapshot stays byte for byte what it was. A snapshot itself takes no write, and that is not a missing feature: it is what makes it worth having.
Where it came from stays written down, and pfs dataset list shows it. As long as it does, the snapshot cannot be removed: deleting it would drop the barrier under the blocks the clone still shares, and the next write into the dataset the snapshot came from would free them. So the clone goes first.
The same choice stands at startup. R9-WURZEL-05: the boot menu offers a snapshot both ways, read only with Enter and as a clone under its own key, because one person wants to look and another wants to work, and neither covers the other.
The attributes are not written here
**pfs dataset attributes names them, with the values each one takes, and that list comes out of the kernel.** This page does not repeat it, and neither does the program: there is one table, in modules/fs/pfs.c, and pfs_dataset_set compares against the same names it enumerates.
That is not tidiness. Until 2026-09-30 the list stood here, a second time in the program and a third time in the kernel, and the three drifted: this page promised compression while the kernel compared kompression, so whoever followed the page got a refusal and checksum beside it worked. It went unnoticed for as long as it did because there was no way to read back what had been set, and a set that does nothing falls to nobody. pfs dataset get <ds> <name> is that way, and it is why the refusal now shows the list (R9-RUF-23).
A snapshot costs nothing at the moment it is taken; it costs a block whenever a block it holds gets overwritten.
What `pfs file info` shows
The line is the nine mode bits, the owner, the group, the size and the stamp of the last change. Under it stands the **rights list** of the entry, one line per holder: who it is (the owner, the group, everyone, or a user by number) and what they may (read, write, append, run, delete, list, enter, change).
Every entry of this filesystem carries such a list, six places of it, and until 2026-09-30 no program showed it. pfs stat, as file info was called then, printed the nine bits it folds down to and a + where a fourth holder fell out; who that was and what they were allowed stood nowhere (R9-RUF-22).
pfs file rights, owner and time read without a value and set with one. Reading was the half that did not exist: the three only ever set, and whoever wanted to see the state had to go through info.
The stamp is a calendar time: seconds since 1970. Zero is the one answer that is no time, and it means that no clock answered when the entry was written. pfs file info and pfs file time print the number and do not format it as a date.
Until 2026-10-02 PFS marked an entry with the runtime of the machine in milliseconds, so what stood on a file was how long the machine had been up when it was touched; after a restart that number started at null again, and a file of today was older than one of yesterday as soon as the run had been shorter (R9-PFS-28).
pfs disk check, and pfs disk scrub beside it
pfs disk check <drive> walks the superblocks, the allocation record, the catalogue, the datasets and their inodes, and holds the allocation map it builds itself against the one on the volume. It **reads and never writes**, and it repairs nothing: a repair is a second step with a decision of its own.
**check and scrub are two things.** check checks the **structure** and is fast. pfs disk scrub <drive> is the same walk with one more demand: **every block really gets read and its checksum recomputed.** That is the half that used to stand under "what it deliberately does not check".
The sums scrub recomputes are crc32c and fletcher4, and both stand in the program a second time, for the same reason the CRC of the inodes, the ZLE unpacker and the LZ4 unpacker do: what writes and what checks must not be the same code. A block secured with sha256 or blake3 is **read** but not recomputed, and the summary says how many those were; an unreadable block is a finding for every kind.
The drive is named and never guessed. pfs disk check without a number would have taken the mounted one, and then the same command would check a different volume depending on what happened to be mounted.
The return value is the number of findings, at most 250; 0 is a clean volume and 255 means it did not get far enough to judge, so read the lines above it. The reasons for 255 are a drive that is not there, a sector size that does not fit a PFS block, no readable superblock, and an encrypted volume: check reads the raw sectors without a key, so on cipher text it would call every block broken.
Checking a mounted volume is allowed, and the output says so: what it sees is the last finished group on the disk, not what still sits in memory, and the volume moves while the check runs. Unmount it before you believe a finding.
pfs disk status, and what it cannot say
pfs disk status [drive] costs nothing and may run at any time: the numbers come out of the record the kernel keeps anyway, and the two superblocks are two reads. The health is **derived** from them and is no second field: a wrong sum is an error and the number stands beside it, only one readable superblock means look again, otherwise good.
**When the volume was last checked and what came out of it stands nowhere on it**, so status talks about this session and not about the drive, and it says that in its last line. A field in the superblock (generation of the last pass, number of findings) would make a statement about the drive out of it; that is a change of the on-disk format and not of a command, so it is not in here (R9-PFS-30).
pfs dataset status <ds> has the same kind of gap and names it the same way: how much a dataset shares with a snapshot is not in the form of the call, and the one place that number exists is the walk of pfs disk check, which reports it for the whole volume.
After a dd onto a bigger drive
An image written onto a bigger stick with dd leaves two things behind the copy that nobody uses yet: space behind the partition, and space behind the filesystem. Two commands take them, and the order is in the names, because a filesystem sees only what its partition gives it.
pfs disk expand-partition <drive> first: the table pfs disk expand <drive> then: the filesystem
pfs disk expand-partition takes the **drive**, not a partition. It corrects the three numbers a dd leaves wrong: last_usable_lba still names the end of the image, the last partition still ends where it ended in the image, and the backup copy of the GPT still lies at the end of the image instead of the end of the drive. It recomputes the three sums (entry table, primary header, backup header) and writes in the order backup first, primary last, so a power cut leaves a primary header whose sum no longer fits its table and the reader falls back to the backup, which by then is the right one.
One rule makes it safe: **only the last partition grows, and only into space no other partition names.** An entry that reaches into the last one is a refusal, not a guess. The stale backup header from the image stays where it was, now inside the grown partition, where the filesystem overwrites it in its own time.
The partitions of a drive get their numbers when the machine starts, so the new size reaches pfs disk expand after the next start and not before.
pfs disk expand <drive> gives the filesystem the rest of the drive it lies on. The allocation record is one bit per unit and lies at a derived place, so a bigger record pushes the start of the data up and there are files under the new start: those blocks move, with the mechanism PFS runs on every finish. Everything new is written into units the old record calls free, and one single write of the superblock switches from the old volume to the new one, so a power cut leaves one of the two and never a half.
It refuses a volume somebody holds: anything the mount table names, the volume that carries the running root, and every relative of those (the partition on such a drive, the drive under such a partition). It also refuses an encrypted volume, and for a harder reason than pfs disk check does: under XTS the unit is the tweak, so a block that moves has to be encrypted again at its new place, and expand reads raw sectors without a key.
The return value is 0 (grown, or nothing to gain) and 255 (did not get far enough, and the lines above say why). Run pfs disk check <drive> after it: that is the second reading of this format, and a finding there means the expand was no success.
What it cannot do from ring 3 is force the drive's own write cache. The order of the writes is the crash safety, and the call behind it does not flush, because there is no flush call for a program yet.
EXAMPLE
$ pfs --help pfs <command> ... manages PFS: four groups, disk dataset snapshot file
SEE ALSO
mkfs.pfs` (which is the same format step under its own name)