A L L O C AT I O N P O L I C I E S
file can store is approximately 5 GB:
s = 96 MB
s = 4 GB
s of 8192K each)
s = 1 GB
s of 4K each)
Total data mapped = 5.09 GB
On a drive smaller than 5 GB, such a file size limit is not a problem, but
on larger drives it becomes more of an issue. The solution is quite simple.
Increasing the size of each allocation group increases the amount of data that
can map, up to the maximum of 64K blocks per
each allocation group were 65,536 blocks long, the maximum file size would
be over 33 GB:
s = 768 MB
(64 MB per
s = 32 GB
s of 64 MB each)
s = 1 GB
s of 4K each)
Total data mapped = 33.76 GB
The amount of space mapped by the double-indirect blocks can also be
increased by making each
map 8K or more, instead of 4K. And, of
course, increasing the file system block size increases the maximum file size.
If even larger file sizes are necessary, BFS has an unused triple-indirect block,
which would increase file sizes to around 512 GB.
When creating a file system, BFS chooses the size of the allocation group
such that the maximum file size will be larger than the size of the device.
Why doesn't the file system always make allocation groups 65,536 blocks
long? Because on smaller volumes such large allocation groups would cause
all data to fall into one allocation group, thus defeating the purpose of clus-
tering directory data and i-nodes separately from file data.
Directory and Index Allocation Policy
BFS reserves the first eight allocation groups as the preferred area for indices
and their data. BFS reserves these eight allocation groups simply by conven-
tion; nothing prevents an i-node or file data block from being allocated in
this area of the disk. If the disk becomes full, BFS will use the disk blocks
in the first eight allocation groups for whatever is necessary. Segregating the
indices to the first eight allocation groups provides them with at least 64 MB
of disk space to grow and prevents file data or normal directory data from
becoming intermixed with the index data. The advantage of this approach is
that indices tend to grow slowly, and this allows them space to grow without
becoming fragmented by normal file data.
The root directory for all BFS file systems begins in the eighth allocation
group (i.e., starting at block 65,536). The root directory i-node is usually
Practical File System Design:The Be File System
, Dominic Giampaolo