[HOWTO] Install bacula with sqlite support and a Dell PowerVault 124T

Status
Not open for further replies.

rstumbaum

Dabbler
Joined
Dec 20, 2011
Messages
17
Hi,

we have the following setup:
- FreeNAS1: Server for home and group drives
- FreeNAS2: Backup Server that receives the data from FreeNAS1 per rsync - with a per HBA attached Dell PowerVault 124T Tapechanger Device

Configuring the tapedevice on FreeNAS2:
[root@backup01] ~# dmesg
mps0: <LSI SAS2008> port 0x3000-0x30ff mem 0xd8440000-0xd844ffff,0xd8400000-0xd843ffff irq 16 at device 0.0 on pci12
mps0: Firmware: 02.15.63.00
mps0: IOCCapabilities: 185c<ScsiTaskFull,DiagTrace,SnapBuf,EEDP,TransRetry,IR>
mps0: [ITHREAD]
(probe3:mps0:0:0:0): TEST UNIT READY. CDB: 0 0 0 0 0 0
(probe3:mps0:0:0:0): CAM status: SCSI Status Error
(probe3:mps0:0:0:0): SCSI status: Check Condition
(probe3:mps0:0:0:0): SCSI sense: NOT READY asc:3a,0 (Medium not present) field replaceable unit: 30
sa0 at mps0 bus 0 scbus3 target 0 lun 0
sa0 at mps0 bus 0 scbus3 target 0 lun 0
sa0: <IBM ULTRIUM-TD4 97F0> Removable Sequential Access SCSI-3 device
sa0: 300.000MB/s transfers
sa0: Command Queueing enabled
[root@backup01] ~# camcontrol devlist
<WDC WD2002FYPS-02W3B 1G01> at scbus0 target 0 lun 0 (pass0)
...
<WDC WD2002FYPS-02W3B 1G01> at scbus0 target 15 lun 0 (pass15)
<IBM ULTRIUM-TD4 97F0> at scbus3 target 0 lun 0 (sa0,pass16)
[root@backup01] ~# camcontrol rescan 3:0:1 # This is required since after the tape no more scanning appears to happen
Re-scan of 3:0:1 was successful
[root@backup01] ~# camcontrol devlist
<WDC WD2002FYPS-02W3B 1G01> at scbus0 target 0 lun 0 (pass0)
...
<WDC WD2002FYPS-02W3B 1G01> at scbus0 target 15 lun 0 (pass15)
<IBM ULTRIUM-TD4 97F0> at scbus3 target 0 lun 0 (sa0,pass16)
<DELL PV-124T 0080> at scbus3 target 0 lun 1 (ch0,pass17)

Install mtx package to access the changer:
mount -uw / # to make the root FS writeable
pkg_add -r mtx # Installation
mount -ur / # to make the root FS readonly again

Check the functionality of mtx and chio:
[root@backup01] /mnt/tank01# mtx -f /dev/pass17 inquiry
Product Type: Medium Changer
Vendor ID: 'DELL '
Product ID: 'PV-124T '
Revision: '0080'
Attached Changer API: No
[root@backup01] /mnt/tank01# mtx -f /dev/pass17 status
Storage Changer /dev/pass17:1 Drives, 8 Slots ( 0 Import/Export )
Data Transfer Element 0:Empty
Storage Element 1:Full :VolumeTag=000011L4
Storage Element 2:Full :VolumeTag=000012L4
Storage Element 3:Full :VolumeTag=000013L4
Storage Element 4:Full :VolumeTag=000014L4
Storage Element 5:Full :VolumeTag=000015L4
Storage Element 6:Full :VolumeTag=000016L4
Storage Element 7:Full :VolumeTag=000017L4
Storage Element 8:Full :VolumeTag=CLNU00L1
[root@backup01] /mnt/tank01# chio -f /dev/ch0 status -v
picker 0: voltag: <:0>
slot 0: <ACCESS,FULL> voltag: <000011L4:0>
slot 1: <ACCESS,FULL> voltag: <000012L4:0>
slot 2: <ACCESS,FULL> voltag: <000013L4:0>
slot 3: <ACCESS,FULL> voltag: <000014L4:0>
slot 4: <ACCESS,FULL> voltag: <000015L4:0>
slot 5: <ACCESS,FULL> voltag: <000016L4:0>
slot 6: <ACCESS,FULL> voltag: <000017L4:0>
slot 7: <EXCEPT,FULL> voltag: <CLNU00L1:0>
drive 0: <ACCESS> voltag: <:0>
[root@backup01] /mnt/tank01#

