vicker313 tech blog

February 7, 2010

CPIO Tape with Unknown Block Size

Filed under: Linux — Tags: , , — vicker313 @ 11:09 am

Here are same useful CPIO command samples (assume the tape is /dev/st0):

  1. To list out the content of the tape:
    cpio -tv -F /dev/st0
  2. To extract the tape to working directory:
    cpio -iv -F /dev/st0
  3. 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

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: