1 <?xml version="1.0" encoding="UTF-8"?>
2 <refentry id="salvager8">
4 <refentrytitle>salvager</refentrytitle>
5 <manvolnum>8</manvolnum>
8 <refname>salvager</refname>
9 <refpurpose>Initializes the Salvager component of the fs process</refpurpose>
12 <title>Synopsis</title>
13 <para><emphasis role="bold">salvager</emphasis> [<emphasis>initcmd</emphasis>] [<emphasis role="bold">-partition</emphasis> <<emphasis>name of partition to salvage</emphasis>>]
14 [<emphasis role="bold">-volumeid</emphasis> <<emphasis>volume id to salvage</emphasis>>] [<emphasis role="bold">-debug</emphasis>] [<emphasis role="bold">-nowrite</emphasis>]
15 [<emphasis role="bold">-inodes</emphasis>] [<emphasis role="bold">-force</emphasis>] [<emphasis role="bold">-oktozap</emphasis>] [<emphasis role="bold">-rootinodes</emphasis>]
16 [<emphasis role="bold">-salvagedirs</emphasis>] [<emphasis role="bold">-blockreads</emphasis>]
17 [<emphasis role="bold">-parallel</emphasis> <<emphasis># of max parallel partition salvaging</emphasis>>]
18 [<emphasis role="bold">-tmpdir</emphasis> <<emphasis>name of dir to place tmp files</emphasis>>]
19 [<emphasis role="bold">-showlog</emphasis>] [<emphasis role="bold">-showsuid</emphasis>] [<emphasis role="bold">-showmounts</emphasis>]
20 [<emphasis role="bold">-orphans</emphasis> (ignore | remove | attach)] [<emphasis role="bold">-help</emphasis>]</para>
24 <title>Description</title>
25 <para>The <emphasis role="bold">salvager</emphasis> command initializes the Salvager component of the <computeroutput>fs</computeroutput>
26 process. In the conventional configuration, its binary file is located in
27 the <replaceable>/usr/afs/bin</replaceable> directory on a file server machine.</para>
29 <para>The Salvager restores internal consistency to corrupted read/write volumes
30 on the local file server machine where possible. For read-only or backup
31 volumes, it inspects only the volume header:</para>
35 <para>If the volume header is corrupted, the Salvager removes the volume
36 completely and records the removal in its log file,
37 <replaceable>/usr/afs/logs/SalvageLog</replaceable>. Issue the <emphasis role="bold">vos release</emphasis> or <emphasis role="bold">vos backup</emphasis>
38 command to create the read-only or backup volume again.</para>
42 <para>If the volume header is intact, the Salvager skips the volume (does not
43 check for corruption in the contents). However, if the File Server notices
44 corruption as it initializes, it sometimes refuses to attach the volume or
45 bring it online. In this case, it is simplest to remove the volume by
46 issuing the <emphasis role="bold">vos remove</emphasis> or <emphasis role="bold">vos zap</emphasis> command. Then issue the <emphasis role="bold">vos
47 release</emphasis> or <emphasis role="bold">vos backup</emphasis> command to create it again.</para>
51 <para>Unlike other server process initialization commands, the <emphasis role="bold">salvager</emphasis>
52 command is designed to be issued at the command shell prompt, as well as
53 being placed into a file server machine's <replaceable>/usr/afs/local/BosConfig</replaceable> file
54 with the <emphasis role="bold">bos create</emphasis> command. It is also possible to invoke the Salvager
55 remotely by issuing the <emphasis role="bold">bos salvage</emphasis> command.</para>
57 <para>Combine the command's options as indicated to salvage different numbers of
58 read/write volumes:</para>
62 <para>To salvage all volumes on the file server machine, provide no arguments.
63 No volumes on the machine are accessible to Cache Managers during the
64 salvage, because the BOS Server stops the File Server and Volume Server
65 processes while the Salvager runs.</para>
69 <para>To salvage all of the volumes on one partition, provide the <emphasis role="bold">-partition</emphasis>
70 argument. As for a salvage of all volumes on the machine, no volumes on
71 the machine are accessible to Cache Managers during the salvage operation.</para>
75 <para>To salvage only one volume, combine the <emphasis role="bold">-partition</emphasis> and <emphasis role="bold">-volumeid</emphasis>
76 arguments. Only that volume is inaccessible to Cache Managers, because the
77 BOS Server does not shutdown the File Server and Volume Server processes.</para>
81 <para>The Salvager normally salvages only those read/write volumes that are
82 marked as having been active when a crash occurred. To have it salvage all
83 relevant read/write volumes, add the <emphasis role="bold">-force</emphasis> flag.</para>
85 <para>The Salvager normally creates new inodes as it repairs damage. If the
86 partition is so full that there is no room for new inodes, use the
87 <emphasis role="bold">-nowrite</emphasis> argument to bringing undamaged volumes online without
88 attempting to salvage damaged volumes. Then use the <emphasis role="bold">vos move</emphasis> command to
89 move one or more of the undamaged volumes to other partitions, freeing up
90 the space that the Salvager needs to create new inodes.</para>
92 <para>By default, multiple Salvager subprocesses run in parallel: one for each
93 partition up to four, and four subprocesses for four or more
94 partitions. To increase or decrease the number of subprocesses running in
95 parallel, provide a positive integer value for the <emphasis role="bold">-parallel</emphasis> argument.</para>
97 <para>If there is more than one server partition on a physical disk, the
98 Salvager by default salvages them serially to avoid the inefficiency of
99 constantly moving the disk head from one partition to another. However,
100 this strategy is often not ideal if the partitions are configured as
101 logical volumes that span multiple disks. To force the Salvager to salvage
102 logical volumes in parallel, provide the string <computeroutput>all</computeroutput> as the value for
103 the <emphasis role="bold">-parallel</emphasis> argument. Provide a positive integer to specify the
104 number of subprocesses to run in parallel (for example, <computeroutput>-parallel 5all</computeroutput>
105 for five subprocesses), or omit the integer to run up to four
106 subprocesses, depending on the number of logical volumes being salvaged.</para>
108 <para>The Salvager creates temporary files as it runs, by default writing them
109 to the partition it is salvaging. The number of files can be quite large,
110 and if the partition is too full to accommodate them, the Salvager
111 terminates without completing the salvage operation (it always removes the
112 temporary files before exiting). Other Salvager subprocesses running at
113 the same time continue until they finish salvaging all other partitions
114 where there is enough disk space for temporary files. To complete the
115 interrupted salvage, reissue the command against the appropriate
116 partitions, adding the <emphasis role="bold">-tmpdir</emphasis> argument to redirect the temporary files
117 to a local disk directory that has enough space.</para>
119 <para>The <emphasis role="bold">-orphans</emphasis> argument controls how the Salvager handles orphaned files
120 and directories that it finds on server partitions it is salvaging. An
121 <emphasis>orphaned</emphasis> element is completely inaccessible because it is not
122 referenced by the vnode of any directory that can act as its parent (is
123 higher in the filespace). Orphaned objects occupy space on the server
124 partition, but do not count against the volume's quota.</para>
126 <para>To generate a list of all mount points that reside in one or more volumes,
127 rather than actually salvaging them, include the <emphasis role="bold">-showmounts</emphasis> flag.</para>
129 <para>This command does not use the syntax conventions of the AFS command
130 suites. Provide the command name and all option names in full.</para>
134 <title>Options</title>
137 <term>[<emphasis>initcmd</emphasis>]</term>
139 <para>Accommodates the command's use of the AFS command parser, and is optional.</para>
144 <term><emphasis role="bold">-partition</emphasis> <<emphasis>name of partition to salvage</emphasis>></term>
146 <para>Specifies the name of the partition to salvage. Specify the full partition
147 name using the form <replaceable>/vicep</replaceable><emphasis>x</emphasis><replaceable></replaceable> or <replaceable>/vicep</replaceable><emphasis>xx</emphasis><replaceable></replaceable>. Omit this argument to
148 salvage every partition on the file server machine.</para>
153 <term><emphasis role="bold">-volumeid</emphasis> <<emphasis>volume id to salvage</emphasis>></term>
155 <para>Specifies the volume ID of a specific read/write volume to salvage. The
156 <emphasis role="bold">-partition</emphasis> argument must be provided along with this one and specify
157 the volume's actual site.</para>
162 <term><emphasis role="bold">-debug</emphasis></term>
164 <para>Allows only one Salvager subprocess to run at a time, regardless of the
165 setting of the <emphasis role="bold">-parallel</emphasis> option. Include it when running the Salvager
166 in a debugger to make the trace easier to interpret.</para>
171 <term><emphasis role="bold">-nowrite</emphasis></term>
173 <para>Brings all undamaged volumes online without attempting to salvage any
174 damaged volumes.</para>
179 <term><emphasis role="bold">-inodes</emphasis></term>
181 <para>Records in the <replaceable>/usr/afs/logs/SalvageLog</replaceable> file a list of all AFS inodes
182 that the Salvager modified.</para>
187 <term><emphasis role="bold">-force</emphasis></term>
189 <para>Inspects all volumes for corruption, not just those that are marked as
190 having been active when a crash occurred.</para>
195 <term><emphasis role="bold">-oktozap</emphasis></term>
197 <para>Removes a volume that is so damaged that even issuing the <emphasis role="bold">vos zap</emphasis>
198 command with the <emphasis role="bold">-force</emphasis> flag is ineffective. Use this argument only in
199 consultation with AFS Development or Product Support. Combine it with the
200 <emphasis role="bold">-partition</emphasis> and <emphasis role="bold">-volumeid</emphasis> arguments to identify the volume to remove.</para>
205 <term><emphasis role="bold">-rootinodes</emphasis></term>
207 <para>Records in the <replaceable>/usr/afs/logs/SalvageLog</replaceable> file a list of all AFS inodes
208 owned by the local superuser <computeroutput>root</computeroutput>.</para>
213 <term><emphasis role="bold">-salvagedirs</emphasis></term>
215 <para>Salvages entire directory structures, even if they do not appear to be
216 damaged. By default, the Salvager salvages a directory only if it is
217 flagged as corrupted.</para>
222 <term><emphasis role="bold">-blockreads</emphasis></term>
224 <para>Forces the Salvager to read a partition one disk block (512 bytes) at a
225 time and to skip any blocks that are too badly damaged to be salvaged.
226 This allows it to salvage as many volumes as possible. By default, the
227 Salvager reads large disk blocks, which can cause it to exit prematurely
228 if it encounters disk errors. Use this flag if the partition to be
229 salvaged has disk errors.</para>
234 <term><emphasis role="bold">-parallel</emphasis> <<emphasis># of max parallel partition salvaging</emphasis>></term>
236 <para>Specifies the maximum number of Salvager subprocesses to run in parallel.
237 Provide one of three values:</para>
241 <para>An integer from the range <computeroutput>1</computeroutput> to <computeroutput>32</computeroutput>. A value of <computeroutput>1</computeroutput> means that a
242 single Salvager process salvages the partitions sequentially.</para>
246 <para>The string <computeroutput>all</computeroutput> to run up to four Salvager subprocesses in parallel on
247 partitions formatted as logical volumes that span multiple physical
248 disks. Use this value only with such logical volumes.</para>
252 <para>The string <computeroutput>all</computeroutput> followed immediately (with no intervening space) by an
253 integer from the range <computeroutput>1</computeroutput> to <computeroutput>32</computeroutput>, to run the specified number of
254 Salvager subprocesses in parallel on partitions formatted as logical
255 volumes. Use this value only with such logical volumes.</para>
259 <para>The BOS Server never starts more Salvager subprocesses than there are
260 partitions, and always starts only one process to salvage a single
261 volume. If this argument is omitted, up to four Salvager subprocesses run
267 <term><emphasis role="bold">-tmpdir</emphasis> <<emphasis>name of dir to place tmp files</emphasis>></term>
269 <para>Names a local disk directory in which the Salvager places the temporary
270 files it creates during a salvage operation, instead of writing them to
271 the partition being salvaged (the default). If the Salvager cannot write
272 to the specified directory, it attempts to write to the partition being
278 <term><emphasis role="bold">-showlog</emphasis></term>
280 <para>Displays on the standard output stream all log data that is being written
281 to the <replaceable>/usr/afs/logs/SalvageLog</replaceable> file.</para>
286 <term><emphasis role="bold">-showsuid</emphasis></term>
288 <para>Displays a list of the pathnames for all files that have the setuid or
289 setgid mode bit set.</para>
294 <term><emphasis role="bold">-showmounts</emphasis></term>
296 <para>Records in the <replaceable>/usr/afs/logs/SalvageLog</replaceable> file all mount points found in
297 each volume. The Salvager does not repair corruption in the volumes, if
303 <term><emphasis role="bold">-orphans</emphasis> (ignore | remove | attach)</term>
305 <para>Controls how the Salvager handles orphaned files and directories. Choose
306 one of the following three values:</para>
312 <para>Leaves the orphaned objects on the disk, but prints a message to the
313 <replaceable>/usr/afs/logs/SalvageLog</replaceable> file reporting how many orphans were found and
314 the approximate number of kilobytes they are consuming. This is the
315 default if the <emphasis role="bold">-orphans</emphasis> argument is omitted.</para>
322 <para>Removes the orphaned objects, and prints a message to the
323 <replaceable>/usr/afs/logs/SalvageLog</replaceable> file reporting how many orphans were removed
324 and the approximate number of kilobytes they were consuming.</para>
331 <para>Attaches the orphaned objects by creating a reference to them in the vnode
332 of the volume's root directory. Since each object's actual name is now
333 lost, the Salvager assigns each one a name of the following form:</para>
337 <term><computeroutput>__ORPHANFILE__.</computeroutput><emphasis>index</emphasis><computeroutput></computeroutput> for files.</term>
344 <term><computeroutput>__ORPHANDIR__.</computeroutput><emphasis>index</emphasis><computeroutput></computeroutput> for directories.</term>
351 <para>where <emphasis>index</emphasis> is a two-digit number that uniquely identifies each
352 object. The orphans are charged against the volume's quota and appear in
353 the output of the <emphasis role="bold">ls</emphasis> command issued against the volume's root
362 <term><emphasis role="bold">-help</emphasis></term>
364 <para>Prints the online help for this command. All other valid options are
372 <title>Examples</title>
373 <para>The following command instructs the Salvager to attempt to salvage the
374 volume with volume ID 258347486 on <replaceable>/vicepg</replaceable> on the local machine.</para>
377 % /usr/afs/bin/salvager -partition /vicepg -volumeid 258347486
382 <title>Privilege Required</title>
383 <para>To issue the command at the shell prompt, the issuer must be logged in as
384 the local superuser <computeroutput>root</computeroutput>.</para>
388 <title>See Also</title>
389 <para><link linkend="BosConfig5">BosConfig(5)</link>,
390 <link linkend="SalvageLog5">SalvageLog(5)</link>,
391 <link linkend="bos_create8">bos_create(8)</link>,
392 <link linkend="bos_getlog8">bos_getlog(8)</link>,
393 <link linkend="bos_salvage8">bos_salvage(8)</link>,
394 <link linkend="vos_move1">vos_move(1)</link></para>
398 <title>Copyright</title>
399 <para>IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.</para>
401 <para>This documentation is covered by the IBM Public License Version 1.0. It was
402 converted from HTML to POD by software written by Chas Williams and Russ
403 Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.</para>