0

I have an HP Ultrium 448 tape backup that is being recognized without seeming issue on Ubuntu. I am able to see it at /dev/st0.

When I issue mt -f /dev/st0 offline, the tape ejects. When I issue mt -f /dev/st0 status, I get:

SCSI 2 tape drive: 
File number=0, block number=0, partition=0. 
Tape block size 0 bytes. Density code 0x42 (LTO-2). 
Soft error count since last status=0 
General status bits on (41010000):  
 BOT ONLINE IM_REP_EN

When I issue tar -tzf /dev/st0, I get:

tar (child): /dev/st0: Cannot read: Cannot allocate memory
tar (child): At beginning of tape, quitting now
tar (child): Error is not recoverable: exiting now

gzip: stdin: unexpected end of file
tar: Child returned status 2
tar: Error is not recoverable: exiting now

I suspect that this is because it was created with the Windows Server 2003 Backup utility. I realize that I can leverage mtftar to get these contents, but how do I get the raw backup data first? Eg, I can't seem to list the file content on the drive initially here. Do I need to pipe initiate some kind of read via mt and then pipe that through mtftar in order to see the data structures on the backup tape?

ylluminate
  • 1,277
  • 3
  • 21
  • 36

2 Answers2

1

mftar should according to the docs be able to read straight from the tape so ...

mftar < /dev/st0 | tar tvf -

If you'd rather grab the data off the tape first and then manipulate with mftar then you can use dd eg

dd if=/dev/st0 of=output1

You might need to specify block size with dd. If you don't know how the tape was written then tcopy can give you a report on its format.

If you've got multiple images on a single tape then you need to use the non-rewinding device /dev/nst0 along with explicit rewinds where required.

Paul Haldane
  • 4,612
0

I just came across the same error message and posted a detailed explanation in this question.

In short, Cannot allocate memory means the program you are using to read the tape isn't using a large enough buffer to read data off the tape. If the program you are using cannot have the size of the read buffer set, you can use dd for this:

dd if=/dev/nst0 bs=1M | tar tvf -

This will use 1MB read buffers which will be able to read tape blocks of 1MB or less in size. Increase as needed until Cannot allocate memory goes away - the value needs to be the same as or larger than the largest block on the tape.

The size of the tape blocks is set during the writing process by the application doing the writing.

Malvineous
  • 1,265