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