|
Just my personal, quick and dirty notes |
|
|
|
|
|
A tape LIBRARY or changer contains one or more tape DRIVES and they are addressed/used independently of one another (mostly) |
|
|
|
`mt` command is for tape drive(s) |
|
`mtx` command is for tape library/changer |
|
|
|
The library has the robot arm for moving tapes around, and slots for storage. The drives are... well, the drives. Like a VCR, for data. I guess then the library is like the Blockbuster. But for data. |
|
|
|
Danger: tape is easy to accidentally overwrite! Especailly if you simply access the /dev/st0 auto-rewinding device, instead of the /dev/nst0 non-auto-rewinding device! |
|
|
|
It will rewind your tape, and other stuff already writing to it... can keep writing to it, not realizing it's been rewound! |
|
|
|
Poof, flagrant tape error, data over = very yes! |
|
|
|
Tapes contain very useful physical switches to make them read-only... use them! Just slide it over, and the tape will become read-only, like the floppy disks in the old days had |
|
|
|
I often do this when keeping tapes in the library. This way, even if someone wanted to maliciously destroy data, they could not, without going down and physically sliding over the read-only switches on the tapes |
|
|
|
Tape libraries additionally have I/O bays, usually a small module of x tapes, that slides out. This is how you take tapes into and out of the library, and how libraries move tapes to other libraries (within the same rack, up and down) |
|
|
|
Tape is sensitive to temp/humidity changes, and should be left to acclimate to the environment it's in before use |
|
(Several hours if say, it was frozen. Don't freeze your tapes! Keep them climate controlled, 64-74F, 20%-50% RH) |
|
|
|
Tape should be stored vertically, long-term, for archival. Pulled every 3-5 years and verified or re-tensioned. |
|
|
|
Useful commmands: |
|
|
|
`lsscsi -g` |
|
|
|
`mtx status` - get status of tape library |
|
|
|
`mtx -f /dev/sg1 status` |
|
|
|
# load and unload slot 27 to/from drive 0 |
|
# NOTE: drive order in mtx may not match SCSI order! Check with sg_logs below and |
|
# match by tape label |
|
mtx -f /dev/sg1 load 27 0 |
|
mtx -f /dev/sg1 unload 27 0 |
|
|
|
`sg_logs -p 0x17 /dev/sg2` |
|
|
|
mtx -f /dev/sg1 eepos 0 transfer 29 27 |
|
|
|
tapestat --human 1 |
|
|
|
mt -f /dev/nst1 status # status of tape drive (not library, that's mtx) |
|
mt -f /dev/nst1 rewind # rewind to beginning |
|
mt -f /dev/nst1 fsf 1 # move forward 1 file |
|
mt -f /dev/nst1 eod # end of data |
|
mt -f /dev/nst0 rewoffl # rewind offline |
|
|
|
tapeinfo -f /dev/sg1 |
|
|
|
LTFS exists, and should be used, it rocks so far in my experience. I think there's an IBM version, a HPE version, and a open source version that are all slightly different maybe? (need to investigate further) |
|
|
|
https://github.com/LinearTapeFileSystem/ltfs |
|
|
|
Also download and use "IBM Tape Diagnostic Tool" for IBM drives |
This is basically just a dump of all my purpose-built, quick and dirty scripts related to tape drives/libraries
Should be used with caution etc