I have been using my hard drive since last 2 years for various trial and error purpose (don’t we all love that!). I keep shifting my hard drive to different types of machines belonging to different architectures. One fine day I suddenly started noticing the following message (in red) whenever I use to upgrade/install/un-install a kernel:

Running depmod.
Running postinst hook script update-grub.
Searching for GRUB installation directory ... found: /boot/grub
warning: grub-probe can't find drive for /dev/sda1.
Please check /boot/grub/device.map, you might have to regenerate it with grub-mkdevicemap.
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-2.6.30-1-test1
Found kernel: /boot/vmlinuz-2.6.30-1-atom-test2
Found kernel: /boot/vmlinuz-2.6.30-1-686
Updating /boot/grub/menu.lst ... done

Basically any program that initiates a GRUB hook, causes the to generate above message.

The Solution


All you need to do to fix the above message is to issue the following command:

grub-mkdevicemap

which basically re-generates the /boot/grub/device.map file for you.

Earlier the contents of this file were:

debian:~# less /boot/grub/device.map
(hd0)   /dev/hda
(hd1)   /dev/hdb
(hd2)   /dev/hdc

After the fix the contents were:

debian:~# less /boot/grub/device.map
(hd0)   /dev/sda

Basically my system did a transition from hdX->sdX and the GRUB device map file became invalid. Also on my earlier system I had 3 IDE hard drives but on my new system I just had one IDE hard drive which uses the newer LIBATA driver in the kernel. More on this “libata” stuff in my future posts.

That’s it!

Be Sociable, Share!