fs – file system devices
bind -b #k /dev
unhandled troff command .sp
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
The device is intended to be bound at
and initially contains a directory named
which in turn contains a
file and one file per configured device.
Most control messages introduce a new device, here named
arguments are interpreted in the name space of the writing process.
The device name
may be a single filename component (containing no slashes);
in this case, the device is created under
instead has the format
the device is made available at
goes away when the last device on it is removed with the
will never be removed.
cat new files ...
corresponds to the catenation of
inter new files ...
corresponds to the block interleaving of
an 8192-byte block size is assumed.
mirror new files ...
corresponds to a RAID-1-like mirroring of
are handled by sequentially writing the same data to the
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.
are handled by sequentially reading from the
from left to right until one succeeds.
The length of the mirror device is the minimum of the lengths of the
part new file offset length
part new offset end
In the first form,
corresponds to the
units starting at
reaches past the end of
is silently reduced to fit.
Units are bytes.
In the second form,
request must have defined the source
for further requests and the end of the device
is determined by the
offset in the source file, and not by the device
length. Units are as defined in the previous
request. This form is accepted for compatibility with
Removes the device named
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.
all devices under
disk dir [ n file ]
implicit in new device names (i.e., it makes
specifies the default unit (sector) size in bytes and the default source
for further partition devices.
Default values are restored when the control file is closed.
crypt new file key
corresponds to a AES-encrypted partition
If the variable
is set in
will read its configuration from the file
on the first attach.
This is useful when the machine boots from a local file server that uses
Use a previously partitioned disk,
partition files available under
echo disk sdC0parts 512 /dev/sdC0/data
disk/fdisk -p /dev/sdC0/data
# now create plan 9 partitions
echo disk sdC0parts 512 /dev/sdC0parts/plan9
disk/prep -p /dev/sdC0parts/plan9
} > /dev/fs/ctl
Mirror the two disks
echo mirror m0 /dev/sdC0/data /dev/sdD0/data >/dev/fs/ctl
echo mirror m1 /dev/sdC1/data /dev/sdD1/data >/dev/fs/ctl
Interleave the two mirrored disks to create
echo inter data /dev/fs/m0 /dev/fs/m1 >/dev/fs/ctl
on the interleaved device:
hjfs -f /dev/fs/data
Save the configuration:
cp /dev/fs/ctl /dev/fd0disk
To load the configuration automatically at boot time,
add this to
Mirrors are RAID-like but not RAID.
There is no fancy recovery mechanism and
no automatic initial copying from a master drive to its mirror drives.
system call on
may transmit at most one command.