Unsolved
This post is more than 5 years old
1 Rookie
•
5 Posts
0
4848
March 13th, 2017 06:00
Networker 8.2.1 - How to change multiple tapes to 'read-only'
In the NMC 8.2.1 I have over a hundred LTO-4 tapes that I need to change the mode on. They all need to be changed from recyclable to read-only. The only way I know how is to manually select each tape and change the mode. Anyone know another way to do a bulk change?


ledugarte
96 Posts
1
March 13th, 2017 06:00
Hello.
nsrmm command with switch -o can change mode :
nsrmm -o readonly -V volume
Make an script.
wlee
263 Posts
1
March 13th, 2017 07:00
I recently reviewed the EMC course "NetWorker Implementation and Management" where it was explained as I described earlier.
I also found an internal EMC kb which also has the following explanation: How NetWorker determines when to use recycleable tapes, kb310350
Read Only Volumes
A read-only volume is not a write-protected volume. The term read-only is best contrasted with appendable. That is, when a volume is read-only, data cannot be appended (written) to the volume. However, the save sets on the volume are subject to browse and retention policies. The volume is not protected from being over-written. When all the save sets on this volume change their status to recyclable, the volume becomes a candidate for automatic recycling and it can be relabeled by NetWorker.
Of course, as per documentation, this is how NetWorker is supposed to work. Please test this to verify the information.
wlee
263 Posts
1
March 13th, 2017 07:00
You should change the volume to not recyclable status.
This is because setting the volume as read only does not prevent NetWorker from relabeling it when it is also recyclable. Recyclable status makes it eligible for relabeling if it is available in a jukebox or tape drive.
The following command will change the mode to notrecyclable, and not prompt for confirmation.
nsrmm -y -v -o notrecyclable (volume_name).
If you have the list of volumes in a text file, then you can create a script to read the file, and pipe it into the nsrmm command. FOR EXAMPLE:
WINDOWS: for /f %A in (volume.txt) do @nsrmm -o notrecyclable -y %A
LINUX: for x in `cat ./volume.lst`; do nsrmm -o notrecyclable -y $x; echo $x; done
Please test your script using one volume in the text file. Once you are satisfied that the script works, you can update the text file with your list.
NOTE: The only absolute way to prevent NetWorker from overwriting the tape is to set the write protect tab on the tape cartridge itself.
RCB_FMGlobal
1 Rookie
•
5 Posts
0
March 13th, 2017 07:00
Ledugarte,
Is it possible with your command to pipe in a text file that contains a list of volumes?
ledugarte
96 Posts
1
March 13th, 2017 07:00
Wallace, a read only tape will not be re-labeled, even if all savesets are expired. For a readonly (R) tape, you will need to manually change the mode to allow labeling.
RCB_FMGlobal
1 Rookie
•
5 Posts
0
March 13th, 2017 08:00
Wallace,
Everytime I run nsrmm command with the -V switch I get an error "invalid volume id" In the NMC for example I have a tape with the volume label of FM0122L4. That is the volume ID I'm supposed to use correct?
wlee
263 Posts
2
March 13th, 2017 12:00
I found the following from the course material "NetWorker Implementation and Management Student Guide".
A volume can be manually assigned a status of read only. This will keep additional data from being written to the volume. Full and recyclable volumes are automatically given a secondary status of read only.
Important: Manually setting a volume to read only does not keep it from being recycled, it only prevents further data from being written to it.
RCB_FMGlobal
1 Rookie
•
5 Posts
0
March 13th, 2017 13:00
Thank you both for you help. I think I know what to do now.
bingo.1
2.4K Posts
1
March 13th, 2017 13:00
@RCB_FMGlobal
You explicitely asked how to set a bunch of tapes to 'read only'. This question has been answered.
You have also seen that 'read only' is not the best method to prevent a tape from beeing overwritten/recycled.
It all depends what you really need to achieve.
If you really want to protect your media you have these possibilities:
- You can set the tape to 'manual recycle' which will prevent automatical recycling if NW needs a tape and there is not other
one available. But this will only work in the same data zone.
- If you must move the tape offsite or to another data zone, may I suggest that you use the write-protect notch on the cartridge itself.
Be aware that no jukebox is able to recognize its position ... until the tape is loaded into a drive.
wlee
263 Posts
0
March 13th, 2017 13:00
@bingo and all... Sorry you cannot use Manual recycle.
Setting a volume to be Manual Recycle is only allowed at the time with the volume is being labeled or relabeled. You cannot change this afterwards.... except during relabeling the volume.
wlee
263 Posts
0
March 13th, 2017 14:00
you do not need to use the -V parameter. You use -V only if you want to specify the volume id, and no the volume name.
example:
nsrmm -y -v -o notrecyclable FM0122L4
ledugarte
96 Posts
0
March 13th, 2017 14:00
You have to use volid, which is different than volume label. Use mminfo to get volid
bingo.1
2.4K Posts
0
March 13th, 2017 15:00
@Wallace
Sorry - but your statement is just incorrect. From the nsrim manpage:
(manual-recyclable)
The volume will not be automatically eligible for recycling when all of its save sets have expired. Instead, the volume may only be recycled by a manual relabel operation. Note that a read-only volume can still be recycled unless the manual-recyclable flag is also set. The manual-recyclable flag can be set using NetWorker Management Console or the nsrmm(1m) and nsrjb(1m) commands when volumes are labeled, or at any time thereafter. This flag is never set automatically.
And btw - why else would you then have the option in the Media GUI?
wlee
263 Posts
0
March 13th, 2017 16:00
The Command Reference guide for the nsrmm command says that for -o parameter: The [not]readonly, [not]scan, [not]offsite, [not]full and [not]manual modes apply only to volumes.... (And) The [not]manual mode is the only valid mode when used with the -l (labeling) option.
Ok I see my mistake here... I took it to mean that you can only set it to manual recycling when labeling... when it is really the other way around: when labeling, you have the option on setting the manual recycling flag on the volume.
So, going back to the original question.... The best thing to do to preserve volumes that are currently in recyclable state would be, in my opinion:
And if you have a list of volumes to change... put it in a text file, and use a script (or batch job) to to read through the file and change each volume in that file.
ble1
4 Operator
•
14.4K Posts
0
March 20th, 2017 08:00
Actually you can set manual ad hoc and you can easily check that with mminfo and report state for volume (just tested) - depending on ssid/volexp you will see either M in start or X at the end of expiration period. And for the record, manual states "The manual-recyclable flag can be set using NetWorker Management Console or the nsrmm(8) and nsrjb(8) commands when volumes are labeled, or at any time thereafter."
However, I can see how could preserve unwanted recycling on tapes (as ssid would expire, but it is still on tape so you could read it with uasm or bring it back to DB via scanner or some other methods depending on bootstrap/index policy one uses). But with disk devices I guess (not tested) this is pointless as there is nothing to instruct ssids not to expire or to be kept so they might get removed. Unless, and that is big unless, nsrim process is smart enough to skip device cleaning in case M or X state is found on disk device. Yes, I know we deal tapes with query in this thread, but I guess someone might be reading this too who would assume the same for disk devices and it is better to raise the flag here.
While I used manual couple of times on tapes in the past for overly paranoid customers, nowadays I assume many of them use disk so whole discussion about how it works requires some tests with disk based devices (advanced and boost; older file type.device will act as tape). For test, I did convert now one disk devices into manual to see what will happen, but I will need to wait for couple of days to see end result (and by that time I will most likely forget about this too).