Tape cheat sheet
One page, one command per task, for the HPE MSL 1/8 autoloader and its LTO-9 drive on pbs-01.
The rotation, the pools and the slot plan are in the backup policy;
this page is meant to be open in a terminal.
Everything runs as root on pbs-01. Every proxmox-tape action also exists in the PBS GUI
under Tape Backup.
The model in four lines
- The loader is two SCSI devices: the changer (the robot) moves cartridges between the slots, the mailslot and the drive; the drive reads, writes, rewinds and ejects.
- A cartridge is identified by its barcode sticker (
ISC006L9), which is also its PBS label. - PBS keeps its own inventory of where each cartridge is and what it holds. A cartridge moved by
any other means (front panel, loader web interface,
pmtx,mtx) needsproxmox-tape inventoryafterwards. - A cartridge written by PBS is readable by PBS only, with the encryption key.
taror LTFS on a pool cartridge destroys its content.
Set the drive once per shell, so that no command needs --drive:
export PROXMOX_TAPE_DRIVE=<drive>
Look
| Task | Command |
|---|---|
| Slots, barcodes, what is in the drive | proxmox-tape changer status |
| Drive state, loaded cartridge, position | proxmox-tape status |
| Label of the loaded cartridge | proxmox-tape read-label |
| All cartridges: pool, media set, status, expiry | proxmox-tape media list |
| What is on the cartridges | proxmox-tape media content |
| Wear and remaining capacity (cartridge chip) | proxmox-tape cartridge-memory |
| Read/write error counters | proxmox-tape volume-statistics |
| Running and past tape tasks | proxmox-backup-manager task list, then proxmox-backup-manager task log <UPID> |
Move cartridges
| Task | Command |
|---|---|
| Load by label | proxmox-tape load-media ISC006L9 |
| Load from a slot | proxmox-tape load-media-from-slot 3 |
| Unload the drive to its slot | proxmox-tape unload |
| Unload to a given slot | proxmox-tape unload --target-slot 3 |
| Slot to slot | proxmox-tape changer transfer <changer> 3 5 |
| Send a cartridge to the mailslot | proxmox-tape export-media ISC006L9 |
| Resynchronise PBS after a manual move | proxmox-tape inventory |
| Rewind | proxmox-tape rewind (automatic on unload) |
| Eject without the robot | proxmox-tape eject |
A cartridge that came in through the mailslot is moved to a free slot with changer transfer,
then proxmox-tape inventory.
New cartridges and cleaning
| Task | Command |
|---|---|
| LTO-9 initialization, once per new cartridge | the loader's New Media Initialization Wizard (web interface), up to 2 h, before anything in PBS |
| Label every unlabelled cartridge in the loader | proxmox-tape barcode-label --pool <pool> (no --pool for a spare) |
| Label the loaded cartridge only | proxmox-tape label --label-text ISC006L9 --pool <pool> |
| Erase a cartridge | load it, then proxmox-tape format --fast |
| Remove a cartridge from the PBS inventory | proxmox-tape media destroy ISC006L9 |
| Clean the drive | proxmox-tape clean (takes the CLN cartridge by itself) |
Back up
| Task | Command |
|---|---|
| List the jobs | proxmox-tape backup-job list |
| Run a job now | proxmox-tape backup-job run <job> |
| One-off copy of a datastore to a pool | proxmox-tape backup <datastore> <pool> |
| Pools and their retention | proxmox-tape pool list |
The monthly cartridge: swap procedure.
Restore
| Task | Command |
|---|---|
| Find the media set | proxmox-tape media list (column media-set UUID) |
| Restore a whole media set | proxmox-tape restore <media-set-uuid> <datastore> |
| Restore one snapshot | proxmox-tape restore <media-set-uuid> <datastore> <store>:vm/107/<timestamp> |
| Cartridge unknown to this PBS (rebuilt host) | load it, proxmox-tape inventory, then proxmox-tape catalog |
| Encryption keys known to this PBS | proxmox-tape key list |
| Bring the key back on a rebuilt host | proxmox-tape key restore with the key file or the paper key, and its password |
The key and its password are in the secretzone and on the paper break-glass.
First-time setup
proxmox-tape changer scan
proxmox-tape changer create <changer> --path /dev/tape/by-id/scsi-<id>
proxmox-tape changer update <changer> --export-slots <mailslot number>
proxmox-tape drive scan
proxmox-tape drive create <drive> --path /dev/tape/by-id/scsi-<id>-sg \
--changer <changer> --changer-drivenum 0
proxmox-tape key create --hint "<hint>"
proxmox-tape pool create weekly --encrypt <key fingerprint>
proxmox-tape backup-job create <job> --store <datastore> --pool weekly \
--drive <drive> --schedule <calendar event>
--export-media-set on the monthly job moves the cartridge to the mailslot when the job ends.
Below PBS
Diagnosis only, and never while a tape task runs. PBS ships its own low-level tools; the generic
Linux ones (apt install mtx mt-st sg3-utils lsscsi) do the same.
| Task | PBS tool | Generic Linux |
|---|---|---|
| Find the devices | proxmox-tape changer scan, proxmox-tape drive scan | lsscsi -g — the changer is mediumx on /dev/sgN, the drive /dev/nst0 |
| Robot status | pmtx status | mtx -f /dev/sgN status |
| Slot 3 to the drive | pmtx load 3 | mtx -f /dev/sgN load 3 0 |
| Drive back to slot 3 | pmtx unload --slot 3 | mtx -f /dev/sgN unload 3 0 |
| Slot to slot | pmtx transfer 3 5 | mtx -f /dev/sgN transfer 3 5 |
| Drive status | pmt status | mt -f /dev/nst0 status |
| Rewind | pmt rewind | mt -f /dev/nst0 rewind |
| Rewind and eject | pmt eject | mt -f /dev/nst0 offline |
| Forward / back 2 files | pmt fsf 2 / pmt bsf 2 | mt -f /dev/nst0 fsf 2 / bsf 2 |
| Go to the end of the data | pmt eod | mt -f /dev/nst0 eom |
| Drive alerts | pmt tape-alert-flags | tapeinfo -f /dev/sgN |
| Error counters | pmt volume-statistics | sg_logs -a /dev/sgN |
/dev/st0 rewinds each time it is closed, /dev/nst0 does not: use nst0, otherwise the next
write starts at the beginning of the tape.
A cartridge outside PBS
On a spare cartridge that has no PBS label:
mt -f /dev/nst0 rewind
tar -b 512 -cvf /dev/nst0 /data/a # file 0
tar -b 512 -cvf /dev/nst0 /data/b # file 1, appended
mt -f /dev/nst0 rewind
mt -f /dev/nst0 fsf 1 # position on file 1
tar -b 512 -tvf /dev/nst0 # list it
-b 512 writes 256 KiB blocks; with the 10 KiB default of tar the drive does not reach its
streaming speed.