b48a4919941f2003cf34fb0c02ed273914acbef9
[openafs.git] / doc / man-pages / pod8 / salvageserver.pod
1 =head1 NAME
2
3 salvageserver - Initializes the Salvageserver component of the dafs process
4
5 =head1 SYNOPSIS
6
7 =for html
8 <div class="synopsis">
9
10 B<salvageserver> [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)] >>>
18     [B<-client>] [B<-help>]
19
20 =for html
21 </div>
22
23 =head1 DESCRIPTION
24
25 In its typical mode of operation, the B<salvageserver> is a daemon process 
26 responsible for salvaging volumes.  It is a component of the C<dafs> 
27 process type.  In the conventional configuration, its binary file is 
28 located in the F</usr/afs/bin> directory on a file server machine.
29
30 The Salvageserver daemon is responsible for scheduling and executing 
31 volume salvage operations on behalf of client processes.  The fileserver 
32 acts as the primary salvageserver client: any failed volume attach 
33 operation results in a salvageserver scheduling request.  The 
34 salvageserver also accepts periodic volume activity messages in order to 
35 update its salvage request priority queue.  Other clients of the 
36 salvageserver daemon include the B<salvsync-debug> utility, and the
37 salvageserver command itself by passing the B<-client> flag.
38
39 The salvage operations performed on vice partition data are nearly 
40 identical to those performed by the standalone Salvager command.  The 
41 key differences between the two commands are:
42
43 =over 4
44
45 =item *
46
47 The Salvageserver is a daemon process which runs concurrently with the 
48 fileserver.  In contrast, the Salvager is a stand-alone application which 
49 is invoked when the fileserver and volserver are not running.
50
51 =item *
52
53 The Salvageserver is incapable of performing whole partition salvage 
54 operations; it operates at volume group granularity.
55
56 =back
57
58 The Salvageserver normally creates new inodes as it repairs damage. If the
59 partition is so full that there is no room for new inodes, use the
60 B<-nowrite> argument to bringing undamaged volumes online without
61 attempting to salvage damaged volumes. Then use the B<vos move> command to
62 move one or more of the undamaged volumes to other partitions, freeing up
63 the space that the Salvageserver needs to create new inodes.
64
65 By default, multiple Salvageserver subprocesses run in parallel: one for each 
66 volume group.  By default, four concurrent salvage operations are 
67 permitted.  You may alter this default by providing a positive integer 
68 value for the B<-parallel> argument.  The maximum permitted value is 32 
69 concurrent salvageserver subprocesses.
70
71 By default, the salvageserver enables a heuristic which attempts to stop
72 disk head thrashing by concurrent salvageserver subprocesses.  Unfortunately,
73 this heuristic significantly degrades performance in many cases.  In at least 
74 the following environments, passing the C<all> string to the B<-parallel> 
75 argument is strongly encouraged:
76
77 =over 4
78
79 =item *
80
81 On NAMEI fileservers
82
83 =item *
84
85 When a vice partition is backed by multiple disks (e.g. RAID)
86
87 =item *
88
89 When a vice partition is backed by SAN-attached storage, LVM, or some other
90 form of storage virtualization which would cause unix device id numbers to
91 be unpredictable.
92
93 =back
94
95 The Salvageserver creates temporary files as it runs, by default writing them
96 to the partition it is salvaging. The number of files can be quite large,
97 and if the partition is too full to accommodate them, the Salvageserver
98 terminates without completing the salvage operation (it always removes the
99 temporary files before exiting). Other Salvageserver subprocesses running at
100 the same time continue until they finish salvaging all other partitions
101 where there is enough disk space for temporary files. To complete the
102 interrupted salvage, reissue the command against the appropriate
103 partitions, adding the B<-tmpdir> argument to redirect the temporary files
104 to a local disk directory that has enough space.
105
106 The B<-orphans> argument controls how the Salvageserver handles orphaned files
107 and directories that it finds on server partitions it is salvaging. An
108 I<orphaned> element is completely inaccessible because it is not
109 referenced by the vnode of any directory that can act as its parent (is
110 higher in the filespace). Orphaned objects occupy space on the server
111 partition, but do not count against the volume's quota.
112
113 To generate a list of all mount points that reside in one or more volumes,
114 rather than actually salvaging them, include the B<-showmounts> flag.
115
116 This command does not use the syntax conventions of the AFS command
117 suites. Provide the command name and all option names in full.
118
119 =head1 OPTIONS
120
121 =over 4
122
123 =item [I<initcmd>]
124
125 Accommodates the command's use of the AFS command parser, and is optional.
126
127 =item B<-partition> <I<name of partition to salvage>>
128
129 Specifies the name of the partition to salvage. Specify the full partition
130 name using the form F</vicepI<x>> or F</vicepI<xx>>. Omit this argument to
131 salvage every partition on the file server machine.
132
133 =item B<-volumeid> <I<volume id to salvage>>
134
135 Specifies the volume ID of a specific read/write volume to salvage.  The
136 B<-partition> argument must be provided along with this one and specify
137 the volume's actual site.
138
139 =item B<-debug>
140
141 This flag should be considered deprecated.  Its primary purpose was to disable
142 forking and parallelization of the Salvager so that log messages were not
143 interleaved.  Due to the manner in which F</usr/afs/logs/SalSrvLog> is 
144 written, log messages from subprocesses are never interleaved; the entire log
145 for a volume group salvage is appended to the master log as one atomic 
146 transaction.
147
148 =item B<-nowrite>
149
150 Brings all undamaged volumes online without attempting to salvage any
151 damaged volumes.
152
153 =item B<-inodes>
154
155 Records in the F</usr/afs/logs/SalSrvLog> file a list of all AFS inodes
156 that the Salvageserver modified.
157
158 =item B<-force>
159
160 Inspects all volumes for corruption, not just those that are marked as
161 having been active when a crash occurred.
162
163 =item B<-oktozap>
164
165 Removes a volume that is so damaged that even issuing the B<vos zap>
166 command with the B<-force> flag is ineffective. Combine it with the
167 B<-partition> and B<-volumeid> arguments to identify the volume to remove.
168 Using this flag will destroy data that cannot be read, so use only with
169 caution and when you're certain that nothing in that volume is still
170 needed.
171
172 =item B<-rootinodes>
173
174 Records in the F</usr/afs/logs/SalSrvLog> file a list of all AFS inodes
175 owned by the local superuser C<root>.
176
177 =item B<-salvagedirs>
178
179 Salvages entire directory structures, even if they do not appear to be
180 damaged. By default, the Salvageserver salvages a directory only if it is
181 flagged as corrupted.
182
183 =item B<-blockreads>
184
185 Forces the Salvageserver to read a partition one disk block (512 bytes) at a
186 time and to skip any blocks that are too badly damaged to be salvaged.
187 This allows it to salvage as many volumes as possible. By default, the
188 Salvageserver reads large disk blocks, which can cause it to exit prematurely
189 if it encounters disk errors. Use this flag if the partition to be
190 salvaged has disk errors.
191
192 =item B<-parallel> <I<# of max parallel partition salvaging>>
193
194 Specifies the maximum number of Salvageserver subprocesses to run in parallel.
195 Provide one of three values:
196
197 =over 4
198
199 =item *
200
201 An integer from the range C<1> to C<32>. A value of C<1> means that a
202 single Salvageserver subprocess salvages the volume groups sequentially.
203 The disk partition heuristic (see above) based upon unix device ids is 
204 enabled.
205
206 =item *
207
208 The disk partition heuristic (see above) based upon unix device ids is 
209 disabled.
210
211 =item *
212
213 The string C<all> followed immediately (with no intervening space) by an
214 integer from the range C<1> to C<32>, to run the specified number of
215 Salvageserver subprocesses in parallel on volume groups.  The disk partition 
216 heuristic (see above) based upon unix device ids is disabled.
217
218 =back
219
220 If this argument is omitted, up to four Salvageserver subprocesses run
221 in parallel.
222
223 =item B<-tmpdir> <I<name of dir to place tmp files>>
224
225 Names a local disk directory in which the Salvageserver places the temporary
226 files it creates during a salvage operation, instead of writing them to
227 the partition being salvaged (the default). If the Salvageserver cannot write
228 to the specified directory, it attempts to write to the partition being
229 salvaged.
230
231 =item B<-showlog>
232
233 Displays on the standard output stream all log data that is being written
234 to the F</usr/afs/logs/SalSrvLog> file.
235
236 =item B<-showsuid>
237
238 Displays a list of the pathnames for all files that have the setuid or
239 setgid mode bit set.
240
241 =item B<-showmounts>
242
243 Records in the F</usr/afs/logs/SalSrvLog> file all mount points found in
244 each volume. The Salvageserver does not repair corruption in the volumes, if
245 any exists.
246
247 =item B<-orphans> (ignore | remove | attach)
248
249 Controls how the Salvageserver handles orphaned files and directories.  Choose
250 one of the following three values:
251
252 =over 4
253
254 =item ignore
255
256 Leaves the orphaned objects on the disk, but prints a message to the
257 F</usr/afs/logs/SalSrvLog> file reporting how many orphans were found and
258 the approximate number of kilobytes they are consuming. This is the
259 default if the B<-orphans> argument is omitted.
260
261 =item remove
262
263 Removes the orphaned objects, and prints a message to the
264 F</usr/afs/logs/SalSrvLog> file reporting how many orphans were removed
265 and the approximate number of kilobytes they were consuming.
266
267 =item attach
268
269 Attaches the orphaned objects by creating a reference to them in the vnode
270 of the volume's root directory. Since each object's actual name is now
271 lost, the Salvageserver assigns each one a name of the following form:
272
273 =over 4
274
275 =item C<__ORPHANFILE__.I<index>> for files.
276
277 =item C<__ORPHANDIR__.I<index>> for directories.
278
279 =back
280
281 where I<index> is a two-digit number that uniquely identifies each
282 object. The orphans are charged against the volume's quota and appear in
283 the output of the B<ls> command issued against the volume's root
284 directory.
285
286 =back
287
288 =item B<-client>
289
290 Salvageserver runs in client Mode.  The requested volume on the requested
291 partition will be scheduled for salvaging by the Salvageserver daemon.
292
293 =item B<-help>
294
295 Prints the online help for this command. All other valid options are
296 ignored.
297
298 =back
299
300 =head1 EXAMPLES
301
302 The following command instructs the Salvageserver to schedule the salvage 
303 of the volume with volume ID 258347486 on F</vicepg> on the local machine.
304
305    % /usr/afs/bin/salvageserver -partition /vicepg -volumeid 258347486 -client
306
307 =head1 PRIVILEGE REQUIRED
308
309 To issue the command at the shell prompt, the issuer must be logged in as
310 the local superuser C<root>.
311
312 =head1 SEE ALSO
313
314 L<BosConfig(5)>,
315 L<SalvageLog(5)>,
316 L<Salvager(8)>,
317 L<bos_create(8)>,
318 L<bos_getlog(8)>,
319 L<bos_salvage(8)>,
320 L<vos_move(1)>
321
322 =head1 COPYRIGHT
323
324 IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.
325 Sine Nomine Associates 2008.  All Rights Reserved.
326
327 This documentation is covered by the IBM Public License Version 1.0.  It was
328 converted from HTML to POD by software written by Chas Williams and Russ
329 Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.  This document
330 was adapted from the Salvager POD documentation.