OSInside / kiwi

KIWI - Appliance Builder Next Generation
https://osinside.github.io/kiwi
GNU General Public License v3.0
297 stars 151 forks source link

Add quota attribute in <volume> definition for Btrfs subvolume usable when btrfs_quota_groups is set to true #2651

Open DriverXavGeForce opened 4 hours ago

DriverXavGeForce commented 4 hours ago

Description

Currently there is no possibility to set Btrfs subvolume quota value in kiwi xml. Quota can be useful to prevent issues with space usage and Btrfs. Adding a quota attribute in the volume definition like this example:

<type
    [...]
    btrfs_quota_groups="true"
    [...]
    >
    <systemdisk>
        <volume name="home"/>
        <volume name="root"/>
        <volume name="tmp"/>
        <volume name="opt"/>
        <volume name="srv"/>
        <volume name="boot/grub2/i386-pc"/>
        <volume name="boot/grub2/x86_64-efi" mountpoint="boot/grub2/x86_64-efi"/>
        <volume name="usr/local"/>
        <volume name="var" copy_on_write="false" quota="5G"/>
        <volume name="var/tmp" copy_on_write="false" quota="5G"/>
        <volume name="var/log" copy_on_write="false" quota="10G"/>
        <volume name="var/log/audit" copy_on_write="false" quota="5G"/>
     </systemdisk>
</type>
schaefi commented 3 hours ago

yep sounds good, looking at this on my next free cycle

schaefi commented 2 hours ago

@DriverXavGeForce Hmm, I need a bit help on this topic. I thought adding the size limit for a volume can be done via btrfs quota but actually that call only allows to enable/disable quota handling for subvolumes:

btrfs quota enable subvol-path

The actual setup for the quotas seems to happen in quota groups whereas there are "normal" and "simple" versions and I have no time to investigate deeper into how to setup that proplerly.

https://man.archlinux.org/man/btrfs-quota.8.en

Can you advise me what procedure you had in mind to set the quota limit ?

Thanks