-   Slackware (
-   -   Question on creating a striped lvm (

lstamm 12-17-2007 12:43 AM

Question on creating a striped lvm
This is not a strictly slackware question, but I'm asking it here because of the expertise of the posters here.

I have a server with a disk (not in a raid array) mostly full with data, spread over three partitions. I've got another disk of the same size that I want to install, and put the data on a striped LVM with the original disk and the new disk forming the new volume group, with three partitions still. I prefer the the striped LVM over a RAID0 array because of the ability to expand and contract the partitions.

My question is, can I create the volume group on just the new empty disk to start with, format the partions, copy over the data from the old disk, then reformat the old disk and bring it into the volume group as part of a striped volume? This wouldn't work on LVM1, but I'm not sure about LVM2. I don't see how the striping would happen, even if it is allowable.

The other option is to reformat both discs at the same time, and create the striped LVM volume group with both disks at the same time. Then reinstall the data from backup.

LinuxManMikeC 12-18-2007 12:11 AM

You can't change the mapping (linear or striped) for extents that have already been allocated to an LV. So you have to backup your data, wipe the current disk, then build a VG using both disks. Then when creating the LVs choose striped mapping.

JZL240I-U 12-18-2007 07:28 AM

As I understand it he doesn't want to change the striping. As a guess I think it is possible to do it the way the OP suggested (LVM ond the new disk, transferring data, making new (striped) PV on old disk and extending volume). You would still have six partitions, mind.

Suggestion: Just try but make a new (verified) backup first. Then, if it really is impossible to do that way you still have a scheme to fall back to.

LinuxManMikeC 12-18-2007 03:44 PM

Sorry, but you understand wrong, both the problem at hand and LVM in general. He wants to move 3 existing filesystems from partitions to Logical Volumes which are striped on two disks. As one of the two disks is the currently full disk with all his data on it, it must be emptied and initialized as a Physical Volume and added to the new Volume Group. If he were to just make the VG with one disk, he could not create LVs with striped mapping because there isn't a second PV to stripe to. Once the second PV is added, you can't convert any existing LVs to striped mapping. LVs must be created with striped mapping to begin with and that requires one or more PVs to do it.


Originally Posted by JZL240I-U (Post 2994536)
You would still have six partitions, mind.

:scratch: This makes absolutely no sense.

To the OP (lstamm):
If you intend to keep the data as three distinct filesystems (moving each partition to an LV) you can backup raw disk images of the 3 partitions. Once you have the Logical Volumes set up you can just restore these disk images directly to their new locations. Then, if necessary, you can resize the filesystems to fill their LVs.

lstamm 12-18-2007 07:20 PM

> LVs must be created with striped mapping to begin with and that requires one or more PVs to do it.

Thanks, LinuxManMikeC. That's exactly the answer I was looking for. I thought I had read somewhere that LVs could be converted to striped mapping with LVM2, after initially being created on a single PV. I couldn't see how that would work, and couldn't find any examples in the docs, but you never know...

All times are GMT -5. The time now is 11:32 PM.