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