3 fs, exsort \- file server maintenance
144 these commands are available only on the console of an
148 .\" The console requires the machine's password to be supplied before
149 .\" accepting commands. Typing a control-D will cause
150 .\" the server to request
151 .\" the password again.
154 prints a `usage string' for the named
156 by default all commands.
157 Also, many commands print menus of their options if given
158 incorrect or incomplete parameters.
161 disables permission checking and allows
165 or for any user if omitted.
166 This may help in initializing a file system.
167 Use this with caution.
173 prints the contents of the ARP cache and
178 changes the current file system, that is, the file tree to which
198 verifies the consistency of the current file system.
199 With no options it checks and reports the status.
200 It suspends service while running.
206 Read every block in the file system (can take a
211 will stop short of the actual contents
212 of a file and just verify the block addresses.
217 each block has a tag that acts as a backwards pointer for
218 consistency checking.
222 and also clear the contents
223 of blocks that have bad tags.
226 Print every file name.
229 Print every directory name.
232 Rebuild the list of free blocks
233 with all blocks that are not referenced.
234 This option is only useful on non-cache/WORM
236 If the filesystem was modified, the summary printed
237 at the conclusion of the check may not reflect the true
238 state of the freelist and may also print a list of
243 blocks are actually on the free list and the true
244 state of the filesystem can be determined by running
249 Each block address that is out of range or duplicate is cleared.
250 Note that only the second and subsequent
251 use of a block is cleared.
252 Often the problems in a file system are
253 caused by one bad file that has a lot of
254 garbage block addresses.
259 (by number of diagnostic messages)
262 to clear the addresses in that file.
265 can be used to reclaim the free list.
268 Cause every directory and indirect block not on the current WORM disk
269 to be advanced to the current WORM on the next dump.
270 This is a discredited idea to try to keep operating
271 on the knee of the cache working set.
275 reduces the file system's
277 to fit the device containing the file system.
278 This is useful after copying a partially-full file system
279 into a slightly smaller device.
282 afterward will construct a new free list that contains no
283 blocks outside the new, smaller file system.
286 Removes temporary files after a recovery from worm.
287 After a cache ream and recover, temporary files and directories
288 refer to invalid data blocks producing checktag errors
289 on access. To get rid of these errors, the
291 flag can be used with the
293 command which will truncate temporary directories
294 and remove temporary files.
297 prints the block numbers in
299 directory entry (direct, indirect and doubly indirect)
300 and checks the tags of the blocks cited.
305 block number (using zero origin)
309 Note that only the block numbers in the directory entry itself
312 does not recurse through indirect blocks.
315 clears the internal directory entry and abandons storage
318 It ignores the usual rules for sanity, such as checking against
319 removing a non-empty directory.
323 will place the abandoned storage in the free list.
326 prints the CPU utilization and state of the processes in the file server.
327 If the name of a process type argument is given,
328 then CPU utilization for only those processes is printed.
331 creates a file on the current file system.
335 are names or numbers from
338 is the low 9 bits of the permission mode of the file, in octal.
344 creates a locked file, append-only file, or directory.
347 controls the cached WORM file systems,
348 specifically the current file system.
351 .BI mvstate " state1 state2 " [ platter ]
365 will cause I/O errors in the last dump to be retried.
370 will cause I/O errors in the last dump to be retried in
371 reallocated slots in the next dump.
376 will flush the cache associated with the WORM.
381 aborts the background process dumping to WORM; as a consequence it
382 leaves holes in the dump file system.
383 Other uses are possible but arcane.
386 limits affected blocks to those on that platter.
388 .BR prchain " [\fIstart\fP] [\fIback-flag\fP]
389 Print the chain of superblocks for the directory containing the
390 roots of the dumped file systems, starting at block number
392 (default 0) going forward (backwards if
394 is supplied and is non-zero).
396 .BR searchtag " [\fIstart\fP] [\fItag\fP] [\fIblocks\fP]
397 Reads the WORM device starting at block
401 blocks (default 1000)
402 until it finds a block with numeric tag
405 .BR savecache " [\fIpercent\fP]
406 Copy the block numbers, in native endian longwords, of blocks in the
412 If an argument is given,
413 then that percent (most recently used) of each cache bucket
416 .BR loadcache " [\fIdskno\fP]
419 and for every block there on WORM disk side
422 read the block from WORM to the cache.
425 is not supplied, all blocks in
429 .BR morecache " dskno [\fIcount\fP]
432 blocks from the beginning of WORM disk side
435 If no count is given,
440 .BR startdump \ [ 01 ]
445 the background dump process.
448 Verify that the superblock on the WORM is readable, ignoring the cached copy.
450 .BR blockcmp " [\fIwbno\fP] [\fIcbno\fP]
451 Compares the WORM block
455 and prints the first 10 differences, if any.
458 Prints how many times each user has caused the system to allocate new space on the WORM;
459 the units are megabytes.
462 Clears the accounting records for
466 prints the current date. It may be adjusted
469 With no sign, it sets the date to the absolute number of seconds
470 since 00:00 Jan 1, 1970 GMT; with a sign it trims the current
474 restores permission checking back to normal after a file system
475 has been initialized.
478 sets permissions such that
481 can read and search any directories.
482 This is the permission necessary to do a
484 command anywhere in the file system to discover disk usage.
487 starts a dump to WORM immediately for
488 the named filesystem,
489 or the current filesystem if none is named.
490 File service is suspended while the cache is scanned;
491 service resumes when the copy to WORM starts.
494 prints for every connection the number of allocated fids.
497 prints the current status of each named
499 including uid, gid, wuid (uid of the last user to modify the file),
500 size, qid, and disk addresses.
503 toggles flags, initially all off:
515 Report as connections are made to the file server.
518 Report authentications.
521 Disable authentication.
524 (Very noisy.) Print all 9P messages to and from the server.
533 Report received RIP packets.
536 Report I/O on the WORM device.
539 Report SNTP activity.
542 If given a second numeric
547 the flag is altered only on that connection.
552 and halts the machine, returning to the boot ROM.
555 clunks all the fids on the named
557 which has the same format as in the output of the
565 With no options it adds user
571 and makes the directory
573 owned by user and group
583 Add a group: add the name to
585 but don't create the directory.
586 By convention, groups are numbered starting from 10000, users from 0.
601 is missing, remove the existing leader.
606 to the member list of
612 from the member list of
618 command the file server overwrites
620 to reflect the internal state of the user table.
625 messages, in particular for system maintenance.
626 Previously attached connections are unaffected.
629 will enable normal behavior.
632 sets the machine's password and writes it in non-volatile RAM.
635 prints the system configuration information.
639 clears the profiling buffer and enables profiling;
642 stops profiling and writes the data to
648 If a number is not specified, the profiling state toggles.
655 maintains an IP routing table. The
658 .TF "add dest gate mask"
660 .B add \f2dest gate \fP[\f2mask\fP]
661 Add a static route from IP address
665 with an optional subnet
669 Delete an entry from the routing table.
672 Display the contents of the routing table.
675 Enables the table to be filled from RIP packets.
678 Disables the table from being updated by RIP packets.
683 queries the SNTP server
686 and sets the time with its response.
690 commands are connected with a service or device identified by the
691 last character of the name:
695 Ethernet controllers;
699 Marvell SATA targets;
704 command prints overall statistics about the file system.
707 command takes an optional argument identifying the characters
710 commands to run. The option is remembered and becomes the
711 default for subsequent
713 commands if it begins with a minus sign.
716 writes dirty blocks in memory to the magnetic disk cache.
719 reports the time required to execute the
723 with no options prints the set of queue-locks held by each process in
724 the file server. If things are quiescent, there should be no output.
727 it prints a stack traceback of that process.
734 to initialize the file server's internal representation of the users
736 Incorrectly formatted entries in
739 If file is explicitly
741 the system builds a minimal functional users table internally;
742 this can help recover from disasters.
753 for the system to function. The
755 table looks like this:
770 reports when the file server was last compiled and last rebooted.
773 reports, one per line, the names of users connected to the file server and the
774 status of their connections.
775 The first number printed on each line is the channel number of the connection.
778 are given the output selects connections owned by those users.
781 moves the WORM disk in slot
783 of the first jukebox to the output shelf.
786 moves the WORM disk from the input shelf of the first jukebox to slot
792 of the first jukebox out of service;
794 puts it back in service.
797 put discs back where the jukebox thinks they belong,
798 and does this for all jukeboxes.
800 When the file server boots, it prints the message
803 for config mode hit a key within 5 seconds
806 If a character is typed within 5 seconds of the message appearing,
807 the server will enter config mode.
810 for the commands available in config mode.
811 The system also enters config mode if, at boot time,
812 the non-volatile RAM does not appear to contain a valid configuration.
815 is a regular command to be run on a CPU server, not on the file server
821 and sorts the cache disk block numbers contained therein.
822 It assumes the numbers are 4-byte integers and guesses the
823 endianness by looking at the data.
824 It then prints statistics about the cache.
827 it writes the sorted data back to
833 ``The Plan 9 File Server''.
837 .B /sys/src/cmd/disk/exsort.c
841 commands should accept an argument identifying a jukebox.