The fs driver builds complex disk files out of simpler disk files.
Inspired by the Plan 9 file server kernel's configuration strings,
it provides device mirroring, partitioning, interleaving, and
catenation for disk–based services like venti(8). |
The device is intended to be bound at /dev and initially contains
a directory named fs, which in turn contains a ctl file and one
file per configured device.
Most control messages introduce a new device, here named new.
The file arguments are interpreted in the name space of the writing
The device name new may be a single filename component (containing
no slashes); in this case, the device is created under #k/fs.
If new instead has the format dir/file, the device is made available
at #k/dir/file. The directory dir goes away when the last device
on it is removed with the del control message, but
#k/fs will never be removed.
cat new files...
inter new files...
The device new corresponds to the catenation of files.|
mirror new files...
The device new corresponds to the block interleaving of files;
an 8192–byte block size is assumed.|
part new file offset length
The device new corresponds to a RAID–1–like mirroring of files.
Writes to new are handled by sequentially writing the same data
to the files from right to left (the reverse of the order in the
control message). A failed write causes an eventual error return
but does not prevent the rest of the writes to the other
devices of the mirror set. Reads from new are handled by sequentially
reading from the files from left to right until one succeeds.
The length of the mirror device is the minimum of the lengths
of the files.|
part new offset end
del oldRemoves the device named old. The device will still be
seen while in use. Further I/O attempts will fail with an error
indication stating that the device is gone. When old is dir/*,
all devices under dir are removed.
In the first form, the device new corresponds to the length units
starting at offset in file. If offset+length reaches past the
end of file, length is silently reduced to fit. Units are bytes.
In the second form, a previous disk request must have defined
the source file for further requests and the end of the device
is determined by the end offset in the source file, and not by
the device length. Units are as defined in the previous disk request.
This form is accepted for compatibility with fdisk (in prep(8))
and sd(3) devices.|
disk dir [ n file ]
crypt new file key
makes dir implicit in new device names (i.e., it makes new mean
dir/new by default). Optional argument n specifies the default
unit (sector) size in bytes and the default source file for further
partition devices. Default values are restored when the control
file is closed.|
clear Discard all fs device definitions.
The device new corresponds to a AES–encrypted partition file encrypted
with key (see cryptsetup(8)).|
If the variable fsconfig is set in plan9.ini(8), fs will read
its configuration from the file $fsconfig on the first attach.
This is useful when the machine boots from a local file server
that uses fs.