LTO tape archive

jpoa

Dabbler
Joined
Oct 7, 2013
Messages
24
@xcom thanks for that lead, I was starting to fiddle around with the jail to keep things on a separate dataset (ended up leaving it as is since it *is* already on a separate dataset by default), and was afraid the device would not be properly exposed. Your hint saved me quite some time here / made me push forward :)

From this point I want to perform some more tests with bacula, I am checking their documentation at the moment in order to ensure that data gets written properly and gets read properly.

This is with the "new" HP LTO6 drive (external) running via an HP H222 on a MicroG8.
 

xcom

Contributor
Joined
Mar 14, 2014
Messages
125
Awesome. I am glad I was able to help.
Keep us posted.
 

jpoa

Dabbler
Joined
Oct 7, 2013
Messages
24
Sooooo... (listening to chariots of fire now...)

It works. :) Just works as it should. Some banging was needed (actually EOF banging), but it works.

Here are the confs so far (might update them a bit/not sure if needed?), plus logs to prove it.

This is with FreeNAS 9.2.1.5-x64, bacula-SD plugin and an HP LTO-6 Ultrium 6250 external tape recorder.

Please note that there are some modifications needed for some recorders, plus some modifications needed for FreeBSD, so *DO NOT UNDER ANY CIRCUMSTANCE* take a tape recorder, stick it to FreeNAS and believe it is working. Test it!


root@bacula-sd_1:/usr/pbi/bacula-sd-amd64/etc/bacula # cat bacula-sd.conf
################################################
# bacula-sd.conf generated by FreeNAS
################################################
Storage {
Name = tapercat-sd
SDPort = 9103
Working Directory = /usr/pbi
Pid Directory = /var/run
Maximum Concurrent Jobs = 10
}
Director {
Name = cat-dir
Password = "officecat"
Monitor = No
}
Device {
Name = folderBaculaBackups
Media Type = File
Archive Device = /media/baculaBackups
Label Media = Yes
Random Access = Yes
Automatic Mount = No
Removable Media = No
Always Open = No
}
Device {
Name = tapeLTO6
Media Type = File
Archive Device = /dev/sa0
Label Media = Yes
Random Access = No
Automatic Mount = No
Removable Media = Yes
Always Open = No
Hardware End of Medium = no
Fast Forward Space File = no
BSF at EOM = yes
TWO EOF = yes
}
Messages {
Name = Standard Cat-Dir
director = bacula-dir = all
}

This paired with a MicroServer G8 is setting up for a nice export system.

HBA replaced but not with a M1015 (went all the way HP here, not messing with the hardware), its a P2XX something.

Since it is a system with 4HDD, I am considering a mirrored pool over ZFS2 (have to check this on the next step).

IMG_20140701_163859.jpg
 

Attachments

  • IMG_20140701_163859.jpg
    IMG_20140701_163859.jpg
    49.2 KB · Views: 544

Alvin

Explorer
Joined
Aug 12, 2013
Messages
65
Nice :)
I'm also having success here. Using misc/amanda-server. (ok, panic mode. When creating this link I saw that amanda has no maintainer anymore, and that the port will be removed. That explains the old version.)
Anyway, it IS working from a jail. I was hoping to also use the built-in ZFS snapshot mechanism, but that requires access to the ZFS subsystem from the jail. I'm sure it it possible, but for now I'm just using it with archivers/gtar and archivers/pigz.
I'm willing to write a howto, but with the port going away that seems a bit useless.

cyberjock said:
There is no support for any tape devices on FreeNAS.
No, tape drive support is available in FreeNAS, as it contains mt(1) and tar(1). In this case I'm using a tape autoloader, so that requires a method to switch the tapes, which requires extra software (misc/mtx).

A cron job with tar -c /mnt should just work as a very basic tape backup solution.
 

Z300M

Guru
Joined
Sep 9, 2011
Messages
882
No, tape drive support is available in FreeNAS, as it contains mt(1) and tar(1). In this case I'm using a tape autoloader, so that requires a method to switch the tapes, which requires extra software (misc/mtx).

