• 0 Posts
  • 4 Comments
Joined 1 year ago
cake
Cake day: June 15th, 2023

help-circle


  • check the GRUB_CMDLINE_LINUX key in /etc/default/grub it should contain the info about any subvolume. if it does not then there might be another grub config hook that is used by Fedora to add that info. If you want to be able to change subvol names without having to touch the grub config you might also want to switch to using subvolid instead of subvol keys on the kernel command line, because the id will stay the same after a rename (this could backfire though if you assign functions to certain names like “fallback” etc.).

    Edit: found the hook that adds the kernel command line option for btrfs subvolumes. in /etc/grub.d/10_linux there is this bit of code:

    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)
            [skipped for brevity]
            ;;
    esac
    

    so it seems it is always looking at the subvol name of the currently mounted root fs.