Venom1991 / refind-btrfs

Generate rEFInd manual boot stanzas from Btrfs snapshots
GNU General Public License v3.0
144 stars 8 forks source link

Could not find the root partition #37

Closed UltraBlackLinux closed 1 year ago

UltraBlackLinux commented 1 year ago

Hey there, this time I actually have no idea, what I could do. Whenever I run refind-btrfs it errros ERROR: Could not find the root partition!

menuentry "Arch Linux" {
    icon     /EFI/refind/themes/refind-theme-regular/icons/512-192/os_arch.png
    volume   "4f58220f-2b24-374a-96c3-7d9c60290781"
    loader   /@/boot/vmlinuz-%v-zen
    initrd   /@/boot/initramfs-%v.img
    options  "root=PARTUUID=4f58220f-2b24-374a-96c3-7d9c60290781 rw add_efi_memmap rootflags=subvol=@ initrd=\boot\amd-ucode.img rd.udev.log_priority=3 vt.global_cursor_default=0 systemd.unified_cgroup_hierarchy=1 loglevel=3 sysrq_always_enabled=1 iommu=soft"
    submenuentry "Boot using fallback initramfs" {
        initrd /@/boot/initramfs-linux-fallback.img
    }
    submenuentry "Boot to terminal" {
        add_options "systemd.unit=multi-user.target"
    }
}

sda1 is my root partition

{
               "name": "sda1",
               "uuid": "6e6211b4-cfb4-44c0-8970-5e4a826e0c5e",
               "partuuid": "4f58220f-2b24-374a-96c3-7d9c60290781"
}

I already tried replacing both uuids with the partuuid, none of which worked, even though both variables are only supposed to have a partuuid.

Adding insult to injury, I have no idea, when to prepend what to the paths of the initframs and vmlinuzs. Just by trying out various configurations I got to this point:

Searching for snapshots of the '@' subvolume in the '/.snapshots/4840/snapshot/.snapshots' directory.
Found subvolume '@' mounted as the root partition.
Found 29 snapshots of the '@' subvolume.
Searching for the 'refind.conf' file on '/dev/sda2'.
Analyzing the 'refind.conf' file.
Found 1 boot stanza matched with the root partition.
...
Initializing the static partition table for subvolume '@/.snapshots/4810/snapshot' from its fstab file.
Found 29 snapshots for addition.
...
WARNING: Could not find the root partition in the '@/.snapshots/4810/snapshot' subvolume's static partition table!
WARNING: None of the snapshots for addition are usable!
WARNING: None of the prepared snapshots are matched with the 'Arch Linux' boot stanza!
ERROR: None of the matched boot stanzas can be combined with any of the prepared snapshots!

Tweaking some more I got the error I mentioned in the beginning. What is the correct configuration? Thanks!

Venom1991 commented 1 year ago

Paste the contents of your main fstab file (the one found in the @ subvolume). Also, check the contents of the snapshotted fstab file (found in, for example, @/.snapshots/4810/snapshot/etc) and paste its content if they aren't identical to the main fstab file's contents.

UltraBlackLinux commented 1 year ago

Paste the contents of your main fstab file (the one found in the @ subvolume). Also, check the contents of the snapshotted fstab file (found in, for example @/.snapshots/4810/snapshot/etc) and paste its content is they aren't identical to the main fstab file's contents.

diff'ed both files and they are the same.

