[elbe-devel] [PATCH v2 0/3] Add support for nested btrfs subvolume hierarchies

Daniel Braunwarth daniel at braunwarth.dev
Thu Nov 3 18:10:08 CET 2022


Btrfs supports three subvolume hierarchies: flat, nested and mixed. Detailed
explanations of each can be found at the btrfs SysadminGuide:

https://btrfs.wiki.kernel.org/index.php/SysadminGuide#Layout

This series of patches adds support for nested btrfs subvolume hierarchies. I'm
planning to add support for flat and mixed hierarchies in a second step.

With this patches applied the following subvolume hierarchy can be easily
achieved:

toplevel                  (volume root directory, to be mounted at /)
+-- home                  (subvolume root directory)
+-- var                   (subvolume root directory)
    +-- www               (subvolume root directory)
    +-- lib               (directory)
         \-- postgresql   (subvolume root directory)

The following ELBE XML snippet would create this:

<fstab>
    <bylabel>
        <label>rfs</label>
        <mountpoint>/</mountpoint>
        <fs>
            <type>btrfs</type>
            <subvolumes>
                <subvolume>
                    <name>home</name>
                </subvolume>
                <subvolume>
                    <name>var</name>
                </subvolume>
                <subvolume>
                    <name>var/www</name>
                </subvolume>
                <subvolume>
                    <name>var/lib/postgresql</name>
                </subvolume>
            </subvolumes>
        </fs>
    </bylabel>
</fstab>

Changes since v1:
- Update example's "created" date
- Add SPDX header to example


Daniel Braunwarth (3):
  examples: add btrfs nested subvolumes example
  schema: fs: extend XML schema for btrfs subvolumes
  elbe: add logic for nested btrfs subvolumes

 elbepack/fstab.py                             | 10 ++
 elbepack/hdimg.py                             | 12 ++-
 ...64-pc-btrfs-nested-subvolumes-bullseye.xml | 95 +++++++++++++++++++
 schema/dbsfed.xsd                             | 43 +++++++++
 4 files changed, 158 insertions(+), 2 deletions(-)
 create mode 100644 examples/x86_64-pc-btrfs-nested-subvolumes-bullseye.xml

--
2.38.1


More information about the elbe-devel mailing list