mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Tobias Waldekranz <tobias@waldekranz.com>
To: barebox@lists.infradead.org
Subject: [RFC next 0/2] dm: lvm: Initial Logical Volume Management support
Date: Mon, 24 Aug 2026 18:31:19 +0000	[thread overview]
Message-ID: <20260824183203.3759144-1-tobias@waldekranz.com> (raw)

This is an initial RFC on the addition of LVM support to Barebox.

Avid readers of Barebox lore might remember me describing LVM support
as a key part of my roadmap of how I would like to boot future
versions of Infix - a network centric OS I work on - in the original
device mapper series. [1]

I have finally gotten some time to get this in a presentable state.

Example session:

    wkz@spa:~/src/github.com/barebox/barebox$ ./barebox -i disk0=infix-x86_64.disk,blkdev
    [...]
    barebox@Sandbox:/ lvm info
    VG "internal":
      UUID:    sN8htx-oD18-wHWH-SuCU-1EWy-th1l-5WPU6j
      SeqNum:  1
      Size:    132 MiB (1 MiB extents)
      #PV:     1
      #LV:     1
      PV disk0.2:
        UUID:  6VHjVF-WVt7-Gk4Y-oTrK-lsgY-ve7N-GJ0CUn
        Size:  134 MiB
      LV "infix-x86_64.raw":
        UUID:  Xp76Ig-9XXj-aBfK-Xv2U-rbsY-nEWX-omt4Bo
        Type:  linear
        Size:  132 MiB
    barebox@Sandbox:/ lvm activate internal infix-x86_64.raw
    [GPT warnings...]
    Created internal-infix-x86_64.raw
    barebox@Sandbox:/ ls /mnt/internal-infix-x86_64.raw.0/
    mounted /dev/internal-infix-x86_64.raw.0 on /mnt/internal-infix-x86_64.raw.0
    bin       boot      cfg       config    dev       etc       home
    lib       lib64     loader    log       media     mnt       opt
    proc      root      run       sbin      srv       sys       tmp
    usr       var
    barebox@Sandbox:/

If the overall structure is OK with the community and maintainers,
then the biggest remaining issue is testing. I have been surprised to
learn that the standard LVM tools will not operate on disk images
(without loopback mounting). Nor does there seem to be any other tools
out there that allows you to provision PVs/VGs/LVs without having them
"live" and attached to the host system. If there are any suggestions
here they would be very welcome!

Additionally, I would like to add some fuzz testing to the metadata
parser.

Looking forward to your feedback!

[1]: https://lore.kernel.org/barebox/20250828150637.2222474-1-tobias@waldekranz.com/

Tobias Waldekranz (2):
  dm: lvm: Initial Logical Volume Management support
  commands: lvm: inspect VGs, activate LVs

 commands/Kconfig                |  11 +
 commands/Makefile               |   1 +
 commands/lvm.c                  | 264 ++++++++++++
 drivers/block/dm/Kconfig        |   9 +
 drivers/block/dm/Makefile       |   1 +
 drivers/block/dm/lvm/Makefile   |   2 +
 drivers/block/dm/lvm/lvm-core.c | 712 ++++++++++++++++++++++++++++++++
 drivers/block/dm/lvm/lvm-md.c   | 396 ++++++++++++++++++
 drivers/block/dm/lvm/lvm-md.h   | 106 +++++
 drivers/block/dm/lvm/lvm2.h     |  54 +++
 include/lvm.h                   | 100 +++++
 11 files changed, 1656 insertions(+)
 create mode 100644 commands/lvm.c
 create mode 100644 drivers/block/dm/lvm/Makefile
 create mode 100644 drivers/block/dm/lvm/lvm-core.c
 create mode 100644 drivers/block/dm/lvm/lvm-md.c
 create mode 100644 drivers/block/dm/lvm/lvm-md.h
 create mode 100644 drivers/block/dm/lvm/lvm2.h
 create mode 100644 include/lvm.h

-- 
2.43.0




             reply	other threads:[~2026-08-24 18:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-24 18:31 Tobias Waldekranz [this message]
2026-08-24 18:31 ` [RFC next 1/2] " Tobias Waldekranz
2026-08-28 14:19   ` Sascha Hauer
2026-08-31  8:39     ` Tobias Waldekranz
2026-08-24 18:31 ` [RFC next 2/2] commands: lvm: inspect VGs, activate LVs Tobias Waldekranz
2026-08-28 14:20   ` Sascha Hauer
2026-08-31  8:40     ` Tobias Waldekranz
2026-08-28 14:10 ` [RFC next 0/2] dm: lvm: Initial Logical Volume Management support Sascha Hauer
2026-08-31  8:37   ` Tobias Waldekranz
2026-08-31  9:11     ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260824183203.3759144-1-tobias@waldekranz.com \
    --to=tobias@waldekranz.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox