Linux device persistence for Data Protector

Device persistence on Linux is not as hard as it seems. Current releases of all major distributions (RHEL and SLES) come with preconfigured udev rules. They will create aliases in the device filesystem in /dev/tape which is pretty handy. The name of the alias will vary, depending of the device but will remain consistent across reboots on different hosts. The original /dev/st* and /dev/nst* files will not be changed at all.

Sure, you can add additional rules, but this won’t make things better. It is a good practice to avoid the device serial number in the name as the S/N will change if the drive is replaced. A device WWID will remain if the library overwrites it. And also keep in mind, if Linux uses an initrd image, you’ll have a hard time making the st, nst and sg devices persistent across reboots.

As you might know, Data Protector uses nst Devices for Tape and sg Devices for Changers by default. You can check this using devbra.

[root@rhel /]# /opt/omni/lbin/devbra -list

device: MEDIA CHANGER; host: "rhel.syncer.de"
port: 0; path: 0; target: 0; lun: 0; Path: "/dev/sg46"
Vendor: "HP"; product: "MSL G3 Series"; revision: "7.30"; serial: "DEC00000AA"
Description: "HP StorageWorks MSL 2024 G3 Series"
presuming drives of type: "LTO: HP Ultrium drive"
S1 = 1001; Sn = 48; D1 = 1; Dn = 2; T1 = 0; Tn = 1; X1 = 101; Xn = 0
Drive 0 serial: "HU00000001"
Drive 1 serial: "HU00000002"

device: DRIVE; host: "rhel.syncer.de"
port: 0; path: 0; target: 0; lun: 0; Path: "/dev/nst1"
Vendor: "HP"; product: "Ultrium 4-SCSI"; revision: "H61W"; serial: "HU00000002"
Description: "HP LTO4 Drive"
device type: "LTO: HP Ultrium drive"

device: DRIVE; host: "rhel.syncer.de"
port: 0; path: 0; target: 0; lun: 0; Path: "/dev/nst0"
Vendor: "HP"; product: "Ultrium 4-SCSI"; revision: "H61W"; serial: "HU00000001"
Description: "HP LTO4 Drive"
device type: "LTO: HP Ultrium drive"

But as mentioned earlier, there are some really useful symlinks in the device filesystem that will provide device persistence by default, regardless of what Data Protector is going to use.

[root@rhel /]# ls -al /dev/tape/by-id/*
lrwxrwxrwx 1 root root 10 Sep 13 2010 /dev/tape/by-id/scsi-350014380032b0c08 -> ../../sg46
lrwxrwxrwx 1 root root 10 Sep 13 2010 /dev/tape/by-id/scsi-350014380032b0c09-nst -> ../../nst0
lrwxrwxrwx 1 root root 10 Sep 13 2010 /dev/tape/by-id/scsi-350014380032b0c0f-nst -> ../../nst1

The idea is to use those device nodes in Data Protector. You can use mt or scsi_info to verify proper operation.

[root@rhel /]# scsi_info /dev/tape/by-id/scsi-350014380032b0c08
SCSI_ID="0,0,2,1":VENDOR="HP":MODEL="MSL G3 Series":FW_REV="7.30":WWN="50001fe1500c1d60":LUN="50014380032b0c08-0201002248502020"

As a good starting point I always recommend to autoconfigure the devices, then rename and configure them as required. Use devices names without any special chars and avoid blanks. Multipath devices require SAN drive licenses, but allow LAN free backups afterwards.


You can add a single or multiple device paths to a robotic device. In our case add the persistent device file found in /dev/tape/by-id here. Under normal circumstances, a single host is enough but for failover purposes alternates are ok. Change the other settings to busy drive handling = Eject, enable barcode scanner if supported and use SCSI reserve/release to make sure no other hosts will not cause interruptions during operation.


The drive should be multipath as well. A clear name helps to identify the drive.


Add the persistent device file found in /dev/tape/by-id here.


Assign a default pool to each drive. I usually use the same default pool for all drives of the same type or library.


