Operating System - HP-UX
1829013 Members
2363 Online
109986 Solutions
New Discussion

cpio -B option - problem reading from tape

 
John Halsall
New Member

cpio -B option - problem reading from tape

Following a system reboot, I'm unable to read a label from the beginning of a tape using cpio -iuvB. cpio -iuv works fine and it seems quite happy to write to the tape with -B however. No block size is being specified. Any ideas?
3 REPLIES 3
H.Merijn Brand (procura
Honored Contributor

Re: cpio -B option - problem reading from tape

Whenever in (tape) doubt, use dd :)

# dd if=/dev/rmt/0m ibs=2048000 | cpio -itv

if you /write/ with -c (compatibility option, you should also read with -c, except when using GNU cpio, which detects the -c like options automatically when reading. One more reason to use only GNU cpio :)
Enjoy, Have FUN! H.Merijn
Ceesjan van Hattum
Esteemed Contributor

Re: cpio -B option - problem reading from tape

-B sets blocksize 10 times higher: 512 -> 5120 bytes per block.

The header will not grow, but
will stay its own size. Very comfortable for the header to stay in...

I cannot try now to simulation your issue, but what about this:

In order to read a tape that was written using some block length besides the default of 512, use the tapecntl(1) command (qv) to either set the block length of the drive to match the block length of the media, or to set the drive into variable block length mode.

Regards,
Ceesjan
John Halsall
New Member

Re: cpio -B option - problem reading from tape

Fixed. Well, actually, it got worse and the tape wouldn't eject and processes were hanging that I couldn't kill, so I rebooted. End of problem. Still a mystery...