3 salvager - Initializes the Salvager component of the fs process
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>]
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.
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:
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.
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.
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.
52 Combine the command's options as indicated to salvage different numbers of
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
135 Accommodates the command's use of the AFS command parser, and is optional.
137 =item B<-partition> <I<name of partition to salvage>>
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.
143 =item B<-volumeid> <I<volume id to salvage>>
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.
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.
157 Brings all undamaged volumes online without attempting to salvage any
162 Records in the F</usr/afs/logs/SalvageLog> file a list of all AFS inodes
163 that the Salvager modified.
167 Inspects all volumes for corruption, not just those that are marked as
168 having been active when a crash occurred.
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.
179 Records in the F</usr/afs/logs/SalvageLog> file a list of all AFS inodes
180 owned by the local superuser C<root>.
182 =item B<-salvagedirs>
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.
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.
197 =item B<-parallel> <I<# of max parallel partition salvaging>>
199 Specifies the maximum number of Salvager subprocesses to run in parallel.
200 Provide one of three values:
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.
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.
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.
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
229 =item B<-tmpdir> <I<name of dir to place tmp files>>
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
239 Displays on the standard output stream all log data that is being written
240 to the F</usr/afs/logs/SalvageLog> file.
244 Displays a list of the pathnames for all files that have the setuid or
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
253 =item B<-orphans> (ignore | remove | attach)
255 Controls how the Salvager handles orphaned files and directories. Choose
256 one of the following three values:
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.
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.
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:
281 =item C<__ORPHANFILE__.I<index>> for files.
283 =item C<__ORPHANDIR__.I<index>> for directories.
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
296 Prints the online help for this command. All other valid options are
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.
306 % /usr/afs/bin/salvager -partition /vicepg -volumeid 258347486
308 =head1 PRIVILEGE REQUIRED
310 To issue the command at the shell prompt, the issuer must be logged in as
311 the local superuser C<root>.
324 IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.
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.