{"id":868,"date":"2009-08-20T06:15:09","date_gmt":"2009-08-19T20:15:09","guid":{"rendered":"http:\/\/nsrd.wordpress.com\/?p=868"},"modified":"2018-12-12T15:49:23","modified_gmt":"2018-12-12T05:49:23","slug":"basics-labelling-and-relabelling-without-unmounting","status":"publish","type":"post","link":"https:\/\/nsrd.info\/blog\/2009\/08\/20\/basics-labelling-and-relabelling-without-unmounting\/","title":{"rendered":"Basics &#8211; Labelling and Relabelling without Unmounting"},"content":{"rendered":"<p>Here&#8217;s a common scenario \u2013 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.<\/p>\n<p>Getting around this behaviour is quite easy, and just requires a bit of typing on the command line.<\/p>\n<p>Let&#8217;s look first at relabelling, since this is arguably the most common scenario. Say you&#8217;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&#8217;d consider something like:<\/p>\n<pre># nsrjb -LRYvvv -S 21<\/pre>\n<p><strong>Note 1<\/strong>: I always put in the &#8216;-vvv&#8217; option whenever dealing with a jukebox. These days I practically consider it to be &#8216;best practices&#8217;.<\/p>\n<p><strong>Note 2<\/strong>: In the examples in this article I&#8217;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&#8217;t recommend you get in the habit of using it.<\/p>\n<p>Instead of using the -L option here, we switch to -l (for load); thus the command becomes:<\/p>\n<pre>[root@tara ~]# nsrjb -lRYvvv -S 21\nsetting verbosity level to `3'\nInfo: Preparing to load volume `BIG990S3' from slot 21 into device `\/dev\/nst0'.\nInfo: Loading volume `BIG990S3' from slot `21' into device `\/dev\/nst0'.\nInfo: Load sleep for 5 seconds.\nInfo: Performing operation `Verify label' on device `\/dev\/nst0'.\nInfo: Operation `Verify label' in progress on device `\/dev\/nst0'\nInfo: Performing operation `Label' on device `\/dev\/nst0'.\nInfo: Operation `Label' in progress on device `\/dev\/nst0'\nInfo: Recycling volume `BIG990S3'<\/pre>\n<p>That&#8217;s it &#8211; those of you familiar with highly verbose nsrjb output will recognise that there&#8217;s no &#8220;Unmount in progress&#8221; style message; the volume remains mounted and instantly ready for use once the relabel operation is complete.<\/p>\n<p>Now, moving on to a tape that hasn&#8217;t previously been labelled, we&#8217;d usually use a command such as:<\/p>\n<p># nsrjb -LYvvv -b poolName -S x<\/p>\n<p>However, to keep the tape mounted after labelling, we need to include the &#8216;-m&#8217; option; thus, if we wanted to label the tape in slot 1 into the &#8220;Default Clone&#8221; pool and keep it mounted after labelling, our command would look like the following:<\/p>\n<pre>[root@tara ~]# nsrjb -mLYvvv -b \"Default Clone\" -S 1\nsetting verbosity level to `3'\nInfo: Preparing to load volume `800843S3' from slot 1 into device `\/dev\/nst0'.\nInfo: Loading volume `800843S3' from slot `1' into device `\/dev\/nst0'.\nInfo: Load sleep for 5 seconds.\nInfo: Performing operation `Verify label' on device `\/dev\/nst0'.\nInfo: Operation `Verify label' in progress on device `\/dev\/nst0'\nInfo: Expected volume `800843S3' in slot `1'. The actual volume is `&lt;NULL&gt;'.\nInfo: Cannot read the current volume label `no tape label found'.\nInfo: nsrmmgd assumes the volume is unlabeled and will write a new label.\nInfo: Performing operation `Label' on device `\/dev\/nst0'.\nInfo: Operation `Label' in progress on device `\/dev\/nst0'\nInfo: Label: `800843S3', pool: `Default Clone', capacity: `&lt;NULL&gt;'.<\/pre>\n<p>There you go &#8230; and don&#8217;t forget Note 2 above! It&#8217;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.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s a common scenario \u2013 you want to label a volume, or relabel a volume, and use it straight away.&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[6],"tags":[130,512,519,604,663,800,807],"class_list":["post-868","post","type-post","status-publish","format-standard","hentry","category-basics","tag-autochanger","tag-jukebox","tag-label","tag-mount","tag-nsrjb","tag-recycle","tag-relabel"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pKpIN-e0","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/868","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/comments?post=868"}],"version-history":[{"count":1,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/868\/revisions"}],"predecessor-version":[{"id":7624,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/868\/revisions\/7624"}],"wp:attachment":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/media?parent=868"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/categories?post=868"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/tags?post=868"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}