Includes mt-st package which provides the mt command for interfacing with tape drives, as well as gnu tar.
Also includes cron for scheduling tape backups and restores. Crontab is included in the /config folder and changes require a container restart.
--device /dev/st0 --device /dev/nst0)/config folderBasic facts about tapes and how they are operated with mt and tar:
EOF marker that defines the end of the file./dev/st0 is rewinding device. After each operation, the tape is rewound to the beginning. /dev/nst0 is non-rewinding and the head remains at its location at the end of each operation.mt -f /dev/nst0 status will show the status of the drive head. If it's at a file (vs a block), it will list the File number. If it's at the beginning of a file, it will list EOF at the bottom (except for the first file, which is really called File number=0, which will show BOT indicating the beginning of tape).mt -f /dev/nst0 rewind or mt -f /dev/nst0 asf 0mt -f /dev/nst0 asf Xwith X being the file number (starting from 0)mt -f /dev/nst0 rewind and confirm with status.tar -cvf /dev/nst0 sourcedirectory1 sourcedirectory2.nst0 device, the drive head should be at the beginning of the second file, indicated by File number=1 and EOF in status output.status shows File number=1 and EOF.tar -cvf /dev/nst0 sourcedirectory1 sourcedirectory2, will now write the second tar file and the head should move to File number=1.mt to forward to the end of the tape to be sure.mt -f /dev/nst0 asf X with X being the file number (starting with 0).mt -f /dev/nst0 rewind (or via mt -f /dev/nst0 asf 0).tar -xvf /dev/nst0. It will read the first file all the way to the EOF, and extract it to the local disk.mt -f /dev/nst0 asf 1 and extract via tar -xvf /dev/nst0.There are plenty more mt commands and arguments listed on its manpage: https://linux.die.net/man/1/mt
Never do mt -f /dev/nst0 erase unless you know it's really what you want. The manpage is not clear about it, but it actually does a secure erase, it takes a really long time (8+ hrs) and you can't cancel it once started. Killing or force killing the process doesn't work, docker stop and docker kill fail. The only way is to cut the power to the drive, which could damage the drive head.
Content type
Image
Digest
sha256:d65d9738e…
Size
12.5 MB
Last updated
3 days ago
docker pull aptalca/tape