Reading LTO cartridge memory

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Reading LTO cartridge memory

Paul Groves-2
Does anyone have a clue how to read the cartridge memory from an LTO
tape? Surely there must exist a command to do such a thing.

I want to add into my script the ability to read the serial number /
cartridge usage to be included in my log files.

Also, how do I set the barcode tag on the cartridge? I would also like
to do this in a script.


--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Reading LTO cartridge memory

Darin Perusich-3
Many moons ago, when I actually did tape backups and had a library,
the mtx command could read barcodes off tapes if your library had
barcode reader. I know it worked with Exabyte and Sun libraries, and I
was using Amanda for backups and it supported it. You'd label your
tables with amlabel, written at the beginning of the tape, and it
stored the barcode in a file for the backup set.
--
Later,
Darin


On Tue, Sep 12, 2017 at 9:41 AM, Paul Groves <[hidden email]> wrote:

> Does anyone have a clue how to read the cartridge memory from an LTO tape?
> Surely there must exist a command to do such a thing.
>
> I want to add into my script the ability to read the serial number /
> cartridge usage to be included in my log files.
>
> Also, how do I set the barcode tag on the cartridge? I would also like to do
> this in a script.
>
>
> --
> To unsubscribe, e-mail: [hidden email]
> To contact the owner, e-mail: [hidden email]
>

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Reading LTO cartridge memory

gregfreemyer
In reply to this post by Paul Groves-2
On Tue, Sep 12, 2017 at 9:41 AM, Paul Groves <[hidden email]> wrote:
> Does anyone have a clue how to read the cartridge memory from an LTO tape?
> Surely there must exist a command to do such a thing.

I too have fantasized about reading that data myself in the past.

Every LTO cartridge (including cleaning cartridges) is said to have a
cartridge memory.  And every LTO drive has a non-contract cartridge
memory reader.

I'm not aware of any way for the host server to ask the LTO drive for
info originating there, nor to provide data to write there.

> I want to add into my script the ability to read the serial number /
> cartridge usage to be included in my log files.
>
> Also, how do I set the barcode tag on the cartridge? I would also like to do
> this in a script.

I'm not sure what you're asking.

Do you have a tape library with a built-in barcode reader?  If so, I
think normally you physically attach the barcodes, then when you load
the media, the library inventories the tapes you loaded by reading the
barcodes.

So, the barcode is a physical label you have to attach.

Greg

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Reading LTO cartridge memory

Paul Groves-2
On 12/09/17 20:01, Greg Freemyer wrote:
> On Tue, Sep 12, 2017 at 9:41 AM, Paul Groves <[hidden email]> wrote:
>> Does anyone have a clue how to read the cartridge memory from an LTO tape?
>> Surely there must exist a command to do such a thing.
> I too have fantasized about reading that data myself in the past.
>
> Every LTO cartridge (including cleaning cartridges) is said to have a
> cartridge memory.  And every LTO drive has a non-contract cartridge
> memory reader.
It is true. I repaired a cartridge with a mising leader pin so got a
good look inside.

On the bottom of the cartridge on the label end opposite corner to the
write protect tab there is a rf chip. If you look in the front of the
drive just below the right hand edge you will see the receiver (labelled
rf in my HP drive).

I have read up about it and apparently you can read /write the data by
issuing SCSI commands. I would not have a clue how to do this.

look up CRCM2159.pdf from HP I would add a link to the file but I cannot
because the mail list refuses it.
> I'm not aware of any way for the host server to ask the LTO drive for
> info originating there, nor to provide data to write there.
There must be a way because several backup programs can do it.

>> I want to add into my script the ability to read the serial number /
>> cartridge usage to be included in my log files.
>>
>> Also, how do I set the barcode tag on the cartridge? I would also like to do
>> this in a script.
> I'm not sure what you're asking.
>
> Do you have a tape library with a built-in barcode reader?  If so, I
> think normally you physically attach the barcodes, then when you load
> the media, the library inventories the tapes you loaded by reading the
> barcodes.
The barcode tag on the LTO cartridge memory which electronically stores
the barcode number. HP LTT shows this number if set.

All LTO drives can read this data from the chip as it is part of the LTO
standard regardless of if they are in a library. The only reason I see
to put the label on is for humans to read the cartridge, or perhaps for
libraries to pick the tape cartridge without having to insert it and
read the chip thinking about it.
> So, the barcode is a physical label you have to attach.
>
> Greg

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Reading LTO cartridge memory

Per Jessen
Paul Groves wrote:

> I have read up about it and apparently you can read /write the data by
> issuing SCSI commands. I would not have a clue how to do this.
>
> look up CRCM2159.pdf from HP I would add a link to the file but I
> cannot because the mail list refuses it.

Um, there's nothing that prevents links being added/sent, but with the
name, google also easily found it:

https://docs.oracle.com/cd/E21407_01/en/CRCM2159/CRCM2159.pdf

>> I'm not aware of any way for the host server to ask the LTO drive for
>> info originating there, nor to provide data to write there.
>
> There must be a way because several backup programs can do it.

If any of those are open source, that's where to find out.

I would offer a guess and say some scsi command to /dev/sgX, a bit a la
mtx.


--
Per Jessen, Zürich (11.4°C)
http://www.hostsuisse.com/ - virtual servers, made in Switzerland.


--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Reading LTO cartridge memory

Per Jessen
Per Jessen wrote:

