如何使用 t_reader 实用程序

Résumé: 本文介绍各种操作系统上 t_reader 和 t_writer 实用程序的用法以及下载位置。

Cet article concerne Cet article ne concerne pas Cet article n’est associé à aucun produit spécifique. Toutes les versions du produit ne sont pas identifiées dans cet article.

Symptômes

  • 必须确定磁带上的实际数据块大小
  • 必须验证 NetWorker 标签结构
  • 必须验证磁带介质的物理完整性
  • 必须确认 NetWorker 数据块标头元数据
  • 必须转储每个数据块的原始前 512 字节

t_reader 实用程序用于诊断和排除磁带机相关问题。它也是 NetWorker 支持,提供了多种磁带功能,使其成为有用的故障处理工具。用于:

  • 测试写入磁带的数据块的实际大小
  • 确定写入磁带的数据块大小是否存在变化
  • 测试读取物理介质是否存在 I/O 错误或物理损坏
  • 确定应用程序层下的元素(驱动程序、操作系统、传输、设备本身)是否可以读取特定大小的数据块
  • 在 Windows 中公开低级信息,使用任何其他当前实用程序都无法实现

 

Cause

磁带介质问题通常是由以下外部因素引起的:

  • 操作系统/HBA/驱动程序阻塞因素问题
  • 在写入过程中未检测到 I/O 硬件或传输错误
  • 由于老化、使用、驱动器卫生或存放不当导致的介质退化

 

Résolution

下载 t_reader 从这里:NetWorker 工具 (需要登录戴尔支持帐户)。

解压捆绑包并使用 t_reader 用于主机的体系结构。

  • t_reader 不会在 UNIX 上自动倒带卷(它在 Windows 上提供) - 这允许您定位到磁带上的任何位置并从任何位置开始。
  • 在大多数操作系统上 t_reader 报告从此时开始找到的块大小;有些需要块大小才能尝试读取。
  • t_reader 从 0 开始枚举文件和记录 - 这意味着如果您要向前移动到文件 5,请故意记录 500,然后运行 t_reader - t_reader 输出似乎从 F0 R0 开始,尽管实际上从更晚的地址开始。
  • 在可以确定实际数据块大小的操作系统上,驱动程序或操作系统中的数据块大小限制会导致错误,指示缓冲区太小而无法容纳数据块数据,例如 cannot allocate memorymore data is available
  • t_reader 不需要读取实际数据,但可以识别和读取 NetWorker 标签(如果存在)
  • 在 Windows 上,它还可以读取和报告块标头信息(如果可用);它还可以转储前 512 个原始字节的数据(请参阅下面的变量)
  • 始终 — 第一对 32 KB 标签块之后的数据块大小必须一致,并且必须与扫描仪返回的写入标签的数据块大小相匹配

Unix
要通过先倒带卷来准备卷,请执行以下操作:

mt -f /dev/nst0 rewind

要运行 t_reader,提供加载了磁带盒的驱动器的操作系统设备文件句柄,例如:

./t_reader_linux /dev/nst0

倒带后标准 NetWorker 卷的输出如下所示:

About to read FileNo-BlockNo: 0-0  Found block size: 32768
About to read FileNo-BlockNo: 0-1 EOF encountered
About to read FileNo-BlockNo: 1-0  Found block size: 32768
About to read FileNo-BlockNo: 1-1 EOF encountered
About to read FileNo-BlockNo: 2-0  Found block size: 98304
About to read FileNo-BlockNo: 2-1  Found block size: 98304
...
About to read FileNo-BlockNo: 19-0  Found this record at block size= 98304
About to read FileNo-BlockNo: 19-1 File Mark encountered
About to read FileNo-BlockNo: 20-0 File Mark encountered
No more data is on Tape

此示例演示了一个正常运行的卷,前两个文件上有两个 32K 数据块,指示标签,后跟 96K 数据块,这些数据块定期用文件标记标点,直到在文件 18 之后出现数据结束 (EOD)。

窗户
对于 Windows,还必须提供要读取的数据块的大小:

t_reader \\.\tape0 131072

