1

I create a 4 GByte sized LV on a RHEL6 machine.

I created a 4 GByte sized EXT4 FS.

[root@server ~]# lvcreate -n newlvnamehere -L 4096M rootvg
  Logical volume "newlvnamehere" created.
[root@server ~]# mkdir /newfshere
[root@server ~]# mkfs.ext4 /dev/mapper/rootvg-newlvnamehere
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=1 blocks, Stripe width=0 blocks
262144 inodes, 1048576 blocks
52428 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=1073741824
32 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736

Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 35 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[root@server ~]# mount /dev/mapper/rootvg-newlvnamehere /newfshere
[root@server ~]# df -m /newfshere
Filesystem           1M-blocks  Used Available Use% Mounted on
/dev/mapper/rootvg-newlvnamehere
                      3904     8      3691   1% /newfshere

If I later use resise2fs it says nothing to do..

Question: Why doesn't the EXT4 FS has the exact same size as the LV? It is only 3904 MByte sized and the LV is 4096. Where did 192 MByte went? 4096-3904.

PE size in the rootvg is 32 MByte. FS Journal size: 128M

1 Answers1

2

You filesystem does have exactly the same size as the LV: mkfs.ext4 says

262144 inodes, 1048576 blocks

which is 4GB. The missing 192MB are accounted for by the journal (128MB) and the filesystem data structures (superblocks and backups).

Why are there so many different ways to measure disk usage? has lots more detail.

Stephen Kitt
  • 434,908