0

I have a virtual machine with two disks, sda1 and sda2. I have a volume group (vg_linux) with these two physical volumes and I want to remove sda2 from this volume group. However, on this volume group, there is the root / logical volume, which is obviously mounted so I can't use vgreduce vg_linux /dev/sda2.

I can't add more disks or change the storage system in any way.

Does somebody have an idea of a way to remove sda2 from vg_linux ?

0

Ensure the free space in vg_linux exceeds the size of sda2. Then move the physical volume off to other PVs, and remove it.

pvmove /dev/sda2
vgreduce vg_linux /dev/sda2
pvremove /dev/sda2

Multiple partitions of the same disk in the same VG does not make much sense to me, there is no performance or administrative advantage. I prefer to create VGs on entire disks and skip the partition table: vgcreate vgdata /dev/sdb /dev/sdc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.