LVM 扩容磁盘

LVM 扩容磁盘

1、查看新增加的磁盘
[root@vrdapavn02wmsp3 ~]# lsblk
NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda             8:0    0  100G  0 disk
├─sda1          8:1    0  500M  0 part /boot
└─sda2          8:2    0 99.5G  0 part
  ├─rhel-root 253:0    0 78.5G  0 lvm  /
  ├─rhel-swap 253:1    0    1G  0 lvm  [SWAP]
  └─rhel-home 253:2    0   20G  0 lvm  /home
sdb             8:16   0  300G  0 disk
sr0            11:0    1 1024M  0 rom
[root@vrdapavn02wmsp3 ~]#

2、创建PV物理卷
[root@vrdapavn02wmsp3 bin]# pvcreate /dev/sdb
  Physical volume "/dev/sdb" successfully created
[root@vrdapavn02wmsp3 bin]# pvs      //使用pvs查看物理卷
  PV         VG   Fmt  Attr PSize   PFree
  /dev/sda2  rhel lvm2 a--   99.51g      0
  /dev/sdb        lvm2 ---  300.00g 300.00g
[root@vrdapavn02wmsp3 bin]#

3、扩展VG卷组
//使用vgs命令查看卷组信息
[root@vrdapavn02wmsp3 bin]# vgs
  VG   #PV #LV #SN Attr   VSize  VFree
  rhel   1   3   0 wz--n- 99.51g    0
[root@vrdapavn02wmsp3 bin]# vgextend rhel /dev/sdb
  Volume group "rhel" successfully extended
[root@vrdapavn02wmsp3 bin]#
//使用lvextend命令扩展逻辑卷
[root@vrdapavn02wmsp3 bin]# lvextend -L +300G /dev/rhel/root
  Insufficient free space: 76800 extents needed, but only 76799 available
[root@vrdapavn02wmsp3 bin]# lvextend -L +299.99G /dev/rhel/root
  Rounding size to boundary between physical extents: 299.99 GiB
  Size of logical volume rhel/root changed from 78.51 GiB (20098 extents) to 378.50 GiB (96896 extents).
  Logical volume root successfully resized.

4、使用xfs_growfs命令使扩容生效
[root@vrdapavn02wmsp3 bin]# xfs_growfs /dev/rhel/root

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值