NSRCK(8)NSRCK(8)NAMEnsrck - NetWorker index consistency check, repair, and recovery program
SYNOPSISnsrck [ -qMv ] | [ -R [ -Y ] ] [ -L check-level [ -t date ] | -X [ -x
percent ] | -C | -F | -m | -n | -c ] [ -T tempdir ] [ clientname ... ]
DESCRIPTIONnsrck is used to check the consistency of the NetWorker online index of
clients' save records. Normally, nsrck is started automatically and
synchronously by the nsrindexd(8) program when nsrindexd starts. You
can modify the nsrck modes to allow normal users to run nsrck and
retain root privileges (see nsr(8) for more details).
When nsrindexd starts up, it determines whether any further checking of
a client's index is necessary. This phase checks certain internal
state of the index database, and if that state is consistent, avoids
further passes. This phase also reports any suspicious-looking index
names (that is indexes whose names cannot be mapped into network
addresses). These online file indexes are then checked more rigor‐
ously.
nsrck detects whether any client indexes need to be converted and does
the proper conversion. Converting the indices takes free space on the
volume that contains the indices; if there is not sufficient free
space, you may use the -T tempdir flag to specify a different direc‐
tory which the conversion will use as its work space. You may also
manually convert client indices by issuing the nsrck command manually.
There are seven different checking levels supported by nsrck. If
client names are supplied, the check is performed on the given client
names. If no names are given, the checks are performed for all client
indexes. The check levels work as follows for each client checked:
Level 1 validates the online file index header, merging a journal of
changes with the existing header. In addition, all save set record
files and the corresponding key files are moved to the appropriate sub‐
directories under db6.
Level 2 does a level 1 check and checks the online file index for new
and cancelled saves. New saves are added to the online file index, and
cancelled saves are removed.
Level 3 does a level 2 check and reconciles the online file index with
the online media index. Records that have no corresponding media save
sets are discarded. Also all empty subdirectories under db6 directory
are deleted.
Level 4 does a level 3 check and checks the validity of the online file
index's internal key files. If any of these key files are invalid,
they are rebuilt.
Level 5 does a level 4 check and verifies the digest of individual save
times against their key files.
Level 6 does a level 5 check and extracts each record from each save
time, verifying that each record can be extracted from the database.
The digest of each save time is re-computed and compared against the
stored digest, and the internal key files are rebuilt.
Level 7 does not do a level 6 check, but merges to the online file
index, the index data recovered from backup media, rebuilds the inter‐
nal key files, and rebuilds the index header. Note that it will not
overwrite existing files in the client file index. So, if online
client file index data already exists for a save set for a particular
save time, it must be removed before Level 7 can be used to restore it
from the backup media. The -t date option may be used to recover the
index as of a specific time. Note that recovering the index to a spe‐
cific time adds the entire contents of the index as of that time to the
current index contents. This option allows browsing of save sets that
have passed their browse policy and are still recoverable. The save
sets referred to by the recovered index will be marked as browsable.
They will remain browsable for the length of time they were originally
browsable.
For example, if a .rec file in the file index is corrupted, if a nsrck-L5 is not performed to purge the corrupted save set first before doing
a nsrck-L7, then the recover will not overwrite the corrupted .rec
file and the file index will remain corrupted.
Checks of a higher level generally take longer than checks at a lower
level. Checks at a higher level provide a more thorough checking of
the online file index. Level 7 is used when the online file index on
disk needs to merge in file index data recovered from backup media.
The nsrck program is restartable at any time during its execution.
Therefore, it can survive system crashes or exhaustion of resources
without losing data.
Each time the NetWorker server starts, it runs nsrck-L 1 to perform a
fast and efficient check for each of the configured client file
indexes. Only the consistency of the index header and journal files are
checked. It is generally not necessary (and very time consuming) to
check every record and key file in the client file index at startup.
The program nsrim will automatically invoke nsrck-L 3 after updating
the save set's browse and retention times in the media database to
remove client file indexes that have exceeded the retention policy. If
a problem is detected, a more thorough check will be automatically per‐
formed on client file index in question.
If you believe an index may be corrupt, you can manually run a higher
level check on the index, for example:
nsrck-L 6
OPTIONS-C This option validates the client's online file index header. It
is identical to specifying the -L 1 option.
-c This option is the same as using -L 2.
-F This option is the same as using -L 2.
-t date
Recover the index as of the specified date (in nsr_getdate(3)
format). This option is only valid with the -L 7 option.
-T tempdir
Specifies a different directory to use for conversion. This is
useful if your client indexes are on file systems that are
nearly full. It will enable the conversion to use the tempdir
specified as a work space for converting indexes. It is not
recommended to use /tmp, since its contents are lost if your
machine is rebooted.
-L level
Specifies the level of checking to use. The valid levels are
1-7.
-M Master mode (not advised for manual operation). This advises
nsrck that it is being run by nsrd(8) or another NetWorker dae‐
mon and should log messages with timestamps, and perform any
other behavior expected by nsrd.
-m Invokes consistency checks to detect and remove inconsistent
records from the media database. If inconsistent records are
detected, the occurences will be recorded in the daemon.log. If
inconsistent save set records are detected and removed, then
nsrck-X should be run to remove the associated index records
from the client's online file index.
This option must only be run when the NetWorker server is idle,
as the media database will be unresponsive while performing the
consistency checks. This option performs the same operations
that are invoked at startup after an improper media database
shutdown is detected, namely:
1) A checksum verification is performed on every record in the
media database to verify record corruption has not occurred.
2) All records from previous media database versions will be
upgraded to the current media database record format.
3) The client id map records are checked for unique identifiers
and names.
4) Each client resource is then checked to verify a client id
map record exists in the media database for the client resource.
5) Each save set record is checked for a valid client entry.
6) The save set records are then checked for valid and unique
record identifier fields.
7) The volume records are then checked for unique record identi‐
fier and name fields.
8) Save sets records are checked to ensure each (continuation)
save set reference exists in the media database.
9) Save sets records are checked to ensure that each volume ref‐
erence exists in the media database.
10) The volume records are then checked to ensure all the save
set references exist in the media database.
-n This option should only be used with the -m option. It is used
to only report consistency errors in the media database, without
repairing or removing the inconsistent entries.
-q Quiet mode. All advisory messages are suppressed.
-v Verbose mode. Advisory messages are emitted.
-R Removes the index for the client. This is valid only when the
-Y option is also specified. If the nsrck is not in master
mode, the user will be prompted with a warning indicating which
online file indexes will be completely removed and given an
opportunity to kill the command if this was not what the user
intended.
-X This is the same as using -L 3
-x percent
This is the same as using -L 1. The "percent" value is ignored,
but permitted. This allows customer scripts using this option
to continue working.
-Y Used in conjunction with -R to remove online file indexes. Using
this flag means that you really do wish to remove the online
file index(es). If you fail to use this flag with the -R
option, you will be warned that you need to add the -Y flag to
the nsrck command.
FILES
/nsr/index/ clientname /db6/nsrck.lck
nsrck locks this file thereby insuring that only one copy of
nsrck is checking a client's index.
/nsr/index/clientname
/nsr/index/clientname/db6
SEE ALSOnsr_layout(5), nsr_policy(5), hosts(5), nsr(8), nsrd(8), nsrindexd(8),
nsrmmdbd(8), nsrim(8), savegrp(8)DIAGNOSTICS
checking index for clientname
Informative message that the files associated with the named
client are being inspected.
WARNING no valid savetimes - cross-check not performed
for clientname
During a cross-check, no save sets were found for this client.
Since this situation can occur during disaster recovery, nsrck
avoids deleting the entire contents client index.
cross-checking index for clientname
Displayed when the -L 3 option is in effect.
completed checking count clients
Displayed as the program finishes, provided some form of check‐
ing was accomplished.
NetWorker 7.3.2 Aug 23, 06 NSRCK(8)