Load virtual tape drives directly
Lets start by assuming you’ve already installed mhvtl, you have a few virtual tape drives, a media changer, and a bunch of virtual tapes. If you haven’t installed mhvtl yet, I wrote a
You can control the media changer or library device using /dev/changer. It doesn’t show up under lsscsi, but the “changer” character device is associated with it. Using the MTX utilities, you can ask the changer to load tapes into drives and list map, etc. But i’ve found it’s actually easier for testing to control the drives directly. You can load and unload tapes directly into and out of a drive by barcode label and tape drive queue.
“000001S3″ is the barcode of my first tape, which is stored as a regular file under /opt/vtl/
# file /opt/vtl/000001S3
/opt/vtl/000001S3: X11 SNF font data, LSB first
Now that you know that, forget about it. You won’t need to mess with those files directly.
To load a tape into a drive:
vtlcmd 1 load 000001S3
vtlcmd 2 load 000107S3
You can unload a drive by just referring to the drive without specifying the tape’s barcode label.
vtlcmd 1 unload
vtlcmd 2 unload
I got the drive numbers for the tape drives, which are “1″ and “2″, by looking at which vtltape’s processes are running:
# ps -ef | grep vtltape
vtl 5701 1 0 Oct23 ? 00:00:00 vtltape -q1
vtl 5712 1 0 Oct23 ? 00:00:00 vtltape -q2
vtl 5790 1 0 Oct23 ? 00:00:00 vtltape -q3
The character device files that these drives refer to appear to be in 1,2,3 order:
[6:0:0:1] tape QUANTUM SDLT600 5400 /dev/st0
[6:0:0:2] tape QUANTUM SDLT600 5400 /dev/st1
[6:0:0:3] tape IBM ULT3580-TD4 5400 /dev/st2