mirnshi wrote:

> 我的8毫米磁带机不能正确识别磁带的密度,怎么办? 如何正确设置磁带机的
> 密度.
>
> 问题的由来:
> 我有一些在SUN工作站上用8mm磁带备份的数据文件,我想在微机上的
> linux(rd5)下读出来,微机的磁带机是EXAByte 8505, 当时用tar命令或dd命令
> 时都报错.
> $ tar  tvf  /dev/st0
> st0: Incorrect block size
> tar: Read error on /dev/st0:Input/Output error

这不是密度的问题而是块尺寸问题。你原先设置的尺寸是多少就用mt命令把磁带机的块尺寸设为多少。
用man mt看具体的命令格式,好象是用setblk子命令。
密度也可以用mt命令来设。

另外tar命令也有块尺寸的设置问题。GNU tar的默认值好象是20*512,你原来
的tar用多少?用tar -b NN指定tar的块储存。

min
 

mirnshi wrote:

> Mr. Gong:
>
> I use default block size on SUN_ws.And SUN default block size also is 20
> I can tar 1/4 tape that backup from SUN_ws.

20 must be the default tar block size which means 20*512 not 20 bytes.There is
another block size, that is, the physical block size of the tape device.

For saving tape I used physical tape block size of 16384 to write our DDS-2
tape. When it was read by a HP-UX server without specifying the physical
block size the result was like what you mentioned. When the physical block
size of the tape was adjusted to the physical block size of the recorded tape
the problem was solved. So, try to find out the physical block size of your tape
and adjust the Linux tape device block size with mt command it will be OK.

> I also used dd, it was also error. It seems that dd can read any block size
> tape.

So, your TAPE PHYSICAL BLOCK SIZE in NOT correct.

> WHY?
>
> BTW, my tape is 5GB.

Please read the man page and other docs of mt.

>
>
> mirnshi

Good luck.

min
 

Linux下对磁带机的物理块默认设置为512 bytes并且不自动支持可变块长. 你可
用下述命令设置为支持可变块:

mt setblk 0

然后再用tar或dd就不会有问题. 但要注意做了上述设置后要重设为其它块大小
才能正确写带.
 

本文转自中文Linux论坛