新しいFSサイズはLVサイズとは異なります。

新しいFSサイズはLVサイズとは異なります。

RHEL6システムで4GB LVを作成しました。

4GBサイズの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

後でresise2fsを使用すると、何もしないことがわかります。

質問:EXT4 FSのサイズがLVと全く同じではないのはなぜですか?サイズは3904MBに過ぎず、LVは4096です。 192MBはどこに行きましたか? 4096-3904.

rootvgのPEサイズは32MBです。 FSログサイズ:128M

ベストアンサー1

あなたのファイルシステムはLVとまったく同じサイズを持っていますmkfs.ext4

262144個のアノード、1048576個のブロック

つまり4GBです。欠落している192 MBは、ログ(128 MB)とファイルシステムのデータ構造(スーパーブロックとバックアップ)によって占められます。

ディスク使用量を測定する方法はなぜそんなに変わりますか?詳細はたくさんあります。

おすすめ記事