mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [RFC next 0/2] dm: lvm: Initial Logical Volume Management support
@ 2026-08-24 18:31 Tobias Waldekranz
  2026-08-24 18:31 ` [RFC next 1/2] " Tobias Waldekranz
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Tobias Waldekranz @ 2026-08-24 18:31 UTC (permalink / raw)
  To: barebox

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




^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-08-31  9:12 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-24 18:31 [RFC next 0/2] dm: lvm: Initial Logical Volume Management support Tobias Waldekranz
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox