[colug-432] Un-LVM-ify a partition?

Matt Meinwald meinwald.1 at osu.edu
Sun Feb 12 10:38:40 EST 2012


On 02/12/2012 07:21 AM, Aaron Toponce wrote:
> On Sat, Feb 11, 2012 at 10:54:40PM -0500, Joshua Kramer wrote:
>> Is it possible to un-LVM-ify a partition?
> 
> First off, we need to get the terminology straight: it's a volume, not a
> partition. They are totally separate, distinct and very different ideas.

They are two separate concepts, yes, but in practice, a logical volume is
multiple chunks of disk plus metadata. In some (but certainly not all) cases, a
volume is just one contiguous piece on one disk.

Partitions are also chunks of disk with metadata. I don't know all the partition
table formats, but in the DOS style at least, there is only one contiguous chunk
of disk per partition. There can however be unused gaps before, after, and
between partitions.

It seems that if certain conditions hold, it should be possible (though
potentially very painful and error-prone) to convert from one to the other.

> 
>> Is there some way I can "remove the LVM wrapper" around the 460G
>> partition?  If, for example, I were to somehow find the exact beginning and
>> ending sectors of my 460G partition, could I use the LVM admin tool to
>> remove the volume, then create a primary partition with those beginning and
>> ending sectors?
> 
> No. Because it's a volume, and not a parition, there is no clear beginning
> and ending points on the physical volume where the data was stored. LVM is
> a low level format, just as much as ext4 is a low level format. Unless you
> use LVM, you will not be able to get the data off the disk.

In the case that the volume is only made up of one chunk of disk, there is a
clear start and end. When there are multiple pieces, each of them have a start
and end. If you are using Linux, running

dmsetup table

as root should give you the location of each piece on disk. I haven't tried it,
but it is conceivably possible to point a partition table to those.

>> While I can assemble an array of disks of various sizes to copy all my data
>> over and just regenerate the partition, I'd like to avoid doing so if
>> possible.
> 
> The only way to get your data out of the volume, and into a disk partition,
> is to mount both separately, and run an rsync(1) from your logical volume
> to the disk partition.

While I'd personally say the best way to do this is by erasing the disk and
recovering the contents from backup, it might be fun to try "un-LVM-ifying"
first, just to see if it's possible.  If you don't have backups, you should
probably start by making them using that array of disks (perhaps you could make
a logical volume spanning them).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
Url : http://lists.colug.net/pipermail/colug-432/attachments/20120212/584de681/attachment-0001.bin 


More information about the colug-432 mailing list