Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How much do modern filesystems reserve for each block group?

In reading about the Unix FFS, I've read that 10% of the disk space is reserved so that files' data blocks can be ensured to be in the same cylinder group. Is this still true with filesystems like ext2/ext3, is there space reserved so that files' data blocks can all be in the same block group? Is it also 10%? or does it vary? Also, is the same true for journaling filesystems as well? Thank you.

like image 957
Bob Bobbio Avatar asked Jun 06 '12 08:06

Bob Bobbio


People also ask

How many blocks can a Linux file system have?

By default a filesystem can contain 2^32 blocks; if the ‘64bit’ feature is enabled, then a filesystem can have 2^64 blocks. The location of structures is stored in terms of the block number the structure lives in and not the absolute offset on disk.

What data structures can a block group contain?

Each block group has its own data structures and data blocks. Here are the data structures a block group can contain: Super Block: a metadata repository, which contains meta data about the entire file system, such as total number of blocks in the file system, total blocks in block groups, inodes, and more.

What is the bitmap size of the disk block in Figure 1?

The given instance of disk blocks on the disk in Figure 1 (where green blocks are allocated) can be represented by a bitmap of 16 bits as: 0000111000000110. Attention reader! Don’t stop learning now.

What is the first free block number of the disk?

Therefore, the first free block number = 8*0+5 = 5. In this approach, the free disk blocks are linked together i.e. a free block contains a pointer to the next free block. The block number of the very first disk block is stored at a separate location on disk and is also cached in memory.


Video Answer


1 Answers

first of all i think that ext filesystems implement the same notion of a cylinder group, they just call it block group. to find out about it , you can fdisk the partition to find your actual block count and blocks/group number .Then the number of block groups = block count / (block/group). They are used in exactly the same way as FFS cgs (to speed up access times). Now journaling IMO has nothing to do with this operation, except that it actually wastes some more space on your disk :). As far as i understand , soft updates which is the BSD solution to the problem that a journal would solve in typical ext filesystems, don't require extra space , but are tremendously complex to implement and add new features on (like resizing). interesting read:

ext3 overhead disclosed part 1

cheers!

like image 190
ramrunner Avatar answered Oct 22 '22 19:10

ramrunner