> Paul Groves wrote:
>
>> I have read up about it and apparently you can read /write the data
>> by issuing SCSI commands. I would not have a clue how to do this.
>>
>> look up CRCM2159.pdf from HP I would add a link to the file but I
>> cannot because the mail list refuses it.
>
> Um, there's nothing that prevents links being added/sent, but with the
> name, google also easily found it:
>
> https://docs.oracle.com/cd/E21407_01/en/CRCM2159/CRCM2159.pdf

>From a quick browse of the above, I noticed the chip feature is referred
to as LTO-CM.  I went and googled that and quickly found this:

https://github.com/scangeo/lto-cm

"Read and write an LTO tape's cartridge memory chip ".



--
Per Jessen, Zürich (12.9°C)
http://www.hostsuisse.com/ - dedicated server rental in Switzerland.


--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Reading LTO cartridge memory

Andrei Borzenkov
On Wed, Sep 13, 2017 at 10:13 AM, Per Jessen <[hidden email]> wrote:

> Per Jessen wrote:
>
>> Paul Groves wrote:
>>
>>> I have read up about it and apparently you can read /write the data
>>> by issuing SCSI commands. I would not have a clue how to do this.
>>>
>>> look up CRCM2159.pdf from HP I would add a link to the file but I
>>> cannot because the mail list refuses it.
>>
>> Um, there's nothing that prevents links being added/sent, but with the
>> name, google also easily found it:
>>
>> https://docs.oracle.com/cd/E21407_01/en/CRCM2159/CRCM2159.pdf
>
> >From a quick browse of the above, I noticed the chip feature is referred
> to as LTO-CM.  I went and googled that and quickly found this:
>
> https://github.com/scangeo/lto-cm
>
> "Read and write an LTO tape's cartridge memory chip ".
>

It only reads/writes single attribute - 0803h "USER MEDIUM TEXT
LABEL". It can be used as example how to integrate handling of more
attributes; in particular barcode is attribute 0806h.

Someone may want to merge in tapeutil patches from
http://www.mesa.nl/pub/tapeutil/ (no idea about license issues) which
also display some additional log pages (which likely provide values
from MAM at the end).

But one should not forget that most "interesting" information in CM is
vendor specific, with little chances to implement. It is enough for
simple purposes like storing meaningful description or matching
barcode though.

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Reading LTO cartridge memory

Paul Groves-2


On 13/09/17 13:18, Andrei Borzenkov wrote:
> It only reads/writes single attribute - 0803h "USER MEDIUM TEXT
> LABEL". It can be used as example how to integrate handling of more
> attributes; in particular barcode is attribute 0806h.
Is it possible to use  program such as sg_raw to access that SCSI
address directly?
Therefore being able to read it. But then how to write to it...?

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Reading LTO cartridge memory

Andrei Borzenkov
16.09.2017 13:20, Paul Groves пишет:
>
>
> On 13/09/17 13:18, Andrei Borzenkov wrote:
>> It only reads/writes single attribute - 0803h "USER MEDIUM TEXT
>> LABEL". It can be used as example how to integrate handling of more
>> attributes; in particular barcode is attribute 0806h.
> Is it possible to use  program such as sg_raw to access that SCSI
> address directly?

Yes, of course.

> Therefore being able to read it. But then how to write to it...?
>

How is writing different? You send the right command to the device ...

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Reading LTO cartridge memory

Paul Groves-2


On 16/09/17 11:29, Andrei Borzenkov wrote:
> 16.09.2017 13:20, Paul Groves пишет:
>>
>> On 13/09/17 13:18, Andrei Borzenkov wrote:
>>> It only reads/writes single attribute - 0803h "USER MEDIUM TEXT
>>> LABEL". It can be used as example how to integrate handling of more
>>> attributes; in particular barcode is attribute 0806h.
>> Is it possible to use  program such as sg_raw to access that SCSI
>> address directly?
> Yes, of course.
Anyone know how to do this? Or where to find some useful information.
>> Therefore being able to read it. But then how to write to it...?
>>
> How is writing different? You send the right command to the device ...
>
Makes sense now you put it like that. I just need to learn the commands
first :)

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Reading LTO cartridge memory

Andrei Borzenkov
16.09.2017 14:42, Paul Groves пишет:

>
>
> On 16/09/17 11:29, Andrei Borzenkov wrote:
>> 16.09.2017 13:20, Paul Groves пишет:
>>>
>>> On 13/09/17 13:18, Andrei Borzenkov wrote:
>>>> It only reads/writes single attribute - 0803h "USER MEDIUM TEXT
>>>> LABEL". It can be used as example how to integrate handling of more
>>>> attributes; in particular barcode is attribute 0806h.
>>> Is it possible to use  program such as sg_raw to access that SCSI
>>> address directly?
>> Yes, of course.
> Anyone know how to do this? Or where to find some useful information.

Well, you can read any available SCSI reference manual for exact format
of READ ATTRIBUTE/WRITE ATTRIBUTE commands as well as list of standard
attributes (you can find them either on www.t10.org or some links were
posted in this thread) as well as check mentioned program how it builds
such command descriptor. I would probably try it (out of general
curiosity) but I do not have any physical tape library/drive to test.

>>> Therefore being able to read it. But then how to write to it...?
>>>
>> How is writing different? You send the right command to the device ...
>>
> Makes sense now you put it like that. I just need to learn the commands
> first :)
>


--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]