3 salvager - Initializes the Salvager component of the fs process
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>]
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.
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:
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.
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.
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.
58 Combine the command's options as indicated to salvage different numbers of
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
143 Accommodates the command's use of the AFS command parser, and is optional.
145 =item B<-partition> <I<name of partition to salvage>>
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.
151 =item B<-volumeid> <I<volume id to salvage>>
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.
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.
165 Brings all undamaged volumes online without attempting to salvage any
170 Records in the F</usr/afs/logs/SalvageLog> file a list of all AFS inodes
171 that the Salvager modified.
175 Inspects all volumes for corruption, not just those that are marked as
176 having been active when a crash occurred.
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.
187 Records in the F</usr/afs/logs/SalvageLog> file a list of all AFS inodes
188 owned by the local superuser C<root>.
190 =item B<-salvagedirs>
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.
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.
205 =item B<-parallel> <I<# of max parallel partition salvaging>>
207 Specifies the maximum number of Salvager subprocesses to run in parallel.
208 Provide one of three values:
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.
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.
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.
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.
237 =item B<-tmpdir> <I<name of dir to place tmp files>>
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
247 Displays on the standard output stream all log data that is being written
248 to the F</usr/afs/logs/SalvageLog> file.
252 Displays a list of the pathnames for all files that have the setuid or
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
261 =item B<-orphans> (ignore | remove | attach)
263 Controls how the Salvager handles orphaned files and directories. Choose
264 one of the following three values:
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.
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.
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:
289 =item C<__ORPHANFILE__.I<index>> for files.
291 =item C<__ORPHANDIR__.I<index>> for directories.
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
304 Prints the online help for this command. All other valid options are
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.
314 % /usr/afs/bin/salvager -partition /vicepg -volumeid 258347486
316 =head1 PRIVILEGE REQUIRED
318 To issue the command at the shell prompt, the issuer must be logged in as
319 the local superuser C<root>.
332 IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.
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.