Subversion Repositories planix.SVN

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
.TH CWFS 4
2
.SH NAME
3
cwfs \- cached-worm file server, dump
4
.SH SYNOPSIS
5
.B cwfs
6
[
7
.B -cf
8
] [
9
.B -a
10
.I announce-string
11
] ... [
12
.B -m
13
.I device-map
14
]
15
.I config-device
16
.SH DESCRIPTION
17
.I Cwfs
18
is a cached-worm file server that runs
19
as a user-mode program and can
20
maintain file systems created by
21
.IR fs (4),
22
the original Plan 9 file server
23
that had its own kernel and operated
24
a standalone system with disks and
25
optical-disc jukebox attached.
26
Unlike
27
.IR fs (4),
28
which could only accept 9P connections over IL/IPv4 on Ethernets
29
(or over Datakit and Cyclones, long ago),
30
.I cwfs
31
accepts 9P connections over any network medium and protocol
32
that it can announce on,
33
by default TCP (over IPv4 or IPv6).
34
Given suitable 9P clients,
35
one could even run 9P over
36
.IR aan (8)
37
or
38
.IR tls (3).
39
.PP
40
The stock
41
.I cwfs
42
implements a 16K file system block size
43
and 32-bit disk addresses,
44
in order to be compatible with some existing file systems, notably
45
.IR emelie 's.
46
These parameters can be changed by recompilation.
47
.PP
48
.I Cwfs
49
expects to find the configuration block on
50
.IR config-device .
51
.PP
52
Options are:
53
.TF -m
54
.TP
55
.B -a
56
announce on
57
.I announce-string
58
instead of
59
.LR tcp!*!9fs .
60
.TP
61
.B -c
62
use a newer, faster, and incompatible cache-device layout.
63
To convert an old file system's cache to the new layout,
64
dump the file system, note the last superblock number,
65
halt
66
.IR cwfs ,
67
restart
68
.I cwfs
69
with
70
.BR -cf ,
71
.I recover
72
the file system, and start
73
.I cwfs
74
with
75
.B -c
76
thereafter.
77
.TP
78
.B -f
79
enter the file server's configuration mode
80
before starting normal operation.
81
.TP
82
.B -m
83
the file
84
.I device-map
85
contains a simple device name
86
(e.g.,
87
.LR w9 )
88
and a replacement per line.
89
The device name is in the usual
90
.I filsys
91
notation of
92
.IR fsconfig (8).
93
The replacement can be the name of an existing file
94
(which
95
.I cwfs
96
will not grow)
97
or another such device name.
98
For example, the file
99
.RS
100
.PD
101
.IP
102
.EX
103
w0 /tmp/w0
104
h1 w2
105
.EE
106
.PP
107
.PD 0.3v
108
would map accesses to device
109
.L w0
110
to existing file
111
.LR /tmp/w0
112
and accesses to device
113
.L h1
114
to device
115
.LR w2 ,
116
if no file named
117
.L w2
118
exists.
119
.RE
120
.PD
121
.PP
122
The file server normally requires all users except
123
.L none
124
to provide authentication tickets on each
125
.IR attach (5).
126
This can be disabled using the
127
.B noauth
128
configuration command (see
129
.IR fsconfig (8)).
130
.PP
131
The group numbered 9999, normally called
132
.BR noworld ,
133
is special
134
on the file server.  Any user belonging to that group has
135
attenuated access privileges.  Specifically, when checking such
136
a user's access to files, the file's permission bits are first ANDed
137
with 0770 for normal files or 0771 for directories.  The effect is
138
to deny world access permissions to
139
.B noworld
140
users, except
141
when walking directories.
142
.PP
143
The user
144
.B none
145
is always allowed to attach to
146
.B emelie
147
without authentication but has minimal permissions.
148
.PP
149
.B Emelie
150
maintains three file systems
151
on a combination of disks and
152
write-once-read-many (WORM) magneto-optical disks.
153
.TP
154
.B other
155
is a simple disk-based file system similar to
156
.IR kfs (4) .
157
.TP
158
.B main
159
is a worm-based file system with a disk-based
160
look-aside cache.
161
The disk cache holds
162
modified worm blocks
163
to overcome the write-once property of the worm.
164
The cache also holds recently accessed
165
non-modified blocks to
166
speed up the effective access time of the worm.
167
Occasionally
168
(usually daily at 5AM) the modified blocks in the
169
disk cache are
170
.IR dumped .
171
At this time,
172
traffic to the file system is halted and the
173
modified blocks are relabeled to the unwritten
174
portion of the worm.
175
After the dump,
176
the file system traffic is continued and
177
the relabeled blocks are copied to the worm by
178
a background process.
179
.TP
180
.B dump
181
Each time the main file system is dumped,
182
its root is appended to a subdirectory of the dump file system.
183
Since the dump file system is not mirrored with a disk
184
cache,
185
it is read-only.
186
The name of the newly added root is created from the date
187
of the dump:
188
.BI / yyyy / mmdds\f1.
189
Here
190
.I yyyy
191
is the full year,
192
.I mm
193
is the month number,
194
.I dd
195
is the day number and
196
.I s
197
is a sequence number if more than
198
one dump is done in a day.
199
For the first dump,
200
.I s
201
is null.
202
For the subsequent dumps
203
.I s
204
is 1, 2, 3, etc.
205
.sp
206
The root of the main file system
207
that is frozen on the first dump
208
of March 1, 1992
209
will be named
210
.B /1992/0301/
211
in the dump file system.
212
.SS "Changes from fs(4)"
213
.IR fs (4)'s
214
IP configuration is ignored and the underlying system's is used.
215
.PP
216
Various other
217
.IR fs (4)
218
commands have been omitted since they (or equivalents) can now be
219
executed directly on the underlying CPU server,
220
notably
221
.I date
222
and
223
.I passwd
224
(see
225
.IR auth/wrkey ).
226
.PP
227
.IR fs (4)'s
228
device names
229
.L h
230
for IDE disks and
231
.L m
232
for Marvell SATA disks are not supported; use
233
.B -m
234
to map wren devices to appropriate names under
235
.BR /dev/sd* .
236
.PP
237
The file server kernel seems to have scanned PCI buses
238
in reverse order from the other Plan 9 kernels,
239
so systems with multiple SCSI cards may find controller
240
numbering reversed.
241
.B -m
242
can be used to compensate for this if you don't want to change
243
.I filsys
244
declarations.
245
.PP
246
The file server kernel's
247
.I config
248
field in NVRAM was overloaded in recent times to hold a
249
.IR secstore (1)
250
key for the CPU hostowner.
251
Since
252
.I cwfs
253
runs on a CPU kernel,
254
the location of its configuration block must be supplied on the command line.
255
.PP
256
Disk labels are now implemented for
257
.B l
258
devices.
259
At the first access of a side,
260
.I cwfs
261
will attempt to read the label and verify that it has the correct side
262
number and byte order; if either is wrong, it will issue a warning.
263
If the label cannot be read,
264
.I cwfs
265
will attempt to write a new label.
266
.SH EXAMPLES
267
Place the root of the
268
.B dump
269
file system on
270
.B /n/dump
271
and show the modified times of the MIPS C compiler
272
over all dumps in February, 1992:
273
.IP
274
.EX
275
cwfs w0
276
9fs dump
277
ls -l /n/dump/1992/02??/mips/bin/vc
278
.EE
279
.PP
280
To get only one line of output for each version of the compiler:
281
.IP
282
.EX
283
ls -lp /n/dump/1992/02??/mips/bin/vc | uniq
284
.EE
285
.SH SOURCE
286
.B /sys/src/cmd/cwfs
287
.SH SEE ALSO
288
.IR yesterday (1),
289
.IR fs (3),
290
.IR sd (3),
291
.IR fossil (4),
292
.IR fs (4),
293
.IR srv (4),
294
.IR fs (8),
295
.IR fsconfig (8)
296
.br
297
Sean Quinlan,
298
``A Cached WORM File System'',
299
.I
300
Software \- Practice and Experience,
301
December, 1991
302
.br
303
Ken Thompson,
304
Geoff Collyer,
305
``The 64-bit Standalone Plan 9 File Server''
306
.SH BUGS
307
For the moment,
308
the file server serves both the old (9P1) and new (9P2000) versions of 9P,
309
deciding which to serve by sniffing the first packet on each connection.
310
.PP
311
File system block size and disk address size (32- or 64-bit) are fixed
312
at compilation time, and this is not easily changed.
313
.PP
314
.I Cwfs
315
is probably not the right choice of file server for new file systems.
316
It's intended to cope with existing file systems on optical jukeboxes
317
or images thereof.