How to fix update-grub: error: cannot find a GRUB drive for /dev/sdX in APT
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.
Quick fix
Fixes update-grub: error: cannot find a GRUB drive for /dev/sdX
sudo grub-mkdevicemap
sudo update-grub- Regenerate the GRUB device map
- Verify you are running from the correct boot environment
- For UEFI/EFI systems, verify boot partition configuration
- Ensure the drive is marked as bootable
sudo grub-mkdevicemapsudo update-grubupdate-grub: error: cannot find a GRUB drive for /dev/sdX
What this error means
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.
Typical symptoms
- update-grub command fails with error about GRUB drive
- grub-install fails when trying to install to a specific drive
- Dual-boot systems fail to update GRUB configuration
- Secondary drives in multi-disk setups are not recognized by GRUB
- USB or external drive installations fail to complete
Common causes
- Missing or outdated device.map file that maps drives incorrectly
- Dual-boot or multi-drive configurations where secondary drives are not properly detected
- Unsupported filesystem types that GRUB cannot extract UUID information from
- Improper mounting of filesystems when running update-grub from a live environment or chroot
- UEFI/GPT partition table issues without required BIOS boot partitions
- Drive or partition not marked as bootable in the partition table
How to fix "update-grub: error: cannot find a GRUB drive for /dev/sdX"
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.
Advanced notes
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.
Frequently asked questions
- What does "update-grub: error: cannot find a GRUB drive for /dev/sdX" mean?
- The "cannot find a GRUB drive" error means that GRUB (the bootloader) cannot locate or properly identify the disk drive specified. 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.
- How do I fix "update-grub: error: cannot find a GRUB drive for /dev/sdX"?
- 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.
- What causes "update-grub: error: cannot find a GRUB drive for /dev/sdX"?
- Missing or outdated device.map file that maps drives incorrectly Dual-boot or multi-drive configurations where secondary drives are not properly detected Unsupported filesystem types that GRUB cannot extract UUID information from
- Is the "update-grub: error: cannot find a GRUB drive for /dev/sdX" error serious?
- Yes. This is a high-severity error that usually blocks work until it is fixed, but the steps above resolve it.
Official resources & further reading
- ๐APT Official Documentation
- ๐Ubuntu GRUB2 Troubleshooting Guide(Official Docs)