How to Remove LVM Physical Volume (PV) on Linux Easily

This post will show you How to Remove LVM Physical Volume (PV) on Linux Easily.

How to Remove LVM Physical Volume (PV) on Linux Easily

If you are looking to know how to remove a physical volume (PV) in linux on lvm. In this post, we have explained you the commands to remove a physical volume (PV) from existing Volume group (VG) on Linux.Assume that, we wanted to remove the phyical volume (PV) "/dev/sdc1" from existing volume group (VG) "vg01".

Step 1 : Ensure that physical volume extents not been used.

Use the below commands to ensure that the physical volume is not been used by any logical volumes.

pvdisplay /dev/sdc1

If it is used, then move to the step 2. If it not used, then skip to step 3.

Step 2 : Move data to other disks within the Volumegroup.

If you have enough free extents on the other disks within the volumegroup.

pvmove /dev/sdc1

If you want to move it to the particular disk within the Volumegroup.

pvmove /dev/sdc1  /dev/sdb1

Step 3 : Remove physical volume from the Volume group.

Use "vgreduce" command to remove the physical volume from the Volume group.

vgreduce vg01 /dev/sdc1

Now your physical volume has been removed from the existing volume group.

Post a Comment

0 Comments