Plan 9 from Bell Labs’s /usr/web/sources/contrib/quanstro/root/sys/src/fs/doc/

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.

fsconfig \- configuring a file server
.B service
.I name
.B config
.I device
.B nvram
.I device
.B filsys
.I name
.I device
.B ip
.I ipaddr
.B ipflag
.I flags
.B ipgw
.I ipaddr
.B ipmask
.I ipaddr
.B ipsntp
.I ipaddr
.B ream
.I name
.B recover
.I name
.B readonly
.B noattach
.B halt
.B end
When a file server's configuration has not been set,
or by explicit request early in the server's initialization (see
.IR fs (8)),
the server enters `config mode'.  The commands described here
apply only in that mode.  They establish configuration 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 necessary to recreate the configuration.
.SS Syntax
In these commands,
.I ipaddr
is an IP address in the form
.I name
is a text string without white space.
The syntax of a
.I device
is more complicated:
.BI w n1 . n2 . n3
Defines a SCSI disk on target (unit) id
.IR n2 ,
controller (host adapter)
.IR n1 ,
and LUN (logical unit number)
.IR n3 .
A single number specifies a target, while two numbers specify
.IB target . lun\f1,
with the missing numbers defaulting to zero.
Any one of the numbers may be replaced by
.BI < m - n >
to represent the values
.I m
.I n
.I M
may be greater than
.IR n .
For example,
.B (w<1-4>)
is the concatenation of SCSI targets 1 through 4.
.BI h n1 . n2 . n3
.I H
is similar to
.IR w ,
but for IDE or ATA disks.
.I Lun
is ignored.
.I Target
0 is an IDE master
and 1 is a slave.
Instead of specifying
.I controller
.IR target
one may omit the
.I controller
and specify a target of
.IB controller-number *2
.B +
.IR target-number ,
.B h2
is equivalent to
.B h1.0.0
(second IDE controller, master drive).
.BI m n1 . n2 . n3
.I M
is similar to
.IR h ,
but for SATA drives connected to Marvell 
88SX[56]0[48][01] controllers.  
Hot-swapping drives is supported.  Similar target
naming rules apply as for IDE controllers.  However the
controller-number is multiplied by the number of 
drives the controller supports rather than 2.
.B m9
is equivalent to
.B m1.1.0
(second controller, second drive),
if the first controller supports 8 drives.
.BI e n1 . n2
Specify an AoE target.
.I n1
is the shelf while
.I n2 
is the slot.  Luns are not used for AoE targets.
.BI ( device... )
A pseudo-device formed from the concatenation of the
.I devices
in the list.  The devices are
.I not
blank- or comma-separated.
.BI [ device... ]
A pseudo-device formed from the block-wise interleaving of the
.I devices
in the list.  The size of the result is the number of devices times
the size of the smallest device.
.BI { device... }
A pseudo-device formed from the mirroring of the first
.I 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 without recovery,
.B [
.B ]
as RAID 0.
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.
.BI p device . n1 . n2
Partition device.  If
.I n1
is less than 101, then
A partition starting at
.IR n1 %
from the beginning of
.I device
with a length
.IR n2 %
of the size of the device.
.I n1
is the absolute starting block number and
.I n2
is the absolute ending block number.
Blocks are
bytes.  This is a file server compile-time constant,
usually 8192 bytes.  It is recommended that AoE targets
not be partitioned by percentage as a replaced drive might
not have exactly the same number of blocks.
.I device
if it contains periods.
.BI x device
A pseudo-device that contains the byte-swapped contents of
.IR 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 processors of the other byte order.
.BI f device
A pseudo-WORM disk: blocks on
.I device
can be written only once and may not be read unless written.
A pseudo-WORM is intended for debugging.  It can be
a source of consternation if the size of the underlying device
changes by a few blocks as the blocks-written bitmap is kept
at an offset from the end of the device.
.BI c device1device2
A cached WORM.  The first
.I device
is the cache, the second the WORM.
.BI o
(Letter o) The read-only (dump) file system
of the most-recently defined cached WORM file system.
.SS Configuration
.B 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.
.B config
.B nvram
commands identify the
.I device
on which the information is recorded.
.B config
command also erases any previous configuration.
.I filsys
command configures a file system on
.I device
and calls it
.IR name .
.I Name
is used as the specifier in
.B attach
messages to connect to that file system.
(The file system
.B main
is the one attached to if the specifier is null; see
.IR attach (5)).
The rest of the configuration commands record IP addresses:
the file server's address
.RI ( ip ),
the local gateway
.RI ( ipgw ),
the local netmask
.RI ( ipmask ),
the local interface flags
.RI ( ipflag ),
and the address of a system running an SNTP server
.RI ( ipsntp ).
.BR ip ,
.B ipgw
.B ipmask
to indicate the interface number;
zero is the default.
.I Ipflag
may allow running
.IR cec (8)
.IR ( cec ),
.IR ( aoe ),
and AoE jumbo frames
.IR ( aoejumbo ).
.SS "One-time actions"
.I 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.
For the
.I recover
command, the
named file system
must be a cached WORM.
.I Recover
clears the associated magnetic cache and initializes the file
system, effectively resetting its contents to the last dump.
.I Readonly
disables all writing to all devices.
This is useful for trying dangerous experiments.
.I Noattach
prevents attaches.
.I Halt
will cause the server to
.I immediately
exit and reboot.
The various configuration commands only record what to do; they write
no data to disk.  The command
.I 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.
Initialize a file server
.B 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
.B kremvax
with a single disk on target 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.  The performance of this example will be poor due
to seek conflict between the cache and pseudo-WORM.
service kremvax
config p(w0)50.1
filsys main cp(w0)50.25[p(w0)0.25p(w0)25.25p(w0)75.25]
filsys dump o
ream main
A complete and complex example:
initialize a file server
.I ila
with a single AoE target on e565.2 for a scratch file system,
a cached pseudo-WORM file system with cache on 25GB of target
e565.0 and worm mirrored on targets e565.1 and e565.1.
It has two ethernet interfaces.  Interface 0 is used for client connections
and a connection to shelf 545.  Interface 1 is a point-to-point
link to shelf 565 and allows jumbo frames.
.IR Cec (8)
is allowed on both interfaces.
The SMTP server is global to the system.  SMTP uses routing to
determine how to contact the server.
config p(a5)95.5
service ila
filsys main cp(e565.0)0.3276800{e565.1e545.1}
filsys dump o
filsys other e565.2
ipflag0 cec aoe
ipflag1 cec aoe aoejumbo
.IR plan9.ini (8)
for this server is as follows
.BR /sys/src/fs/port/config.c
Ken Thompson,
``The Plan 9 File Server''.
Sean Quinlan,
``A Cached WORM File System'',
Software \- Practice and Experience,
December, 1991
Erik Quanstrom
``The Diskless Fileserver'',
Procedings of IWP92,
December, 2007.

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to