Install bacula2 with sqlite support and hack your way around the memory based Configuration files:
mount -uw / # to make the root FS writeable
pkg_add -r bacula2-server bacula2-client
mkdir -p /mnt/tank01/bacula/var/db/bacula
cd /conf/base/var/db
ln -s /mnt/tank01/bacula/var/db/bacula
mkdir -p /mnt/tank01/bacula/etc
cd /conf/base/etc/local
ln -s /mnt/tank01/bacula/etc/bacula-barcodes
ln -s /mnt/tank01/bacula/etc/bacula-sd.conf
ln -s /mnt/tank01/bacula/etc/bacula-fd.conf
ln -s /mnt/tank01/bacula/etc/bacula-dir.conf
ln -s /mnt/tank01/bacula/etc/bconsole.conf
cd /conf/base/etc/rc.d
ln -s /usr/local/share/bacula/bacula
chown bacula:operator /dev/ch0
chown bacula:operator /dev/sa0
mount -ur / # to make the root FS readonly again

Configure bacula:
vi /usr/local/etc/bacula-barcodes
vi /usr/local/etc/bacula-sd.conf
vi /usr/local/etc/bacula-fd.conf
vi /usr/local/etc/bacula-dir.conf

Start bacula:
/usr/local/share/bacula/bacula start


/usr/local/etc/bacula-sd.conf:
...
Autochanger {
# DELL PV-124T
Name = Autochanger01
Device = Autochanger01-Drive0
Changer Command = "/usr/local/sbin/chio-bacula %c %o %S %a %d"
Changer Device = /dev/ch0
}
Device {
# IBM ULTRIUM-TD4
Name = Autochanger01-Drive0 #
Drive Index = 0
Media Type = LTO-4
Archive Device = /dev/sa0
AutomaticMount = yes; # when device opened, read it
AlwaysOpen = yes;
RemovableMedia = yes;
RandomAccess = no;
AutoChanger = yes
#
# Enable the Alert command only if you have the mtx package loaded
# Note, apparently on some systems, tapeinfo resets the SCSI controller
# thus if you turn this on, make sure it does not reset your SCSI
# controller. I have never had any problems, and smartctl does
# not seem to cause such problems.
#
# Alert Command = "sh -c 'tapeinfo -f %c |grep TapeAlert|cat'"
# If you have smartctl, enable this, it has more info than tapeinfo
# Alert Command = "sh -c 'smartctl -H -l error %c'"
# BEGIN Recommendations from pkg_add
Hardware End of Medium = no;
Backward Space Record = no;
Backward Space File = no;
Fast Forward Space File = no;
BSF at EOM = yes;
TWO EOF = yes;
# END Recommendations from pkg_add
# BEGIN FreeBSD adjustments after running "btape test"
# None now...
# END FreeBSD adjustments after running "btape test"
}
...

We still have the problem that:
- we use the old version of bacula since that still comes with sqlite instead of postgres
- bacula does not startup automatically after a reboot
- we need to rescan for the Autochanger after a reboot
- we need to change the permissions on /dev/sa0 and /dev/ch0 after a reboot

But at least we have a backup we can take offsite...

Hope that helps people get startet with their bacula installation on FreeNAS...

Cheers
Rainer
 
Status
Not open for further replies.
Top