Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / doc / man-pages / pod8 / bos_salvage.pod
CommitLineData
805e021f
CE
1=head1 NAME
2
3bos_salvage - Restores internal consistency to a file system or volume
4
5=head1 SYNOPSIS
6
7=for html
8<div class="synopsis">
9
10B<bos salvage> S<<< B<-server> <I<machine name>> >>>
11 S<<< [B<-partition> <I<salvage partition>>] >>>
12 S<<< [B<-volume> <I<salvage volume number or volume name>>] >>>
13 S<<< [B<-file> <I<salvage log output file>>] >>> [B<-all>] [B<-showlog>]
14 S<<< [B<-parallel> <I<# of max parallel partition salvaging>>] >>>
15 S<<< [B<-tmpdir> <I<directory to place tmp files>>] >>>
16 S<<< [B<-orphans> (ignore | remove | attach)] >>> S<<< [B<-cell> <I<cell name>>] >>>
17 S<<< [B<-forceDAFS>] >>>
18 [B<-noauth>] [B<-localauth>] [B<-help>]
19
20B<bos sa> S<<< B<-se> <I<machine name>> >>> S<<< [B<-part> <I<salvage partition>>] >>>
21 S<<< [B<-v> <I<salvage volume number or volume name>>] >>>
22 S<<< [B<-f> <I<salvage log output file>>] >>> [B<-a>] [B<-sh>]
23 [<-para> <I<# of max parallel partition salvaging>>]
24 S<<< [B<-t> <I<directory to place tmp files>>] >>>
25 S<<< [B<-o> (ignore | remove | attach)] >>> S<<< [B<-c> <I<cell name>>] >>> [B<-n>]
26 S<<< [B<-force>] >>>
27 [B<-l>] [B<-h>]
28
29=for html
30</div>
31
32=head1 DESCRIPTION
33
34The B<bos salvage> command salvages (restores internal consistency to) one
35or more volumes on the file server machine named by the B<-server>
36argument. When processing one or more partitions, the command restores
37consistency to corrupted read/write volumes where possible. For read-only
38or backup volumes, it inspects only the volume header:
39
40=over 4
41
42=item *
43
44If the volume header is corrupted, the Salvager removes the volume
45completely and records the removal in its log file,
46F</usr/afs/logs/SalvageLog>. Issue the B<vos release> or B<vos backup>
47command to create the read-only or backup volume again.
48
49=item *
50
51If the volume header is intact, the Salvager skips the volume (does not
52check for corruption in the contents). However, if the File Server notices
53corruption as it initializes, it sometimes refuses to attach the volume or
54bring it online. In this case, it is simplest to remove the volume by
55issuing the B<vos remove> or B<vos zap> command. Then issue the B<vos
56release> or B<vos backup> command to create it again.
57
58=back
59
60Use the indicated arguments to salvage a specific number of volumes:
61
62=over 4
63
64=item *
65
66To process all volumes on a file server machine, provide the B<-server>
67argument and the B<-all> flag. No volumes on the machine are accessible to
68Cache Managers during the salvage operation, because the BOS Server stops
69the File Server and Volume Server processes while the Salvager runs. The
70BOS Server automatically restarts them when the operation completes.
71
72=item *
73
74To process all volumes on one partition, provide the B<-server> and
75B<-partition> arguments. As for a salvage of the entire machine, no
76volumes on the machine are accessible to Cache Managers during the salvage
77operation. The BOS Server automatically restarts the File Server and
78Volume Server when the operation completes.
79
80=item *
81
82To salvage only one read/write volume, combine the B<-server>,
83B<-partition>, and B<-volume> arguments. Only that volume is inaccessible
84to Cache Managers, because the BOS Server does not shutdown the File
85Server and Volume Server processes during the salvage of a single
86volume. Do not name a read-only or backup volume with the B<-volume>
87argument. Instead, remove the volume, using the B<vos remove> or B<vos
88zap> command. Then create a new copy of the volume with the B<vos release>
89or B<vos backup> command.
90
91=back
92
93During the salvage of an entire machine or partition, the B<bos status>
94command reports the C<fs> process's auxiliary status as C<Salvaging file
95system>.
96
97The Salvager always writes a trace to the F</usr/afs/logs/SalvageLog> file
98on the file server machine where it runs. To record the trace in another
99file as well (either in AFS or on the local disk of the machine where the
100B<bos salvage> command is issued), name the file with the B<-file>
101argument. To display the trace on the standard output stream as it is
102written to the F</usr/afs/logs/SalvageLog> file, include the B<-showlog>
103flag.
104
105By default, multiple Salvager subprocesses run in parallel: one for each
106partition up to four, and four subprocesses for four or more
107partitions. To increase or decrease the number of subprocesses running in
108parallel, provide a positive integer value for the B<-parallel> argument.
109
110If there is more than one server partition on a physical disk, the
111Salvager by default salvages them serially to avoid the inefficiency of
112constantly moving the disk head from one partition to another. However,
113this strategy is often not ideal if the partitions are configured as
114logical volumes that span multiple disks. To force the Salvager to salvage
115logical volumes in parallel, provide the string C<all> as the value for
116the B<-parallel> argument. Provide a positive integer to specify the
117number of subprocesses to run in parallel (for example, C<-parallel 5all>
118for five subprocesses), or omit the integer to run up to four
119subprocesses, depending on the number of logical volumes being salvaged.
120
121The Salvager creates temporary files as it runs, by default writing them
122to the partition it is salvaging. The number of files can be quite large,
123and if the partition is too full to accommodate them, the Salvager
124terminates without completing the salvage operation (it always removes the
125temporary files before exiting). Other Salvager subprocesses running at
126the same time continue until they finish salvaging all other partitions
127where there is enough disk space for temporary files. To complete the
128interrupted salvage, reissue the command against the appropriate
129partitions, adding the B<-tmpdir> argument to redirect the temporary files
130to a local disk directory that has enough space.
131
132The B<-orphans> argument controls how the Salvager handles orphaned files
133and directories that it finds on server partitions it is salvaging. An
134I<orphaned> element is completely inaccessible because it is not
135referenced by the vnode of any directory that can act as its parent (is
136higher in the filespace). Orphaned objects occupy space on the server
137partition, but do not count against the volume's quota.
138
139=head1 CAUTIONS
140
141Running this command can result in data loss if the Salvager process can
142repair corruption only by removing the offending data. Consult the
143I<OpenAFS Administration Guide> for more information.
144
145=head1 OPTIONS
146
147=over 4
148
149=item B<-server> <I<machine name>>
150
151Indicates the file server machine on which to salvage volumes. Identify
152the machine by IP address or its host name (either fully-qualified or
153abbreviated unambiguously). For details, see L<bos(8)>.
154
155=item B<-partition> <I<salvage partition>>
156
157Specifies a single partition on which to salvage all volumes. Provide the
158complete partition name (for example F</vicepa>) or one of the following
159abbreviated forms:
160
161 /vicepa = vicepa = a = 0
162 /vicepb = vicepb = b = 1
163
164After F</vicepz> (for which the index is 25) comes
165
166 /vicepaa = vicepaa = aa = 26
167 /vicepab = vicepab = ab = 27
168
169and so on through
170
171 /vicepiv = vicepiv = iv = 255
172
173=item B<-volume> <I<salvage volume id or name>>
174
175Specifies the name or volume ID number of a read/write volume to
176salvage. The B<-partition> argument must be provided along with this one.
177
178=item B<-file> <I<salvage log output file>>
179
180Specifies the complete pathname of a file into which to write a trace of
181the salvage operation, in addition to the F</usr/afs/logs/SalvageLog> file
182on the server machine. If the file pathname is local, the trace is written
183to the specified file on the local disk of the machine where the B<bos
184salvage> command is issued. If the B<-volume> argument is included, the
185file can be in AFS, though not in the volume being salvaged. Do not
186combine this argument with the B<-showlog> flag.
187
188=item B<-all>
189
190Salvages all volumes on all of the partitions on the machine named by the
191B<-server> argument.
192
193=item B<-showlog>
194
195Displays the trace of the salvage operation on the standard output stream,
196as well as writing it to the F</usr/afs/logs/SalvageLog> file. Do not
197combine this flag with the B<-file> argument.
198
199=item B<-parallel> <I<# of max parallel partition salvaging>>
200
201Specifies the maximum number of Salvager subprocesses to run in
202parallel. Provide one of three values:
203
204=over 4
205
206=item *
207
208An integer from the range C<1> to C<32>. A value of C<1> means that a
209single Salvager process salvages the partitions sequentially.
210
211=item *
212
213The string C<all> to run up to four Salvager subprocesses in parallel on
214partitions formatted as logical volumes that span multiple physical
215disks. Use this value only with such logical volumes.
216
217=item *
218
219The string all followed immediately (with no intervening space) by an
220integer from the range C<1> to C<32>, to run the specified number of
221Salvager subprocesses in parallel on partitions formatted as logical
222volumes. Use this value only with such logical volumes.
223
224=back
225
226The BOS Server never starts more Salvager subprocesses than there are
227partitions, and always starts only one process to salvage a single
228volume. If this argument is omitted, up to four Salvager subprocesses run
229in parallel.
230
231=item B<-tmpdir> <I<directory to place tmp files>>
232
233Specifies the full pathname of a local disk directory to which the
234Salvager process writes temporary files as it runs. If this argument is
235omitted, or specifies an ineligible or nonexistent directory, the Salvager
236process writes the files to the partition it is currently salvaging.
237
238=item B<-orphans> (ignore | remove | attach)
239
240Controls how the Salvager handles orphaned files and directories. Choose
241one of the following three values:
242
243=over 4
244
245=item ignore
246
247Leaves the orphaned objects on the disk, but prints a message to the
248F</usr/afs/logs/SalvageLog> file reporting how many orphans were found and
249the approximate number of kilobytes they are consuming. This is the
250default if the B<-orphans> argument is omitted.
251
252=item remove
253
254Removes the orphaned objects, and prints a message to the
255F</usr/afs/logs/SalvageLog> file reporting how many orphans were removed
256and the approximate number of kilobytes they were consuming.
257
258=item attach
259
260Attaches the orphaned objects by creating a reference to them in the vnode
261of the volume's root directory. Since each object's actual name is now
262lost, the Salvager assigns each one a name of the following form:
263
264=over 4
265
266=item *
267
268C<__ORPHANFILE__.I<index>> for files.
269
270=item *
271
272C<__ORPHANDIR__.I<index>> for directories.
273
274=back
275
276where I<index> is a two-digit number that uniquely identifies each
277object. The orphans are charged against the volume's quota and appear in
278the output of the B<ls> command issued against the volume's root
279directory.
280
281=back
282
283=item B<-forceDAFS>
284
285If the fileserver is a Demand Attach File Server, then the B<-forceDAFS>
286flag must be provided in order for the B<salvager> to run.
287
288=item B<-cell> <I<cell name>>
289
290Names the cell in which to run the command. Do not combine this argument
291with the B<-localauth> flag. For more details, see L<bos(8)>.
292
293=item B<-noauth>
294
295Assigns the unprivileged identity C<anonymous> to the issuer. Do not
296combine this flag with the B<-localauth> flag. For more details, see
297L<bos(8)>.
298
299=item B<-localauth>
300
301Constructs a server ticket using a key from the local
302F</usr/afs/etc/KeyFile> or F</usr/afs/etc/KeyFileExt> file.
303The B<bos> command interpreter presents the
304ticket to the BOS Server during mutual authentication. Do not combine this
305flag with the B<-cell> or B<-noauth> options. For more details, see
306L<bos(8)>.
307
308=item B<-help>
309
310Prints the online help for this command. All other valid options are
311ignored.
312
313=back
314
315=head1 EXAMPLES
316
317The following command salvages all volumes on the F</vicepd> partition of
318the machine C<db3.example.com>:
319
320 % bos salvage -server db3.example.com -partition /vicepd
321
322The following command salvages the volume with volume ID number 536870988
323on partition F</vicepb> of the machine C<fs2.example.com>:
324
325 % bos salvage -server fs2.example.com -partition /vicepb -volume 536870988
326
327The following command salvages all volumes on the machine
328C<fs4.example.com>. Six Salvager processes run in parallel rather than the
329default four.
330
331 % bos salvage -server fs4.example.com -all -parallel 6
332
333=head1 PRIVILEGE REQUIRED
334
335The issuer must be listed in the F</usr/afs/etc/UserList> file on the
336machine named by the B<-server> argument, or must be logged onto a server
337machine as the local superuser C<root> if the B<-localauth> flag is
338included.
339
340=head1 SEE ALSO
341
342L<KeyFile(5)>,
343L<KeyFileExt(5)>,
344L<SalvageLog(5)>,
345L<UserList(5)>,
346L<bos(8)>,
347L<salvager(8)>,
348L<salvageserver(8)>,
349L<vos_backup(1)>,
350L<vos_release(1)>,
351L<vos_remove(1)>,
352L<vos_zap(1)>
353
354The I<OpenAFS Administration Guide> at
355L<http://docs.openafs.org/AdminGuide/>.
356
357=head1 COPYRIGHT
358
359IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.
360
361This documentation is covered by the IBM Public License Version 1.0. It was
362converted from HTML to POD by software written by Chas Williams and Russ
363Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.