Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combination of snapshotted btrfs with lvm failing #2305

Open
frispete opened this issue May 31, 2023 · 1 comment
Open

Combination of snapshotted btrfs with lvm failing #2305

frispete opened this issue May 31, 2023 · 1 comment

Comments

@frispete
Copy link

Hi Marcus,

we're facing an "interesting" issue when combining snapshotted btrfs with lvm.

When doing so, the btrfs snapshots remain uninitialized in the kiwi image.
Otoh, doing so with yast results in the expected behaviour.

Here's the relevant config excerpt:

    <preferences profiles="kvm-and-xen">
        <version>15.4</version>
        <packagemanager>zypper</packagemanager>
        <bootsplash-theme>SLE</bootsplash-theme>
        <bootloader-theme>SLE</bootloader-theme>
        <locale>en_US</locale>
        <keytable>us</keytable>
        <timezone>Europe/Berlin</timezone>
        <hwclock>utc</hwclock>
        <rpm-excludedocs>true</rpm-excludedocs>
        <type
            image="oem"
            initrd_system="dracut"
            filesystem="btrfs"
            bootloader="grub2"
            bootpartition="false"
            firmware="uefi"
            efipartsize="256"
            kernelcmdline="plymouth.enable=0 console=ttyS0,115200 console=tty0"
            bootkernel="custom"
            devicepersistency="by-uuid"
            btrfs_quota_groups="false"
            btrfs_root_is_snapshot="true"
            installiso="false"
        >

            <oemconfig>
                <oem-swap>true</oem-swap>
                <oem-swapname>swap</oem-swapname>
                <oem-swapsize>4000</oem-swapsize>
            </oemconfig>
            <systemdisk name="systemimg" preferlvm="true">
                 <volume name="@root=root" size="14G"/>
            </systemdisk>

            <size unit="G">20</size>
        </type>
    </preferences>

Our investigation has shown so far, that if <preferlvm> is enabled, <btrfs_root_is_snapshot> is ignored.

Here's the build result of that config:

$ btrfs subvol show /
/
        Name:                   <FS_TREE>
        UUID:                   3cb5189d-2fd7-4b79-97f6-8c599f70f04f
        Parent UUID:            -
        Received UUID:          -
        Creation time:          2023-05-03 15:03:56 +0000
        Subvolume ID:           5
        Generation:             84
        Gen at creation:        0
        Parent ID:              0
        Top level ID:           0
        Flags:                  -
        Snapshot(s):

Without lvm, it is initialized correctly:

$ btrfs subvol show /
@/.snapshots/1/snapshot
        Name:                   snapshot
        UUID:                   301db37a-1d31-e944-8dfa-7e132cfa0b3d
        Parent UUID:            a7358e86-4fe1-b64f-90c5-26e2a4121c81
        Received UUID:          -
        Creation time:          2023-05-03 13:35:41 +0000
        Subvolume ID:           258
        Generation:             46
        Gen at creation:        8
        Parent ID:              257
        Top level ID:           257
        Flags:                  -
        Snapshot(s):

This is with kiwi 9.24.43 from SLES 15 SP4, but a similar result was produced with later versions.

Are there any technical reasons to not support this combination properly, or is it just missing some specific (ugly, I admit) corner case handling?

@frispete
Copy link
Author

Hi Marcus,

it would really be nice if you could spend some spare minutes on this issue.
In case, the description is missing something, let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant