Hi all, I’m playing around with LVMs to expand data storage and I’m looking at what would be required to transfer those drives to another device, all the steps I can find require exporting the volume group and then importing on the other device. But what would be the case if your boot drive were to fail, and you needed to move the drives without being able to export the volume group. Can you just do an import with a new device, or are there other steps required to do so?

Secondly, is there a benefit to creating an LVM volume with a btrfs filesystem vs just letting btrfs handle it?

  • IsoKiero@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 days ago

    If you’re talking about just moving the physical volumes (as in the actual hard drives) as is to another computer they’re automatically scanned and ready to go in majority of modern distributions. No need to export/import anything. This is obviously assuming your boot drive isn’t a part of volume group and you have healthy drives at your hands. You can test this with any live-distribution, just boot from USB into a new operating system and verify your physical volumes/volume groups from that.

    If you want to move the volume group to a new set of disks simplest way would be to add physical drive(s) to volume group and then removing the old drive(s) from it after data has been copied. Search for pvmove and vgreduce. This obviously requires a working system, if your data drive has already failed it’s a whole another circus.

    • Cenzorrll@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 day ago

      I did not find just moving the drives to work. There were some other issues that I came across that might have a part to play in it, I made the lvm and filesystem on an RPI5 running OMV and moved it to a rock3c running OMV from an armbian install. Turns out there’s a pagefile size mismatch between the two that prevented mounting the btrfs filesystem. But I still wasn’t able to get the rock3c to recognize the VG or that there were new PVs attached without exporting first. So perhaps the armbian install isn’t modern enough to automatically recognize it.

      I didn’t expect learning new things about btrfs to be the outcome of this little experiment, but I guess that’s just how things work.

      • IsoKiero@sopuli.xyz
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 day ago

        I haven’t tested lvm on arm-based systems, but if it doesn’t automatically locate them you could try pvscan/vgscan/lvscan.