f7009c65372ea029fcf2335d2b0778f3286e32df
[openafs.git] / doc / man-pages / pod8 / salvager.pod
1 =head1 NAME
2
3 salvager - Initializes the Salvager component of the fs process
4
5 =head1 SYNOPSIS
6
7 =for html
8 <div class="synopsis">
9
10 B<salvager> [I<initcmd>] S<<< [B<-partition> <I<name of partition to salvage>>] >>>
11     S<<< [B<-volumeid> <I<volume id to salvage>>] >>> [B<-debug>] [B<-nowrite>]
12     [B<-inodes>] [B<-force>] [B<-oktozap>] [B<-rootinodes>]
13     [B<-salvagedirs>] [B<-blockreads>]
14     S<<< [B<-parallel> <I<# of max parallel partition salvaging>>] >>>
15     S<<< [B<-tmpdir> <I<name of dir to place tmp files>>] >>>
16     [B<-showlog>] [B<-showsuid>] [B<-showmounts>]
17     S<<< [B<-orphans> (ignore | remove | attach)] >>> [B<-help>]
18
19 =for html
20 </div>
21
22 =head1 DESCRIPTION
23
24 The B<salvager> command initializes the Salvager component of the C<fs>
25 process. In the conventional configuration, its binary file is located in
26 the F</usr/afs/bin> directory on a file server machine.
27
28 The Salvager restores internal consistency to corrupted read/write volumes
29 on the local file server machine where possible. For read-only or backup
30 volumes, it inspects only the volume header:
31
32 =over 4
33
34 =item *
35
36 If the volume header is corrupted, the Salvager removes the volume
37 completely and records the removal in its log file,
38 F</usr/afs/logs/SalvageLog>. Issue the B<vos release> or B<vos backup>
39 command to create the read-only or backup volume again.
40
41 =item *
42
43 If the volume header is intact, the Salvager skips the volume (does not
44 check for corruption in the contents). However, if the File Server notices
45 corruption as it initializes, it sometimes refuses to attach the volume or
46 bring it online. In this case, it is simplest to remove the volume by
47 issuing the B<vos remove> or B<vos zap> command. Then issue the B<vos
48 release> or B<vos backup> command to create it again.
49
50 =back
51
52 Unlike other server process initialization commands, the B<salvager>
53 command is designed to be issued at the command shell prompt, as well as
54 being placed into a file server machine's F</usr/afs/local/BosConfig> file
55 with the B<bos create> command. It is also possible to invoke the Salvager
56 remotely by issuing the B<bos salvage> command.
57
58 Combine the command's options as indicated to salvage different numbers of
59 read/write volumes:
60
61 =over 4
62
63 =item *
64
65 To salvage all volumes on the file server machine, provide no arguments.
66 No volumes on the machine are accessible to Cache Managers during the
67 salvage, because the BOS Server stops the File Server and Volume Server
68 processes while the Salvager runs.
69
70 =item *
71
72 To salvage all of the volumes on one partition, provide the B<-partition>
73 argument. As for a salvage of all volumes on the machine, no volumes on
74 the machine are accessible to Cache Managers during the salvage operation.
75
76 =item *
77
78 To salvage only one volume, combine the B<-partition> and B<-volumeid>
79 arguments. Only that volume is inaccessible to Cache Managers, because the
80 BOS Server does not shutdown the File Server and Volume Server processes.
81
82 =back
83
84 The Salvager normally salvages only those read/write volumes that are
85 marked as having been active when a crash occurred. To have it salvage all
86 relevant read/write volumes, add the B<-force> flag.
87
88 The Salvager normally creates new inodes as it repairs damage. If the
89 partition is so full that there is no room for new inodes, use the
90 B<-nowrite> argument to bringing undamaged volumes online without
91 attempting to salvage damaged volumes. Then use the B<vos move> command to
92 move one or more of the undamaged volumes to other partitions, freeing up
93 the space that the Salvager needs to create new inodes.
94
95 By default, multiple Salvager subprocesses run in parallel: one for each
96 partition up to four, and four subprocesses for four or more
97 partitions. To increase or decrease the number of subprocesses running in
98 parallel, provide a positive integer value for the B<-parallel> argument.
99
100 If there is more than one server partition on a physical disk, the
101 Salvager by default salvages them serially to avoid the inefficiency of
102 constantly moving the disk head from one partition to another. However,
103 this strategy is often not ideal if the partitions are configured as
104 logical volumes that span multiple disks. To force the Salvager to salvage
105 logical volumes in parallel as if they were on separate disks, provide the
106 string C<all> as the value for the B<-parallel> argument.
107
108 To set both parameters at the same time, append the number of Salvager
109 processes to the string C<all>. For example, C<-parallel all5> treats
110 each partition as a separate disk and runs five Salvager processes, thus
111 salvaging five partitions at a time.
112
113 The Salvager creates temporary files as it runs, by default writing them
114 to the partition it is salvaging. The number of files can be quite large,
115 and if the partition is too full to accommodate them, the Salvager
116 terminates without completing the salvage operation (it always removes the
117 temporary files before exiting). Other Salvager subprocesses running at
118 the same time continue until they finish salvaging all other partitions
119 where there is enough disk space for temporary files. To complete the
120 interrupted salvage, reissue the command against the appropriate
121 partitions, adding the B<-tmpdir> argument to redirect the temporary files
122 to a local disk directory that has enough space.
123
124 The B<-orphans> argument controls how the Salvager handles orphaned files
125 and directories that it finds on server partitions it is salvaging. An
126 I<orphaned> element is completely inaccessible because it is not
127 referenced by the vnode of any directory that can act as its parent (is
128 higher in the filespace). Orphaned objects occupy space on the server
129 partition, but do not count against the volume's quota.
130
131 To generate a list of all mount points that reside in one or more volumes,
132 rather than actually salvaging them, include the B<-showmounts> flag.
133
134 This command does not use the syntax conventions of the AFS command
135 suites. Provide the command name and all option names in full.
136
137 =head1 OPTIONS
138
139 =over 4
140
141 =item [I<initcmd>]
142
143 Accommodates the command's use of the AFS command parser, and is optional.
144
145 =item B<-partition> <I<name of partition to salvage>>
146
147 Specifies the name of the partition to salvage. Specify the full partition
148 name using the form F</vicepI<x>> or F</vicepI<xx>>. Omit this argument to
149 salvage every partition on the file server machine.
150
151 =item B<-volumeid> <I<volume id to salvage>>
152
153 Specifies the volume ID of a specific read/write volume to salvage.  The
154 B<-partition> argument must be provided along with this one and specify
155 the volume's actual site.
156
157 =item B<-debug>
158
159 Allows only one Salvager subprocess to run at a time, regardless of the
160 setting of the B<-parallel> option. Include it when running the Salvager
161 in a debugger to make the trace easier to interpret.
162
163 =item B<-nowrite>
164
165 Brings all undamaged volumes online without attempting to salvage any
166 damaged volumes.
167
168 =item B<-inodes>
169
170 Records in the F</usr/afs/logs/SalvageLog> file a list of all AFS inodes
171 that the Salvager modified.
172
173 =item B<-force>
174
175 Inspects all volumes for corruption, not just those that are marked as
176 having been active when a crash occurred.
177
178 =item B<-oktozap>
179
180 Removes a volume that is so damaged that even issuing the B<vos zap>
181 command with the B<-force> flag is ineffective. Use this argument only in
182 consultation with AFS Development or Product Support. Combine it with the
183 B<-partition> and B<-volumeid> arguments to identify the volume to remove.
184
185 =item B<-rootinodes>
186
187 Records in the F</usr/afs/logs/SalvageLog> file a list of all AFS inodes
188 owned by the local superuser C<root>.
189
190 =item B<-salvagedirs>
191
192 Salvages entire directory structures, even if they do not appear to be
193 damaged. By default, the Salvager salvages a directory only if it is
194 flagged as corrupted.
195
196 =item B<-blockreads>
197
198 Forces the Salvager to read a partition one disk block (512 bytes) at a
199 time and to skip any blocks that are too badly damaged to be salvaged.
200 This allows it to salvage as many volumes as possible. By default, the
201 Salvager reads large disk blocks, which can cause it to exit prematurely
202 if it encounters disk errors. Use this flag if the partition to be
203 salvaged has disk errors.
204
205 =item B<-parallel> <I<# of max parallel partition salvaging>>
206
207 Specifies the maximum number of Salvager subprocesses to run in parallel.
208 Provide one of three values:
209
210 =over 4
211
212 =item *
213
214 An integer from the range C<1> to C<32>. A value of C<1> means that a
215 single Salvager process salvages the partitions sequentially.
216
217 =item *
218
219 The string C<all> to run up to four Salvager subprocesses in parallel on
220 partitions formatted as logical volumes that span multiple physical
221 disks. Use this value only with such logical volumes.
222
223 =item *
224
225 The string C<all> followed immediately (with no intervening space) by an
226 integer from the range C<1> to C<32>, to run the specified number of
227 Salvager subprocesses in parallel on partitions formatted as logical
228 volumes. Use this value only with such logical volumes.
229
230 =back
231
232 The BOS Server never starts more Salvager subprocesses than there are
233 partitions, and always starts only one process to salvage a single
234 volume. If this argument is omitted, up to four Salvager subprocesses run
235 in parallel but partitions on the same device are salvaged serially.
236
237 =item B<-tmpdir> <I<name of dir to place tmp files>>
238
239 Names a local disk directory in which the Salvager places the temporary
240 files it creates during a salvage operation, instead of writing them to
241 the partition being salvaged (the default). If the Salvager cannot write
242 to the specified directory, it attempts to write to the partition being
243 salvaged.
244
245 =item B<-showlog>
246
247 Displays on the standard output stream all log data that is being written
248 to the F</usr/afs/logs/SalvageLog> file.
249
250 =item B<-showsuid>
251
252 Displays a list of the pathnames for all files that have the setuid or
253 setgid mode bit set.
254
255 =item B<-showmounts>
256
257 Records in the F</usr/afs/logs/SalvageLog> file all mount points found in
258 each volume. The Salvager does not repair corruption in the volumes, if
259 any exists.
260
261 =item B<-orphans> (ignore | remove | attach)
262
263 Controls how the Salvager handles orphaned files and directories.  Choose
264 one of the following three values:
265
266 =over 4
267
268 =item ignore
269
270 Leaves the orphaned objects on the disk, but prints a message to the
271 F</usr/afs/logs/SalvageLog> file reporting how many orphans were found and
272 the approximate number of kilobytes they are consuming. This is the
273 default if the B<-orphans> argument is omitted.
274
275 =item remove
276
277 Removes the orphaned objects, and prints a message to the
278 F</usr/afs/logs/SalvageLog> file reporting how many orphans were removed
279 and the approximate number of kilobytes they were consuming.
280
281 =item attach
282
283 Attaches the orphaned objects by creating a reference to them in the vnode
284 of the volume's root directory. Since each object's actual name is now
285 lost, the Salvager assigns each one a name of the following form:
286
287 =over 4
288
289 =item C<__ORPHANFILE__.I<index>> for files.
290
291 =item C<__ORPHANDIR__.I<index>> for directories.
292
293 =back
294
295 where I<index> is a two-digit number that uniquely identifies each
296 object. The orphans are charged against the volume's quota and appear in
297 the output of the B<ls> command issued against the volume's root
298 directory.
299
300 =back
301
302 =item B<-help>
303
304 Prints the online help for this command. All other valid options are
305 ignored.
306
307 =back
308
309 =head1 EXAMPLES
310
311 The following command instructs the Salvager to attempt to salvage the
312 volume with volume ID 258347486 on F</vicepg> on the local machine.
313
314    % /usr/afs/bin/salvager -partition /vicepg -volumeid 258347486
315
316 =head1 PRIVILEGE REQUIRED
317
318 To issue the command at the shell prompt, the issuer must be logged in as
319 the local superuser C<root>.
320
321 =head1 SEE ALSO
322
323 L<BosConfig(5)>,
324 L<SalvageLog(5)>,
325 L<bos_create(8)>,
326 L<bos_getlog(8)>,
327 L<bos_salvage(8)>,
328 L<vos_move(1)>
329
330 =head1 COPYRIGHT
331
332 IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.
333
334 This documentation is covered by the IBM Public License Version 1.0.  It was
335 converted from HTML to POD by software written by Chas Williams and Russ
336 Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.