summaryrefslogtreecommitdiff
path: root/static/unix-v10/man8/worm.8
blob: 004f4a059dd0ab292ec37dc158ba4dfa42b4c1c0 (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
432
433
434
435
436
.TH WORM 8 "wild"
.CT 1 sa_nonmortals
.SH NAME
worm, jukebox \- optical disk utilities
.SH SYNOPSIS
.B "worm mkfs"
[
.BI -f device
] [
.BI -c comments
] [
.BI -b blksz
] [
.BI -n nblks
] [
.BI -v newvol_id
]
.I vol_id
.PP
.B "worm stat"
[
.BI -f device
] [
.BI -F n
] [
.B -v
] [
.I vol_id
]
.PP
.B "worm ls"
[
.BI -f device
] [
.B -l
] [
.I file ...
]
.PP
.B "worm rm"
[
.BI -f device
]
.I vol_id
[
.I file ...
]
.PP
.B "worm mv"
[
.BI -f device
]
.I vol_id
.I "src dest"
.PP
.B "worm write"
[
.BI -f device
]
.I vol_id
[
.I file ...
]
.PP
.B "worm read"
[
.BI -f device
] [
.B -dm
]
.I vol_id
[
.I file ...
]
.PP
.B "worm cat"
[
.BI -f device
]
.I vol_id
.I file
.PP
.B "worm copy"
[
.B -v
] [
.BI -m min_free
] [
.BI -f src_dev
]
.I src_vol_id
.I dest_dev
.I dest_vol_id
.PP
.B "worm offline"
[
.BI -f device
]
.PP
.B "worm btree"
[
.BI -f device
]
.I vol_id
.PP
.B "worm dir"
[
.BI -f device
]
.I vol_id
.PP
.B "worm tmpdir"
[
.BI -f device
]
.I vol_id
.PP
.B "worm mount"
[
.BI -w secs
] [
.I vol_id
]
.PP
.B "jukebox"
[
.B -aemprsuU
] [
.BI -w secs
] [
.I vol_id
]
.SH DESCRIPTION
The
.I worm
programs manipulate arbitrary files.
They are intended for use with the raw device associated
with a Write-Once Read-Many (WORM) optical disk.
The default device is
.FR /dev/worm0 .
Other devices are specified by
.BI -f device
and a device name of a single digit
.I n
is taken as an abbreviation for
.FR /dev/worm \f2n\fP.
Most of the commands implement a simple file system.
Programs just wanting a raw device should still use
.B "worm mkfs"
so that the disk is properly labeled.
The 
.IR vol_id ,
or label,
should be unique and by convention, the vol_id's
for the A and B sides of a disk should be the same string suffixed by
a lowercase
.B a
and
.B b
respectively.
.PP
.I "Worm mkfs"
labels an optical disk.
The
.I comments
field is limited to 256 chars.
It is purely descriptive and is printed by
.IR "worm stat \-v" .
The (default) blocksize is 1024 for our SONY disks.
The number of blocks on a disk can be found by
.IR ra (4)
or
.IR scsish (8);
the default size
(1,600,000 for single density, 3,250,000 for double density)
sets aside 30MB or so as a hedge against oversights.
If the disk has already been initialised, its vol_id must match
.IR vol_id .
A new vol_id can be set with
.BR -v .
.PP
.I "Worm stat"
prints out labeling information
including the amount of free space left on the disk.
Option
.I vol_id
turns off all output except exit status: zero if 
.I vol_id 
matches that of the disk,
one otherwise.
Option
.B -F
similarly exits with status zero if the disk has more than
.I n
free blocks, otherwise three.
Option
.B -v
produces more output.
.PP
.I "Worm ls"
simulates an emasculated
.IR ls (1).
.PP
.I "Worm rm"
makes the specifed files unavailable to the rest of the
.I worm
commands.
.PP
.I "Worm mv"
renames
.I src
to
.IR dest .
.PP
.I "Worm write"
copies files onto the WORM.
If no file arguments are given,
filenames are read one per line from standard input.
The total number of files and bytes is printed on standard output.
.PP
.I "Worm read"
restores files from the WORM.
If no file arguments are given,
filenames are read one per line from standard input.
Option
.B -d
causes directories to be created as needed.
Option
.B -m
restores the original modification times.
.PP
.I "Worm cat"
copies the named file from the WORM to the standard output.
.PP
.I "Worm copy"
copies files directly from one disk to another.
The names of the files to be copied are taken from standard input;
groups (separated by blank lines) will be kept together.
The names are typically generated by
.BR "worm ls" .
The
.B -v
option prints out progress and summary information.
The copy will terminate before copying a group that would leave the destination
volume with less than
.I minfree
(deafult value is 40000) blocks free.
.PP
.I "Worm offline"
makes the WORM go offline, ready for ejecting.
This command is harmless;
accessing an offline drive will cause it to spin up and go online
without operator intervention.
.I "Worm offline"
only takes effect after the last close of the WORM
and as a bonus, applies to any MSCP device such as an RA81.
.PP
.I "Worm tmpdir"
saves a copy of the directory in
.BI /usr/worm/tmp/ vol_id
if the directory
.F /usr/worm/tmp
exists.
This will speed up subsequent access substantially,
although it will still be slower than
.I "worm btree"
below.
On the other hand, 
.I worm tmpdir
typically takes 5 minutes to run (on a VAX 11/750)
whereas
.I worm btree
takes about 45 minutes.
.PP
.I "Worm btree"
constructs a new directory for the whole disk (in the form of a
.IR cbt (1)
database).
The new superblock is at zero.
All the worm commands go faster with such an index but it is intended to be done
just once, after the disk is complete.
The directory occupies of the order of 10MB but may be more.
If you really have to add more files to the disk,
you need to write zeros on the first 1K block of the WORM before using
.IR "worm write" .
.PP
.I "Worm dir"
takes the btree directory from the disk and stores in
.FR /usr/worm/dirs .
Future uses of the disk will be much faster.
.PP
.I "Worm mount"
returns the device on which the disk labelled
.I vol_id
is mounted.
If the drive(s) are busy and you have a jukebox, the
.BI -w s
option tells how many seconds to wait before failing.
The default is wait forever.
If no
.I vol_id
is given, print the drive status.
.PP
.I "Jukebox"
manages the disks in the SONY jukebox.
There are several options (default is
.BR -s ):
.TP 10
.B -a
Allocate a blank disk and label it
.IR vol_id .
Use
.I "worm mkfs"
to change any fields from their default value.
.TP
.B -e
Eject the disk labeled
.I vol_id.
To physically retrieve the disk,
press the
.B OUT
button (the
.B "OUT READY"
light should be on).
Repeat until the
.B "IN READY"
light goes on.
.TP
.B -m
Mount the disk labelled
.I vol_id
in some drive and print the drive number on standard output.
.TP
.B -p
Print the list of disks in the jukebox.
.TP
.B -r
Rebuild the list of disks by examining each disk in the jukebox.
Do not do this unless you are sure you need to.
If
.I vol_id
is given, it should be one of the following letters and governs
how disks are assigned shelf numbers.
The default is to leave the shelf number unchanged.
Other options (mainly useful for demos) are
.B c
(compresses the disks in the jukebox towards the bottom or lower numbered shelves),
.B r
(distributes the disks randomly), and
.B s
(sorts the disks by vol_id).
.TP
.B -s
Print the status of the jukebox.
.TP
.B -u
Unload offline disks back onto their shelves.
.TP
.B -U
Unload all disks (offline or not) back onto their shelves.
.TP
.BI -w secs
This option only affects the behavior of
.BR -m .
If all drives are busy, try again for
.I secs
seconds before failing.
.PP
To load a disk into the jukebox, press the
.B IN
button on the jukebox when the
.B "IN READY"
light is on.
After the shutter opens, push the disk in firmly.
The disk (blank or initialised) is not examined immediately but on demand.
.SS Etiquette
Vol_ids should be unique as discussed above.
The file
.F /n/wild/usr/worm/vol_ids
contains known vol_ids.
The commands for reading and writing require vol_id's
to guard against accessing the wrong disk.
.PP
The recommended protocol for changing disks is
if no one appears to be using the drive
(by using
.IR ps (1)),
execute
.I "worm offline"
and go to the drive.
If, and only if, the drive has the DRIVE OFF (middle) light on,
hit the EJECT button and change disks.
If the light is not on, then
someone is still using the disk and you should wait until they are done
before hitting EJECT.
.SS Programming considerations
Programs should not depend on writing any block more than once; however,
our SONY optical disks implement a small number of multiple writes
via bad block replacement.
A
.IR read (2)
of an unwritten block returns with an errno of
.BR ENXIO .
On Vaxes, the WORM is an MSCP device;
thus geometry information can be fetched as in
.IR ra (4).
.PP
For maximum speed, read and write in large blocks (preferably 63K)
and avoid seeks.
A seek across the whole disk takes about 1 second.
.PP
The device
.F /dev/worm?
is simply an appropriate raw
.IR ra (4)
device, partition 7 (the whole disk).
.SH EXAMPLES
.EX
worm mkfs -c"512x512x24 movies" tdmoviesa
worm write tdmoviesa < filenames
worm read -d tdmoviesa bumblebee/act2/frame1
.EE
.SH FILES
.F /dev/worm?
.br
.F /n/wild/usr/worm/vol_ids
.br
.F /n/wild/usr/worm/jukedir
.SH SEE ALSO
.IR backup (8),
.IR scsish (8),
.IR backup (1)
.SH BUGS
The output of
.I "worm ls"
is not necessarily sorted.