UUID=3336-8C4E                            /boot/efi      vfat    umask=0077 0 2
UUID=6e6211b4-cfb4-44c0-8970-5e4a826e0c5e / btrfs subvol=/@,defaults,noatime,noautodefrag,compress=zstd,discard=async,ssd 0 0 #Modified_by_garuda-hotfixes(1)
UUID=6e6211b4-cfb4-44c0-8970-5e4a826e0c5e /root btrfs subvol=/@root,defaults,noatime,noautodefrag,compress=zstd,discard=async,ssd 0 0 #Modified_by_garuda-hotfixes(1)
UUID=6e6211b4-cfb4-44c0-8970-5e4a826e0c5e /srv btrfs subvol=/@srv,defaults,noatime,noautodefrag,compress=zstd,discard=async,ssd 0 0 #Modified_by_garuda-hotfixes(1)
UUID=6e6211b4-cfb4-44c0-8970-5e4a826e0c5e /var/cache btrfs subvol=/@cache,defaults,noatime,noautodefrag,compress=zstd,discard=async,ssd 0 0 #Modified_by_garuda-hotfixes(1)
UUID=6e6211b4-cfb4-44c0-8970-5e4a826e0c5e /var/log btrfs subvol=/@log,defaults,noatime,noautodefrag,compress=zstd,discard=async,ssd 0 0 #Modified_by_garuda-hotfixes(1)
UUID=6e6211b4-cfb4-44c0-8970-5e4a826e0c5e /var/tmp btrfs subvol=/@tmp,defaults,noatime,noautodefrag,compress=zstd,discard=async,ssd 0 0 #Modified_by_garuda-hotfixes(1)
UUID=ebceb2a3-01ad-46a4-9516-0a322af54c8d /home btrfs defaults,noatime,noautodefrag,compress=zstd,discard=async,ssd 0 0 #Modified_by_garuda-hotfixes(1)
tmpfs                                     /tmp           tmpfs   defaults,noatime,mode=1777 0 0

I also already tried prepending the @ of the root partition with a \ in the refind config, but that did nothing at all

Venom1991 commented 1 year ago

Try removing the "#Modified_by_garuda-hotfixes(1)" comments in both the main fstab file and also the snapshotted one. If it is a read-only snapshot you can either convert it to a writable one ("btrfs property set -ts /path/to/snapshot ro false") or create another snapshot of @ AFTER you've removed those comments.

I handle comments (ignore them completely, that is) only if they're occupying the whole line of text by themselves, not if they're combined with actual partition definitions.

UltraBlackLinux commented 1 year ago
WARNING: Detected boot files required by the 'Arch Linux' boot stanza which do not exist in the '@/.snapshots/4841/snapshot' subvolume: initramfs-%v.img, vmlinuz-%v-zen, initramfs-%v-fallback.img!
WARNING: None of the prepared snapshots are matched with the 'Arch Linux' boot stanza!
ERROR (refind_btrfs.state_management.conditions/conditions.py/check_boot_stanzas_with_snapshots): None of the matched boot stanzas can be combined with any of the prepared snapshots!

That now returned the above. I thought %v was a valid placeholder for kernel versions?

Edit: Just tried booting that, and it's apprently not valid

Venom1991 commented 1 year ago

Placeholders are not handled by this tool because it's primarily intended for Arch Linux where there's no such concept (AFAIK) - there's only "vmlinuz-linux" (vanilla), "vmlinuz-linux-lts", "vmlinuz-linux-zen", ... but there is no (for example) "vmlinuz-linux-5.10-lts".

Hm, sorry - it seems that you are running (in fact) Arch... I guess I'll have to somehow handle those variables as well as inline fstab comments.

UltraBlackLinux commented 1 year ago

Placeholders are not handled by this tool because it's primarily intended for Arch Linux where there's no such concept (AFAIK) - there's only "vmlinuz-linux" (vanilla), "vmlinuz-linux-lts", "vmlinuz-linux-zen", ... but there is no (for example) "vmlinuz-linux-5.10-lts".

Hm, sorry - it seems that you are running (in fact) Arch... I guess I'll have to somehow handle those variables as well as inline fstab comments.

I'm just gonna remove them. Still need to debug why it's not booting xD I think there is something wrong with my btrfs paths

Edit: Oh hey it's working Edit 2: refind-btrfs is too

UltraBlackLinux commented 1 year ago

Thank you for your help!

(Also what about the comments thing?)

Venom1991 commented 1 year ago

(Also what about the comments thing?)

That one is definitely a bug so open another issue, please.