A cron job with tar -c /mnt should just work as a very basic tape backup solution.
BackAgain/2000 (for IBM's OS/2 and its successor, eComStation), when used with a Sony/Dell/Compaq DDS4 autoloader, would automatically go from one tape to the next if the backup "overflowed" the first tape. Is that feature not available in all backup software?
 

jpoa

Dabbler
Joined
Oct 7, 2013
Messages
24
I just resorted to bacula on that, it auto changes (requests) a new tape.
 

jpoa

Dabbler
Joined
Oct 7, 2013
Messages
24
Z300M, word of caution!!

I noticed Bacula was failing tests without some special directives on the config file, please bear in mind that these options are not supported via the bacula plugin UI so you need to do them via CLI and prevent the start script of bacula by IXSystems from overwriting it!

tl:dr; Risk of data loss if you use the bacula plugin with tapes without customisation!

To avoid the Bacula SD plugin on FreeNAS to rewrite the configuration file:

Open the shell on the Jail and edit the start script

vi /usr/local/etc/rc.d/ix-bacula-sd

At the end change to match this:

name=ix-bacula-sd
#start_cmd=generate_bacula_sd
start_cmd=':'
stop_cmd=':'

##### CONTEXT

We configure bacula via the web interface and let it start once.

This will create the config files and so on.

Since we are using a tape drive with FreeNAS we want to do some
custom configuration which would be overwritten with every start.

This way we can avoid that.


Also, in order to test btape you need to copy the config file to
/usr/pbi/bacula-sd-amd64/etc/bacula/bacula-sd.conf since btape
expects it to be there.
 

jpoa

Dabbler
Joined
Oct 7, 2013
Messages
24
I should write a decent tutorial, I recon now...

Anyway, to tired at the moment but ask ahead if you encounter problems.
 

NaCl

Dabbler
Joined
Apr 10, 2012
Messages
14
Greetings,

Does all of this still apply to 9.3? Any better/easier news on this front in that version?

I'm _trying_ to purchase a drive as I type this. I'm trying to go with the IBM TS2260, the option with the SAS & USB3 port. Crazily enough, it has proven nigh on impossible to locate anyone in the fsk'ing company that can _actually_ sell anything! Unfortunately, they are the only ones that appear to offer one of these w/USB. Xendata has one but they want $5.5K for it. I could get an autoloader for that.

I was hoping to attach it directly to the FreeNAS, but had resolved myself to falling back to hanging it off of my Windows workstation and manually just dragging and dropping over a CIFS share. Win8+ is supposed to have better CIFS support and ltfs is a thing. It might not be easily automated, but I'm in it more for periodic back up of my plex data which doesn't change _that_ often. One giant initial archival set should be sufficient to stave off a catastrophic failure.

Thanks!
 

jpoa

Dabbler
Joined
Oct 7, 2013
Messages
24
Greetings halite, I believe this should not change much when using 9.3.

However, pay attention at two big changes in this ecosystem, FreeNAS 10 is coming out (is there a date?) and Bacula has just released a new version which (in theory) has support for ZFS filesystems (which would be a big plus in our case).

I have yet to see how that thing works on the new one.

Nonetheless the current bacula plugin could use some love (there was once an issue with the interface that was solved so there is a user base, even if small), I would not be too surprised if the plugin gets some love once the new versions are out for a while. Can only speak for myself, for many times considered solving some of the configuration woes of the bacula-sd plugin, but knowing that v10 is coming soon I will not do it until then.

Out of curiosity, how much are these IBM recorders costing now? I had never considered USB for this, but if the cost is fine... Anyway, you always have the alternative of getting a board with SAS connector and jump the need for a USB tape drive (which I am sure you considered).

Our setup here works flawlessly (we did a restore already, so yes, it works IRL), although I am cautious about the latest FreeNAS upgrades since there was an issue on some machines with some plugins (which seem to be solved now, so you should be OK).

tl;dr: Bacula works with FreeNAS and tape recorders *if* your tape recorder is properly detected by the kernel (run the bacula tests to be sure everything is working A-OK). It might seem complicated to setup but it is not (really), and once it is running you don't need to change anything.

In your case, since you can fallback to another alternative you shouldn't be too worried. I can assure you that this HP model works fine, no idea about the IBM one.
 

Alvin

Explorer
Joined
Aug 12, 2013
Messages
65
I should write a decent turorial too :smile:
Yes, it still works. I'm using misc/amanda-server in a jail and I'm hoping it will still work somehow with version 10. Official tape support would be even better.
 

NaCl

Dabbler
Joined
Apr 10, 2012
Messages
14
Greetings jpoa,

First off, I wanted to thank you for your efforts. They were sufficiently encouraging enough to get me to persevere. I had never used bacula before and it was/_is_ a bit of effort to get everything straight as to how it works and all the pieces interoperate.

Pardon the delayed response. It was an _ordeal_ just trying to purchase a drive. IBM sucks, they flat-out can.not seem to sell anyone anything. Perhaps if you are a large business they _might_ be motivated. As an individual, my $3k USD is not just not, apparently worth it to them. That said, it did lead me to Quantum. All these lto6 drives are oem'd by someone else. I haven't actually cracked mine open to see, but the fw is IBM so perhaps they are doing it? In any event, I decided to go with an autoloader. I picked up a Quantum SuperLoader 3, 16 slot. Amusingly enough, it was about the same, if not even cheaper, as a single standalone ts2260. I went with straight up SAS since the USB variant is super hard to come by. And ltfs is not as amazing as it could be. It doesn't support spanned physical media so even if I did get that going, I'd have to deal with 2.5TB swaths of my data. As I'm talking about a bit over 60TB, that's just not going to work for me. And, for similar reasons, swapping tapes was also unappealing.

Onto the good stuff. What camcontrol reports:
Code:
# camcontrol devlist | egrep -i 'ibm|quantum'
<IBM ULTRIUM-HH6 E4J1> at scbus0 target 68 lun 0 (pass36,sa0)
<QUANTUM UHDL 0091> at scbus0 target 68 lun 1 (ch0,pass38)


I attempted to configure bacula via the UI w/displeasing results. For one, and this may be one of the config issues you mentioned, after adding a device, it's added but there's no way to modify and/or remove it as subsequent selections of it come back with an error. And no clue as to what the error _is_. Also, I'm not certain how you are using it w/your setup. Are you just using it for backing up other machines? e.g. external clients. My use-case is that all my data is _on_ the NAS...all my plex transcodes and 1:1 isos of my optical media collection. The idea of if I could get the sd working, to only have to set up a client on a windows machine to back up the data one the NAS through CIFS shares was 'crazy' and something to reserve for the last ditch effort. So I played around in the bacula-sd jail a bit.

Ultimately I dx'd all of the ix configuration nonsense, used the samples as guides and created the dir, sd, fd, and bconsole configs manually. The versions are built with postgres support, I bootstrapped and updated pkg to get that installed. Then, zsh, as the lack of a _real_ shell is soul-crushing. Then mtx for the changer and postgres for bacula db action. The end result is that everything is working as of this morning. This is also why, as you'll see, a lot of the bits are fairly generic. i.e. MyCatalog, Default, etc.. I'm still not clear on how I want to set up my naming. The most important thing for me then/now is to get at one complete full backup. Once that's done, I can put in some new tapes, and choose some more original/useful names. Then do it again on those and purge/recycle that original.

Current status of the job:

Code:
bacula-sd_1# echo 'status client' | /usr/pbi/bacula-sd-amd64/sbin/bconsole -c /usr/pbi/bacula-sd-amd64/etc/bconsole.conf
Connecting to Director localhost:9101
1000 OK: bacula-dir Version: 5.2.12 (12 September 2012)
Enter a period to cancel a command.
status client
Automatically selected Client: bacula-fd
Connecting to Client bacula-fd at localhost:9102

bacula-fd Version: 5.2.12 (12 September 2012) amd64-portbld-freebsd9 freebsd 9-STABLE-p5
Daemon started 02-Sep-15 22:51. Jobs: run=7 running=0.
Heap: heap=0 smbytes=391,666 max_bytes=393,588 bufs=129 max_bufs=131
Sizeof: boffset_t=8 size_t=8 debug=0 trace=0
Running Jobs:
JobId 11 Job FullBackupClient1.2015-09-03_02.15.21_03 is running.
Full Backup Job started: 03-Sep-15 02:15
Files=3,019 Bytes=2,702,750,366,546 Bytes/sec=73,962,847 Errors=0
Files Examined=3,019
Processing file: /mnt/media/video/transcoded/tv_shows/Star Trek The Next Generation/Season 06/Star Trek The Next Generation - S06E26 - Descent (1).mkv
SDReadSeqNo=5 fd=5
Director connected at: 03-Sep-15 12:24


And the device status portion:
Code:
Device status:
Autochanger "Superloader3" with devices:
"lto6autochanger" (/dev/sa0)
Device "lto6autochanger" (/dev/sa0) is mounted with:
Volume: NIA327L6
Pool: Default
Media type: LTO-6
Slot 2 is loaded in drive 0.
Total Bytes=202,375,885,824 Blocks=3,137,026 Bytes/block=64,512
Positioned at File=202 Block=6,027
====

Used Volume status:
NIA327L6 on device "lto6autochanger" (/dev/sa0)
Reader=0 writers=1 devres=0 volinuse=1
====


The transition from the tape in slot 1 to the tape in slot 2 was automatically handled by bacula and, ultimately, mtx. Since this is already compressed video data, I was expecting to only get the native 2.5TB/tape. And, thus far, that's what it's looking like from tape 1.

Code:
Connecting to Director localhost:9101                                                                                           
1000 OK: bacula-dir Version: 5.2.12 (12 September 2012)                                                                         
Enter a period to cancel a command.                                                                                             
list media                                                                                                                       
Automatically selected Catalog: MyCatalog                                                                                       
Using Catalog "MyCatalog"                                                                                                       
Pool: Default                                                                                                                   
+---------+------------+-----------+---------+-------------------+----------+--------------+---------+------+-----------+-----------+---------------------+                                                                                                         
| mediaid | volumename | volstatus | enabled | volbytes          | volfiles | volretention | recycle | slot | inchanger | mediatype | lastwritten         |                                                                                                         
+---------+------------+-----------+---------+-------------------+----------+--------------+---------+------+-----------+-----------+---------------------+                                                                                                         
|       2 | NIA326L6   | Full      |       1 | 2,524,203,085,824 |    2,525 |   31,536,000 |       1 |    1 |         1 | LTO-6    | 2015-09-03 11:41:03 |                                                                                                         
|       3 | NIA327L6   | Append    |       1 |   226,985,472,000 |      227 |   31,536,000 |       1 |    2 |         1 | LTO-6    | 2015-09-03 12:33:52 |                                                                                                         
|       4 | NIA320L6   | Append    |       1 |            64,512 |        0 |   31,536,000 |       1 |    3 |         1 | LTO-6    |                     |                                                                                                         
|       5 | NIA321L6   | Append    |       1 |            64,512 |        0 |   31,536,000 |       1 |    4 |         1 | LTO-6    |                     |                                                                                                         
|       6 | NIA322L6   | Append    |       1 |            64,512 |        0 |   31,536,000 |       1 |    5 |         1 | LTO-6    |                     |                                                                                                         
|       7 | NIA323L6   | Append    |       1 |            64,512 |        0 |   31,536,000 |       1 |    6 |         1 | LTO-6    |                     |                                                                                                         
|       8 | NIA324L6   | Append    |       1 |            64,512 |        0 |   31,536,000 |       1 |    7 |         1 | LTO-6    |                     |                                                                                                         
|       9 | NIA325L6   | Append    |       1 |            64,512 |        0 |   31,536,000 |       1 |    8 |         1 | LTO-6    |                     |                                                                                                         
|      10 | NIA328L6   | Append    |       1 |            64,512 |        0 |   31,536,000 |       1 |   10 |         1 | LTO-6    |                     |                                                                                                         
|      11 | NIA329L6   | Append    |       1 |            64,512 |        0 |   31,536,000 |       1 |   11 |         1 | LTO-6    |                     |                                                                                                         
|      12 | NIA330L6   | Append    |       1 |            64,512 |        0 |   31,536,000 |       1 |   12 |         1 | LTO-6    |                     |                                                                                                         
|      13 | NIA331L6   | Append    |       1 |            64,512 |        0 |   31,536,000 |       1 |   13 |         1 | LTO-6    |                     |                                                                                                         
|      14 | NIA332L6   | Append    |       1 |            64,512 |        0 |   31,536,000 |       1 |   14 |         1 | LTO-6    |                     |                                                                                                         
|      15 | NIA333L6   | Append    |       1 |            64,512 |        0 |   31,536,000 |       1 |   15 |         1 | LTO-6    |                     |                                                                                                         
|      16 | NIA334L6   | Append    |       1 |            64,512 |        0 |   31,536,000 |       1 |   16 |         1 | LTO-6    |                     |                                                                                                         
+---------+------------+-----------+---------+-------------------+----------+--------------+---------+------+-----------+-----------+---------------------+


Slot 9 is not listed as that is the slot that contains the cleaning tape.

The thing that almost defeated me was a failure with getting postgres working. It fails to start due to an inability to get shared memory. After quite a bit of searching it was clear that these needed to be set.
Code:
security.jail.sysvipc_allowed=1
security.jail.param.allow.sysvipc=1


The _where_ is the kicker. It seems obvious they need to be set on the FreeNAS host machine. I manually attempted to set both but that did not affect the jail, even after a restart. And param.allow didn't even work. Setting it to 1 just returned
the parameter as 0 -> 0. So I don't know what it is that prevents root from being able to mod that. Various postings indicated they should be in the obvious /etc/sysctl.conf, other indicated there _and_ /boot/loader.conf, and then at least one mentioned
Code:
jail_sysvipc_allow="YES"
in /etc/rc.config. And, indeed, looking at /etc/rc.d/jail, _that_ appears to be the actual place. I ended up 'shotgunning it' as that was the order I had found things. I have yet to remove them everywhere else as of yet.

This,
Code:
jail -m jid=8 allow.sysvipc=1
, also works. (my jail id is 8 ymmv)

Only one 'minor' issue remains for me. If I start the console when there is no tape in the drive it punts with a device not configured error. I have tried various permutations of Always Open/AutoMount booleans in the config(s) but those don't appear to matter. Clearly bacula/mtx
are able to change the tapes appropriately. Even
Code:
label barcodes
worked w/out issue, even before I knew about and added the Cleaning Prefix attribute and it attempted to label the cleaning tape. It emitted a reasonable error and moved on. I'm not sure how to configure it to be ok w/the drive being empty and just know to go ahead and load a tape. This is minor enough that I still consider this a fully working solution. And I'm not sure if this would prevent a scheduled job from just working (auto loading an appendable tape) or if it's just a bconsole issue. I guess I'll see at the next incremental.

I may attempt to update to version 7 of bacula at some point since pkg is working. There are some minor, to me, new features so I'm not in a hurry currently. Maybe after I get some backups, and a few more restores, done.

Thanks again!

Greetings halite, I believe this should not change much when using 9.3.

However, pay attention at two big changes in this ecosystem, FreeNAS 10 is coming out (is there a date?) and Bacula has just released a new version which (in theory) has support for ZFS filesystems (which would be a big plus in our case).

I have yet to see how that thing works on the new one.

Nonetheless the current bacula plugin could use some love (there was once an issue with the interface that was solved so there is a user base, even if small), I would not be too surprised if the plugin gets some love once the new versions are out for a while. Can only speak for myself, for many times considered solving some of the configuration woes of the bacula-sd plugin, but knowing that v10 is coming soon I will not do it until then.

Out of curiosity, how much are these IBM recorders costing now? I had never considered USB for this, but if the cost is fine... Anyway, you always have the alternative of getting a board with SAS connector and jump the need for a USB tape drive (which I am sure you considered).

Our setup here works flawlessly (we did a restore already, so yes, it works IRL), although I am cautious about the latest FreeNAS upgrades since there was an issue on some machines with some plugins (which seem to be solved now, so you should be OK).

tl;dr: Bacula works with FreeNAS and tape recorders *if* your tape recorder is properly detected by the kernel (run the bacula tests to be sure everything is working A-OK). It might seem complicated to setup but it is not (really), and once it is running you don't need to change anything.

In your case, since you can fallback to another alternative you shouldn't be too worried. I can assure you that this HP model works fine, no idea about the IBM one.
 
Last edited:

billgreenwood

Dabbler
Joined
Apr 11, 2014
Messages
42
Archiware P5 provide a backup solution for FreeNAS and have even written a guide.
http://www.archiware.com/blog/build-your-own-archiware-appliance-en/


My additions to the main guide gets the software running in a jail. The software which is quite easy to use (but it is not free) is designed to work with Tape. But I've not yet tried adding the hardware to FreeNAS.

I installed this software so a client could use it to backup files I create for them directly from a folder on my server.


So I could lock out other parts of the system to my client. I did not want to install P5 directly on the root system, so with a few minor alterations from the Archiware guide, I installed P5 into a FreeNAS Jail which easily allowed me to only allow P5 to see areas of the main filesystem. Of course using jails means you could use this to test out without having to install it on your root system and also have multiple instances of P5 should you wish.


This carries on after step 6 of the guide. ( I guess most are experienced with FreeNAS here, but there's a bit of simple stuff explained - ish!)

On FreeNAS 9.3.1 create a standard jail and give this Jail the storage required. Storage will be a folder/s on your zpool.

FreeNAS Jails create links to storage areas defined by you up on the main pool, (using the guide as an example) choosing the path from root /mnt/awpool/aw/clientsdata/privatestorage will be seen in the jail only as /privatestorage

I have allowed the Jail access only to the folder called privatestorage.

https://doc.freenas.org/9.3/freenas_jails.html#adding-jails

Before installing P5.
In the Jails own shell (in the Web GUI) set your root password (the command is Passwd then type and retype whatever password you want for root user of the Jail). You will need the root password to log into the installed P5.

On the root folder of the Jail I set up a folder called PresStore to store P5. mkdir PresStore.

Now the Jail shell does not have wget, so from the main shell (or ssh as the main root) download P5 then move it in to the PresStore folder.

(the tar file listed in the guide did not exist, I downloaded awpst531.tgz)

wget http://awdist.archiware.com/awpst531.tgz then move awpst531.tgz into the PresStore folder in the jail

mv awpst531.tgz /mnt/awpool/jails/PresStore/PresStore/

Here's an explanation of the path
/(root) ... mnt (mnt folder) ... awpool (zpool name) ... jails (folder where jails are stored) ... PresStore (folder of jail name itself) ... PresStore (Yes same name! The folder I made, in which to store the application in the jail).

Now as the guide, cd into /mnt/awpool/jails/PresStore/PresStore/ unpack the file using tar

tar awpst531.tgz

Then install P5 as the guide.

./start-server


Once installed you can log on to it http://EXA.MP.LE.IP:8000/lexxapp/login?
Log in as root and your root password.

The jail will have a different IP from the main FreeNAS, so have a read on configuring jails. You can set the ip range and even change the IP and even P5 port once installed.

https://doc.freenas.org/9.3/freenas_jails.html#managing-jails

Looking at the guide
As of yet I've not set up the init / shutdown scripts, but you could write a shell command in a text file and call that from the init / shutdown scrips in the WEB GUI.


Hope this helps someone.
 

gmork123

Cadet
Joined
Feb 8, 2020
Messages
1
Thanks for above hints!

For archiware P5 version 6 on 11.3-RELEASE I needed the following to get it running in a jail:


Code:
# cat /etc/devfs.rules

[usbrules=100]

add path 'usbctl' mode 660 group uucp

add path 'usb/*' mode 660 group uucp

add path 'ttyU*' mode 660 group uucp



[devfsrules_jail_p5=5]

add include $devfsrules_hide_all

add include $devfsrules_unhide_basic

add include $devfsrules_unhide_login

add path zfs unhide

add path xpt0 unhide

add path sa* unhide

add path pass* unhide

add path pass7 unhide mode 0660

add path ch0 unhide

add path nsa* unhide



# service devfs restart



# sysctl -n kern.hostuuid


(it is important to give a proper hostid/uuid to the prison for licensing P5. Use this HOST_ID in below command, also change interface+ip address)



# iocage create -r 11.3-RELEASE -u HOST_ID ip4_addr="bge0|192.168.234.107/24" host_hostname=p5 mount_devfs=1 devfs_ruleset=5 securelevel=-1



I could not get stacking rulesets working and https://forums.freebsd.org/threads/solved-customised-devfs-rules-unhiding-everything-in-jails.46091/ suggested to flatten it. Probably I'm exposing somewhat to much devices to the jail but for me this is working perfectly. P5 recocgnized my library.
 

KenwoodFox

Explorer
Joined
Nov 6, 2018
Messages
74
Misters,

It works. I am too tired now to continue, but it works.

PS: To the admins, I will post on other (two?) threads that were mentioning tapes with a link to here, there might be followers on those threads that might not see this.
How'd you manage to get it to work? I'm having trouble with FreeNAS resetting /etc/devfs.rules on startup :c
 
Top