Command Reference Manual
Purpose
Restores internal consistency to a file system or volume
Synopsis
bos salvage -server <machine name> [-partition <salvage partition>]
[-volume <salvage volume number or volume name>]
[-file <salvage log output file>] [-all] [-showlog]
[-parallel <# of max parallel partition salvaging>]
[-tmpdir <directory to place tmp files>]
[-orphans <ignore | remove | attach>]
[-cell <cell name>]
[-noauth] [-localauth] [-help]
bos sa -se <machine name> [-part <salvage partition>]
[-v <salvage volume number or volume name>]
[-f <salvage log output file>] [-a] [-sh]
[-para <# of max parallel partition salvaging>]
[-t <directory to place tmp files>]
[-o <ignore | remove | attach>]
[-c <cell name>] [-n] [-l] [-h]
Description
The bos salvage command salvages (restores internal consistency
to) one or more volumes on the file server specified with the
-server argument. Use the indicated arguments to salvage a
specific number of volumes:
- To salvage all volumes on a server machine, provide the -server
argument and the -all flag. No volumes on the machine are
accessible to Cache Managers during the salvage, because the BOS Server stops
the File Server and Volume Server components of the fs process
while the Salvager runs. The BOS Server automatically restarts the File
Server and Volume Server when the salvage completes.
- To salvage all volumes on one partition, provide the -server
and -partition arguments. No volumes on the machine are
accessible to Cache Managers during the salvage, because the BOS Server stops
the File Server and Volume Server components of the fs process
while the Salvager runs. The BOS Server automatically restarts the File
Server and Volume Server when the salvage completes.
- To salvage only one volume, combine the -server,
-partition, and -volume arguments. Only that
volume is inaccessible to Cache Managers, because the BOS Server does not
shutdown the File Server and Volume Server components of the fs
process during the salvage of a single volume.
During the salvage of an entire machine or partition, the bos
status command reports the fs process's auxiliary status
as Salvaging file system.
By default, the bos salvage command starts multiple Salvager
subprocesses to salvage multiple partitions in parallel: one for each
partition up to four, and four subprocesses for four or more
partitions. To increase or decrease the number of subprocesses running
in parallel, use the -parallel argument. The BOS Server
never starts more Salvager subprocesses than there are partitions, and always
starts only one subprocess to salvage a single volume.
The Salvager always writes a trace to the
/usr/afs/logs/SalvageLog file on the server machine where it
runs. To record the trace in another file as well, name it with the
-file argument. To display the trace on the standard output
stream as it is written to the /usr/afs/logs/SalvageLog file,
include the -showlog flag.
As the Salvager process salvages a partition, it writes temporary files, by
default to the partition it is currently salvaging. The number of
temporary files can be quite large, and if there is not enough disk space to
accommodate them, the Salvager terminates without completing the salvage
operation (as always, it removes the temporary files before exiting).
Other Salvager subprocesses running at the same time continue until they
finish salvaging all other partitions where there is enough disk space for
temporary files. To complete the interrupted salvage, reissue the
command against the appropriate partitions, adding the -tmpdir
argument to redirect the temporary files to a local disk directory that has
enough space.
The -orphans argument controls how the Salvager handles
orphaned files and directories that it finds on server partitions
it is salvaging. An orphaned element is completely inaccessible because
it is not referenced by the vnode of any directory that can act as its parent
(is higher in the file tree). Orphaned objects occupy space on the
server partition, but do not count against the volume's quota.
Cautions
Running this command can result in data loss if the Salvager process can
repair corruption only by removing the offending data. Consult the
AFS System Administrator's Guide for more information.
Options
- -server
- Indicates the file server machine on which to salvage volumes.
-
- Identify the machine by IP address or its host name (either
fully-qualified or abbreviated unambiguously). For details, see the
introductory reference page for the bos command suite.
- -partition
- Specifies a single partition on which to salvage all volumes.
Provide the complete partition name (for example /vicepa) or one of
the following abbreviated forms:
/vicepa = vicepa = a = 0
/vicepb = vicepb = b = 1
and so on through
/vicepiv = vicepiv = iv = 255
- -volume
- Specifies the name or volume ID number of a volume to salvage, which can
be of any type: ReadWrite, ReadOnly, or Backup. The
-partition argument must be provided along with this one.
- -file
- Specifies the complete pathname of a file into which to write a trace of
the salvage operation, in addition to the /usr/afs/logs/SalvageLog
file on the server machine. If the file pathname is local, the trace is
written to the specified file on the local disk of the machine where the
bos salvage command is issued. If the -volume
argument is included, the file can be in AFS, though not in the volume being
salvaged. Do not combine this argument and the -showlog
flag.
- -all
- Salvages all volumes on all of the partitions on the machine.
- -showlog
- Displays the trace of the salvage operation on the standard output stream,
as well as writing it to the /usr/afs/logs/SalvageLog file.
Do not combine this flag with the -file argument.
- -parallel
- Specifies the maximum number of Salvager processes to run in
parallel. Specify an integer from the range 1 to
32. A value of 1 means that a single Salvager
process salvages the partitions sequentially. The BOS Server never
starts more Salvager processes than there are partitions, and always starts
only one process to salvage a single volume. If this argument is
omitted, up to four Salvager processes run in parallel.
- -tmpdir
- Specifies the full pathname of a local disk directory to which the
Salvager process writes temporary files as it runs. If this argument is
omitted, or specifies an ineligible or nonexistent directory, the Salvager
process writes the files to the partition it is currently salvaging.
- -orphans
- Controls how the Salvager handles orphaned files and directories.
Choose one of the following three values:
- ignore
- Leaves the orphaned objects on the disk, but prints a message to the
/usr/afs/logs/SalvageLog file reporting how many orphans were found
and the approximate number of kilobytes they are consuming. This is the
default if the -orphans argument is omitted.
- remove
- Removes the orphaned objects, and prints a message to the
/usr/afs/logs/SalvageLog file reporting how many orphans were
removed and the approximate number of kilobytes they were consuming.
- attach
- Attaches the orphaned objects by creating a reference to them in the vnode
of the volume's root directory. Since each object's actual
name is now lost, the Salvager assigns each one a name of the following
form:
_ _ORPHANFILE_ _.index for files
_ _ORPHANDIR_ _.index for directories
where index is a two-digit number that uniquely identifies each
object. The orphans are charged against the volume's quota and
appear in the output of the ls command issued against the
volume's root directory.
- -cell
- Names the cell in which to run the command. Do not combine this
argument with the -localauth flag. For more details, see the
introductory bos reference page.
- -noauth
- Assigns the unprivileged identity anonymous to the
issuer. Do not combine this flag with the -localauth
flag. For more details, see the introductory bos reference
page.
- -localauth
- Constructs a server ticket using a key from the local
/usr/afs/etc/KeyFile file. The bos command
interpreter presents the ticket to the BOS Server during mutual
authentication. Do not combine this flag with the -cell or
-noauth options. For more details, see the introductory
bos reference page.
- -help
- Prints the online help for this command. All other valid options
are ignored.
Examples
The following command salvages all volumes on the /vicepd
partition of the machine db3.abc.com:
% bos salvage -server db3.abc.com -partition /vicepd
The following command salvages the volume with volume ID number 536870988
on partition /vicepb of the machine
fs2.abc.com:
% bos salvage -server fs2.abc.com -partition /vicepb -volume 536870988
The following command salvages all volumes on the machine
fs4.abc.com. Six Salvager processes run in
parallel rather than the default four.
% bos salvage -server fs4.abc.com -all -parallel 6
Privilege Required
The issuer must be listed in the /usr/afs/etc/UserList file on
the machine named by the -server argument, or must be logged onto a
server machine as the local superuser root if the
-localauth flag is included.
Related Information
bos
salvager
KeyFile
UserList
SalvageLog
AFS System Administrator's Guide
© IBM Corporation 1999. All Rights Reserved