tar blocking factor

tar blocking factor

Post by Jean-Pierre Radle » Fri, 05 Jun 1998 04:00:00




| When I tar files to tape (sco 5.04) I get a response indicating the blocking
| size is 10K (jives with /etc/default/tar=20); however as the files are
| written to tape the report the file name and number of blocks indicates 512
| byte blocks.
|
| example:
| -rw-rw-rw-   1 root     sys      1058208 Jun  4 15:55 CC9_0011.prt
| eps:ttyp3# tar cv7 CC9_0011.prt
| Volume ends at 7899999K, blocking factor = 10K
| a CC9_0011.prt 2067 tape blocks
| eps:ttyp3#
|
| 1058208/2067 = 512

Semantic overload.  Files on the hard drive ocuupy blocks of 512 bytes
each.

Tar archives are written (or read) at some "blocking" number of bytes at
a time.  In the case of 'b 20', tar will deal with the tape in hunks of
10k at a time.

Consider also the dd command.

If you want to copy a file to a floppy, and do it this way:

        dd if=some_file of=/dev/rfd0

it will take some time.  You will notice considerably faster
execution if you do instead

        dd if=some_file of=/dev/rfd0 bs=18k

IOW, in the case of tar, or dd, think of the blocking size as a
large buffer that the device drivers attempt to digest at one gulp.

This will also affect the total amount of bytes written to the archive.
Now on a tape, you can't really see this effect, but try this experiment,
using purely empty files as archive fodder:

# touch a b c
# tar cvfb 2tar 2 a b c
a a 0 tape blocks
a b 0 tape blocks
a c 0 tape blocks
# tar cvfb 20tar 20 a b c
a a 0 tape blocks
a b 0 tape blocks
a c 0 tape blocks
# l *tar
-rw-r--r--   1 root     sys        10240 Jun  4 19:41 20tar
-rw-r--r--   1 root     sys         3072 Jun  4 19:41 2tar

--

 
 
 

1. Best tar blocking factor for HP DDS tape drive ?

There is blocking-factor option for the tar cmd.  It seems the tar write
to the tape drive for every blocking-factor (default is 20) X 512 bytes.
And the tape drive write and skip to next block even if the data size
is less than tape drive's block size.

Since DDS is using rotary head, I guess the block size of such tape
is the data stored during half round of the head turning.  Which may
be 10K bytes to 200K bytes.  Anyone knows the block size of DDS-1, 2, 3
such that we can tune to best blocking-factor when using tar ?

Or the efficiency was optimized internally by the drive (since it also
perform compression) and the user doesn't need to care about it ?
Then, why you have to match the blocking-factor during create and extract ?

Thanks in advance.

SK

2. tcp/ip accept() problem under 2.5.1

3. Q: tar blocking factor/blocksize

4. Getting RIVA 128 to work in X

5. SCO tar error on block size (not block factor)

6. How do you set up a HP DJ820Cxi to work with Linux?

7. tar tape blocking factor

8. CE - the simple unix text editor

9. How do I determine the optimal blocking factor for tar?

10. block size vs. blocking factor

11. DAT blocking factor & tapetool

12. DDS3, ufsdump, blocking factor.

13. tape blocking factors