Convert ext4 lvm to normal ext4 partition

M A Young m.a.young at durham.ac.uk
Fri Nov 12 21:16:41 UTC 2010


On Fri, 12 Nov 2010, Michael Miles wrote:

> Thanks for the suggestion but I somehow think it will be cheaper and much 
> faster to just purchase a new drive.
> I can just imagine how long it would take my shaw connection to upload 500 
> gig...
>
> Besides it's mostly downloaded movies and music in flac that I am sure would 
> sent the old piracy people right out of whack.

It should be theoretically possible to convert an LVM partition to one 
normal partition in some cases. Have a look at /etc/lvm/backup/#lvmname# 
which is a backup of the LVM structure. If the segment count for the 
required partition is 1 (which is likely unless you have been doing 
anything advanced) then your partition will be in one piece and if you can 
work out where it starts and stops and can repartition the disk to match 
then you can convert it to a real partition.

For example if the value of pe_start in the above file is 384 then you may 
be able to mount the file system (read only) directly, eg. via

mount -o ro,loop,offset=$((384*512)) /dev/physical_partition /mount/point

However, I suspect that you may find it rather more complicated to carry 
this all out, and definitely worth taking a backup of anything you don't 
want to lose first.

 	Michael Young


More information about the users mailing list