• Check Available Disk

[root@testsvr01~]# lsblk
NAME                  MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                     8:0    0  100G  0 disk
sdb                     8:16   0  500G  0 disk
sdc                     8:32   0  500G  0 disk
└─vg_pgdata-lv_pgdata 253:2    0  500G  0 lvm  /pgdata
sr0                    11:0    1 1024M  0 rom
vda                   252:0    0  100G  0 disk
├─vda1                252:1    0  500M  0 part /boot
└─vda2                252:2    0 99.5G  0 part
  ├─rhel-root         253:0    0   50G  0 lvm  /
  ├─rhel-swap         253:1    0  3.9G  0 lvm  [SWAP]
  └─rhel-home         253:3    0 45.6G  0 lvm  /home
[root@testsvr01~]#

  • Create Physical Disk Group

[root@testsvr01~]# pvcreate /dev/sdb
  Physical volume "/dev/sdb" successfully created.

  • Extend Volumn Group

[root@testsvr01~]# vgextend vg_pgdata /dev/sdb
  Volume group "vg_pgdata" successfully extended

  • Move Existing data to New Volumn

[root@testsvr01~]#  pvmove -b /dev/sdc /dev/sdb
  Detected pvmove in progress for /dev/sdc
[root@testsvr01~]#.

  • For Abort Previous command - pvmove

[root@testsvr01~]# pvmove --abort

  • Monitor PVMove Status

[root@testsvr01~]# pvmove -i 5
  /dev/sdc: Moved: 2.08%
  /dev/sdc: Moved: 2.22%
  /dev/sdc: Moved: 2.35%
  /dev/sdc: Moved: 2.48%

  • Reduce Old LVM Disk from Volumn Group

[root@testsvr01~]# vgreduce vg_pgdata /dev/sdc
  Removed "/dev/sdc" from volume group "vg_pgdata"
[root@testsvr01~]#

  • Check Disk Status 

[root@testsvr01~]# lsblk
NAME                  MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                     8:0    0  100G  0 disk
sdb                     8:16   0  500G  0 disk
└─vg_data-lv_data     253:2    0  500G  0 lvm  /pgdata
sdc                     8:32   0  500G  0 disk
└─vg_pgdata-lv_pgdata 253:3    0  500G  0 lvm
sdd                     8:48   0  500G  0 disk
sr0                    11:0    1 1024M  0 rom
sr1                    11:1    1  374K  0 rom
vda                   252:0    0  100G  0 disk
├─vda1                252:1    0  500M  0 part /boot
└─vda2                252:2    0 99.5G  0 part
  ├─rhel-root         253:0    0   50G  0 lvm  /
  ├─rhel-swap         253:1    0  3.9G  0 lvm  [SWAP]
  └─rhel-home         253:4    0 45.6G  0 lvm  /home

  • Remove Physical Volumn

[root@testsvr01~]# pvremove /dev/sdc
  Labels on physical volume "/dev/sdc" successfully wiped.

 

Technology