NetWorker: Using the scanner utility

Summary: This article describes various use cases for the scanner tool and general usage best practices and caveats.

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Instructions

scanner is a command-line tool in the NetWorker software suite which is installed with the Storage Node component of the software. Its function is to read the contents of a volume using a configured device name or even an unconfigured path to a device containing a NetWorker volume. It has these main uses:
  • Creating a list of all savesets found on the volume file system
  • Importing a foreign or deleted volume back into the media database
  • Reading a saveset to rebuild index entries from the data itself, where the browse period has passed
  • Correcting entries for one or more savesets on a volume if media database records are incorrect
  • Directly reading saveset data to a local file for separate uasm recovery, especially for damaged or incomplete savesets

Verifying volume label and contents

Scanner's default usage when not including any other arguments can be used to report the label, volume ID, block size for tape media, and what saveset entities exist on a volume. While no -i / -m is present, no database records are modified. This can be useful to verify presence of a disk or tape saveset by checking the media itself; It can also determine if there is a viable, readable label - for example, scanner may reveal tape encryption prevents a label read (See LTO Hardware Encryption and NetWorker for more details), presenting the error:

8945:scanner: read: -1 bytes

It may also reveal SCSI resets for tape-class devices (Troubleshooting Overwritten Labels and SCSI Resets in NetWorker), where mount fails:

Unexpected file number, wanted 2, got <other number>

Example: 

scanner device_name_or_local_path

Importing volumes and records

In the event a volume has been deleted from the media database, or a volume is to be imported from a different NetWorker server to a new one, until a record exists in the media database, the volume will not be mountable. If no filter is applied, -m causes all detected savesets to be rebuilt along with the volume record in the media database. See below for selective scanning options.
Example: 
scanner -m device_name_or_local_path

Re-indexing savesets for browse

When a saveset has passed its configured browse date as recorded in its media database entry, the corresponding index files are deleted from the online server Index, and the saveset flag changes from 'browsable' to 'recoverable'. Recover of the saveset requires media database records, which the -m switch rebuilds. However, in order to rebuild index entries and restore browsability, use -i instead. While index entries are not necessary for file system recoveries, they are required for complex savesets like databases. NDMP savesets cannot be re-indexed in this way; nsrck -L7 index recovery is the only option. -F is strongly recommended to reset browse flag for the saveset and preserve rebuilt index entries. In earlier versions of NetWorker, where -F is not available, you may need to delete all instances of the saveset in order to allow scanner -i to repopulate the ssbrowse value, and replace browsable status.
Example:
scanner -i -F device_name_or_local_path

Forcing saveset metadata correction

If a saveset already exists in the database when scanner finds it, the default behavior is to forgo update, for performance reasons. Where entries in the media database are considered to be missing or incomplete/corrupted, or -i is being used to re-index a saveset past its browse period, use -F to force overwrite of the record information; otherwise, deletion of the saveset isrequired first. Note that unless a new retention time is specified (see below) using -y, the new instance retention is calculated automatically. Note as well this flag is required when scanning tape media. 
Example: 

scanner -m -F device_name_or_local_path

Scanning saveset contents to local file

Sometimes, for savesets which require special handling, such as tape savesets with bad spots, scanner can be used to directly read the data and instead of updating media database entries, commit the data to a monolithic file which can then be recovered with the uasm utility. This can be a useful last resort where typical recoveries prove impossible. To scan a saveset to file, specify a single saveset only with -S and redirect the output. Note that data output on stdout, and log messages on stderr - if both are redirected to the data file, it is unusable. Ensure that stderr is redirected elsewhere appropriately. See NetWorker: Using uasm for save and recovery for details how to recover from the scanned saveset file.
Example: 

scanner -S saveset_id > scanned_saveset_filename 2> scanner_log

Selectively scanning a volume

There are several ways to scan a volume for specific entries:
  • Individual savesets: Use -S saveset_id one or more times to scan only for those savesets; can be used instead of or with -I saveset_id_listfile which will also restrict checking for savesets in the file (one per line).
  • Bootstraps: To scan for bootstrap savesets only - run scanner with the -B switch. Note that there is no need to use -m / -i or -F since bootstraps are not required to be in the media database to recover - their location and saveset ID are all that are required for nsrdr disaster recovery.
  • Creation time range: Use -Y for creation start / later-than datetime (for example 2023/01/01) and -Z for creation end / earlier than datetime (for example 2024/02/29) to restrict to savesets created within a specific time period only.
  • Client / saveset name: Use either or both of -c client or -N saveset_name to scan only for savesets matching these criteria; -m or -i is required for -c. Either switch can be used multiple times to match multiple criteria.

Best practices when scanning tape volumes

The scanner utility is low level and not represented at all in the UI, nor handled in normal NetWorker operations. As a result, it is important to ensure that tape devices are protected from interference, since the NetWorker server is not aware of scanner's operation, and may request the tape or the drive. To avoid this,

  1. Load the tape cartridge in an empty drive without mounting from the UI in the library / drive context menu.
  2. Mark the tape device as 'Disabled' or 'Service Mode' to avoid NetWorker attempting to do anything with either drive or media.
  3. Begin the scanner command and allow it to complete.
  4. When finished, re-enable the tape drive, and unload the tape media.

Affected Products

NetWorker
Article Properties
Article Number: 000227522
Article Type: How To
Last Modified: 12 Aug 2024
Version:  1
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.