Configure the drive advanced settings as follows. Disable autocleaning on the library and enable detect dirty drive to let Data Protector take care of the drive maintenance. SCSI reserve/release makes the read and write operation more safe and rescan causes an library inventory update (barcode scan) when the drive is used.


Use at least 256k block size on LTO3, LTO4 and LTO5 drives. If you’re unable to format media afterwards, check if the HBA or driver is capable of the block size. More agent buffers allocate more memory during backup.


You should rename the Device Lock Name to the name of the drive to keep things consistent.


A device policy helps Data Protector to choose free drives for automatic replacement during object copy and restore. By using this option you can exclude some of your drives from such tasks.


You can upload the device configuration of the library and the drives using omniupload if you want to load the configuration in your own cell.

C:\>omnidownload -library MSL4048
NAME "MSL4048"
DESCRIPTION "HP StorageWorks MSL4048"
HOST rhel.syncer.de
POLICY SCSI-II
TYPE LTO-Ultrium
SHAREDLIB
BARCODEREADER
BUSYDRIVETOSLOT
BARCODE_AS_LABEL
SANSTABLEADDR
IOCTLSERIAL "DEC00000AA"
CONTROL "/dev/tape/by-id/scsi-350014380032b0c0"
REPOSITORY
"1"
"2"
"3"
"4"
"5"
"6"
"7"
"8"
"9"
"10"
"11"
"12"
"13"
"14"
"15"
"16"
"17"
"18"
"19"
"20"
"21"
"22"
"23"
"24"
"25"
"26"
"27"
"28"
"29"
"30"
"31"
"32"
"33"
"34"
"35"
"36"
"37"
"38"
"39"
"40"
"41"
"42"
"43"
"44"
"45"
"46"
"47"
"48"
MULTIPATH
"rhel.syncer.de";"/dev/tape/by-id/scsi-350014380032b0c0"
"sles.syncer.de";"/dev/tape/by-id/scsi-350014380032b0c0"
MGMTCONSOLEURL ""
C:\>omnidownload -device MSL4048_D1
NAME "MSL4048_D1"
DESCRIPTION "HP LTO4 Drive"
HOST rhel.syncer.de
POLICY SCSI-II
TYPE LTO-Ultrium
POOL "MSL4048_Default"
LIBRARY "MSL4048"
CONCURRENCY 8
SHAREDDRIVE
CLEANME
ENCRCAPABLE
RESCAN
SEGSIZE 20000
BUFFERS 32
DRIVES
"/dev/tape/by-id/scsi-350014380032b0c09-nst"
"1"
MULTIPATH
"rhel.syncer.de";"/dev/tape/by-id/scsi-350014380032b0c09-nst"
"sles.syncer.de";"/dev/tape/by-id/scsi-350014380032b0c09-nst"
BLKSIZE 256
LOCKNAME  "MSL4048_D1"
SANSTABLEADDR
DEVSERIAL "HU00000001"
DEVICESUBTYPE "MSL4048"
RESTOREDEVICEPOOL YES
COPYDEVICEPOOL YES
C:\>omnidownload -device MSL4048_D2
NAME "MSL4048_D2"
DESCRIPTION "HP LTO4 Drive"
HOST rhel.syncer.de
POLICY SCSI-II
TYPE LTO-Ultrium
POOL "MSL4048_Default"
LIBRARY "MSL4048"
CONCURRENCY 8
SHAREDDRIVE
CLEANME
ENCRCAPABLE
RESCAN
SEGSIZE 20000
BUFFERS 32
DRIVES
"/dev/tape/by-id/scsi-350014380032b0c0f-nst"
"2"
MULTIPATH
"rhel.syncer.de";"/dev/tape/by-id/scsi-350014380032b0c0f-nst"
"sles.syncer.de";"/dev/tape/by-id/scsi-350014380032b0c0f-nst"
BLKSIZE 256
LOCKNAME  "MSL4048_D2"
SANSTABLEADDR
DEVSERIAL "HU00000002"
DEVICESUBTYPE "MSL4048"
RESTOREDEVICEPOOL YES
COPYDEVICEPOOL YES

 

Leave a Reply