Here are same useful CPIO command samples (assume the tape is /dev/st0):
- To list out the content of the tape:
cpio -tv -F /dev/st0 - To extract the tape to working directory:
cpio -iv -F /dev/st0 - To archive files from working directory to tape:
find . -print | cpio -ov -F /dev/st0
Sometime we might face problem in extracting the tape because wrong block size is used. To check the block size used in a CPIO archived tape catridges, try command below:
dd if=/dev/sto of=/tmp/deleteme ibs=64k count=1
If no error prompts out, it means the tape is archived in 64k. Else try other block size number such as 128k until you find a figure that doesn’t result an error message. The command will create a dummy file called deleteme at /tmp, which can safely be removed. After you know the block size, use command below to list or extract the content of the tape:
cpio -tv --block-size 64 -F /dev/st0
cpio -iv --block-size 64 -F /dev/st0
Posted by vicker313 



