这次新上架一个KT服务器,官方技术还是把根目录只分区了20G,按照普通用户的习惯,所有资料都放根目录,显然空间是不够的。利用lvresize命令,可以调整LV逻辑卷大小,调整完毕后,用resize2fs更新下文件系统大小,就可以了。具体可以参考下面的操作过程。
[root@SAT18-C53-5 /]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rootvg-rootlv
20G 2.0G 17G 11% /
tmpfs 1.9G 0 1.9G 0% /dev/shm
/dev/sda1 239M 33M 194M 15% /boot
/dev/mapper/rootvg-tmplv
2.9G 12M 2.8G 1% /tmp
/dev/mapper/rootvg-usrlv
20G 1.2G 18G 7% /usr
/dev/mapper/rootvg-varlv
4.8G 148M 4.5G 4% /var
lvresize -l +13232 /dev/rootvg/rootlv
[root@SAT18-C53-5 /]# lvresize -l +13232 /dev/rootvg/rootlv
Size of logical volume rootvg/rootlv changed from 20.00 GiB (640 extents) to 433.50 GiB (13872 extents).
Logical volume rootlv successfully resized
resize2fs /dev/rootvg/rootlv
[root@SAT18-C53-5 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rootvg-rootlv
427G 2.4G 403G 1% /
tmpfs 1.9G 0 1.9G 0% /dev/shm
/dev/sda1 239M 33M 194M 15% /boot
/dev/mapper/rootvg-tmplv
2.9G 12M 2.8G 1% /tmp
/dev/mapper/rootvg-usrlv
20G 1.2G 18G 7% /usr
/dev/mapper/rootvg-varlv
4.8G 151M 4.4G 4% /var
附上pvdisplay,vgdisplay,lvdispaly信息: