[linux-lvm] Changing from standard partition to LVM partition without reinstalling

James Hawtin oolon at ankh.org
Fri Mar 3 17:49:10 UTC 2017

On 03/03/17 09:51, Amjad Syed wrote:
> Hello,
> We are using  RHEL  7.2 servers to create two node  Active/Passive 
>  High available system with shared storage (SAN). We are using pacemaker.
> The existing  Partition on HDD of  Server is of standard type and  we 
> would like to move it to LVM type as we have just two nodes and we are 
> not going to use clvm.
> The current partition on HDD is as follows
> /   ->  50 GB
> swap -> 25 GB
> /u01 -> 200GB
> What is the best way to change the partition type to LVM without 
> reinstallation?
Its possible but its quite difficult to do as you don't have a seperate 
/boot partion. I don't know if RHEL 7.2 has an LVM aware grub. Moving it 
to LVM would require a new initrd which can cause lots of problems. If I 
was doing it I would use tar or dump to copy the information off the 
disk. Repartition it with LVM with a physical partiton for /boot, do 
some fiddling with a boot disk to sort the boot out then it done. That 
is alot of work for very little gain IMHO, so I would question why you 
want to convert this to LVM are you looking to reclaim space from / to 
use elseware? Is you swap space far to big and you with to use that space?

Personally I would add a temporary new disk to the system create an LVM 
PV on that create a VG/LV for /u01 and format it and copy the data from 
/u01. The I would delete the existing swap and /u01 partitions. Create a 
new partition using all the free space on the old disk as and LVM PV, 
add it to the VG, the use pvmove to move the data back from the tempory 
disk back to the main one. If I wished to steal some space from / I 
would create a filesystem based swap file on / or just create a smaller 
swap from the lvm. This all has the advantage that you don't have to fix 
the boot, saving a lot of effort, and redoing an initrd from a boot disc 
is not something to be done by the inexperienced. However this would 
just require making new filesystems and copying data.


More information about the linux-lvm mailing list