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

Aaron Toponce aaron.toponce at gmail.com
Sun Feb 12 08:21:00 EST 2012


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.

> I have a 500G disk that used to be in a desktop machine I used on a regular
> basis.  So there's a LOT of stuff on the disk, dating back years.  The disk
> consists of one boot partition, and a LVM containing two additional
> partitions, a 20G and a 460G.

So, the disk is the only member of a volume group, and you have two logical
volumes in that group?

> I want to use this disk as an external disk in a USB enclosure for backing
> stuff up.  The only issue is, with LVM it's not "plug and go" - you have to
> plug it in, and then as root run vgchange to make the LVM-based partitions
> visible.

This, among other things such as live snapshots, data mirroring and
resizing volumes, makes LVM a serious contender for storage management. I
have 6 USB flash drives, each 2 GB, that are in a RAID 10 array. I assemble
the drives mith mdadm(8), then activate the volume group, decrypt the
encrypted volumes, and mount to my /mnt directories. Sure, it's manual
labor, but I have flexible, redundant, portable and fast data.

> 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.

> 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.

--
. o .   o . o   . . o   o . .   . o .
. . o   . o o   o . o   . o o   . . o
o o o   . o .   . o o   o o .   o o o
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 519 bytes
Desc: not available
Url : http://lists.colug.net/pipermail/colug-432/attachments/20120212/02dd3db4/attachment.bin 


More information about the colug-432 mailing list