这样做的效果是,Windows 尝试读取提供给它的任何块大小,并且不会抱怨(尽管可能大于写入的实际块大小)- 但如果作为参数提供的块大小小于实际块,或者存在操作系统或驱动程序限制,使该大小的块不可用,则会出错。

由于 Windows 无法自动确定和报告块大小,因此必须将其作为第二个参数提供。如果块大小太大,它会误报,因为它只是读取多个块并将它们表示为参数提供的大小。如果提供的块大小(例如131072)小于 实际 块大小(例如262144),则收到错误:

>>>>>File Mark Encountered. Total Records Estimated In File 1 Are 1
Read Record does not align on Assigned Buffer

因此,为了正确确定未知数据块大小,请从 32768 开始,然后加倍,直到实用程序成功。但是,您通常可以从标签中确定 预期的 数据块大小。

Windows 还具有两个变量,可以设置为更深入的调试:

set EXPLODE_LEVEL=1

原因 t_reader 要报告找到的任何 NetWorker 数据块的数据块标头,请执行以下操作:

Read 262144 bytes: HW Fn-Rn:2-81 Media Fn-Rn:2-81 Cummulative Bytes Read 21561344

mr_version 6
mr_size 262144
Volid 4222551389 (0xFBAF055D)
Media Fn 2-Media Rn 81
mr_len 444
mr_chunk_len 1

原因 t_reader 要转储每个块的第一个 512 B,请读取:

set DUMP_BUFFER=1

预期输出如下:

Read 262144 bytes: HW Fn-Rn: 2-47 Cummulative Bytes Read 12648448

Dumping 512 Bytes Starting At Address: 0x  850048
0x0000: 56 4F 4C 31 51 30 57 30 50 53 20 20 20 20 20 20
0x0010: 20 20 20 20 20 4E 45 54 57 4F 52 4B 45 52 20 20
0x0020: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0x0030: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
0x0040: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 33
0x0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
...

这可能允许进行更深入的调试或验证非 NetWorker、损坏或加密的卷,但显然适用于不常见的用途。

 

Informations supplémentaires

t_reader 还捆绑了一个配套的实用程序, t_writer.exe。这是一个仅限 Windows 的应用工具,它取代了 tar 和 dd 等 UNIX 应用工具,并允许以自定义数据块大小对磁带执行测试写入。它需要随附的文件、seeding.image 或任何同名的二进制文件。

要使用该实用程序,请使用介质加载设备作为第一个参数,并将所需的数据块大小(以字节为单位)作为第二个参数来运行它,例如:

win_t_writer.exe \\.\Tape2147483639 131072

该实用程序将一直运行,直到用户中断该过程。它可以在具有不同块大小的同一卷上连续运行以模拟不同的块大小,或者在怀疑随机 I/O 错误或 SCSI 重置时重复运行直到失败。它还可用于演示条件是否正在截断应用程序层以下的块大小。

作为输出示例:

C:\Users\Administrator\t_reader>win_t_writer.exe \\.\Tape2147483639 131072

CAUTION: This Is An Un-Supported Tool. To Be Used By Tech. Support Personnel Only
For Comments or Change Requests, email: abid.yazdanie@emc.com

******WARNING Tape Write operations will occur on the device******
******Data Destruction Will Occur******
******You are using this tool at your own risk******


usage: win_t_writer \\.\tapeX 131072
Where tapeX is \\.\tapeX and 131072 (128X1024) is the desired block size, in this case 128K
The Block Size Used Above Is Only An Example.
Run mt -f \\.\tapeX status To Find The Max. Block Size For Your Tape Drive

Enter y to proceed or n to abort: y
Proceeding to write....
About to allocate write buffer
Opening Seeding File seeding.image
Copying Contents Of Seeding File: seeding.image To Write Buffer
WRITE access to device \\.\\\.\Tape2147483639
Successfully opened device: \\.\\\.\Tape2147483639

Calling WriteFile in a perennial loop...

 

Produits concernés

NetWorker
Propriétés de l’article
Numéro d’article: 000094976
Type d’article: Solution
Dernière modification: 30 mars 2026
Version:  4
Trouvez des réponses à vos questions auprès d’autres utilisateurs Dell
Services de support
Vérifiez si votre appareil est couvert par les services de support.