FS(8)                                                       FS(8)

     NAME
          fs, exsort - file server maintenance

     SYNOPSIS
          help [ command ... ]
          arp subcommand
          auth [on] [system|file]
          cfs filesystem
          check [options]
          clri [file...]
          cpu [proc]
          create path uid gid perm [lad]
          cwcmd subcommand
          cycl subcommand
          date [[+-] seconds]
          dump
          flag flag [ channel ]
          halt
          netdb [file]
          newuser name [options]
          passwd
          profile [01]
          remove [files...]
          search [blockno [nblock [bw]]]
          stat[acejklw]
          statp [proc]
          stats [[-] flags...]
          sync
          time command
          trace [number]
          users [file]
          version
          who [user...]
          wormcp [ funit tunit [nblock]]

          disk/exsort [-w] [file]

     DESCRIPTION
          Except for exsort, these commands are available only on the
          console of an fs(4) file server.

          Help prints a `usage string' for the named commands, by
          default all commands.  Also, many commands print menus of
          their options if given incorrect or incomplete parameters.

          The console requires the machine's password to be supplied
          before accepting commands.  Typing a control-D will cause
          the server to request the password again.

          Arp has two subcommands: print prints the contents of the

     Page 1                       Plan 9            (printed 12/22/24)

     FS(8)                                                       FS(8)

          ARP cache and flush flushes it.

          Auth starts authentication.  It reads authentication keys
          from file (default /adm/keys).  If file is of the form
          il!IP.address it is taken to be a system from which to
          authenticate using IL, rather than reading its own keys
          file.  The address must be a numeric IP address and only IL
          is supported.  If the optional string on is provided, auth
          records in non-volatile RAM the file or system from which to
          authenticate.  Once on, authentication can never be turned
          off, even by rebooting.

          Cfs changes the current file system, that is, the file tree
          to which commands (check, clri, create, netdb, newuser,
          profile, remove, and users) apply.  The initial filesystem
          is main.

          Check verifies the consistency of the current file system.
          With no options it checks and reports the status.  It sus-
          pends service while running.  Options are:

          rdall     Read every block in the file system (can take a
                    long time).

          tag       Fix bad tags; each block has a tag that acts as a
                    backwards pointer for consistency checking.

          pfile     Print every file name (can take a long time).

          free      Rebuild the list of free blocks.

          setqid    Resequence the qids in the file system, starting
                    at one; all outstanding fids become invalid.

          bad       For each block with a bad tag, create a new block,
                    copy the data from the bad block, and write the
                    correct tag in the new block.

          touch     Cause every directory and indirect block not on
                    the current WORM disk to be advanced to the cur-
                    rent WORM on the next dump.

          Clri clears the internal directory entry and abandons stor-
          age associated with files. It ignores the usual rules for
          sanity, such as checking against removing a non-empty direc-
          tory.  A subsequent check free will place the abandoned
          storage in the free list.

          Cpu prints the CPU utilization and state of the processes in
          the file server.

     Page 2                       Plan 9            (printed 12/22/24)

     FS(8)                                                       FS(8)

          Create creates a file on the current file system.  Uid and
          gid are names or numbers from /adm/users.  Perm is the low 9
          bits of the permission mode of the file, in octal.  An
          optional final l, a, or d creates a locked file, append-only
          file, or directory.

          Cwcmd controls the cached WORM file systems.

          mvstate state1 state2
               States are none, dump, dump1, read, and write.  A
               mvstate dump1 write will cause I/O errors in the last
               dump to be retried in the next dump.  A mvstate read
               none will flush the cache associated with the WORM.  A
               mvstate dump write aborts the background process dump-
               ing to WORM; as a consequence it leaves holes in the
               dump file system.  Other uses are possible but arcane.

          prchain [start] [back]
               Print the chain of superblocks for the directory con-
               taining the roots of the dumped file systems, starting
               at block number start (default 0) going forward (back-
               wards if back is supplied).

          savecache
               Copy the block numbers, in native endian longwords, of
               all blocks in the read state to the file /adm/cache for
               use by disk/exsort.

          loadcache [dskno]
               Read /adm/cache and for every block there on WORM disk
               dskno, read the block from WORM to the cache.  If dskno
               is not supplied, all blocks in /adm/cache are read.

          wormcmp [dskno]
               Read WORM disk dskno and compare it to the contents of
               the cache, block by block.  Dskno is zero by default.

          startdump [01]
               Suspend (0) or restart (1) the background dump process.

          Cycl controls the Cyclone fiber link to the main CPU server.
          The subcommands are

          reboot      Reinitialize the Cyclone board and connection.

          verbose     Put the Cyclone driver in verbose debugging
                      mode.

          ping        Bounce a packet off the remote Cyclone board;
                      used internally to resynchronize after an error
                      on the fiber.

     Page 3                       Plan 9            (printed 12/22/24)

     FS(8)                                                       FS(8)

          Date prints the current date.  It may be adjusted using
          +-seconds.  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 time.

          Dump starts a dump to WORM immediately for all file systems
          that have a WORM associated.  File service is suspended
          while the cache is scanned; service resumes when the copy to
          WORM starts.

          Flag toggles flags, initially all off:

          arp       Report ARP activity.

          attach    Report as connections are made to the file server.

          chat      (Very noisy.)  Print all 9P messages to and from
                    the server.

          dkit      Report datakit activity.

          If given a second numeric channel, as reported by who, the
          flag is altered only on that connection.

          Halt does a sync and halts the machine, returning to the
          boot ROM.

          Netdb reads /lib/ndb/local to establish network information.

          Newuser requires a name argument.  With no options it adds
          user name, with group leader name, to /adm/users and makes
          the directory /usr/name owned by user and group name. The
          options are

          ?          Print the entry for name.

          :          Add a group: add the name to /adm/users but don't
                     create the directory.  By convention, groups are
                     numbered starting from 10000, users from 0.

          newname    Rename existing user name to newname.

          =leader    Change the leader of name to leader. If leader is
                     missing, remove the existing leader.

          +member    Add member to the member list of name.

          -member    Remove existing member from the member list of
                     name.

     Page 4                       Plan 9            (printed 12/22/24)

     FS(8)                                                       FS(8)

          After a successful newuser command the file server over-
          writes /adm/users to reflect the internal state of the user
          table.

          Passwd sets the machine's password and writes it in non-
          volatile RAM.

          Profile 0 clears the profiling buffer and enables profiling;
          profile 1 stops profiling and writes the data to
          /adm/kprofdata for use by kprof (see prof(1)). If a number
          is not specified, the profiling state toggles.

          Remove removes files.

          Search looks on the WORM for written (w; default) or blank
          (b) blocks starting at block blockno (default 0) through
          nblock (default 100) following blocks.  Block numbers are as
          reported by statw.

          The stat commands are connected with a service or device
          identified by the last character of the name: c, Cyclone
          fiber link; e, Eagle Ethernet controller; j, Jaguar SCSI/VME
          disk controller; k, Datakit; l, LANCE Ethernet controller;
          w, cached WORM.  The Statp command prints statistics about
          processes; an optional argument identifies the process to be
          displayed; stata prints overall statistics about the file
          system.  The stats command takes an optional argument iden-
          tifying the characters of stat commands to run.  The option
          is remembered and becomes the default for subsequent stats
          commands if it begins with a minus sign.

          Sync writes dirty blocks in memory to the magnetic disk
          cache.

          Time reports the time required to execute the command.

          Trace 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 number it
          prints a stack traceback of that process.

          Users uses the contents of file (default /adm/users) to ini-
          tializes the file server's internal representation of the
          users structure.  Incorrectly formatted entries in file will
          be ignored.  If file is explicitly default, the system
          builds a minimal functional users table internally; this can
          help recover from disasters.  If the file cannot be read,
          you must run

               users default

          for the system to function.  The default table looks like

     Page 5                       Plan 9            (printed 12/22/24)

     FS(8)                                                       FS(8)

          this:

               -1:adm:adm:
               0:none:adm:
               1:rob:rob:
               10000:sys::
               10001:map:map:
               10002:doc::
               10003:upas:upas:
               10004:cda::
               10005:bootes:bootes:

          Version reports when the file server was last compiled and
          last rebooted.

          Who 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.  If users are given the output selects con-
          nections owned by those users.

          Wormcp copies from WORM disk funit to WORM disk tunit nblock
          native blocks (default the whole disk).  If tunit is writ-
          ten, wormcp guarantees the written data is equal to the data
          on funit and stops if not.  Wormcp does a binary search to
          find the lowest unwritten block on tunit at which to start
          the copy.  With no arguments, wormcp stops a running copy.

          When the file server boots, it prints the message

               for config mode hit a key within 5 seconds

          If a character are typed within 5 seconds of the message
          appearing, the server will enter config mode.  See
          fsconfig(8) 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 configura-
          tion.

          Exsort is a regular command to be run on a CPU server, not
          on the file server console.  It reads the named file
          (default /adm/cache) and sorts the cache disk block numbers
          contained therein.  It assumes the numbers are 4-byte inte-
          gers and guesses the endianness by looking at the data.  It
          then prints statistics about the cache.  With option -w it
          writes the sorted data back to file.

     SEE ALSO
          fs(4)

     Page 6                       Plan 9            (printed 12/22/24)