Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Storage & Archiving Raw access to the LTFS data partition

  • Raw access to the LTFS data partition

  • B. Rordin

    January 28, 2016 at 4:16 pm

    I need to access the data partition of an LTFS tape gone bad (unable to mount) for recovery purposes. I tried to read from a normal functional LTFS tape for testing purposes and while I can read the label and index from the index partition I’m not able to reach the data partition.

    # dd if=/dev/nst0 of=file0 bs=524288
    VOL1 L LTFS 4

    # dd if=/dev/nst0 of=file1 bs=524288
    (replaced all <> with [] because creativecow messes up the code)
    [?xml version="1.0" encoding="UTF-8"?]
    [ltfslabel version="2.2.0"]
    [creator]QUANTUM LTFS 2.2.0 - Linux - mkltfs[/creator]

    # dd if=/dev/nst0 of=file2 bs=524288

    # dd if=/dev/nst0 of=file3 bs=524288
    [?xml version="1.0" encoding="UTF-8"?]
    [ltfsindex version="2.2.0"]
    [creator]QUANTUM LTFS 2.2.0 - Linux - ltfs - Unmount[/creator]
    (thats the tape index)

    # dd if=/dev/nst0 of=file4 bs=524288

    # dd if=/dev/nst0 of=file5 bs=524288
    dd: reading `/dev/nst0': Input/output error

    # mt -f /dev/nst0 status
    SCSI 2 tape drive:
    File number=4, block number=-1, partition=0.
    Tape block size 0 bytes. Density code 0x5a (no translation).
    Soft error count since last status=0
    General status bits on (d010000):

    From that point on I can’t read anything. The status shows EOD so my guess is that I must somehow position the tape beyond that but I don’t know how.

    Ideally I want to dump the entire data partition to a file and then later use photorec to recover all files from it. I already have a list of the files in the order they were written and photorec supports all file types on this tape so it seems like it could be possible.

    Any help from the ltfs/dd/mt gurus will be greatly appreciated.

  • Martin Greenwood

    January 29, 2016 at 10:41 am

    I assume you have tried the ltfsck tool to try to recover the index? What is the error message you see when attempting to mount?
    As far as raw reading, it looks like it’s working. The index is on the first partition and there usually isn’t a lot else on that partition, so you will get to the end of data quickly. You need to switch to reading from the second partition this is done with the SCSI locate command, try set partition or partseek with mt.

    Martin Greenwood

  • B. Rordin

    January 29, 2016 at 4:02 pm

    [Martin Greenwood] “I assume you have tried the ltfsck tool to try to recover the index?”

    Sure, but the tape I’m trying to recover appears as it have no index partition at all – it doesn’t mount so ltfsck just fails. It says : Cannot read ANSI label: expected 80 bytes, but received 0. I’m sure the data is still there because I recorded the tape so even if the index partition is somehow gone the data should be there.

    Have in mind that the output I gave in my original post is all from a good tape I’m playing with while trying to figure out a solution. My understanding so far is that I must somehow rewind forward the tape to the data partition beyond the EOD marker on the index partition and just dump it to a file. The problem I cannot go beyond the EOD marker using mt.

  • Martin Greenwood

    January 29, 2016 at 8:47 pm

    What happens if you try the partition commands I mentioned? They should switch you into the data partition.



  • Tom Goldberg

    January 30, 2016 at 5:53 pm

    Sadly the LTO Consortium since inception has locked out, in the drive firmware, all LTO drives from reading beyond the EOD marker. This was done ostensibly to protect erased tapes from being read since erasing a data tape only resets the EOD, it does not clear or overwrite anything that was on the tape.

    If the EOD is at 0 in the data partition, I know of no way for you to get the data back short of using a data recovery service. If it is only the index partition that was reset, you can rebuild the index and get to your data.

    Tom Goldberg
    30201 Rainbow Hill Rd.
    Evergreen, CO 80439

    Home Gutenberg

  • B. Rordin

    February 1, 2016 at 8:50 am

    To all of those:

    mt -f /dev/nst0 setpartition 0
    mt -f /dev/nst0 setpartition 1
    mt -f /dev/nst0 partseek 0 0
    mt -f /dev/nst0 partseek 0 1

    I get:

    /dev/nst0: Invalid argument

    I’ve tried with both the bad tape and another good working tape. Is this the correct way to use setpartition?

    BTW I tried to dd from the bad tape’s index partition and this is what I got:
    # dd if=/dev/nst0 of=file0 bs=524288
    (empty file)

    # dd if=/dev/nst0 of=file1 bs=524288
    [?xml version="1.0" encoding="UTF-8"?]
    [ltfsindex version="2.2.0"]
    [creator]QUANTUM LTFS 2.2.0 - Linux - ltfs - Unmount[/creator]
    ...etc. This looks like the index of the tape.

    # dd if=/dev/nst0 of=file2 bs=524288
    (empty file)

    # dd if=/dev/nst0 of=file3 bs=524288
    dd: reading `/dev/nst0': Input/output error

    So basically I’m missing the label and and the xlm after it which somehow got overwritten.

  • Bernd Potschka

    November 25, 2017 at 9:25 am

    just would like to know, if you found any solution?
    I ´ve the same problem on a win7 system and no idea how to get acces to the data…
    Any help would be great

  • David Margolis

    February 14, 2019 at 2:22 pm

    I realize this is an old thread, but the EOD encountered by the OP is from partition 0, not partition 1, so it is not the case of the data partition having an EOD mark at byte 0. dd was encountering the index partition EOD, and so the question of how to advance dd past that marker to the data partition is still on the table. Unless you meant that the LTO consortium locked out going beyond the EOD for the index partition, which is not what you said.
    Could you clarify or explain what I may be misunderstanding?


  • Chris Langlois

    January 28, 2022 at 9:49 pm

    I had a similar situation.

    You might need to enable the partition switching option.

    <code data-renderer-mark=”true”> mt -f /dev/nst0 stoptions can-partitions

Viewing 1 - 9 of 9 posts

Log in to reply.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy