help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GRUB search doesn't set btrfs subvolume


From: Andrei Borzenkov
Subject: Re: GRUB search doesn't set btrfs subvolume
Date: Sun, 12 Mar 2023 09:21:07 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1

On 11.03.2023 22:46, Lyubomir Parvanov wrote:

And what is this search command?

https://www.gnu.org/software/grub/manual/grub/html_node/search.html


I know what grub search command is. You said "call to the search command in order to set the prefix environment variable. But as far as I understand it doesn't take into account the btrfs subvolumes" and I asked you to show this search command invocation.

Also show output of

lsblk -f

NAME               FSTYPE      FSVER LABEL UUID
       FSAVAIL FSUSE% MOUNTPOINTS
sda

├─sda1             vfat        FAT32       CCF8-C7BD
       504,9M     1% /boot/efi
├─sda2             btrfs
5f772e81-6e8f-4194-b9b7-5de280170447  256,2M    63% /boot/.snapshots
│
                    /boot
└─sda3             crypto_LUKS 1
a062052c-fc1f-47f9-bf2d-732f0570a842
   └─sda3_decrypted btrfs
b35ef12f-89d2-4449-bf5d-8aef71480809  889,6G     3% /home/.snapshots

                    /home

                    /var/crash

                    /.snapshots

                    /var/log

                    /var/snap/firefox/common/host-hunspell

                    /

from your operating system where grub.cfg is generated.

as I understand it doesn't take into account the btrfs subvolumes. The
prefix
environment variable has the value of (hd0,gpt2)/grub right after
dropping
into Minimal bash, and if i manually set the prefix to
(hd0,gpt2)/@boot/grub
instead and execute normal, the system boots successfully. What seems
strange to me is that the calls to linux and initrd do in fact detect
(and
set) the @boot btrfs subvolume.

I do not understand what it means. What exactly "initrd detects and sets
@boot" means?

It somehow knows to include @boot inside the calls to the linux and
initrd commands
inside grub.cfg, like so:
linux /@boot/vmlinuz-5.19.0-35-generic
root=UUID=b35ef12f-89d2-4449-bf5d-8aef71480809 ro rootflags=subvol=@  quiet
splash $vt_handoff

Yet it doesn't include @boot in the prefix grub env variable. At least
that's what i think causes the issue, cause as i said if i set it manually
in the minimal shell it is able to boot.

I am also attaching the output of findmnt, which might be useful too:
TARGET                                        SOURCE
                      FSTYPE      OPTIONS
/
/dev/mapper/sda3_decrypted[/@]                    btrfs
rw,relatime,space_cache=v2,subvolid=256,subvol=/@
├─/var/crash
  /dev/mapper/sda3_decrypted[/@varcrash]            btrfs
rw,relatime,space_cache=v2,subvolid=262,subvol=/@varcrash
├─/home
/dev/mapper/sda3_decrypted[/@home]                btrfs
rw,relatime,space_cache=v2,subvolid=257,subvol=/@home
│ └─/home/.snapshots
  /dev/mapper/sda3_decrypted[/@home-snapshot]       btrfs
rw,relatime,space_cache=v2,subvolid=259,subvol=/@home-snapshot
├─/.snapshots
/dev/mapper/sda3_decrypted[/@root-snapshot]       btrfs
rw,relatime,space_cache=v2,subvolid=258,subvol=/@root-snapshot
├─/var/log
  /dev/mapper/sda3_decrypted[/@varlog]              btrfs
rw,relatime,space_cache=v2,subvolid=263,subvol=/@varlog
└─/boot                                       /dev/sda2[/@boot]
                     btrfs
rw,relatime,space_cache=v2,subvolid=256,subvol=/@boot
   ├─/boot/efi                                 /dev/sda1
                     vfat
  
rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro
   └─/boot/.snapshots                          /dev/sda2[/@boot-snapshot]
                      btrfs
rw,relatime,space_cache=v2,subvolid=257,subvol=/@boot-snapshot





reply via email to

[Prev in Thread] Current Thread [Next in Thread]