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
    root@nwsvr# /etc/init.d/networker stop
  2. Under /nsr/mm/mmvolume6 remove the following files (for NetWorker 5.x the path is /nsr/mm/mmvolume):
    root@nwsvr# cd /nsr/mm/mmvolume6
    root@nwsvr# rm clients_i*.*
    root@nwsvr# rm ss_i*.*
    root@nwsvr# rm vol_*.*
    Do not remove the following files:
    clients.0
    ss.0
    vol.0
    VolHdr

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

  3. Empty the files in the /nsr/tmp directory
    root@nwsvr# 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
    root@nwsvr# rm /nsr/mm/.cmprssd
  5. Force NetWorker to automatically cross check the index database with the media database
    root@nwsvr# 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
    root@nwsvr# /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.