Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tape labels are overwritten and limited to 6 characters #487

Open
antarean opened this issue Nov 7, 2024 · 3 comments
Open

Tape labels are overwritten and limited to 6 characters #487

antarean opened this issue Nov 7, 2024 · 3 comments

Comments

@antarean
Copy link

antarean commented Nov 7, 2024

Describe the bug
I have set tape-labels on all my tapes.
When using 'mkltfs', these labels are overwritten.
Checking the code, using the "-s" should set the label, but this is limited to 6 characters.
LTO-specification should allow me 8 characters (actually 32)

To Reproduce
Steps to reproduce the behavior:

  1. Store label-barcode on the Tape
  2. use mkltfs to create LTFS
  3. notice the barcode is emptied
  4. try with mkltfs -s ...
  5. notice the barcode is limited to a length of 6

Expected behavior
I would expect existing barcodes to not be overwritten or at least allow 8 character barcodes.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [Linux]

Additional context
Add any other context about the problem here.

In the LTFS Format Specification v2.4 (page 54) Barcode is defined as being 32 bytes in length.
Page 56 shows an example of the barcode: 6 characters, then tape-type, f.e. L8
I want to keep using the full barcode as all my tapes are identified using the full barcode when loading them into the drive.

@piste-jp
Copy link
Member

piste-jp commented Nov 8, 2024

What you are talking about is BARCODE field in the Host-type MAM Attributes described into section 10.4 (on the LTFS spec 2.4).

Indeed it is defined as 32-byte wide. But barcode stuff is really complicated. Please read through the section 10.4.6 also, especially NOTE: describes really important things.

From implementation perspective, the most important element is the barcode field of the ANSI VOL1 label, it is 6-byte long. So mkltfs can accept only 6-byte barcode and it put the specified barcode value into VOL1 and MAM. (One more field is existed in the CM but it cannot be touched from LTFS, library put a value provided by physical label automatically.)

I never recommend as the LTFS spec says, you can overwrite barcode value in MAM via VEA ltfs.mamBarcode, this VEA updates only MAM value, barcode in the VOL1 cannot be changed at all.

@antarean
Copy link
Author

antarean commented Nov 8, 2024

Hi piste-jp,

Thank you for your reply.
I am definitely not asking for the VOL1 to be adjusted.
I looked at the code and that would take a while and I have no idea where it is used.

For me, the important one is the barcode-field in the chip/MAM.

Is there a reason why the following can't be done:

  1. user specifies a barcode that is longer then 6 characters (8 in my case)
  2. the full barcode is used for the MAM (chip on the tape)
  3. the first 6 characters is used for the VOL1

If this is possible, then I think, as a next step, it would be possible to read the barcode from the tape and use that instead of an empty string for " mkltfs " ?

@piste-jp
Copy link
Member

I looked at the code and that would take a while and I have no idea where it is used.

It is not only for LTFS, but for other tape based softwares. They might check the VOL1 and recognize this tape is already used by LTFS.

Is there a reason why the following can't be done:

Hmm, I'm not sure this idea is good for backward compatibility. My counter proposal is introducing new option for handling long barcode like --long-label or something into mkltfs.

If this is possible, then I think, as a next step, it would be possible to read the barcode from the tape and use that instead of an empty string for " mkltfs " ?

Sorry, I cannot understand what you are saying. I don't think barcode value is automatically set by other hardwares like library. And label value shall be based on the physical label on the tape...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants