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.
160 .BI crypt " new file key"
163 corresponds to a AES-encrypted partition
180 will read its configuration from the file
183 This is useful when the machine boots from a local file server that uses
186 Use a previously partitioned disk,
189 partition files available under
194 echo disk sdC0parts 512 /dev/sdC0/data
195 disk/fdisk -p /dev/sdC0/data
196 # now create plan 9 partitions
197 echo disk sdC0parts 512 /dev/sdC0parts/plan9
198 disk/prep -p /dev/sdC0parts/plan9
216 echo mirror m0 /dev/sdC0/data /dev/sdD0/data >/dev/fs/ctl
217 echo mirror m1 /dev/sdC1/data /dev/sdD1/data >/dev/fs/ctl
220 Interleave the two mirrored disks to create
224 echo inter data /dev/fs/m0 /dev/fs/m1 >/dev/fs/ctl
229 on the interleaved device:
235 Save the configuration:
238 cp /dev/fs/ctl /dev/fd0disk
241 To load the configuration automatically at boot time,
246 fsconfig=/dev/fd0disk
259 .B /sys/src/9/port/devfs.c
261 Mirrors are RAID-like but not RAID.
262 There is no fancy recovery mechanism and
263 no automatic initial copying from a master drive to its mirror drives.
269 may transmit at most one command.