centos 扩容空间

查找到新增的磁盘/dev/sdb

[root@localhost ~]# fdisk -l

磁盘 /dev/sdb:375.8 GB, 375809638400 字节,734003200 个扇区Units = 扇区 of 1 * 512 = 512 bytes扇区大小(逻辑/物理):512 字节 / 512 字节I/O 大小(最小/最佳):512 字节 / 512 字节

创建pv(物理卷)

[root@localhost ~]# pvcreate /dev/sdb

Physical volume "/dev/sdb" successfully created

扩容vg(卷组)

[root@localhost ~]# vgextend centos /dev/sdb

Volume group "centos" successfully extended

[root@localhost ~]# vgs

VG #PV #LV #SN Attr VSize VFree 

centos 2 3 0 wz--n- 399.50g 350.00g  

[root@localhost ~]# vgdisplay

--- Volume group ---

VG Name centos

Alloc PE / Size 12673 / 49.50 GiB

Free PE / Size 89600 / 350.00 GiB

扩展lv(逻辑卷)

[root@localhost ~]# lvextend -L +350G /dev/mapper/centos-home Size of logical volume centos/home changed from 10.00 GiB (2560 extents) to 360.00 GiB (92160 extents). Logical volume home successfully resized

重定向lv大小

[root@localhost ~]# xfs_growfs /dev/mapper/centos-home

查看扩容结果

[root@localhost ~]# df -h文件系统 容量 已用 可用 已用% 挂载点/dev/mapper/centos-root 36G 4.1G 32G 12% //dev/mapper/centos-home 360G 37M 360G 1% /home/dev/sda1 497M 124M 373M 25% /boot

redhat6:

[root@localhost ~]# lvextend -L +295G /dev/mapper/VolGroup-lv_home

[root@localhost ~]# resize2fs /dev/mapper/VolGroup-lv_home

参考:

LVM逻辑卷管理教程:

http://www.server110.com/linux/201403/7420.html 

linux动态增加LV空间:

http://www.cnblogs.com/weaver1/archive/2011/12/30/2307451.html

相关推荐