Hello all,
Consulting https://eoscta.docs.cern.ch/install/start/, I see there’s a tape label step with a particular format for the tape label that’s written to the first file space on the tape.
Is there an exact format that’s required for this particular block?
The tape format of CTA is identical to the format of CASTOR.
This is documented but admittedly not very easy to find: you can find details of the format in the CASTOR Tape Server Handbook, section 1.6.5.1 CASTOR File Format.
1 Like
Thankyou Michael,
For my sanity, I put together a simple bash script to bulk label media using that format. The relevant snippet for formatting the label was, with the variable being BARCODE for the tape’s barcode label, and using \x20 to ensure future-me remembers it’s a space and not some other magic whitespace:
printf -v VOLUMEINDICATOR "%-4.4s" "VOL1"
printf -v VOLUMESERIAL "%-6.6s" "${BARCODE}"
printf -v ACCESSIBILITY "\x20"
printf -v RESERVEDFORFUTURE "\x20%.0s" {1..13}
printf -v IMPLEMENTATIONID "\x20%.0s" {1..13}
printf -v OWNERID "%-14.14s" "CASTOR"
printf -v RESERVED "\x20%.0s" {1..28}
printf -v STANDARDLABEL "3"
printf -v LABEL "%s%s%s%s%s%s%s%s" \
"${VOLUMEINDICATOR}" \
"${VOLUMESERIAL}" \
"${ACCESSIBILITY}" \
"${RESERVEDFORFUTURE}" \
"${IMPLEMENTATIONID}" \
"${OWNERID}" \
"${RESERVED}" \
"${STANDARDLABEL}"
For further explanation, that I wrote the bash code to label the tape, because it was a little non-obvious why Logical Block Protection was failing with cta-tape-label. If using MHVTL for testing, I had to make sure the product identification of the drive was set to MHVTL, otherwise CTA used a generic tape mode, and tried to use LBP. As I wanted to understand the on tape format further, the detour was worthwhile.
The MHVTL install documentation for CTA has the virtual drives with product identification of T10000B, the CI generate_mhvtl_config.sh script is creating the device with a product identification of MHVTL.
I see the Install CTA documentation has a dd(1) method for labeling tapes, the CI scripts use cta-tape-label, is one method preferred over another?
cta-tape-label
is the correct method, as it makes certain checks before labelling the tape (tape must be present in the catalogue and must be empty). Also tapes must have the same label as before, or the oldLabel
option must be specified, to prevent accidentally relabelling a tape with a different label.
By default, tapes are labelled with LBP enabled if the drive supports it.
In this case (as in many others…) the documentation is out-of-date: the dd
method for labelling tapes is deprecated.
1 Like