Linux给根目录扩容时,为什么执行lvextend之后扩容的大小并不是100%?

比如我创建了新的50G分区,在执行完lvextend后,根目录增加的大小只有46.99G,这是为什么呢?

阅读 3.4k
1 个回答
因为1k是1024
[root@xxxx-centos7-template ~]# lvcreate -L 99G -n data centos  
Logical volume "data" created.  
[root@xxxx-centos7-template ~]# lvdisplay  
--- Logical volume ---  
LV Path                /dev/centos/swap  
LV Name                swap  
VG Name                centos  
LV UUID                vFM0SF-6giK-lWPg-iCTY-usKM-ywpA-bp5zxd  
LV Write Access        read/write  
LV Creation host, time xxxx-centos7-template, 2018-04-20 13:44:01 +0800  
LV Status              available

 open                 2

LV Size                8.00 GiB  
Current LE             2048  
Segments               1  
Allocation             inherit  
Read ahead sectors     auto

* currently set to     8192  
Block device           253:1

--- Logical volume ---  
LV Path                /dev/centos/root  
LV Name                root  
VG Name                centos  
LV UUID                mtRvdH-eFlc-3EiS-xQbW-lqfm-y6K5-bAiZrv  
LV Write Access        read/write  
LV Creation host, time xxxx-centos7-template, 2018-04-20 13:44:01 +0800  
LV Status              available

 open                 1

LV Size                41.80 GiB  
Current LE             10701  
Segments               1  
Allocation             inherit  
Read ahead sectors     auto

* currently set to     8192  
Block device           253:0

--- Logical volume ---  
LV Path                /dev/centos/data  
LV Name                data  
VG Name                centos  
LV UUID                Jj7pYx-vlUm-2z9U-UcK0-Wx3m-182t-UeQH25  
LV Write Access        read/write  
LV Creation host, time xxxx-centos7-template, 2019-03-13 20:50:49 +0800  
LV Status              available

 open                 0

LV Size                99.00 GiB  
Current LE             25344  
Segments               1  
Allocation             inherit  
Read ahead sectors     auto

* currently set to     8192  
Block device           253:2
[root@xxxx-centos7-template ~]# df -h  
Filesystem               Size  Used Avail Use% Mounted on  
/dev/mapper/centos-root   42G  1.6G   41G   4% /  
devtmpfs                 3.9G     0  3.9G   0% /dev  
tmpfs                    3.9G     0  3.9G   0% /dev/shm  
tmpfs                    3.9G  8.5M  3.9G   1% /run  
tmpfs                    3.9G     0  3.9G   0% /sys/fs/cgroup  
/dev/sda1                197M  103M   95M  53% /boot  
tmpfs                    799M     0  799M   0% /run/user/0  
/dev/mapper/centos-data   98G   61M   93G   1% /data
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题