2019独角兽企业重金招聘Python工程师标准>>>
1、查看磁盘空间,有一部分没有加进来
[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rootvg-lvroot 29G 7.1G 21G 26% /
tmpfs 7.8G 68K 7.8G 1% /dev/shm
/dev/xvda1 1008M 74M 883M 8% /boot
[root@localhost ~]#
2、查看剩余空间
[root@localhost ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/xvda2 rootvg lvm2 a-- 99.00g 67.70g
[root@localhost ~]# vgs
VG #PV #LV #SN Attr VSize VFree
rootvg 1 2 0 wz--n- 99.00g 67.70g
[root@localhost ~]#
3、查看扩展目录
[root@localhost ~]# vgscan
Reading all physical volumes. This may take a while...
Found volume group "rootvg" using metadata type lvm2
[root@localhost ~]#
4、扩展空间
[root@localhost ~]# lvextend -L +67G /dev/rootvg/lvroot
Extending logical volume lvroot to 96.30 GiB
Logical volume lvroot successfully resized
[root@localhost ~]#
5、刷新,不然不起作用
[root@localhost ~]# resize2fs /dev/rootvg/lvroot
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/rootvg/lvroot is mounted on /; on-line resizing required
old desc_blocks = 2, new_desc_blocks = 7
Performing an on-line resize of /dev/rootvg/lvroot to 25243648 (4k) blocks.
The filesystem on /dev/rootvg/lvroot is now 25243648 blocks long.
6、再次查看,已经添加进来了
[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rootvg-lvroot 95G 7.1G 83G 8% /
tmpfs 7.8G 68K 7.8G 1% /dev/shm
/dev/xvda1 1008M 74M 883M 8% /boot
参考:
http://blog.csdn.net/pu1030/article/details/7457501
http://guoyanxi.iteye.com/blog/1185988