Home>Computers>Make lto-cm compile

Make lto-cm compile

lto-cm doesn’t compile, here are some tips!

Those of you who are looking to check out the lto-cm utility located here https://github.com/scangeo/lto-cm may find that the damn thing doesn’t compile. Here are some quick notes that allowed me to get it up and running. Many thanks to my friend Kevin for discovering this. I have decided to post it up here as a reference for the other folks who want to try this software out. 

First of all you need to modify lto-cm.c . The #include directives for sg_lib.h and sg_io_linux.h need to have the folder include/ prepended to them. The header files were moved to the include directory but the source was not updated to reflect that change. 

Second, you will need to download the sg3_utils source and compile it so you have the appropriate modules you need to compile lto-cm. 

Finally to compile the software you can issue the following command:


gcc lto-cm.c /path/to/sg3_utils/lib/*.o -o lto-cm

What is lto-cm?

So by this point you might be wondering, what the heck does lto-cm do? Well, this is in relation to tapes. On each tape there is an RFID tag and the LTO specification leverages this to store statistics about each tape onto the tag. 

lto-cm demonstrates utilizing the sg3 libraries to read and write to the user label attribute within this RFID tag on each tape. This could be used in backup software to identify each tape beyond just each physical label. (for instance in the event the label gets lost) You are allowed up to 160 characters in the user label on the tape.

lto-cm reading the empty user label slot on a tape.
lto-cm reading the user label data from tape RFID chip.
Writing some data to the RFID chip using lto-cm

So you can modify this program to read other bytes. There are many things stored in the RFID. Documentation on this starts at page 355 (page 381) in the document “IBM LTO SCSI Reference”. This document is presently located at: https://www-01.ibm.com/support/docview.wss?uid=ssg1S7003556&aid=1

Look at Section 6.5 “Medium auxiliary memory attributes (MAM)… I’ll also include / attach the PDF file to this post incase the IBM link breaks.

Rate this post