NetWorker Media database scavenging

This post follows on from my previous listing relating to media database corruption. In this article I provide a quick procedure to scavenge/rebuild the media database;

Media database scavenging is simply a way to force Legato NetWorker to rebuild the media database header files. The files that are deleted are all rebuildable from the 'main' media database file but the 'keys' are deleted, and they are rebuilt next time NetWorker starts.

Caution: Before you start this procedure, ensure that there are no running jobs (backup, recovery, cloning, etc...), also make sure you have a bootstrap backup before commencing. (see my post for details on performing a bootstrap backup.

  1. Stop NetWorker daemons/services
    # /etc/init.d/networker stop
  2. Under /nsr/mm/mmvolume6 remove the following files (for NetWorker 5.x the path is /nsr/mm/mmvolume):
    # cd /nsr/mm/mmvolume6
    # rm clients_i*.*
    # rm ss_i*.*
    # rm vol_*.*
    Do not remove the following files:
    clients.0
    ss.0
    vol.0
    VolHdr

    You MUST keep these files. These files are NEEDED to rebuild the media database.

  3. Empty the files in the /nsr/tmp directory
    # rm -rf /nsr/tmp
  4. Force media database compression on rebuild, by removing the /nsr/mm/.cmprssd (unix) or c:\program files\legato\nsr\mm\cmprssd (windows) file
    # rm /nsr/mm/.cmprssd
  5. Force NetWorker to automatically cross check the index database with the media database
    # rm /nsr/mm/nsrim.prv
    nsrim.prv will be created with the current date, and NetWorker will perform the cross check approximately 24 hours later.
  6. Restart NetWorker daemons/service
    # /etc/init.d/networker start

In the situation where the corruption is severe and the above procedure did not resolve the media database corruption, the media database can be recovered from the bootstrap using the mmrecov command to get a good copy of the media database. NetWorker software attempts to generate a bootstrap every day, so no more than one day of data should be lost.