This error occurs when GRUB cannot properly map or detect a drive during installation or update. Common causes include incorrect device mapping, dual-boot configurations, or filesystem support issues. Regenerating the device map and ensuring proper mounting usually resolves the problem.
The "cannot find a GRUB drive" error means that GRUB (the bootloader) cannot locate or properly identify the disk drive specified. This typically happens when update-grub or grub-install runs and GRUB probe fails to detect the drive in the device.map file or cannot access the drive at all. The error indicates a mismatch between the actual hardware configuration and what GRUB expects, often due to missing device mapping files, incorrect partition configurations, or issues with how the drive is being accessed during the installation process.
The device.map file may be missing or outdated. Regenerate it by running:
sudo grub-mkdevicemap
sudo update-grubThis recreates the device.map file based on current hardware and should resolve the mapping issue in most cases.
If you are updating GRUB from a live USB or recovery environment, ensure you have properly mounted the root filesystem and any required partitions:
mount /dev/sdXY /mnt
mount /dev/sdXZ /mnt/boot
sudo chroot /mntBefore chrooting, also bind critical filesystems:
mount --bind /dev /mnt/dev
mount --bind /dev/pts /mnt/dev/pts
mount --bind /proc /mnt/proc
mount --bind /run /mnt/run
mount --bind /sys /mnt/sysThen run update-grub from within the chroot environment.
If your system uses UEFI firmware, ensure the EFI System Partition (ESP) is properly mounted:
mount /dev/nvme0n1p3 /mnt
mount /dev/nvme0n1p1 /mnt/boot/efi
arch-chroot /mnt
grub-mkconfig -o /boot/grub/grub.cfg
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grubReplace the device names with your actual partitions. Ensure the EFI partition has at least 100 MB of space.
Check if the partition is marked as bootable in the partition table:
sudo fdisk -l /dev/sdXLook for a "*" in the Boot column. If the boot flag is missing, set it with:
sudo fdisk /dev/sdXThen type "a" to toggle the boot flag on the correct partition, then "w" to write changes.
If GRUB cannot extract UUID information from your filesystem, it falls back to device names like /dev/sdXX. Verify your filesystem is supported:
df -TCommon supported filesystems include ext4, btrfs, and xfs. If using an unsupported filesystem, you may need to manually edit /boot/grub/grub.cfg and replace device names with UUID values:
blkid /dev/sdXYUse the UUID output to update your GRUB configuration if needed.
If grub-probe continues to fail even after proper mounting, you can replace the grub-probe binary with a shell script that outputs a known filesystem type:
sudo mv /usr/sbin/grub-probe /usr/sbin/grub-probe.orig
sudo tee /usr/sbin/grub-probe > /dev/null << EOF
#!/bin/bash
echo ext4
EOF
sudo chmod +x /usr/sbin/grub-probeRun update-grub, then restore the original binary:
sudo mv /usr/sbin/grub-probe.orig /usr/sbin/grub-probeUse this only if all other solutions fail, as it bypasses GRUB filesystem detection.
For dual-boot systems, ensure the primary boot drive (the one with the GRUB loader) is set as the first boot drive in firmware settings. On systems with multiple drives, GRUB may fail to detect secondary drives if they are not properly initialized or if the partition table is corrupted. Use parted or gdisk for GPT partitions to verify partition integrity. In some cases, especially with LVM or encrypted partitions, you may need to load additional modules or configure GRUB explicitly in /etc/default/grub before running update-grub.
dpkg: serious warning: files list file for package 'package-name' contains empty filename
How to fix "files list file contains empty filename" in APT
E: Sub-process /usr/bin/dpkg returned an error code (2)
How to fix "Sub-process /usr/bin/dpkg returned an error code (2)" in APT
dpkg-divert: error: rename involves overwriting 'path' with different file
How to fix dpkg-divert rename conflicts in APT
E: Sub-process /usr/bin/dpkg returned an error code (1) during kernel installation
How to fix "dpkg returned an error code (1)" in APT kernel installation
dpkg: dependency problems prevent configuration of triggers
dpkg: dependency problems prevent configuration of triggers in apt