Question

I can read a LTO Tape without problem in C#.

There is also a Cartridge Memory (LTO-CM) in each cartridge. http://en.wikipedia.org/wiki/Linear_Tape-Open

How can I read/write some bytes in this chip in C#, or C?

Was it helpful?

Solution

There's this project in C: https://github.com/scangeo/lto-cm

It is made to read and write the "text attribute" that is supposed to be used by applications or users. Most of the other fields are reserved for the drive and tape vendors and manufacturers.

It uses the reader integrated in the tape drives through SCSI commands.

For now it has been tested with HP and IBM LTO-4 drives and probably needs some tuning for other hardware. For some reason it also works only with some SCSI cards.

We use it to write a tape label identifying the tape and providing a complete MD5 checksum of the tape, for future integrity checks, that we calculate after writing the whole tape.

OTHER TIPS

Looks like there are no common/generic means to read LTO cartridge memory neither in C# .NET nor in other programming language/framework.

There can be only particular drive model(s) specific tools written in .NET for that purpose. You might find it on web sites of manufacturers.

According to this post from ADSM.ORG:

in order read the CM [Cartridge Memory] contents, we need to access it through the particular drive's interface, not the API for the CM itself.

The method for accessing that information probably uses proprietary extensions for each drive manufacturer. Mine are HP drives, and HP has a Tape Tools package.

Nevertheless - according to this answer by Richard Sims from ADSM.ORG website - you can still access cartridge memory with SCSI commands:

vendors don't consider that customers should need to access the Medium Auxiliary Memory (MAM) - the industry generic name for an in-cartridge non-volatile memory chip which tracks usage and other info.

The manual "IBM TotalStorage LTO Ultrium Tape Drive - SCSI Reference" (GA32-4050) fully describes their MAM and how to read and write it via SCSI commands.

The device driver programming manual (in this case, "IBM Ultrium Device Drivers - Programming Reference (GC35-0483)) provides many ioctl functions which make it easier for a programmer to invoke what resolve to SCSI commands; but in this case I see no ready operation for getting MAM data.

Those ioctl operations are what the handy-dandy ntutil and tapeutil commands invoke to acquire info, and I see nothing in their doc saying that they can return it (though it might be implicitly returned from other operations).

Here is yet another Linux software for reading LTO cartridge memory. This software supports more attributes over lto-cm.

Also, you can use a generic RFID card reader such as Proxmark3 or ACR122u instead of LTO drives.

https://github.com/RfidResearchGroup/proxmark3

https://github.com/philpem/nfc-ltocm

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top