Home

This document is a cache from http://www.nobius.org/~dbg/practical-file-system-design.pdf


Practical File System Design

Document source : www.nobius.org


106
6
A L L O C AT I O N P O L I C I E S
file can store is approximately 5 GB:
12 direct
block run
s = 96 MB
(8192K per
block run
)
512 indirect
block run
s = 4 GB
(512
block run
s of 8192K each)
256,000 double-indirect
block run
s = 1 GB
(256K
block run
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
each
block run
can map, up to the maximum of 64K blocks per
block run
. If
each allocation group were 65,536 blocks long, the maximum file size would
be over 33 GB:
12 direct
block run
s = 768 MB
(64 MB per
block run
)
512 indirect
block run
s = 32 GB
(512
block run
s of 64 MB each)
256,000 double-indirect
block run
s = 1 GB
(256K
block run
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
block run
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
page 106







Summary :

106 6 A L L O C AT I O N P O L I C I E S file can store is approximately 5 GB: 12 direct block run s = 96 MB (8192K per block run ) 512 indirect block run s = 4 GB (512 block run s of 8192K each) 256,000 double-indirect block run s = 1 GB (256K block run 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.


Tags : size,each,groups,bfs,512,directory,group,system,blocks,eight,disk,maximum,mapped





Terms    |    Link pdf-search-files.com    |    Site Map
   |    Content Removal Notice   
   |    Contact   

All books are the property of their respective owners.
Please respect the publisher and the author for their creations if their books copyrighted