How to delete a disk from a LVM group while keeping the data

This is the scenario:

I want to remove a old hard disk which is a LVM PV and contains data. There is free space available on other PVs in the VG. It should move the data from the disk to be removed to other PVs and then remove the disk.

Refer to Removing an Old Disk in LVM HOWTO.

The process to remove sdb from VG vg is as follows.

First, distribute old extends from sdb to other PV

# pvmove /dev/sdb

it will take much time.

Second, delete sdb

# vgreduce vg /dev/sdb

Now, you can physically remove the sdb disk.

Then you can add new disks and extend the VGs.

Answered by anonymous.

After vgreduce, you may wipe the labels on the disk by

# pvremove /dev/sdb

Leave a Reply

Your email address will not be published. Required fields are marked *