我有一个HP Ultrium 448磁带备份,在Ubuntu上没有看到问题。 我可以在/dev/st0看到它。
当我mt -f /dev/st0 offline发行mt -f /dev/st0 offline ,磁带popup。 当我发出mt -f /dev/st0 status ,我得到:
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
当我发出tar -tzf /dev/st0 ,我得到:
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
我怀疑这是因为它是使用Windows Server 2003 Backup工具创build的。 我意识到我可以利用mtftar来获取这些内容,但是如何获得原始备份数据呢? 例如,我似乎无法在这里列出驱动器上的文件内容。 我是否需要通过pipe道启动某种读取,然后通过mtftarpipe道来查看备份磁带上的数据结构?
mftar应根据文档能够直接从磁带上读取… … –
mftar < /dev/st0 | tar tvf -
如果你想先从磁带上取下数据然后用mftar进行处理,那么你可以使用dd
dd if=/dev/st0 of=output1
您可能需要使用dd指定块大小。 如果你不知道磁带是怎么写的,那么tcopy可以给你一个格式的报告。
如果您在一个磁带上有多个图像,则需要使用非倒带设备/dev/nst0以及需要的显式倒带。
我刚刚遇到了同样的错误信息,并在这个问题上发布了详细的解释。
简而言之, Cannot allocate memory意味着你用来读取磁带的程序没有使用足够大的缓冲区来从磁带读取数据。 如果您正在使用的程序不能具有读取缓冲区集的大小,则可以使用dd来执行此操作:
dd if=/dev/nst0 bs=1M | tar tvf -
这将使用1MB的读取缓冲区,可以读取1MB或更小的磁带块。 根据需要增加,直到Cannot allocate memory消失 – 该值需要与磁带上最大的块相同或更大。
磁带块的大小在写入过程中由应用程序进行设置。