Venom1991 / refind-btrfs

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

ERROR (refind_btrfs.state_management.conditions/conditions.py/check_filtered_block_devices): Could not find the ESP! #52

Open sentakuhm opened 1 year ago

sentakuhm commented 1 year ago

I know there is same issue [#16](ERROR (refind_btrfs.state_management.conditions/conditions.py/check_filtered_block_devices): Could not find the ESP!), but tried all my best but cant solve it.

/dev/nvme0n1p2

UUID=79db120b-271e-4354-9d27-893cf51fee92 / btrfs rw,noatime,compress=zstd:1,ssd,discard=async,space_cache=v2,subvolid=256,subvol=/@ 0 0

/dev/nvme0n1p2

UUID=79db120b-271e-4354-9d27-893cf51fee92 /home btrfs rw,noatime,compress=zstd:1,ssd,discard=async,space_cache=v2,subvolid=257,subvol=/@home 0 0

/dev/nvme0n1p2

UUID=79db120b-271e-4354-9d27-893cf51fee92 /swap btrfs rw,noatime,compress=zstd:1,ssd,discard=async,space_cache=v2,subvolid=258,subvol=/@swap 0 0

/dev/nvme0n1p2

UUID=79db120b-271e-4354-9d27-893cf51fee92 /.snapshots btrfs rw,noatime,compress=zstd:1,ssd,discard=async,space_cache=v2,subvolid=259,subvol=/@.snapshots 0 0

/dev/nvme0n1p2

UUID=79db120b-271e-4354-9d27-893cf51fee92 /var/log btrfs rw,noatime,compress=zstd:1,ssd,discard=async,space_cache=v2,subvolid=260,subvol=/@log 0 0

/dev/nvme0n1p2

UUID=79db120b-271e-4354-9d27-893cf51fee92 /var/cache/pacman/pkg btrfs rw,noatime,compress=zstd:1,ssd,discard=async,space_cache=v2,subvolid=261,subvol=/@pkgs 0 0

/dev/nvme0n1p1

UUID=DED3-A9F7 /efi vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro 0 2

Swapfile

/swap/swapfile none swap defaults 0 0

/dev/nvme0n1p3

UUID=37a478c3-4fd3-4177-85bf-a4a137d8dda5 /GamesDisk ext4 defaults 0 2

/dev/nvme0n1p4

UUID=922EEDEC2EEDC975 /LocalDisk ntfs3 uid=sentaku,gid=users,umask=0022 0 0


* output of `lsblk --json --merge --paths --output NAME,TYPE,MAJ:MIN`

{ "blockdevices": [ { "name": "/dev/sda", "type": "disk", "maj:min": "8:0", "children": [ { "name": "/dev/sda1", "type": "part", "maj:min": "8:1" } ] },{ "name": "/dev/nvme0n1", "type": "disk", "maj:min": "259:0", "children": [ { "name": "/dev/nvme0n1p1", "type": "part", "maj:min": "259:1" },{ "name": "/dev/nvme0n1p2", "type": "part", "maj:min": "259:2" },{ "name": "/dev/nvme0n1p3", "type": "part", "maj:min": "259:3" },{ "name": "/dev/nvme0n1p4", "type": "part", "maj:min": "259:4" } ] } ] }


* Output of `lsblk /dev/sda --json --paths --tree --output PTUUID,PTTYPE,PARTUUID,PARTTYPE,PARTLABEL,UUID,NAME,FSTYPE,LABEL,MOUNTPOINT`

{ "blockdevices": [ { "ptuuid": "a1f7e11f-0066-4aca-91f8-c01bddb172b5", "pttype": "gpt", "partuuid": null, "parttype": null, "partlabel": null, "uuid": null, "name": "/dev/sda", "fstype": null, "label": null, "mountpoint": null, "children": [ { "ptuuid": "a1f7e11f-0066-4aca-91f8-c01bddb172b5", "pttype": "gpt", "partuuid": "5c6e69f1-4755-4e5b-99be-452289ad9a76", "parttype": "ebd0a0a2-b9e5-4433-87c0-68b6b72699c7", "partlabel": "Basic data partition", "uuid": "C4E6ECB0E6ECA440", "name": "/dev/sda1", "fstype": "ntfs", "label": null, "mountpoint": null } ] } ] }

* Output of `findmnt --json --mtab --real --nofsroot --output PARTUUID,PARTLABEL,UUID,SOURCE,FSTYPE,LABEL,TARGET,OPTIONS`

{ "filesystems": [ { "partuuid": "a768537f-a70b-4203-9095-ecf6e62634f6", "partlabel": null, "uuid": "79db120b-271e-4354-9d27-893cf51fee92", "source": "/dev/nvme0n1p2", "fstype": "btrfs", "label": "Arch Linux", "target": "/", "options": "rw,noatime,compress=zstd:1,ssd,discard=async,space_cache=v2,subvolid=976,subvol=/@" },{ "partuuid": "a768537f-a70b-4203-9095-ecf6e62634f6", "partlabel": null, "uuid": "79db120b-271e-4354-9d27-893cf51fee92", "source": "/dev/nvme0n1p2", "fstype": "btrfs", "label": "Arch Linux", "target": "/.snapshots", "options": "rw,noatime,compress=zstd:1,ssd,discard=async,space_cache=v2,subvolid=259,subvol=/@.snapshots" },{ "partuuid": "a768537f-a70b-4203-9095-ecf6e62634f6", "partlabel": null, "uuid": "79db120b-271e-4354-9d27-893cf51fee92", "source": "/dev/nvme0n1p2", "fstype": "btrfs", "label": "Arch Linux", "target": "/home", "options": "rw,noatime,compress=zstd:1,ssd,discard=async,space_cache=v2,subvolid=257,subvol=/@home" },{ "partuuid": "a768537f-a70b-4203-9095-ecf6e62634f6", "partlabel": null, "uuid": "79db120b-271e-4354-9d27-893cf51fee92", "source": "/dev/nvme0n1p2", "fstype": "btrfs", "label": "Arch Linux", "target": "/swap", "options": "rw,noatime,compress=zstd:1,ssd,discard=async,space_cache=v2,subvolid=258,subvol=/@swap" },{ "partuuid": "a768537f-a70b-4203-9095-ecf6e62634f6", "partlabel": null, "uuid": "79db120b-271e-4354-9d27-893cf51fee92", "source": "/dev/nvme0n1p2", "fstype": "btrfs", "label": "Arch Linux", "target": "/var/cache/pacman/pkg", "options": "rw,noatime,compress=zstd:1,ssd,discard=async,space_cache=v2,subvolid=261,subvol=/@pkgs" },{ "partuuid": "a768537f-a70b-4203-9095-ecf6e62634f6", "partlabel": null, "uuid": "79db120b-271e-4354-9d27-893cf51fee92", "source": "/dev/nvme0n1p2", "fstype": "btrfs", "label": "Arch Linux", "target": "/var/log", "options": "rw,noatime,compress=zstd:1,ssd,discard=async,space_cache=v2,subvolid=260,subvol=/@log" },{ "partuuid": "650b3570-74ab-4180-95e9-4ca6777c0943", "partlabel": null, "uuid": "DED3-A9F7", "source": "/dev/nvme0n1p1", "fstype": "vfat", "label": null, "target": "/efi", "options": "rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro" },{ "partuuid": "8856295a-66f3-4b92-919d-255ce05fe43c", "partlabel": null, "uuid": "37a478c3-4fd3-4177-85bf-a4a137d8dda5", "source": "/dev/nvme0n1p3", "fstype": "ext4", "label": "Gaming", "target": "/GamesDisk", "options": "rw,relatime" },{ "partuuid": "42c45d81-a122-4a32-89b9-fae21751edcb", "partlabel": "Basic data partition", "uuid": "922EEDEC2EEDC975", "source": "/dev/nvme0n1p4", "fstype": "ntfs3", "label": null, "target": "/LocalDisk", "options": "rw,relatime,uid=1000,gid=984,dmask=0022,fmask=0022,iocharset=utf8" },{ "partuuid": null, "partlabel": null, "uuid": null, "source": "portal", "fstype": "fuse.portal", "label": null, "target": "/run/user/1000/doc", "options": "rw,nosuid,nodev,relatime,user_id=1000,group_id=1000" } ] }

Venom1991 commented 1 year ago

Try setting this config option.

EDIT: Did you try setting it to "5c6e69f1-4755-4e5b-99be-452289ad9a76"?

sentakuhm commented 1 year ago

Try setting this config option.

EDIT: Did you try setting it to "5c6e69f1-4755-4e5b-99be-452289ad9a76"?

the same settings are on /etc/refind-btrfs.conf and i didn't setting it to "5c6e69f1-4755-4e5b-99be-452289ad9a76".

i think you mean "650b3570-74ab-4180-95e9-4ca6777c0943" which is for efi partition. i added it to settings which is the error message changed to:

Initializing the block devices using lsblk.
Initializing the physical partition table for device '/dev/sda' using lsblk.
Initializing the live partition table for device '/dev/sda' using findmnt.
Initializing the physical partition table for device '/dev/nvme0n1' using lsblk.
Initializing the live partition table for device '/dev/nvme0n1' using findmnt.
Found the ESP mounted at '/efi' on '/dev/nvme0n1p1'.
ERROR (refind_btrfs.state_management.conditions/conditions.py/check_filtered_block_devices): Could not find the root partition!
Venom1991 commented 1 year ago

Paste the output of lsblk /dev/nvme0n1--json --paths --tree --output PTUUID,PTTYPE,PARTUUID,PARTTYPE,PARTLABEL,UUID,NAME,FSTYPE,LABEL,MOUNTPOINT.

sentakuhm commented 1 year ago

Paste the output of lsblk /dev/nvme0n1--json --paths --tree --output PTUUID,PTTYPE,PARTUUID,PARTTYPE,PARTLABEL,UUID,NAME,FSTYPE,LABEL,MOUNTPOINT.

{
   "blockdevices": [
      {
         "ptuuid": "dc7037f7-f0dd-43e4-bcbc-5b49bf890000",
         "pttype": "gpt",
         "partuuid": null,
         "parttype": null,
         "partlabel": null,
         "uuid": null,
         "name": "/dev/nvme0n1",
         "fstype": null,
         "label": null,
         "mountpoint": null,
         "children": [
            {
               "ptuuid": "dc7037f7-f0dd-43e4-bcbc-5b49bf890000",
               "pttype": "gpt",
               "partuuid": "650b3570-74ab-4180-95e9-4ca6777c0943",
               "parttype": "0fc63daf-8483-4772-8e79-3d69d8477de4",
               "partlabel": null,
               "uuid": "DED3-A9F7",
               "name": "/dev/nvme0n1p1",
               "fstype": "vfat",
               "label": null,
               "mountpoint": "/efi"
            },{
               "ptuuid": "dc7037f7-f0dd-43e4-bcbc-5b49bf890000",
               "pttype": "gpt",
               "partuuid": "a768537f-a70b-4203-9095-ecf6e62634f6",
               "parttype": "0fc63daf-8483-4772-8e79-3d69d8477de4",
               "partlabel": null,
               "uuid": "79db120b-271e-4354-9d27-893cf51fee92",
               "name": "/dev/nvme0n1p2",
               "fstype": "btrfs",
               "label": "Arch Linux",
               "mountpoint": "/var/log"
            },{
               "ptuuid": "dc7037f7-f0dd-43e4-bcbc-5b49bf890000",
               "pttype": "gpt",
               "partuuid": "8856295a-66f3-4b92-919d-255ce05fe43c",
               "parttype": "0fc63daf-8483-4772-8e79-3d69d8477de4",
               "partlabel": null,
               "uuid": "37a478c3-4fd3-4177-85bf-a4a137d8dda5",
               "name": "/dev/nvme0n1p3",
               "fstype": "ext4",
               "label": "Gaming",
               "mountpoint": "/GamesDisk"
            },{
               "ptuuid": "dc7037f7-f0dd-43e4-bcbc-5b49bf890000",
               "pttype": "gpt",
               "partuuid": "42c45d81-a122-4a32-89b9-fae21751edcb",
               "parttype": "ebd0a0a2-b9e5-4433-87c0-68b6b72699c7",
               "partlabel": "Basic data partition",
               "uuid": "922EEDEC2EEDC975",
               "name": "/dev/nvme0n1p4",
               "fstype": "ntfs",
               "label": null,
               "mountpoint": "/LocalDisk"
            }
         ]
      }
   ]
}
Venom1991 commented 1 year ago

Honestly, judging by the output I don't really find anything wrong with your setup. I'll have to debug when I find the time.

sentakuhm commented 1 year ago

i did a clean install now error before seems to be gone, but i got new one

Initializing the block devices using lsblk.
Initializing the physical partition table for device '/dev/sda' using lsblk.
Initializing the live partition table for device '/dev/sda' using findmnt.
Initializing the physical partition table for device '/dev/nvme0n1' using lsblk.
Initializing the live partition table for device '/dev/nvme0n1' using findmnt.
Found the ESP mounted at '/efi' on '/dev/nvme0n1p1'.
Found the root partition on '/dev/nvme0n1p2'.
Searching for snapshots of the '@' subvolume in the '/.snapshots' directory.
Found subvolume '@' mounted as the root partition.
Found 2 snapshots of the '@' subvolume.
Searching for the 'refind.conf' file on '/dev/nvme0n1p1'.
Analyzing the 'refind.conf' file.
ERROR (refind_btrfs.state_management.conditions/conditions.py/check_matched_boot_stanzas): Could not find a boot stanza matched with the root partition!

refind.conf:

menuentry "Arch Linux" {
    icon     /EFI/refind/icons/os_arch.png
    volume   "Arch Linux"
    loader   /boot/vmlinuz-linux-zen
    initrd   /boot/initramfs-linux-zen.img
    options  "root=UUID=55ce5036-4cba-4755-9e92-d69701b68f6a rw quiet rootflags=subvol=@ initrd=boot\amd-ucode.img"
    submenuentry "Boot using fallback initramfs" {
        initrd /boot/initramfs-linux-zen-fallback.img
    }
    submenuentry "Boot to terminal" {
        add_options "systemd.unit=multi-user.target"
    }
    disabled
}

is something wrong here or what?

Venom1991 commented 1 year ago

If you inspect findmnt's output of the / partition you'll notice that its UUID is not the same as the one in the boot stanza:

{
         "partuuid": "a768537f-a70b-4203-9095-ecf6e62634f6",
         "partlabel": null,
         "uuid": "79db120b-271e-4354-9d27-893cf51fee92",
         "source": "/dev/nvme0n1p2",
         "fstype": "btrfs",
         "label": "Arch Linux",
         "target": "/",
         "options": "rw,noatime,compress=zstd:1,ssd,discard=async,space_cache=v2,subvolid=976,subvol=/@"
}

That is to say, "79db120b-271e-4354-9d27-893cf51fee92" is not the same as "55ce5036-4cba-4755-9e92-d69701b68f6a". Try setting "root=UUID=79db120b-271e-4354-9d27-893cf51fee92" or "root=PARTUUID=a768537f-a70b-4203-9095-ecf6e62634f6" in your boot stanza. You can study the example, as well.

sentakuhm commented 1 year ago

yes i know they are not same cuz i made a clean install so UUID options changed to:

"filesystems": [
      {
         "partuuid": "a768537f-a70b-4203-9095-ecf6e62634f6",
         "partlabel": null,
         "uuid": "55ce5036-4cba-4755-9e92-d69701b68f6a",
         "source": "/dev/nvme0n1p2",
         "fstype": "btrfs",
         "label": "Arch Linux",
         "target": "/",
         "options": "rw,noatime,compress=zstd:1,ssd,discard=async,space_cache=v2,subvolid=256,subvol=/@"
      }

when using PARTUUID, i got same message after running refind-btrfs.

Venom1991 commented 1 year ago

But that UUID in the boot stanza is not the same one as the one in findmnt's output. Please check that you setup fulfills all of the prerequisites, especially the last one.

EDIT: Ah, I see it's they're supposed to be the same now but do paste findmnt's output here, again.

EDIT 2: I noticed that your boot stanza has the "disabled" option included in it. These boot stanzas are parsed by refind-btrfs but they're also completely ignored by it, as well.

sentakuhm commented 1 year ago
{
   "filesystems": [
      {
         "partuuid": "a768537f-a70b-4203-9095-ecf6e62634f6",
         "partlabel": null,
         "uuid": "55ce5036-4cba-4755-9e92-d69701b68f6a",
         "source": "/dev/disk/by-uuid/55ce5036-4cba-4755-9e92-d69701b68f6a",
         "fstype": "btrfs",
         "label": "Arch Linux",
         "target": "/",
         "options": "rw,noatime,compress=zstd:1,ssd,discard=async,space_cache=v2,subvolid=256,subvol=/@"
      },{
         "partuuid": "a768537f-a70b-4203-9095-ecf6e62634f6",
         "partlabel": null,
         "uuid": "55ce5036-4cba-4755-9e92-d69701b68f6a",
         "source": "/dev/disk/by-uuid/55ce5036-4cba-4755-9e92-d69701b68f6a",
         "fstype": "btrfs",
         "label": "Arch Linux",
         "target": "/home",
         "options": "rw,noatime,compress=zstd:1,ssd,discard=async,space_cache=v2,subvolid=257,subvol=/@home"
      },{
         "partuuid": "a768537f-a70b-4203-9095-ecf6e62634f6",
         "partlabel": null,
         "uuid": "55ce5036-4cba-4755-9e92-d69701b68f6a",
         "source": "/dev/disk/by-uuid/55ce5036-4cba-4755-9e92-d69701b68f6a",
         "fstype": "btrfs",
         "label": "Arch Linux",
         "target": "/var/log",
         "options": "rw,noatime,compress=zstd:1,ssd,discard=async,space_cache=v2,subvolid=262,subvol=/@var_log"
      },{
         "partuuid": "650b3570-74ab-4180-95e9-4ca6777c0943",
         "partlabel": null,
         "uuid": "DF28-0FD1",
         "source": "/dev/nvme0n1p1",
         "fstype": "vfat",
         "label": null,
         "target": "/efi",
         "options": "rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro"
      },{
         "partuuid": "8856295a-66f3-4b92-919d-255ce05fe43c",
         "partlabel": null,
         "uuid": "37a478c3-4fd3-4177-85bf-a4a137d8dda5",
         "source": "/dev/nvme0n1p3",
         "fstype": "ext4",
         "label": "Gaming",
         "target": "/GamesDisk",
         "options": "rw,relatime"
      },{
         "partuuid": "42c45d81-a122-4a32-89b9-fae21751edcb",
         "partlabel": "Basic data partition",
         "uuid": "922EEDEC2EEDC975",
         "source": "/dev/nvme0n1p4",
         "fstype": "ntfs3",
         "label": null,
         "target": "/LocalDisk",
         "options": "rw,relatime,uid=1000,gid=984,dmask=0022,fmask=0022,iocharset=utf8"
      },{
         "partuuid": null,
         "partlabel": null,
         "uuid": null,
         "source": "portal",
         "fstype": "fuse.portal",
         "label": null,
         "target": "/run/user/1000/doc",
         "options": "rw,nosuid,nodev,relatime,user_id=1000,group_id=1000"
      },{
         "partuuid": null,
         "partlabel": null,
         "uuid": null,
         "source": "/dev/loop0",
         "fstype": "ext4",
         "label": null,
         "target": "/var/lib/waydroid/rootfs",
         "options": "ro,relatime"
      },{
         "partuuid": null,
         "partlabel": null,
         "uuid": null,
         "source": "/dev/loop1",
         "fstype": "ext4",
         "label": null,
         "target": "/var/lib/waydroid/rootfs/vendor",
         "options": "ro,relatime"
      },{
         "partuuid": "a768537f-a70b-4203-9095-ecf6e62634f6",
         "partlabel": null,
         "uuid": "55ce5036-4cba-4755-9e92-d69701b68f6a",
         "source": "/dev/disk/by-uuid/55ce5036-4cba-4755-9e92-d69701b68f6a",
         "fstype": "btrfs",
         "label": "Arch Linux",
         "target": "/var/lib/waydroid/rootfs/vendor/waydroid.prop",
         "options": "rw,noatime,compress=zstd:1,ssd,discard=async,space_cache=v2,subvolid=256,subvol=/@"
      }
   ]
}

EDIT: Ah, I see it's they're supposed to be the same now but do paste findmnt's output here, again.

EDIT 2: I noticed that your boot stanza has the "disabled" option included in it. These boot stanzas are parsed by refind-btrfs but they're also completely ignored by it, as well.

how to enable it?

Venom1991 commented 1 year ago

how to enable it?

Simply remove the "disabled" line from the boot stanza's definition.

sentakuhm commented 1 year ago

now got another message

Initializing the block devices using lsblk.
Initializing the physical partition table for device '/dev/loop0' using lsblk.
Initializing the live partition table for device '/dev/loop0' using findmnt.
Initializing the physical partition table for device '/dev/loop1' using lsblk.
Initializing the live partition table for device '/dev/loop1' using findmnt.
Initializing the physical partition table for device '/dev/sda' using lsblk.
Initializing the live partition table for device '/dev/sda' using findmnt.
Initializing the physical partition table for device '/dev/nvme0n1' using lsblk.
Initializing the live partition table for device '/dev/nvme0n1' using findmnt.
Found the ESP mounted at '/efi' on '/dev/nvme0n1p1'.
ERROR (refind_btrfs.state_management.conditions/conditions.py/check_filtered_block_devices): Could not find the root partition!
Venom1991 commented 1 year ago

That error isn't related to boot stanzas and it seems we're going around in circles. Other than debugging your exact same setup I'm all out of ideas. Sorry.

Venom1991 commented 1 year ago

On second glance this seems to be the issue: "source": "/dev/disk/by-uuid/55ce5036-4cba-4755-9e92-d69701b68f6a". This tool currently does not support persistent block device naming schemes. See issue #46.