• LVM in LVM

    From Steve Keller@21:1/5 to All on Mon Sep 16 11:40:01 2024
    In older Debian releases, I think at least until Debian 9, it was
    possible to access PVs and LVs which are stored in a LV. The PV
    inside the containing LV could be displayed and activated with
    vgdisplay(8) and vgchange(8).

    This scenario makes sense if you have a LV for a VM guest, that uses
    LVM inside, and when you need to access file systems in the guest from
    the host (while the guest is shutdown).

    I don't see how this can be done in the current Debian 12.

    Steve

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Woodall@21:1/5 to Steve Keller on Mon Sep 16 12:50:01 2024
    On Mon, 16 Sep 2024, Steve Keller wrote:

    In older Debian releases, I think at least until Debian 9, it was
    possible to access PVs and LVs which are stored in a LV. The PV
    inside the containing LV could be displayed and activated with
    vgdisplay(8) and vgchange(8).

    This scenario makes sense if you have a LV for a VM guest, that uses
    LVM inside, and when you need to access file systems in the guest from
    the host (while the guest is shutdown).

    I don't see how this can be done in the current Debian 12.

    Steve


    Not sure because I've previously battled the opposite problem but I'd
    start here in lvm.conf

    # Configuration option devices/sysfs_scan.
    # Restrict device scanning to block devices appearing in sysfs.
    # This is a quick way of filtering out block devices that are
    # not
    # present on the system. sysfs must be part of the kernel and
    # mounted.)
    sysfs_scan = 1

    # Configuration option devices/scan_lvs.
    # Scan LVM LVs for layered PVs, allowing LVs to be used as PVs.
    # When 1, LVM will detect PVs layered on LVs, and caution must
    # be
    # taken to avoid a host accessing a layered VG that may not
    # belong
    # to it, e.g. from a guest image. This generally requires
    # excluding
    # the LVs with device filters. Also, when this setting is
    # enabled,
    # every LVM command will scan every active LV on the system
    # (unless
    # filtered), which can cause performance problems on systems
    # with
    # many active LVs. When this setting is 0, LVM will not detect
    # or
    # use PVs that exist on LVs, and will not allow a PV to be
    # created on
    # an LV. The LVs are ignored using a built in device filter that
    # identifies and excludes LVs.
    scan_lvs = 0

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andy Smith@21:1/5 to Steve Keller on Mon Sep 16 18:50:02 2024
    Hi,

    On Mon, Sep 16, 2024 at 11:21:49AM +0200, Steve Keller wrote:
    In older Debian releases, I think at least until Debian 9, it was
    possible to access PVs and LVs which are stored in a LV.

    […]

    I don't see how this can be done in the current Debian 12.

    Works fine for me on all versions of Debian up to stable. Haven't
    tried it on newer. I use it in exactly the scenario you describe.

    Check your filters in /etc/lvm/lvm.conf as otherwise the system
    won't scan block devices that are LVs, so won't find PVs on them.

    Thanks,
    Andy

    --
    https://bitfolk.com/ -- No-nonsense VPS hosting

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Steve Keller@21:1/5 to Tim Woodall on Fri Sep 20 11:30:02 2024
    Tim Woodall <debianuser@woodall.me.uk> writes:

    On Mon, 16 Sep 2024, Steve Keller wrote:

    I don't see how this can be done in the current Debian 12.

    Not sure because I've previously battled the opposite problem but I'd
    start here in lvm.conf

    # Configuration option devices/scan_lvs.
    # Scan LVM LVs for layered PVs, allowing LVs to be used as PVs.
    # When 1, LVM will detect PVs layered on LVs, and caution must
    # be
    # taken to avoid a host accessing a layered VG that may not
    # belong
    # to it, e.g. from a guest image. This generally requires
    # excluding
    # the LVs with device filters. Also, when this setting is
    # enabled,
    # every LVM command will scan every active LV on the system
    # (unless
    # filtered), which can cause performance problems on systems
    # with
    # many active LVs. When this setting is 0, LVM will not detect
    # or
    # use PVs that exist on LVs, and will not allow a PV to be
    # created on
    # an LV. The LVs are ignored using a built in device filter that
    # identifies and excludes LVs.
    scan_lvs = 0

    Thanks, that's exactly what I was looking for. I've set scan_lvs = 1
    and called vgscan, and now I see the embedded PV and can activate it.
    In older Debian releases this was default and changed sometime after
    Debian 9.

    Steve

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)