FORUMS: list search recent posts

Raw access to the LTFS data partition

COW Forums : Archiving and Back-Up

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
B. Rordin
Raw access to the LTFS data partition
on Jan 28, 2016 at 4:16:02 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]
[formattime]2016-01-14T16:07:33.262279375Z[/formattime]
[volumeuuid]602a42d2-3024-4313-8796-1a044cef11d2[/volumeuuid]
[location]
[partition]a[/partition]
[/location]
[partitions]
[index]a[/index]
[data]b[/data]
[/partitions]
[blocksize]524288[/blocksize]
[compression]true[/compression]
[/ltfslabel]


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

# 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]
[volumeuuid]602a42d2-3024-4313-8796-1a044cef11d2[/volumeuuid]
....etc.
(thats the tape index)

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

# 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):
EOD WR_PROT ONLINE IM_REP_EN


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.
Thanks!



Return to posts index

Martin Greenwood
Re: Raw access to the LTFS data partition
on Jan 29, 2016 at 10:41:02 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
CTO
yoyotta.com


Return to posts index

B. Rordin
Re: Raw access to the LTFS data partition
on Jan 29, 2016 at 4:02:55 pm
Last Edited By B. Rordin on Jan 29, 2016 at 6:08:38 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.



Return to posts index


Martin Greenwood
Re: Raw access to the LTFS data partition
on Jan 29, 2016 at 8:47:57 pm

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

Martin

YoYotta


Return to posts index

B. Rordin
Re: Raw access to the LTFS data partition
on Feb 1, 2016 at 8:50:42 am
Last Edited By B. Rordin on Feb 1, 2016 at 9:14:41 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]
[volumeuuid]3fe76962-877a-48fc-b690-4fad2db5daf0[/volumeuuid]
[generationnumber]86[/generationnumber]
[updatetime]2016-01-14T15:22:11.000222042Z[/updatetime]
[location]
[partition]a[/partition]
[startblock]5[/startblock]
[/location]
...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.



Return to posts index

Tom Goldberg
Re: Raw access to the LTFS data partition
on Jan 30, 2016 at 5:53:42 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
TGCS
30201 Rainbow Hill Rd.
Evergreen, CO 80439
mailto:tomgoldberg@gmail.com
http://tomgoldberg.net




Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]