fs, exsort – file server maintenance
path uid gid perm
these commands are available only on the console of an
prints a ‘usage string’ for the named
by default all commands.
Also, many commands print menus of their options if given
incorrect or incomplete parameters.
disables permission checking and allows
for the specified
or for any user if omitted.
This may help in initializing a file system.
Use this with caution.
prints the contents of the ARP cache and
changes the current file system, that is, the file tree to which
verifies the consistency of the current file system.
With no options it checks and reports the status.
It suspends service while running.
Read every block in the file system (can take a
will stop short of the actual contents
of a file and just verify the block addresses.
each block has a tag that acts as a backwards pointer for
Fix bad tags
and also clear the contents
of blocks that have bad tags.
Print every file name.
Print every directory name.
Rebuild the list of free blocks
with all blocks that are not referenced.
This option is only useful on non-cache/WORM
If the filesystem was modified, the summary printed
at the conclusion of the check may not reflect the true
state of the freelist and may also print a list of
blocks are actually on the free list and the true
state of the filesystem can be determined by running
with no arguments.
Each block address that is out of range or duplicate is cleared.
Note that only the second and subsequent
use of a block is cleared.
Often the problems in a file system are
caused by one bad file that has a lot of
garbage block addresses.
In such a case,
it is wiser to use
to find the bad file
(by number of diagnostic messages)
and then use
to clear the addresses in that file.
can be used to reclaim the free list.
Cause every directory and indirect block not on the current WORM disk
to be advanced to the current WORM on the next dump.
This is a discredited idea to try to keep operating
on the knee of the cache working set.
Buy more cache disk.
reduces the file system’s
to fit the device containing the file system.
This is useful after copying a partially-full file system
into a slightly smaller device.
afterward will construct a new free list that contains no
blocks outside the new, smaller file system.
Removes temporary files after a recovery from worm.
After a cache ream and recover, temporary files and directories
refer to invalid data blocks producing checktag errors
on access. To get rid of these errors, the
flag can be used with the
command which will truncate temporary directories
and remove temporary files.
prints the block numbers in
directory entry (direct, indirect and doubly indirect)
and checks the tags of the blocks cited.
is supplied, the
block number (using zero origin)
is set to
(defaults to zero).
Note that only the block numbers in the directory entry itself
does not recurse through indirect blocks.
clears the internal directory entry and abandons storage
It ignores the usual rules for sanity, such as checking against
removing a non-empty directory.
will place the abandoned storage in the free list.
prints the CPU utilization and state of the processes in the file server.
If the name of a process type argument is given,
then CPU utilization for only those processes is printed.
creates a file on the current file system.
are names or numbers from
is the low 9 bits of the permission mode of the file, in octal.
An optional final
creates a locked file, append-only file, or directory.
controls the cached WORM file systems,
specifically the current file system.
The subcommands are:
mvstate state1 state2 [ platter ]
will cause I/O errors in the last dump to be retried.
will cause I/O errors in the last dump to be retried in
reallocated slots in the next dump.
will flush the cache associated with the WORM.
aborts the background process dumping to WORM; as a consequence it
leaves holes in the dump file system.
Other uses are possible but arcane.
limits affected blocks to those on that platter.
prchain [start] [back-flag]
Print the chain of superblocks for the directory containing the
roots of the dumped file systems, starting at block number
(default 0) going forward (backwards if
is supplied and is non-zero).
searchtag [start] [tag] [blocks]
Reads the WORM device starting at block
and proceeding for
blocks (default 1000)
until it finds a block with numeric tag
Copy the block numbers, in native endian longwords, of blocks in the
state to the file
for use by
If an argument is given,
then that percent (most recently used) of each cache bucket
and for every block there on WORM disk side
read the block from WORM to the cache.
is not supplied, all blocks in
morecache dskno [count]
blocks from the beginning of WORM disk side
to the cache.
If no count is given,
read all of side
into the cache.
the background dump process.
Verify that the superblock on the WORM is readable, ignoring the cached copy.
blockcmp [wbno] [cbno]
Compares the WORM block
with the cache block
and prints the first 10 differences, if any.
Prints how many times each user has caused the system to allocate new space on the WORM;
the units are megabytes.
Clears the accounting records for
prints the current date. It may be adjusted
With no sign, it sets the date to the absolute number of seconds
since 00:00 Jan 1, 1970 GMT; with a sign it trims the current
restores permission checking back to normal after a file system
has been initialized.
sets permissions such that
can read and search any directories.
This is the permission necessary to do a
command anywhere in the file system to discover disk usage.
starts a dump to WORM immediately for
the named filesystem,
or the current filesystem if none is named.
File service is suspended while the cache is scanned;
service resumes when the copy to WORM starts.
prints for every connection the number of allocated fids.
prints the current status of each named
including uid, gid, wuid (uid of the last user to modify the file),
size, qid, and disk addresses.
toggles flags, initially all off:
Print channels in
Report ARP activity.
Report as connections are made to the file server.
(Very noisy.) Print all 9P messages to and from the server.
Report 9P errors.
Report IL errors.
Report received RIP packets.
Report I/O on the WORM device.
Report SNTP activity.
If given a second numeric
as reported by
the flag is altered only on that connection.
and halts the machine, returning to the boot ROM.
clunks all the fids on the named
which has the same format as in the output of the
With no options it adds user
with group leader
and makes the directory
owned by user and group
The options are
Print the entry for
Add a group: add the name to
but don’t create the directory.
By convention, groups are numbered starting from 10000, users from 0.
Rename existing user
Change the leader of
is missing, remove the existing leader.
to the member list of
from the member list of
After a successful
command the file server overwrites
to reflect the internal state of the user table.
messages, in particular for system maintenance.
Previously attached connections are unaffected.
will enable normal behavior.
sets the machine’s password and writes it in non-volatile RAM.
prints the system configuration information.
clears the profiling buffer and enables profiling;
stops profiling and writes the data to
for use by
If a number is not specified, the profiling state toggles.
maintains an IP routing table. The
add dest gate [mask]
Add a static route from IP address
with an optional subnet
Delete an entry from the routing table.
Display the contents of the routing table.
Enables the table to be filled from RIP packets.
Disables the table from being updated by RIP packets.
queries the SNTP server
and sets the time with its response.
commands are connected with a service or device identified by the
last character of the name:
Marvell SATA targets;
command prints overall statistics about the file system.
command takes an optional argument identifying the characters
commands to run. The option is remembered and becomes the
default for subsequent
commands if it begins with a minus sign.
writes dirty blocks in memory to the magnetic disk cache.
reports the time required to execute the
with no options prints the set of queue-locks held by each process in
the file server. If things are quiescent, there should be no output.
With an argument
it prints a stack traceback of that process.
uses the contents of
to initialize the file server’s internal representation of the users
Incorrectly formatted entries in
will be ignored.
If file is explicitly
the system builds a minimal functional users table internally;
this can help recover from disasters.
cannot be read, you
for the system to function. The
table looks like this:
reports when the file server was last compiled and last rebooted.
reports, one per line, the names of users connected to the file server and the
status of their connections.
The first number printed on each line is the channel number of the connection.
are given the output selects connections owned by those users.
moves the WORM disk in slot
of the first jukebox to the output shelf.
moves the WORM disk from the input shelf of the first jukebox to slot
of the first jukebox out of service;
puts it back in service.
put discs back where the jukebox thinks they belong,
and does this for all jukeboxes.
When the file server boots, it prints the message
for config mode hit a key within 5 seconds
If a character is typed within 5 seconds of the message appearing,
the server will enter config mode.
for the commands available in config mode.
The system also enters config mode if, at boot time,
the non-volatile RAM does not appear to contain a valid configuration.
is a regular command to be run on a CPU server, not on the file server
It reads the named
and sorts the cache disk block numbers contained therein.
It assumes the numbers are 4-byte integers and guesses the
endianness by looking at the data.
It then prints statistics about the cache.
it writes the sorted data back to
“The Plan 9 File Server”.
commands should accept an argument identifying a jukebox.