the method above doesn't fully work, since even though grub doesn't pass the subvol= option to the kernel, it still tries to find kernel at full path, including the subvolume name.
e.g. in /boot/grub/grub.cfg there are lines like:
linux /@/boot/vmlinuz-5.13.0-20-generic
to make it work as easy as on OpenSuse i have made separate subvolume for /boot
1.
in /etc/grub.d/10_linux
i have removed (commented out) the lines:
# case x"$GRUB_FS" in
# xbtrfs)
# rootsubvol="`make_system_path_relative_to_its_root /`"
# rootsubvol="${rootsubvol#/}"
# if [ "x${rootsubvol}" != x ]; then
# GRUB_CMDLINE_LINUX="rootflags=subvol=${rootsubvol} ${GRUB_CMDLINE_LINUX}"
# fi;;
# xzfs)
# # We have a more specialized ZFS handler, with multiple system in 10_linux_zfs.
# if [ -e "`dirname $(readlink -f $0)`/10_linux_zfs" ]; then
# exit 0
# fi
# rpool=`${grub_probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true`
# bootfs="`make_system_path_relative_to_its_root / | sed -e "s,@$,,"`"
# LINUX_ROOT_DEVICE="ZFS=${rpool}${bootfs%/}"
# ;;
# esac
Though i could have commented out only the btrfs related path, but i don't use zfs anyway
2.
Then mounted the btrfs root subvolume (subvolid=5 option) sudo mount -L sys -o subvolid=5 /mnt
and created @boot subvolume there, and copied (cp -a) the boot directory from my previous boot.
3.
created fstab record for the new boot:
LABEL=sys /boot btrfs defaults,subvol=@boot 0 2
and mounted it
mount -a
mount /boot/efi
4.
update-grub
Now works fine even on top of luks.
I have also created separate subvolume for /var/log but this is optional.
the method above doesn't fully work, since even though grub doesn't pass the subvol= option to the kernel, it still tries to find kernel at full path, including the subvolume name. vmlinuz- 5.13.0- 20-generic
e.g. in /boot/grub/grub.cfg there are lines like:
linux /@/boot/
to make it work as easy as on OpenSuse i have made separate subvolume for /boot
1. d/10_linux
in /etc/grub.
i have removed (commented out) the lines:
# case x"$GRUB_FS" in "`make_ system_ path_relative_ to_its_ root /`" "${rootsubvol# /}" LINUX=" rootflags= subvol= ${rootsubvol} ${GRUB_ CMDLINE_ LINUX}" ${grub_ probe} --device ${GRUB_DEVICE} --target=fs_label 2>/dev/null || true` "`make_ system_ path_relative_ to_its_ root / | sed -e "s,@$,,"`" DEVICE= "ZFS=${ rpool}$ {bootfs% /}"
# xbtrfs)
# rootsubvol=
# rootsubvol=
# if [ "x${rootsubvol}" != x ]; then
# GRUB_CMDLINE_
# fi;;
# xzfs)
# # We have a more specialized ZFS handler, with multiple system in 10_linux_zfs.
# if [ -e "`dirname $(readlink -f $0)`/10_linux_zfs" ]; then
# exit 0
# fi
# rpool=`
# bootfs=
# LINUX_ROOT_
# ;;
# esac
Though i could have commented out only the btrfs related path, but i don't use zfs anyway
2.
Then mounted the btrfs root subvolume (subvolid=5 option) sudo mount -L sys -o subvolid=5 /mnt
and created @boot subvolume there, and copied (cp -a) the boot directory from my previous boot.
3. subvol= @boot 0 2
created fstab record for the new boot:
LABEL=sys /boot btrfs defaults,
and mounted it
mount -a
mount /boot/efi
4.
update-grub
Now works fine even on top of luks.
I have also created separate subvolume for /var/log but this is optional.