Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On my VPS (running Debian 6.0 on Xen with PyGrub) I get the following error when trying to upgrade the system:

Searching for GRUB installation directory ... found: /boot/grub
warning: grub-probe can't find drive for /dev/xvda1.
grub-probe: error: cannot find a GRUB drive for /dev/xvda1.  Check your device.map.

I googled and found this solution:

echo '(hd0) /dev/xvda' > /boot/grub/device.map
mknod /dev/xvda b 202 0

Apparently that only works on older systems and not on my server.

Any ideas?

share|improve this question

Had the same problem, and that solution also did not work me.

Here's what worked at last:

echo '(hd0) /dev/xvdb' > /boot/grub/device.map
mknod /dev/xvdb b 202 0

(It didn't work with xvda for me.) Then edit /usr/sbin/grub-update and find

find_device ()
        if ! test -e ${device_map} ; then
                echo quit | grub --batch --no-floppy --device-map=${device_map} > /dev/null
        grub-probe --device-map=${device_map} -t device $1 2> /dev/null

and replace with

find_device ()
        if ! test -e ${device_map} ; then
                echo quit | grub --batch --no-floppy --device-map=${device_map} > /dev/null
        # grub-probe --device-map=${device_map} -t device $1 2> /dev/null
        echo /dev/xvdb


apt-get upgrade

Edit /boot/grub/menu.lst with

sed -i "s/xvdb/xvda1/g" /boot/grub/menu.lst


Make a note of the changes made :)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.