FSCONFIG(8)                                           FSCONFIG(8)

     NAME
          fsconfig - configuring a file server

     SYNOPSIS
          service name

          config device

          nvram device

          filsys name device

          ip ipaddr

          ipgw ipaddr

          ipmask ipaddr

          ipauth ipaddr

          ipsntp ipaddr

          ream name

          recover name

          allow

          readonly

          noauth

          noattach

          copyworm

          copydev from-dev to-dev

          halt

          end

     DESCRIPTION
          When an fs(4) file server's configuration has not been set,
          or by explicit request early in the server's initialization
          (see fs(8)), the server enters `config mode'.  The commands
          described here apply only in that mode.  They establish con-
          figuration constants that are typically valid for the life
          of the server, and therefore need be run only once.  If the
          non-volatile RAM on the server gets erased, it will be

     Page 1                       Plan 9            (printed 11/21/24)

     FSCONFIG(8)                                           FSCONFIG(8)

          necessary to recreate the configuration.

        Syntax
          In these commands, ipaddr is an IP address in the form
          111.103.94.19 and name is a text string without white space.
          The syntax of a device is more complicated:

          wn1.n2.n3
               Defines a SCSI disk on target (unit) id n2, controller
               (host adapter) n1, and LUN (logical unit number) n3. A
               single number specifies a target, while two numbers
               specify target.lun, with the missing numbers defaulting
               to zero.  Any one of the numbers may be replaced by
               <m-n> to represent the values m through n inclusive.  M
               may be greater than n. For example, (w<1-4>) is the
               concatenation of SCSI targets 1 through 4.

          hn1.n2.n3
               H is similar to w, but for IDE or ATA disks, and the
               controllers must be specified in plan9.ini.  Lun is
               ignored.  Target 0 is an IDE master and 1 is a slave.
               Instead of specifying controller and target separately,
               one may omit the controller and specify a target of
               controller-number*2 + target-number, thus h2 is equiva-
               lent to h1.0.0 (second IDE controller, master drive).

          mn1.n2.n3
               M is similar to h, but for SATA drives connected to
               Marvell 88SX[56]0[48][01] controllers.  There is no
               need to specify the controllers in plan9.ini as they
               are autodiscovered.  Hot-swapping drives is not cur-
               rently supported.  Similar target naming rules apply as
               for IDE controllers.  However the controller-number is
               multiplied by the number of drives the controller sup-
               ports rather than 2.  Thus m9 is equivalent to m1.1.0
               (second controller, second drive), if the first con-
               troller supports 8 drives.

          ln1.n2.n3

          rn1.n2.n3
               The same as w, but leaving a single block at the begin-
               ning for a label (l), or not.  Only n2 is really of
               interest, and refers to a side of a WORM disc.  These
               are only really relevant when used as device3 in the j
               device (see below).

          (device...)
               A pseudo-device formed from the concatenation of the
               devices in the list.  The devices are not blank- or
               comma-separated.

     Page 2                       Plan 9            (printed 11/21/24)

     FSCONFIG(8)                                           FSCONFIG(8)

          [device...]
               A pseudo-device formed from the block-wise interleaving
               of the devices in the list.  The size of the result is
               the number of devices times the size of the smallest
               device.

          {device...}
               A pseudo-device formed from the mirroring of the first
               device in the list onto all the others.  The size of
               the result is the size of the smallest device.  One
               might think of this as RAID 1, and [ ] as RAID 0,
               though neither includes any fancy recovery mechanisms.
               Each block is written to all the devices, starting with
               the rightmost in the list and working leftward.  A
               block is read from the first device that provides it
               without error, starting with the leftmost in the list
               and working rightward.

          pdevice.n1.n2
               A partition starting at n1% from the beginning of
               device with a length n2% of the size of the device.
               Parenthesize device if it contains periods.

          xdevice
               A pseudo-device that contains the byte-swapped contents
               of device. Since the file server writes integers to
               disk in its native byte order, it can be necessary to
               use this device to read file systems written by proces-
               sors of the other byte order.

          j(device1 device2...)device3
               Device1 is the SCSI juke box interface.  The device2s
               are the SCSI drives in the jukebox and device3 repre-
               sents the demountable platters in the juke box.

          fdevice
               A pseudo-WORM disk: blocks on device can be written
               only once and may not be read unless written.

          cdevice1device2
               A cached WORM.  The first device is the cache, the sec-
               ond the WORM.

          o    (Letter o) The read-only (dump) file system of the
               most-recently defined cached WORM file system.

        Configuration
          The service command sets the textual name of the server as
          known in the network databases.

          The configuration information is stored in block zero on a
          device whose device string is written in non-volatile RAM.

     Page 3                       Plan 9            (printed 11/21/24)

     FSCONFIG(8)                                           FSCONFIG(8)

          The config and nvram commands identify the device on which
          the information is recorded.  The config command also erases
          any previous configuration.

          The filsys command configures a file system on device and
          calls it name. Name is used as the specifier in attach mes-
          sages to connect to that file system.  (The file system main
          is the one attached to if the specifier is null; see
          attach(5)).

          The rest of the configuration commands record IP addresses:
          the file server's address (ip), the local gateway's (ipgw),
          the local authentication server's (ipauth), the local subnet
          mask (ipmask), and the address of a system running an SNTP
          server (ipsntp).  Ipauth is no longer used.  If the server
          has more than one network interface, a digit may be appended
          to the keywords ip, ipgw and ipmask to indicate the inter-
          face number; zero is the default.

        One-time actions
          The ream command initializes the named file system.  It
          overwrites any previous file system on the same device and
          creates an empty root directory on the device.  If name is
          main, the file server, until the next reboot, will accept
          wstat messages (see stat(5)) that change the owner and group
          of files, to enable initializing a fresh file system from a
          mkfs(8) archive.

          For the recover command, the named file system must be a
          cached WORM.  Recover clears the associated magnetic cache
          and initializes the file system, effectively resetting its
          contents to the last dump.

          Allow turns off all permission checking; use with caution.

          Readonly disables all writing to all devices.  This is use-
          ful for trying dangerous experiments.

          Noauth disables authentication.

          Noattach prevents attachs.

          Copyworm will copy a file system named main to one named
          output, block by block, and loop.  It knows how to read a
          fake worm file system.

          Copydev will copy the device from-dev to the device to-dev.
          block by block, and panic.

          Halt will cause the server to immediately exit and reboot.

          The various configuration commands only record what to do;

     Page 4                       Plan 9            (printed 11/21/24)

     FSCONFIG(8)                                           FSCONFIG(8)

          they write no data to disk.  The command end exits config
          mode and begins running the file server proper.  The server
          will then perform whatever I/O is required to establish the
          configuration.

     EXAMPLE
          Initialize a file server kgbsun with a single file system
          interleaved between SCSI targets 3 and 4.

               service kgbsun
               config w3
               filsys main [w<3-4>]
               ream main

          Initialize a file server kremvax with a single disk on tar-
          get 0 partitioned as a cached pseudo-WORM file system with
          the cache on the third quarter of the drive and the pseudo-
          WORM on the interleave of the first, second, and fourth
          quarters.

               service kremvax
               config p(w0)50.1
               filsys main cp(w0)50.25f[p(w0)0.25p(w0)25.25p(w0)75.25]
               filsys dump o
               ream main

          A complete and complex example: initialize a file server fsb
          with a single SCSI disk on target 0 for a scratch file sys-
          tem, a cached WORM file system with cache disk on target 2
          and an optical-disc jukebox on targets 4 (robotics) and 5
          (one optical drive), and another cached WORM file system
          with cache disk on target 3 and another optical-disc jukebox
          on a second SCSI bus at targets 3 and 4.  Both jukeboxes
          contain 16 slots of optical discs.  It has two Ethernet
          interfaces and can reach an SNTP server on the first one.

               service fsb
               config w0
               filsys main cw2j(w4w5)(l<0-31>)
               filsys dump o
               filsys hp40fx cw3j(w1.<3-4>.0)(l<0-31>)
               filsys hp40fxdump o
               filsys other w0
               ipauth 0.0.0.0
               ipsntp 10.9.0.3
               ip0 10.9.0.2
               ipgw0 10.9.0.3
               ipmask0 255.255.0.0
               ip1 10.0.0.2
               ipgw1 10.0.0.1
               ipmask1 255.255.0.0
               ream main

     Page 5                       Plan 9            (printed 11/21/24)

     FSCONFIG(8)                                           FSCONFIG(8)

               ream hp40fx
               ream other
               end

     SOURCE
          /sys/src/fs/port/config.c

     SEE ALSO
          Ken Thompson, ``The Plan 9 File Server''.

     Page 6                       Plan 9            (printed 11/21/24)