summaryrefslogtreecommitdiff
path: root/sys/man/8/fsconfig
blob: e5a0c6748228a4192e9871fcfa6549a402b30b9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
.TH FSCONFIG 8
.SH NAME
fsconfig \- configuring a file server
.SH SYNOPSIS
.B service
.I name
.PP
.B config
.I device
.PP
.B nvram
.I device
.PP
.B filsys
.I name
.I device
.PP
.B ip
.I ipaddr
.PP
.B ipgw
.I ipaddr
.PP
.B ipmask
.I ipaddr
.PP
.B ipauth
.I ipaddr
.PP
.B ipsntp
.I ipaddr
.PP
.B ream
.I name
.PP
.B recover
.I name
.PP
.B allow
.PP
.B readonly
.PP
.B noauth
.PP
.B noattach
.PP
.B copyworm
.PP
.B copydev
.I from-dev
.I to-dev
.PP
.B halt
.PP
.B end
.SH DESCRIPTION
When an
.IR fs (4)
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
.BR 111.103.94.19
and
.I name
is a text string without white space.
The syntax of a
.I device
is more complicated:
.TP
.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
through
.I n
inclusive.
.I M
may be greater than
.IR n .
For example,
.B (w<1-4>)
is the concatenation of SCSI targets 1 through 4.
.TP
.BI h n1 . n2 . n3
.I H
is similar to
.IR w ,
but for IDE or ATA disks,
and the controllers must be specified in
.BR plan9.ini .
.I Lun
is ignored.
.I Target
0 is an IDE master
and 1 is a slave.
Instead of specifying
.I controller
and
.IR target
separately,
one may omit the
.I controller
and specify a target of
.IB controller-number *2
.B +
.IR target-number ,
thus
.B h2
is equivalent to
.B h1.0.0
(second IDE controller, master drive).
.TP
.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.
There is no need to specify the controllers in 
.B plan9.ini
as they are autodiscovered.
Hot-swapping drives is not currently 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.
Thus
.B m9
is equivalent to
.B m1.1.0
(second controller, second drive),
if the first controller supports 8 drives.
.TP
.BI l n1 . n2 . n3
.TP
.BI r n1 . n2 . n3
The same as
.BR w ,
but leaving a single block at the beginning for a label
.BI ( l ),
or not.
Only
.I n2
is really of interest,
and refers to a side of a WORM disc.
These are only really relevant when used as
.I device3
in the
.B j
device (see below).
.TP
.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.
.TP
.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.
.TP
.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,
and
.B [
.B ]
as RAID 0,
though neither includes any fancy recovery mechanisms.
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.
.TP
.BI p device . n1 . n2
A partition starting at
.IR n1 %
from the beginning of
.I device
with a length
.IR n2 %
of the size of the device.
Parenthesize
.I device
if it contains periods.
.TP
.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.
.TP
.BR j (\f2device1\ device2\f1...)\f2device3
.I Device1
is the SCSI juke box interface.
The
.IR device2 s
are the SCSI drives in the jukebox and
.I device3
represents the demountable platters in the juke box.
.TP
.BI f device
A pseudo-WORM disk: blocks on
.I device
can be written only once and may not be read unless written.
.TP
.BI c device1device2
A cached WORM.  The first
.I device
is the cache, the second the WORM.
.TP
.BI o
(Letter o) The read-only (dump) file system
of the most-recently defined cached WORM file system.
.SS Configuration
The
.B service
command sets the textual name of the server as known in
the network databases.
.PP
The configuration information is stored in block zero on a
device whose device string is written in non-volatile RAM.
The
.B config
and
.B nvram
commands identify the
.I device
on which the information is recorded.
The
.B config
command also erases any previous configuration.
.PP
The
.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)).
.PP
The rest of the configuration commands record IP addresses:
the file server's address
.RI ( ip ),
the local gateway's
.RI ( ipgw ),
the local authentication server's
.RI ( ipauth ),
the local subnet mask
.RI ( ipmask ),
and the address of a system running an SNTP server
.RI ( ipsntp ).
.I Ipauth
is no longer used.
If the server has more than one network interface,
a digit may be appended to the keywords
.BR ip ,
.B ipgw
and
.B ipmask
to indicate the interface number;
zero is the default.
.SS "One-time actions"
.PP
The
.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.
If
.I name
is
.BR main ,
the file server, until the next reboot,
will accept
.B wstat
messages
(see
.IR stat (5))
that change the owner and group of files,
to enable initializing a fresh file system from a
.IR mkfs (8)
archive.
.PP
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.
.PP
.I Allow
turns off all permission checking; use with caution.
.PP
.I Readonly
disables all writing to all devices.
This is useful for trying dangerous experiments.
.PP
.I Noauth
disables authentication.
.PP
.I Noattach
prevents attachs.
.PP
.I Copyworm
will copy a file system named
.I main
to one named
.IR output ,
block by block,
and loop.
It knows how to read a fake worm file system.
.PP
.I Copydev
will copy the device
.I from-dev
to the device
.IR to-dev .
block by block,
and panic.
.PP
.I Halt
will cause the server to
.I immediately
exit and reboot.
.PP
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.
.SH EXAMPLE
Initialize a file server
.B kgbsun
with a single file system interleaved between SCSI targets 3 and 4.
.IP
.EX
service kgbsun
config w3
filsys main [w<3-4>]
ream main
.EE
.PP
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.
.IP
.EX
service kremvax
config p(w0)50.1
filsys main cp(w0)50.25f[p(w0)0.25p(w0)25.25p(w0)75.25]
filsys dump o
ream main
.EE
.PP
A complete and complex example:
initialize a file server
.I fsb
with a single SCSI disk on target 0 for a scratch file system,
a cached WORM file system with cache disk on target 2 and
an optical-disc jukebox on targets 4 (robotics) and 5 (one optical drive),
and another cached WORM file system with cache disk on target 3
and another optical-disc jukebox on a second SCSI bus at targets 3 and 4.
Both jukeboxes contain 16 slots of optical discs.
It has two Ethernet interfaces and can reach an SNTP server on the first one.
.IP
.EX
service fsb
config w0
filsys main cw2j(w4w5)(l<0-31>)
filsys dump o
filsys hp40fx cw3j(w1.<3-4>.0)(l<0-31>)
filsys hp40fxdump o
filsys other w0
ipauth 0.0.0.0
ipsntp 10.9.0.3
ip0 10.9.0.2
ipgw0 10.9.0.3
ipmask0 255.255.0.0
ip1 10.0.0.2
ipgw1 10.0.0.1
ipmask1 255.255.0.0
ream main
ream hp40fx
ream other
end
.EE
.SH SOURCE
.BR /sys/src/fs/port/config.c
.SH "SEE ALSO
Ken Thompson,
``The Plan 9 File Server''.