Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grub-install: error: failed to get canonical path #1993

Closed
abalfoort opened this issue Jun 17, 2022 · 7 comments
Closed

grub-install: error: failed to get canonical path #1993

abalfoort opened this issue Jun 17, 2022 · 7 comments

Comments

@abalfoort
Copy link
Contributor

abalfoort commented Jun 17, 2022

Describe the bug
Bootloader cannot install on EFI system.

To Reproduce
Steps to reproduce the behavior:

  1. Start installation (replace or manual)
  2. Calamares erros out when trying to run grub-instrall

Expected behavior
grub-install should finish without errors.

Screenshots and Logs

    Starting job "bootloader" ( 34 / 42 ) 
2022-06-17 - 06:08:03 [6]: virtual Calamares::JobResult Calamares::PythonJob::exec()
    Job file "/usr/lib/x86_64-linux-gnu/calamares/modules/bootloader/main.py" 
2022-06-17 - 06:08:03 [6]: [PYTHON JOB]: Found gettext "en_US" in "/usr/share/locale/en_US" 
2022-06-17 - 06:08:03 [6]:     .. Job description from pretty_name "bootloader" = "Install bootloader." 
2022-06-17 - 06:08:03 [6]: [PYTHON JOB]: "Bootloader: grub (efi)" 
2022-06-17 - 06:08:03 [6]:     .. Running ("grub-install", "--target=x86_64-efi", "--efi-directory=/boot/efi", "--bootloader-id=debian", "--force") 
2022-06-17 - 06:08:03 [6]:     .. Target cmd: ("grub-install", "--target=x86_64-efi", "--efi-directory=/boot/efi", "--bootloader-id=debian", "--force") Exit code: 1 output:
 Installing for x86_64-efi platform.
grub-install: error: failed to get canonical path of `/dev/sda1'.
2022-06-17 - 06:08:03 [2]: WARNING: [PYTHON JOB]: "Command 'grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=debian --force' returned non-zero exit status 1." 
2022-06-17 - 06:08:03 [6]: [PYTHON JOB]: "stdout:Installing for x86_64-efi platform.\ngrub-install: error: failed to get canonical path of `/dev/sda1'." 
2022-06-17 - 06:08:03 [6]: [PYTHON JOB]: "stderr:None" 

Additional context
Calamares build v3.3.
Tested with Debian 11 (stable) in Virtualbox 6.1.
In settings.conf bootloader is configured to run just before umount.

@demmm
Copy link
Contributor

demmm commented Jun 17, 2022

Can you check the log and see what is set for the bootloader partition? And on the fail, can you check what filesystem is set on (as in this case) /dev/sda1? sudo fdisk -l

@abalfoort
Copy link
Contributor Author

Settings for /dev/sda1 in log:

2022-06-17 - 10:42:58 [6]:     ..  mapping for "/dev/sda1" "/dev/sda1" 
     partlabel :   "EFI" 
     partition-uuid (partuuid) :   "PartUUID$926d85e4" 
     parttype :   "" 
     partattrs :   "0" 
     mountPoint: :   "/boot/efi" 
     fs: :   "fat32" 
     fsName :   "fat32" 
     filesystem-uuid (uuid) :   "FSUUID$397a92c1" 
     claimed :   "true" 

Fdisk:

solydxk@solydxk:~$ sudo fdisk -l
Disk /dev/sda: 30 GiB, 32212254720 bytes, 62914560 sectors
Disk model: VBOX HARDDISK   
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: CDCEF9F0-E664-FE4C-A74C-A24E2581EDC6

Device        Start      End  Sectors  Size Type
/dev/sda1      4096   618495   614400  300M EFI System
/dev/sda2    618496 21590015 20971520   10G Linux filesystem
/dev/sda3  21590016 62910539 41320524 19.7G Linux filesystem


Disk /dev/loop0: 1.71 GiB, 1831739392 bytes, 3577616 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Blkid:

solydxk@solydxk:~$ sudo blkid /dev/sda1
/dev/sda1: LABEL_FATBOOT="NO_LABEL" LABEL="NO_LABEL" UUID="AABE-C764" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI" PARTUUID="6ceed259-f76c-674f-96f2-229b8f8f09b6"

@abalfoort
Copy link
Contributor Author

I replaced the new bootloader module with the version from the 3.2.x-stable branch and had the same result. So, something goes wrong earlier in the process.

@demmm
Copy link
Contributor

demmm commented Jun 17, 2022

It seems to me to be a path issue, not using the chroot rootmountpoint for /dev/sda1.

To confirm, you can manually try to run the grub-install line, after you mount /dev/sda1.

@abalfoort
Copy link
Contributor Author

abalfoort commented Jun 18, 2022

No problem doing that manually, so yes, this seems to be a chroot issue.

In chroot:

root@solydxk:/# mount /dev/sda1 /boot/efi

root@solydxk:/# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=debian --force
Installing for x86_64-efi platform.
Installation finished. No error reported.

root@solydxk:/# ls /boot/efi/EFI/debian
BOOTX64.CSV  fbx64.efi  grub.cfg  grubx64.efi  mmx64.efi  shimx64.efi

@demmm
Copy link
Contributor

demmm commented Jun 18, 2022

Do you see this issue on EFI/GRUB only? Tested BIOS/GRUB (or maybe EFI/systemd-boot)?
Are your fstab & mount configuration files updated for the 3.3 move?

@abalfoort
Copy link
Contributor Author

@demmm
You're right, I checked all conf files and found that only mount was not up-to-date. Figure that.
Thanks for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants