Keeping all files in BTRFS-subvolumes in x86 dualboot-config

  • (i know this is not "officially supported" but i'd still like to do it this way.)

    i use LE in a multiboot-config with linux and grub on an x86_64-PC. Ususally i use one BTRFS-filesystem and each (Linux-)OS (or rather its rootfs) resides in its own subvolume there; one install maintains grub but its config (grub.cfg) is simple (just a couple of lines per distro) and can easily be adapted. Homedirs, mediafiles etc ususally reside on a different btrfs-disk in their own subvols.

    i'd like to have one subvol for LE which contains both KERNEL and SYSTEM and LE_DATA (/storage) in its own subvol.

    the following config works:

    KERNEL is inside /boot of one distro, SYSTEM is in btrfs-subvol in extra-partition (sda2, btrfs, labelled LE_DATA) and this is also mounted as storage. the media-dirs on the other disk are easily accessible inn /var/media/somwhere....)

    grub.cfg:

    Code
    # 20210824 medi + LE
    set timeout=5
    menuentry ' :: KODI on GENTOO :: ' {
    set root=(hd0,gpt1)
    linux /GENROOT/boot/5.13.12 root=/dev/sda1 rootflags=subvol=GENROOT rootfstype=btrfs net.ifnames=0
    }
    menuentry 'LibreELEC' {
    linux (hd0,gpt1)/GENROOT/boot/KERNEL boot=/dev/sda2 disk=/dev/sda2 rootfstype=btrfs
    }

    sda2 ist labelled LE_DATA and its default-subvol is also LE_DATA

    i'd like to keep KERNEL and SYSTEM in their own subvol.

    configuring grub to boot

    Code
    linux (hd0,gpt1)/LE/KERNEL (...)

    is probably no problem but i don't know how to configure the remaining parts.

    considering the pxeboot/NFS-documentation i think it's quite flexible but i do not know the parameters/syntax.

    is there an doc or can anybody tell me sth. about the APPEND=-statement ?

    THX for your input!

  • APPEND is a syslinux/extlinux thing. The main boot params are boot=/path/to/KERNEL and disk=/path/to/storage .. the init script embedded in the kernel will find SYSTEM in the same location as KERNEL so there's nothing to set. The only other params normally on the APPEND line are to redirect console output and quiet to silence output to screen. I'm not sure the rootfstype is required, the init should detect the filesystem used for disk= and use whatever is needed.

    Have a look at LibreELEC.tv/init at master · LibreELEC/LibreELEC.tv · GitHub