3 fs \- file system devices
16 driver builds complex disk files out of simpler disk files.
17 Inspired by the Plan 9 file server kernel's configuration strings,
18 it provides device mirroring, partitioning, interleaving, and catenation
19 for disk-based services like
22 The device is intended to be bound at
24 and initially contains a directory named
26 which in turn contains a
28 file and one file per configured device.
30 Most control messages introduce a new device, here named
34 arguments are interpreted in the name space of the writing process.
38 may be a single filename component (containing no slashes);
39 in this case, the device is created under
43 instead has the format
45 the device is made available at
49 goes away when the last device on it is removed with the
54 will never be removed.
58 .BI cat " new files" \fR...
61 corresponds to the catenation of
64 .BI inter " new files" \fR...
67 corresponds to the block interleaving of
69 an 8192-byte block size is assumed.
71 .BI mirror " new files" \fR...
74 corresponds to a RAID-1-like mirroring of
78 are handled by sequentially writing the same data to the
80 from right to left (the reverse of
81 the order in the control message).
82 A failed write causes an eventual error return
83 but does not prevent the rest of the writes
84 to the other devices of the mirror set.
87 are handled by sequentially reading from the
89 from left to right until one succeeds.
90 The length of the mirror device is the minimum of the lengths of the
93 .BI part " new file offset length"
95 .BI part " new offset end
107 reaches past the end of
110 is silently reduced to fit.
115 request must have defined the source
117 for further requests and the end of the device
120 offset in the source file, and not by the device
121 length. Units are as defined in the previous
123 request. This form is accepted for compatibility with
132 Removes the device named
134 The device will still be seen while in use.
135 Further I/O attempts will fail with an error indication stating that
145 .BI disk " dir [ n file ]
148 implicit in new device names (i.e., it makes
155 specifies the default unit (sector) size in bytes and the default source
157 for further partition devices.
158 Default values are restored when the control file is closed.
171 will read its configuration from the file
174 This is useful when the machine boots from a local file server that uses
177 Use a previously partitioned disk,
180 partition files available under
185 echo disk sdC0parts 512 /dev/sdC0/data
186 disk/fdisk -p /dev/sdC0/data
187 # now create plan 9 partitions
188 echo disk sdC0parts 512 /dev/sdC0parts/plan9
189 disk/prep -p /dev/sdC0parts/plan9
207 echo mirror m0 /dev/sdC0/data /dev/sdD0/data >/dev/fs/ctl
208 echo mirror m1 /dev/sdC1/data /dev/sdD1/data >/dev/fs/ctl
211 Interleave the two mirrored disks to create
215 echo inter data /dev/fs/m0 /dev/fs/m1 >/dev/fs/ctl
220 on the interleaved device:
223 disk/kfs -f /dev/fs/data
226 Save the configuration:
229 cp /dev/fs/ctl /dev/fd0disk
232 To load the configuration automatically at boot time,
237 fsconfig=/dev/fd0disk
250 .B /sys/src/9/port/devfs.c
252 Mirrors are RAID-like but not RAID.
253 There is no fancy recovery mechanism and
254 no automatic initial copying from a master drive to its mirror drives.
260 may transmit at most one command.