Kontrolle einer virtuellen Library unter Linux

 

In diesem Beispiel wurde eine virtuelle Library, durch eine HPE StoreOnce VSA bereitgestellt, verwendet. 

Siehe : Linux iSCSI Anbindung an eine vituelle Tape Libray

 

Folgende Geräte wurden auf der Linux Seite erkannt:

# lsscsi
[3:0:0:0]    tape    HP       Ultrium 4-SCSI   ED41  /dev/st0
[4:0:0:0]    tape    HP       Ultrium 4-SCSI   ED41  /dev/st1
[5:0:0:0]    tape    HP       Ultrium 4-SCSI   ED41  /dev/st2
[6:0:0:0]    tape    HP       Ultrium 4-SCSI   ED41  /dev/st3
[7:0:0:0]    mediumx HP       MSL G3 Series    EL31  /dev/sch0

 

Mittels devbra können wir die Ausgabe der Geräte umfangreicher gestallten und testen wie Data Protector diese anzeigen würde:

 

# devbra -devices

Exch    HP:MSL G3 Series  Path: "/dev/sg7"  SN: "ZZ002C1088"
        Description: HP StorageWorks MSL 2024 G3 Series
        Revision: EL31  Flags: 0x0006  Slots: 48  Drives: 4
        Drive(s) SN:
                "ZZ002C1000"
                "ZZ002C1001"
                "ZZ002C1002"
                "ZZ002C1003"

Tape    HP:Ultrium 4-SCSI  Path: "/dev/nst3"  SN: "ZZ002C1003"
        Description: HP LTO4 Drive
        Revision: ED41  Device type: lto [13]  Flags: 0x0001

Tape    HP:Ultrium 4-SCSI  Path: "/dev/nst2"  SN: "ZZ002C1002"
        Description: HP LTO4 Drive
        Revision: ED41  Device type: lto [13]  Flags: 0x0001

Tape    HP:Ultrium 4-SCSI  Path: "/dev/nst1"  SN: "ZZ002C1001"
        Description: HP LTO4 Drive
        Revision: ED41  Device type: lto [13]  Flags: 0x0001

Tape    HP:Ultrium 4-SCSI  Path: "/dev/nst0"  SN: "ZZ002C1000"
        Description: HP LTO4 Drive
        Revision: ED41  Device type: lto [13]  Flags: 0x0001

 

Nun wollen wir mit der Library arbeiten. Dazu verbinden wir uns mit dieser durch das uma Tool.

# uma -ioctl /dev/sch0
*** PROGRAM: UMA        VERSION: Micro Focus Data Protector Micro Focus Data Protector A.10.50: UMA, internal build 125, built on Tue 20 Aug 2019 12:27:51 AM CEST

*** © Copyright 2019 Micro Focus or one of its affiliates.
*** License is restricted for use with licensed
*** Micro Focus Data Protector products.

/dev/sch0> stat
Element Status (T=Transport, X=Im/Export, D=Drive, S=Storage):
          0 T1   Empty  "" ""

        448 X1   Full   "" ""

        480 D1   Empty  "" ""
        481 D2   Empty  "" ""
        482 D3   Empty  "" ""
        483 D4   Empty  "" ""

         32 S1   Full   "" ""
         33 S2   Empty  "" ""
         34 S3   Full   "" ""
         35 S4   Full   "" ""
         36 S5   Full   "" ""
         37 S6   Full   "" ""
         38 S7   Full   "" ""
         39 S8   Full   "" ""


. . .

 

 Innerhalb des Tools sind verschiedene Befehle vorhanden:

/dev/sch0> help
Commands:
        inq                      read SCSI inquiry data
        res                      reserve ioctl device
        rel                      release ioctl device
        init                     init element status
        addr                     read element addresses
        offl <drive>             put drive off-line
        sense                    read sense data
        modesense [page]         read mode sense data
        pos <slot>               position element
        move <from> <to> [0|1]   move element
        stat {[<slot>|D|T|X|S]}  read element status
        test                     test unit ready
        doorlock [1|0]           locking or unlocking library door
        bye, exit, quit          terminate program execution

 

So können wir nun ein Band aus dem Slot 1 in das Drive 1 bewegen.

/dev/sch0> move S1 D1
/dev/sch0> stat D
        480 D1   Full   "" "" from S1
        481 D2   Empty  "" ""
        482 D3   Empty  "" ""
        483 D4   Empty  "" ""

/dev/sch0> stat S
         32 S1   Empty  "" ""
         33 S2   Empty  "" ""
         34 S3   Full   "" ""
         35 S4   Full   "" ""
...

 

Da nun ein Band im Laufwerk eingelegt ist,
können wir mit Linux darauf zugreifen und ein tar Backup erzeugen (/etc/iscsi) und auch kontrollieren:

# tar cvf /dev/st0  /etc/iscsi/
tar: Removing leading `/' from member names
/etc/iscsi/
/etc/iscsi/iscsid.conf
/etc/iscsi/initiatorname.iscsi


# tar tvf /dev/st0
drwxr-xr-x root/root         0 2019-11-09 11:38 etc/iscsi/
-rw------- root/root     12327 2019-08-09 01:58 etc/iscsi/iscsid.conf
-rw-r--r-- root/root        50 2019-11-09 11:08 etc/iscsi/initiatorname.iscsi