Howto get used tapes in bareos

29 views
Skip to first unread message

Adam Podstawka

unread,
Dec 3, 2019, 5:47:12 AM12/3/19
to bareos...@googlegroups.com
Hi,

i have a little problem, we build a new backup system and wanted to use
our old tapes in it. But the tapes are all labeled already through the
old system.
An "label barcodes" doesn't add them to the pool, as they are already
labeld.
i can't get to work an "echo 'add pool=Scratch volumename=000001L6' |
bconsole", but i don't want to mount all tapes and delete the
label/empty them to be able to use them in the new system.

Any hints? AS this are like 300 tapes, and doing "add" in bconsole by
hand will take to long.

Thanks
Adam

--
Adam Podstawka

Brock Palen

unread,
Dec 3, 2019, 10:05:46 AM12/3/19
to Adam Podstawka, bareos-users
I would do the following (google for exact commands)

BTW I would personally relabel them, but I use encryption managed by bareos in the tape drive. Also I think bareos tape labels are different than other software, so the label on the media cannot be reused, (I think)

Shutdown the SD, to be safe eject any tapes you don’t want to be purged.
If your library understands mtx us it to get a list of slots.

Make a script that itterates over every tape (if you have two drives split into two lists to speed up)

use mt to weof to each tape and just loop through them.


eg. (verify working from memory)
sg0 is the library
sg1 is the first drive (lsscsi -g) May want to use the /dev/nst* devices instead.

for x in $(cat /tmp/slots)
do
echo “Loading slot $x"
mtx -f /dev/sg0 load $x 0

# write end of file at start of tape taking out old data/label
mt -f /dev/sg1 rewind
mt -f /dev/sg1 weof
mt -f /dev/sg1 rewind

echo “Ejecting drive 0 to slot $x
mtx -f /dev/sg0 unload 0 $x
done


Finally when all done in bareos

update slots
label pool=Scratch barcodes encrypt yes


Verify all my syntax/do a test run with a single tape, it will be slow but should work.


Brock Palen
1 (989) 277-6075
bro...@mlds-networks.com
www.mlds-networks.com
Websites, Linux, Hosting, Joomla, Consulting
> --
> You received this message because you are subscribed to the Google Groups "bareos-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to bareos-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/bareos-users/0025900e-29cd-a635-dc6b-fa0e83748941%40dsmz.de.

Spadajspadaj

unread,
Dec 3, 2019, 3:03:01 PM12/3/19
to bareos...@googlegroups.com
Won't update slots (or update slots scan) help?

Regards,

MK

Adam Podstawka

unread,
Dec 5, 2019, 12:41:41 AM12/5/19
to bareos...@googlegroups.com
Hi MK,


Am 03.12.19 um 21:02 schrieb Spadajspadaj:
>
>> Any hints? AS this are like 300 tapes, and doing "add" in bconsole by
>> hand will take to long.
>>
> Won't update slots (or update slots scan) help?
tried this already with no success.

Regards
Adam

--
Adam Podstawka

Adam Podstawka

unread,
Dec 5, 2019, 12:44:48 AM12/5/19
to bareos...@googlegroups.com
Hi Brock,

thanks for this, i think we need to go this way

Just wanted to mention that the tapes came from an old bareos instance
and were labeled there. Had the hope to get them used without any extra
work.

Regards
Adam


Am 03.12.19 um 16:05 schrieb Brock Palen:
--
Adam Podstawka

Reply all
Reply to author
Forward
0 new messages