Update manpage links, fix doc typo in fssync-debug
[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. Combine it with the
182 B<-partition> and B<-volumeid> arguments to identify the volume to remove.
183 Using this flag will destroy data that cannot be read, so use only with
184 caution and when you're certain that nothing in that volume is still
185 needed.
186
187 =item B<-rootinodes>
188
189 Records in the F</usr/afs/logs/SalvageLog> file a list of all AFS inodes
190 owned by the local superuser C<root>.
191
192 =item B<-salvagedirs>
193
194 Salvages entire directory structures, even if they do not appear to be
195 damaged. By default, the Salvager salvages a directory only if it is
196 flagged as corrupted.
197
198 =item B<-blockreads>
199
200 Forces the Salvager to read a partition one disk block (512 bytes) at a
201 time and to skip any blocks that are too badly damaged to be salvaged.
202 This allows it to salvage as many volumes as possible. By default, the
203 Salvager reads large disk blocks, which can cause it to exit prematurely
204 if it encounters disk errors. Use this flag if the partition to be
205 salvaged has disk errors.
206
207 =item B<-parallel> <I<# of max parallel partition salvaging>>
208
209 Specifies the maximum number of Salvager subprocesses to run in parallel.
210 Provide one of three values:
211
212 =over 4
213
214 =item *
215
216 An integer from the range C<1> to C<32>. A value of C<1> means that a
217 single Salvager process salvages the partitions sequentially.
218
219 =item *
220
221 The string C<all> to run up to four Salvager subprocesses in parallel on
222 partitions formatted as logical volumes that span multiple physical
223 disks. Use this value only with such logical volumes.
224
225 =item *
226
227 The string C<all> followed immediately (with no intervening space) by an
228 integer from the range C<1> to C<32>, to run the specified number of
229 Salvager subprocesses in parallel on partitions formatted as logical
230 volumes. Use this value only with such logical volumes.
231
232 =back
233
234 The BOS Server never starts more Salvager subprocesses than there are
235 partitions, and always starts only one process to salvage a single
236 volume. If this argument is omitted, up to four Salvager subprocesses run
237 in parallel but partitions on the same device are salvaged serially.
238
239 =item B<-tmpdir> <I<name of dir to place tmp files>>
240
241 Names a local disk directory in which the Salvager places the temporary
242 files it creates during a salvage operation, instead of writing them to
243 the partition being salvaged (the default). If the Salvager cannot write
244 to the specified directory, it attempts to write to the partition being
245 salvaged.
246
247 =item B<-showlog>
248
249 Displays on the standard output stream all log data that is being written
250 to the F</usr/afs/logs/SalvageLog> file.
251
252 =item B<-showsuid>
253
254 Displays a list of the pathnames for all files that have the setuid or
255 setgid mode bit set.
256
257 =item B<-showmounts>
258
259 Records in the F</usr/afs/logs/SalvageLog> file all mount points found in
260 each volume. The Salvager does not repair corruption in the volumes, if
261 any exists.
262
263 =item B<-orphans> (ignore | remove | attach)
264
265 Controls how the Salvager handles orphaned files and directories.  Choose
266 one of the following three values:
267
268 =over 4
269
270 =item ignore
271
272 Leaves the orphaned objects on the disk, but prints a message to the
273 F</usr/afs/logs/SalvageLog> file reporting how many orphans were found and
274 the approximate number of kilobytes they are consuming. This is the
275 default if the B<-orphans> argument is omitted.
276
277 =item remove
278
279 Removes the orphaned objects, and prints a message to the
280 F</usr/afs/logs/SalvageLog> file reporting how many orphans were removed
281 and the approximate number of kilobytes they were consuming.
282
283 =item attach
284
285 Attaches the orphaned objects by creating a reference to them in the vnode
286 of the volume's root directory. Since each object's actual name is now
287 lost, the Salvager assigns each one a name of the following form:
288
289 =over 4
290
291 =item C<__ORPHANFILE__.I<index>> for files.
292
293 =item C<__ORPHANDIR__.I<index>> for directories.
294
295 =back
296
297 where I<index> is a two-digit number that uniquely identifies each
298 object. The orphans are charged against the volume's quota and appear in
299 the output of the B<ls> command issued against the volume's root
300 directory.
301
302 =back
303
304 =item B<-help>
305
306 Prints the online help for this command. All other valid options are
307 ignored.
308
309 =back
310
311 =head1 EXAMPLES
312
313 The following command instructs the Salvager to attempt to salvage the
314 volume with volume ID 258347486 on F</vicepg> on the local machine.
315
316    % /usr/afs/bin/salvager -partition /vicepg -volumeid 258347486
317
318 =head1 PRIVILEGE REQUIRED
319
320 To issue the command at the shell prompt, the issuer must be logged in as
321 the local superuser C<root>.
322
323 =head1 SEE ALSO
324
325 L<BosConfig(5)>,
326 L<SalvageLog(5)>,
327 L<bos_create(8)>,
328 L<bos_getlog(8)>,
329 L<bos_salvage(8)>,
330 L<vos_move(1)>
331
332 =head1 COPYRIGHT
333
334 IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.
335
336 This documentation is covered by the IBM Public License Version 1.0.  It was
337 converted from HTML to POD by software written by Chas Williams and Russ
338 Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.