2057e1502ad3d07c66471d0b5ce4b5ebcd7918dd
[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, provide the string C<all> as the value for
106 the B<-parallel> argument. Provide a positive integer to specify the
107 number of subprocesses to run in parallel (for example, C<-parallel 5all>
108 for five subprocesses), or omit the integer to run up to four
109 subprocesses, depending on the number of logical volumes being salvaged.
110
111 The Salvager creates temporary files as it runs, by default writing them
112 to the partition it is salvaging. The number of files can be quite large,
113 and if the partition is too full to accommodate them, the Salvager
114 terminates without completing the salvage operation (it always removes the
115 temporary files before exiting). Other Salvager subprocesses running at
116 the same time continue until they finish salvaging all other partitions
117 where there is enough disk space for temporary files. To complete the
118 interrupted salvage, reissue the command against the appropriate
119 partitions, adding the B<-tmpdir> argument to redirect the temporary files
120 to a local disk directory that has enough space.
121
122 The B<-orphans> argument controls how the Salvager handles orphaned files
123 and directories that it finds on server partitions it is salvaging. An
124 I<orphaned> element is completely inaccessible because it is not
125 referenced by the vnode of any directory that can act as its parent (is
126 higher in the filespace). Orphaned objects occupy space on the server
127 partition, but do not count against the volume's quota.
128
129 To generate a list of all mount points that reside in one or more volumes,
130 rather than actually salvaging them, include the B<-showmounts> flag.
131
132 This command does not use the syntax conventions of the AFS command
133 suites. Provide the command name and all option names in full.
134
135 =head1 OPTIONS
136
137 =over 4
138
139 =item [I<initcmd>]
140
141 Accommodates the command's use of the AFS command parser, and is optional.
142
143 =item B<-partition> <I<name of partition to salvage>>
144
145 Specifies the name of the partition to salvage. Specify the full partition
146 name using the form F</vicepI<x>> or F</vicepI<xx>>. Omit this argument to
147 salvage every partition on the file server machine.
148
149 =item B<-volumeid> <I<volume id to salvage>>
150
151 Specifies the volume ID of a specific read/write volume to salvage.  The
152 B<-partition> argument must be provided along with this one and specify
153 the volume's actual site.
154
155 =item B<-debug>
156
157 Allows only one Salvager subprocess to run at a time, regardless of the
158 setting of the B<-parallel> option. Include it when running the Salvager
159 in a debugger to make the trace easier to interpret.
160
161 =item B<-nowrite>
162
163 Brings all undamaged volumes online without attempting to salvage any
164 damaged volumes.
165
166 =item B<-inodes>
167
168 Records in the F</usr/afs/logs/SalvageLog> file a list of all AFS inodes
169 that the Salvager modified.
170
171 =item B<-force>
172
173 Inspects all volumes for corruption, not just those that are marked as
174 having been active when a crash occurred.
175
176 =item B<-oktozap>
177
178 Removes a volume that is so damaged that even issuing the B<vos zap>
179 command with the B<-force> flag is ineffective. Use this argument only in
180 consultation with AFS Development or Product Support. Combine it with the
181 B<-partition> and B<-volumeid> arguments to identify the volume to remove.
182
183 =item B<-rootinodes>
184
185 Records in the F</usr/afs/logs/SalvageLog> file a list of all AFS inodes
186 owned by the local superuser C<root>.
187
188 =item B<-salvagedirs>
189
190 Salvages entire directory structures, even if they do not appear to be
191 damaged. By default, the Salvager salvages a directory only if it is
192 flagged as corrupted.
193
194 =item B<-blockreads>
195
196 Forces the Salvager to read a partition one disk block (512 bytes) at a
197 time and to skip any blocks that are too badly damaged to be salvaged.
198 This allows it to salvage as many volumes as possible. By default, the
199 Salvager reads large disk blocks, which can cause it to exit prematurely
200 if it encounters disk errors. Use this flag if the partition to be
201 salvaged has disk errors.
202
203 =item B<-parallel> <I<# of max parallel partition salvaging>>
204
205 Specifies the maximum number of Salvager subprocesses to run in parallel.
206 Provide one of three values:
207
208 =over 4
209
210 =item *
211
212 An integer from the range C<1> to C<32>. A value of C<1> means that a
213 single Salvager process salvages the partitions sequentially.
214
215 =item *
216
217 The string C<all> to run up to four Salvager subprocesses in parallel on
218 partitions formatted as logical volumes that span multiple physical
219 disks. Use this value only with such logical volumes.
220
221 =item *
222
223 The string C<all> followed immediately (with no intervening space) by an
224 integer from the range C<1> to C<32>, to run the specified number of
225 Salvager subprocesses in parallel on partitions formatted as logical
226 volumes. Use this value only with such logical volumes.
227
228 =back
229
230 The BOS Server never starts more Salvager subprocesses than there are
231 partitions, and always starts only one process to salvage a single
232 volume. If this argument is omitted, up to four Salvager subprocesses run
233 in parallel.
234
235 =item B<-tmpdir> <I<name of dir to place tmp files>>
236
237 Names a local disk directory in which the Salvager places the temporary
238 files it creates during a salvage operation, instead of writing them to
239 the partition being salvaged (the default). If the Salvager cannot write
240 to the specified directory, it attempts to write to the partition being
241 salvaged.
242
243 =item B<-showlog>
244
245 Displays on the standard output stream all log data that is being written
246 to the F</usr/afs/logs/SalvageLog> file.
247
248 =item B<-showsuid>
249
250 Displays a list of the pathnames for all files that have the setuid or
251 setgid mode bit set.
252
253 =item B<-showmounts>
254
255 Records in the F</usr/afs/logs/SalvageLog> file all mount points found in
256 each volume. The Salvager does not repair corruption in the volumes, if
257 any exists.
258
259 =item B<-orphans> (ignore | remove | attach)
260
261 Controls how the Salvager handles orphaned files and directories.  Choose
262 one of the following three values:
263
264 =over 4
265
266 =item ignore
267
268 Leaves the orphaned objects on the disk, but prints a message to the
269 F</usr/afs/logs/SalvageLog> file reporting how many orphans were found and
270 the approximate number of kilobytes they are consuming. This is the
271 default if the B<-orphans> argument is omitted.
272
273 =item remove
274
275 Removes the orphaned objects, and prints a message to the
276 F</usr/afs/logs/SalvageLog> file reporting how many orphans were removed
277 and the approximate number of kilobytes they were consuming.
278
279 =item attach
280
281 Attaches the orphaned objects by creating a reference to them in the vnode
282 of the volume's root directory. Since each object's actual name is now
283 lost, the Salvager assigns each one a name of the following form:
284
285 =over 4
286
287 =item C<__ORPHANFILE__.I<index>> for files.
288
289 =item C<__ORPHANDIR__.I<index>> for directories.
290
291 =back
292
293 where I<index> is a two-digit number that uniquely identifies each
294 object. The orphans are charged against the volume's quota and appear in
295 the output of the B<ls> command issued against the volume's root
296 directory.
297
298 =back
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 instructs the Salvager to attempt to salvage the
310 volume with volume ID 258347486 on F</vicepg> on the local machine.
311
312    % /usr/afs/bin/salvager -partition /vicepg -volumeid 258347486
313
314 =head1 PRIVILEGE REQUIRED
315
316 To issue the command at the shell prompt, the issuer must be logged in as
317 the local superuser C<root>.
318
319 =head1 SEE ALSO
320
321 L<BosConfig(5)>,
322 L<SalvageLog(5)>,
323 L<bos_create(8)>,
324 L<bos_getlog(8)>,
325 L<bos_salvage(8)>,
326 L<vos_move(1)>
327
328 =head1 COPYRIGHT
329
330 IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.
331
332 This documentation is covered by the IBM Public License Version 1.0.  It was
333 converted from HTML to POD by software written by Chas Williams and Russ
334 Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.