BLOCKING FACTOR CALCULATION

A file contains 35,000 records, each of a fixed size of 190 bytes. The file is to be stored in a disk drive having blocks of 4120 bytes with 512 bytes of inter-block gaps. If unspanned blocking is used, compute the following:

  1. Blocking factor (i.e., the average number of blocks per record).

Blocking factor (bfr) = B/R = 4120/190 = 21

  • Number of blocks needed to store the 35,000 records.

Number of disk blocks b = r/bfr = 35000/21 = 1667

  • Total size of the file.

Size of 190 disk blocks = 1667 x 4120 = 6868040 bytes

For 1667 disk blocks, there will be 1666 inter-block gaps

Size of 1666 inter-block gaps = 1666 x 512 = 852992 bytes

Total size of the file = 6868040 + 852992 = 7721032 bytes

                                       = 7721032/1024 = 7540.0703125 Kbytes

                                       = 7540.0703125/1024 = 7.363 MB

What will be the size of the bit table for a 160-GB disk with 1024-byte blocks?

Size of bit table = Disk Size / (8 * file system block size)

                                = 160 x 1024 x 1024 x 1024 / (8* 1024)

                             = 20971520 bytes

                                = 20971520 / 1024 = 20480 Kbytes

                                = 20 MB

1 thought on “BLOCKING FACTOR CALCULATION”

Leave a Comment