Here’s a common scenario – you want to label a volume, or relabel a volume, and use it straight away. The default behaviour of NetWorker after labelling or relabelling a volume is to then unmount it, which means having to then manually mount the volume after it has been (unnecessarily) ejected.

Getting around this behaviour is quite easy, and just requires a bit of typing on the command line.

Let’s look first at relabelling, since this is arguably the most common scenario. Say you’ve got a volume in slot 21 of your tape library that you want to relabel and have it remain mounted so you can immediately start using it. For a normal relabel operation you’d consider something like:

# nsrjb -LRYvvv -S 21

Note 1: I always put in the ‘-vvv’ option whenever dealing with a jukebox. These days I practically consider it to be ‘best practices’.

Note 2: In the examples in this article I’m using the -Y switch, which means NetWorker does not prompt for any confirmation on the operation (it assumes Yes in response to any question it may have); this is done only for the purposes of keeping example output simplified, and I don’t recommend you get in the habit of using it.

Instead of using the -L option here, we switch to -l (for load); thus the command becomes:

[root@tara ~]# nsrjb -lRYvvv -S 21
setting verbosity level to `3'
Info: Preparing to load volume `BIG990S3' from slot 21 into device `/dev/nst0'.
Info: Loading volume `BIG990S3' from slot `21' into device `/dev/nst0'.
Info: Load sleep for 5 seconds.
Info: Performing operation `Verify label' on device `/dev/nst0'.
Info: Operation `Verify label' in progress on device `/dev/nst0'
Info: Performing operation `Label' on device `/dev/nst0'.
Info: Operation `Label' in progress on device `/dev/nst0'
Info: Recycling volume `BIG990S3'

That’s it – those of you familiar with highly verbose nsrjb output will recognise that there’s no “Unmount in progress” style message; the volume remains mounted and instantly ready for use once the relabel operation is complete.

Now, moving on to a tape that hasn’t previously been labelled, we’d usually use a command such as:

# nsrjb -LYvvv -b poolName -S x

However, to keep the tape mounted after labelling, we need to include the ‘-m’ option; thus, if we wanted to label the tape in slot 1 into the “Default Clone” pool and keep it mounted after labelling, our command would look like the following:

[root@tara ~]# nsrjb -mLYvvv -b "Default Clone" -S 1
setting verbosity level to `3'
Info: Preparing to load volume `800843S3' from slot 1 into device `/dev/nst0'.
Info: Loading volume `800843S3' from slot `1' into device `/dev/nst0'.
Info: Load sleep for 5 seconds.
Info: Performing operation `Verify label' on device `/dev/nst0'.
Info: Operation `Verify label' in progress on device `/dev/nst0'
Info: Expected volume `800843S3' in slot `1'. The actual volume is `<NULL>'.
Info: Cannot read the current volume label `no tape label found'.
Info: nsrmmgd assumes the volume is unlabeled and will write a new label.
Info: Performing operation `Label' on device `/dev/nst0'.
Info: Operation `Label' in progress on device `/dev/nst0'
Info: Label: `800843S3', pool: `Default Clone', capacity: `<NULL>'.

There you go … and don’t forget Note 2 above! It’s not wise to get into the habit of throwing a -Y into nsrjb commands; the examples only show it to keep the examples simpler.

 

A commonly asked question is “how do I register a cleaning cartridge?” If NetWorker is managing your cleaning, it’s typically a case of just telling NetWorker how many cleaning uses are left in the nominated slot(s) for cleaning.

I always prefer to do it from the command line. From there, the command is:

# nsrjb -U x -S y

Where:

  • x is the number of uses of the cleaning cartridge left (e.g., 20)
  • y is the slot number of the cleaning cartridge you want to “register”.
 

Continuing the Commands you should know topic, here’s a single variant of nsrjb that you really, really should know.

Introduced somewhere in the NetWorker 7.3.x, the fast inventory operation available in nsrjb is a boon if you’re in a situation where you’re introducing a lot of barcoded media to a library.

By running the command:

# nsrjb -II

NetWorker will inventory only those volumes that don’t need to be loaded. I.e., just the barcoded volumes that are already in the media database. Thus, this command can be a great time-saver.

© 2012 The NetWorker Blog Suffusion theme by Sayontan Sinha