by j_not_j · 2w ago · 0 comments
Buying a Sony or IBM HSM with 20GB tapes backing a 5TB store (built with 2GB disks) soon looks pretty stupid when drives exceeded 40 and 80GB. (Adjust your calendar or drive scaling to match your expectations.)
Back in the day I worked on a quote for a European weather agency who wanted a CD-ROM archive built with robots. CD-ROM! DVD-R was just coming up in those days. The effective product lifespan would only have been 2 or 3 years until large scale enterprise disk would have superceded it.
Nowadays with multi-TB tapes the minimum viable archivable unit is in the gigabytes. Nobody would be 2million files on a single LTO tape.
HSM is really a product category: do you want write-only archive (think weather data, satellite images, etc). Are some files expirable so you want to actually eventually "delete" files by re-writing tapes with only valid data? What's the allowable time-to-first-byte on retrieval? What kind of redundancy is appropriate? What is the operating cost vs capital cost tradeoff? And, importantly, what database is supporting the metadata and how is it maintained?
Antipatterns:
- grep on a caching filesystem backed with a tape library - monthly retrievals of the same file year after year (even LTO has a limited tape operation lifetime) - management failure/refusal to migrate to newer tech every 4 years - buying 10 years of capacity in advance
You can get a lot done with tar, mt, and bash in a grow-your-own nearline archive with a tape technology of your choice.
The general idea was:
- support multiple tapes and duplicate tapes - all tape handling is manual (issue text message "mount tape TX003 please") - first file on tape is a tar file with a tape serial number as the file name. Check this at tape mount time. - to archive: add a file at the end of the tape (mt to position at EOT) - detect write-past EOT with an mt error; this wasn't too reliable tho, mtx might be better. If detected, request next tape. - the database ("directory") is up to you. A text file with tape name, file number and filename allows to use mt to FSF to the file number for retrieval. Or echo this to a distinct file in a directory. How you expect to retrieve should guide you here.
Good luck and happy coding.
This was done on IRIX with bash; probably a couple hundred lines or less.
1. to write a new file, forward space to end of written files (FSF) which by convention is two consecutive filemarks. Backspace one filemark, then write the file. Then write two filemarks.
2. I mistakenly wrote "write-past EOT" but it is end-of-media (EOM) that can happen writing a file. At that point your policy might be only complete files per tape so you backspace to previous filemark, write the second filemark ("logical end of media") and then ask for a new tape.
Files have to be written blockwise (use dd or tar or pax or cpio).