0

I have one very large (physical) disk and many smaller ones.

Using Logical Volume Management's builtin mirroring functions, is it possible to achieve one very large mirrored logical volume that, on a physical level, is comprised of ALL the data stored on the large physical disk and a mirror of it on one of the smaller disks?

Presumably this is very possible by splitting the large volume up, but is it possible to keep the large volume contiguous, to end up with something like the following:

Logical:
             [================================================][========================]

Physical (sort of):

LargeVolume  [sda1============mirrored=below==================||sda2===unmirrored======|]
                  |          |            |            |    
                  V          |            |            |
OtherVolumes [sdb======]     V            |            |
                        [sdc======]       V            |
                                   [sde=========]      V
                                                 [sdf=========]


Data:
LargeVolume  [AAAAABBBBBCCDDDDDDDEEFFFFFFGGGGHHHHIIIIJJKLL----||XXXXYYYZZZ-----------|]
                  |          |            |            |    
                  V          |            |            |
OtherVolumes  AAAAABBBBB     V            |            |
                        CCDDDDDDDEE       V            |
                                   FFFFFFGGGGHHHH      V
                                                 IIIIJJKLL----

If so, how does one go about it? Is it done by putting all the volumes to be mirrored in one LVM pool and calling lvcreate -m1 on it?

I think pvgstrict setting and Physical Volume Groups might be part of the answer, but I'm new to LVM and it doesn't make that much sense to me yet.

0

Conceptually logical volumes (LV) are indivisible units in LVM. LVs live on Volume Groups (VG) which span across one or more Physical Volumes (PV).

So I interpreted the question as being:

"Can I mirror an LV that sits on one disk/PV into a location that is supported by multiple PVs?"

Yes. Although you can't mirror an LV into a different VG.

Otherwise, please clarify further.

4
  • Sorry, I think I explained the question poorly. I'll edit it.
    – rory
    Jun 16 '20 at 11:05
  • updated answer.
    – Pedro
    Jun 16 '20 at 12:57
  • Thanks very much. The second part of my question was "If so, how does one go about it?" Do you just create a volume pool and lvcreate -m1 and LVM is smart enough to always put one copy of the data onto the largest volume to ensure max capacity?
    – rory
    Jun 16 '20 at 14:28
  • There's a multiple ways to do this. You can control which PVs an LV will occupy, but it is best-effort. When you mirror an LV I don't know if you're limited in this... You'll need to come up with a test rig and experiment the various options.
    – Pedro
    Jun 17 '20 at 9:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.