Configuring btrfs and quotas

15 views
Skip to first unread message

Alex Gooch

unread,
Oct 28, 2024, 11:48:15 AM10/28/24
to kiwi
Hello all:

I was previously attempting to build btrfs over lvm, but it seems that is not possible (from a previous conversation posted in 2016). Rather than continuing to fight with that, I have decided to just create the whole systemdisk as btrfs.

I am attempting to build a btrfs oem system, to be installed on a bare metal machine. Documentation shows that we can set quotas within the xml file:

<image schemaversion="8.0" name="openSUSE-Leap-15.1"> <type image="oem" filesystem="btrfs"> <systemdisk name="vgroup" preferlvm="true"> <volume name="usr/lib" size="1G" label="library"/> <volume name="@root" freespace="500M"/> <volume name="etc_volume" mountpoint="etc" copy_on_write="false"/> <volume name="bin_volume" size="all" mountpoint="/usr/bin" quota="2G"/> </systemdisk> </type> </image>
When I attempt this in my build, I get a failure with multiple errors (e.g. shown below):
/var/tmp/kiwi_xslt-6sfnzrs2:35:49: error: attribute "quota" not allowed here; expected attribute "arch", "copy_on_write", "filesystem_check", "freespace", "label", "mountpoint", "parent" or "size"

The relevant piece of my appliance.kiwi file is shown below:
        <type
            image="oem"
            bootpartition="true"
            bootpartsize="1024"
            efipartsize="512"
            filesystem="btrfs"
            initrd_system="dracut"
            installiso="true"
            installboot="install"
            target_removable="false"
            firmware="efi"
            kernelcmdline="rd.kiwi.oem.maxdisk=1T"
        >
            <machine memory="512" guestOS="suse" HWversion="4">
                <vmdisk id="0" controller="ide"/>
                <vmnic driver="e1000" interface="0" mode="bridged"/>
            </machine>
            <!--<bootloader name="grub2" console="serial" timeout="10"/>-->
            <oemconfig>
                <oem-unattended>true</oem-unattended>
                <oem-swapsize>1024</oem-swapsize>
                <oem-multipath-scan>false</oem-multipath-scan>
            </oemconfig>
            <systemdisk preferlvm="false">
                <volume name="@root"/>
                <volume name="var" quota="15G"/>
                <volume name="var/log" quota="12G"/>
                <volume name="var/lib" quota="5G"/>
                <volume name="var/lib/docker" quota="150G"/>
                <volume name="var/tmp" quota="100G"/>
                <volume name="var/opt" quota="6G"/>
                <volume name="home" quota="5G"/>
                <volume name="usr/local" quota="5G"/>
                <volume name="tmp" quota="5G"/>
                <volume name="systems" quota="5G"/>
                <volume name="opt" quota="5G"/>
                <volume name="srv" quota="5G"/>
                <volume name="snapshots"/>
                <!--
                <volume name="boot/grub2/x86_64-efi"/>
                <volume name="boot/grub2/i386-pc"/>
                -->
            </systemdisk>

If we are not supposed to set quotas here, where else should this be done? Are you able to review this block of the xml code and let me know if I am doing something wrong? Any suggestions would be helpful. Thank you all in advance.

Alex

Marcus Schäfer

unread,
Nov 5, 2024, 10:26:15 AM11/5/24
to kiwi-...@googlegroups.com
Hi Alex,

> /var/tmp/kiwi_xslt-6sfnzrs2:35:49: error: attribute "quota" not allowed
> here; expected attribute "arch", "copy_on_write", "filesystem_check",
> "freespace", "label", "mountpoint", "parent" or "size"

Sounds like a too old kiwi version. You can take a look at the
integration test that uses quota here:

https://build.opensuse.org/projects/Virtualization:Appliances:Images:Testing_x86:tumbleweed/packages/test-image-disk/files/_service:obs_scm:appliance.kiwi?expand=1

quota support is available in v10.1.13 or later

---
commit d79e183e80ce147d5f642cc79c7687e17b45dc0e (tag: v10.1.13)
Author: Marcus Schäfer <marcus....@gmail.com>
Date: Thu Sep 26 14:12:25 2024 +0200

Bump version: 10.1.12 → 10.1.13

commit 9215ac55b8ebfaac70fd6c11f8e7fa2593a19c9e
Merge: fb32551fa 8a087f870
Author: Neal Gompa (ニール・ゴンパ) <ne...@gompa.dev>
Date: Thu Sep 26 08:08:18 2024 -0400

Merge pull request #2657 from OSInside/volume_quotas

Add quota attribute to volume section
---

Regards,
Marcus
--
Public Key available via: https://keybase.io/marcus_schaefer/key.asc
keybase search marcus_schaefer
-------------------------------------------------------
Marcus Schäfer Brunnenweg 18
Tel: +49 7562 905437 D-88260 Argenbühl
Germany
-------------------------------------------------------
signature.asc
Reply all
Reply to author
Forward
0 new messages