{"id":34,"date":"2012-11-06T01:33:39","date_gmt":"2012-11-06T09:33:39","guid":{"rendered":"http:\/\/blog.ls-al.com\/?p=34"},"modified":"2012-11-06T01:33:39","modified_gmt":"2012-11-06T09:33:39","slug":"bacula-relabel-tape","status":"publish","type":"post","link":"https:\/\/blog.ls-al.com\/bacula-relabel-tape\/","title":{"rendered":"Bacula Relabel Tape"},"content":{"rendered":"

Some notes on what I did to erase a tape in Bacula.<\/p>\n

unmount using bconsole<\/strong><\/p>\n

*unmount\r\nThe defined Storage resources are:\r\n     1: File\r\n     2: Scalar\r\nSelect Storage resource (1-2): 2\r\n3307 Issuing autochanger \"unload slot 2, drive 0\" command.\r\n3001 Device \"\"Drive-1\" (\/dev\/nst0)\" unmounted.<\/pre>\n

I used the library web front-end to move the tape into this drive then erased the label using operating system command mt:<\/strong><\/p>\n

root@bcla001:~# mt -f \/dev\/st0 rewind && mt -f \/dev\/st0 weof && mt -f \/dev\/st0 rewind<\/pre>\n

Manually label tape using bconsole. You probably want to use barcode labeling though. Look further down in this post.<\/strong><\/p>\n

*label\r\nThe defined Storage resources are:\r\n     1: File\r\n     2: Scalar\r\nSelect Storage resource (1-2): 2\r\nEnter new Volume name: FullTest0002\r\nEnter slot (0 or Enter for none): \r\nDefined Pools:\r\n     1: Default\r\n     2: File\r\n     3: Scratch\r\n     4: FullTest\r\n     5: AllIncrementals\r\n     6: AllDifferentials\r\n     7: DiffTest\r\n     8: IncrTest\r\nSelect the Pool (1-8): 4\r\nConnecting to Storage daemon Scalar at bcla001:9103 ...\r\nSending label command for Volume \"FullTest0002\" Slot 0 ...\r\nNo slot defined in catalog (slot=0) for Volume \"\" on \"Drive-1\" (\/dev\/nst0).\r\nCartridge change or \"update slots\" may be required.\r\n3301 Issuing autochanger \"loaded? drive 0\" command.\r\n3302 Autochanger \"loaded? drive 0\", result is Slot 2.\r\n3000 OK label. VolBytes=64512 DVD=0 Volume=\"FullTest0002\" Device=\"Drive-1\" (\/dev\/nst0)\r\nRequesting to mount Drive-1 ...\r\n3001 Device \"\"Drive-1\" (\/dev\/nst0)\" is mounted with Volume \"FullTest0002\"<\/pre>\n

check status using bconsole:<\/strong><\/p>\n

*status jobid=6\r\nConnecting to Storage daemon Scalar at bcla001:9103\r\n\r\nbcla001-sd Version: 5.2.6 (21 February 2012) x86_64-pc-linux-gnu debian wheezy\/sid\r\nDaemon started 07-Sep-12 17:37. Jobs: run=2, running=0.\r\n Heap: heap=589,824 smbytes=296,475 max_bytes=460,222 bufs=128 max_bufs=142\r\n Sizes: boffset_t=8 size_t=8 int32_t=4 int64_t=8 mode=0,0\r\n\r\nRunning Jobs:\r\nWriting: Full Backup job Test JobId=6 Volume=\"FullTest0002\"\r\n    pool=\"FullTest\" device=\"Drive-1\" (\/dev\/nst0)\r\n    spooling=0 despooling=0 despool_wait=0\r\n    Files=1,047,529 Bytes=1,862,098,892,915 Bytes\/sec=36,129,899\r\n    FDReadSeqNo=36,562,344 in_msg=33718333 out_msg=5 fd=4\r\n====\r\n...snip\r\n====\r\n\r\nDevice status:\r\nAutochanger \"Autochanger\" with devices:\r\n   \"Drive-1\" (\/dev\/nst0)\r\nDevice \"FileStorage\" is not open or does not exist.\r\nDevice \"Drive-1\" (\/dev\/nst0) is mounted with:\r\n    Volume:      FullTest0002\r\n    Pool:        FullTest\r\n    Media type:  Ultrium5-SCSI\r\n    Slot 2 is loaded in drive 0.\r\n    Total Bytes=758,596,608 Blocks=11,758 Bytes\/block=64,517\r\n    Positioned at File=0 Block=11,759\r\n====\r\n\r\nUsed Volume status:\r\nFullTest0002 on device \"Drive-1\" (\/dev\/nst0)\r\n    Reader=0 writers=1 devres=0 volinuse=1\r\n====\r\n\r\n====<\/pre>\n

Label using the barcode on the tape.<\/strong><\/p>\n

*label barcodes slot=11\r\nThe defined Storage resources are:\r\n     1: File\r\n     2: Scalar\r\nSelect Storage resource (1-2): 2\r\nConnecting to Storage daemon Scalar at bcla001:9103 ...\r\n3306 Issuing autochanger \"slots\" command.\r\nDevice \"Drive-1\" has 30 slots.\r\nConnecting to Storage daemon Scalar at bcla001:9103 ...\r\n3306 Issuing autochanger \"list\" command.\r\nThe following Volumes will be labeled:\r\nSlot  Volume\r\n==============\r\n  11  VOL021\r\nDo you want to label these Volumes? (yes|no): yes\r\nDefined Pools:\r\n     1: Default\r\n     2: File\r\n     3: Scratch\r\n     4: FullTest\r\n     5: AllIncrementals\r\n     6: AllDifferentials\r\n     7: DiffTest\r\n     8: IncrTest\r\nSelect the Pool (1-8): 1\r\nConnecting to Storage daemon Scalar at bcla001:9103 ...\r\nSending label command for Volume \"VOL021\" Slot 11 ...\r\n3301 Issuing autochanger \"loaded? drive 0\" command.\r\n3302 Autochanger \"loaded? drive 0\", result: nothing loaded.\r\n3304 Issuing autochanger \"load slot 11, drive 0\" command.<\/pre>\n","protected":false},"excerpt":{"rendered":"

Some notes on what I did to erase a tape in Bacula. unmount using bconsole *unmount The defined Storage resources<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-34","post","type-post","status-publish","format-standard","hentry","category-backups"],"_links":{"self":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/34","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/comments?post=34"}],"version-history":[{"count":0,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/posts\/34\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/media?parent=34"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/categories?post=34"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ls-al.com\/wp-json\/wp\/v2\/tags?post=34"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}