grub-probe can't find drive for /dev/xvda1

If you are getting following while doing "apt-get upgrade" try our solution below.

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.

First let's create /dev/xvda block device:
Code:
mknod /dev/xvda b 202 0

Edit /boot/grub/device.map file:
Change...
Code:
(hd0) /dev/sda
To...
Code:
(hd0) /dev/xvda

Edit /usr/sbin/update-grub file:
Change...
Code:
find_device ()
{
        if ! test -e ${device_map} ; then
                echo quit | grub --batch --no-floppy --device-map=${device_map} > /dev/null
        fi
        grub-probe --device-map=${device_map} -t device $1 2> /dev/null
}
to
Code:
find_device ()
{
        if ! test -e ${device_map} ; then
                echo quit | grub --batch --no-floppy --device-map=${device_map} > /dev/null
        fi
        #grub-probe --device-map=${device_map} -t device $1 2> /dev/null

        echo /dev/xvda
}

Run...
Code:
update-grub 0

Assuming your root disk is /dev/xvda1, run...
Code:
sed -i "s/xvda/xvda1/g" /boot/grub/menu.lst


You should be able to run your "apt-get upgrade" now.

Posted on: 02/03/2013








0 Comments
If you want to leave a comment please Login or Register