0

Based on New FS size differs from LV size

We need a 4 GByte sized FS on top of an LV. OS: RHEL6, 64bit.

Question: How big LV is needed to have a 4096 MByte sized FS on it? Are there any percentages that can be calculated?

Ex. LV needs to be 104.6875% of the FS, can this be applied to all sizes? Or ex.: journal size, superblock consumption changes as the FS size differs?

Filesystem is ex. EXT4, but could be any other.

1 Answers1

0

The default journal size is 128MB, and the default inode tables occupy 2MB for every 128MB. So if you want 4096MB of actual storage space, you need to allocate enough space for 128MB of journal, and 4096/126 128MB blocks (rounding up), i.e. 33 blocks, or 4224MB, for a total of 4352MB. This will give you slightly more than 4096MB of usable storage (precisely, 4158MB).

The Ext4 disk layout wiki page has all the details.

Stephen Kitt
  • 434,908