Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Share Post: Digg Delicious Reddit Twitter StumbleUpon
PyGrub "grub-probe can't find drive for /dev/xvda1" error - Debian Squeeze
03-25-2011, 02:12 AM (This post was last modified: 03-25-2011 02:18 AM by quad3datwork.)
Post: #1
PyGrub "grub-probe can't find drive for /dev/xvda1" error - Debian Squeeze
If you are getting following while doing "apt-get upgrade"...
Quote:Setting up linux-image-2.6.32-5-686-bigmem (2.6.32-31) ...
Running depmod.
Running update-initramfs.
update-initramfs: Generating /boot/initrd.img-2.6.32-5-686-bigmem
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 2.6.32-5-686-bigmem /boot/vmlinuz-2.6.32-5-686-bigmem
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 2.6.32-5-686-bigmem /boot/vmlinuz-2.6.32-5-686-bigmem
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.

run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-2.6.32-5-686-bigmem.postinst line 799, <STDIN> line 2.
dpkg: error processing linux-image-2.6.32-5-686-bigmem (--configure):
subprocess installed post-installation script returned error exit status 2
Setting up isc-dhcp-common (4.1.1-P1-15+squeeze1) ...
configured to not write apport reports
Setting up isc-dhcp-client (4.1.1-P1-15+squeeze1) ...
Setting up firmware-linux-free (2.6.32-31) ...
Setting up linux-libc-dev (2.6.32-31) ...
Setting up dhcp3-client (4.1.1-P1-15+squeeze1) ...
Errors were encountered while processing:
linux-image-2.6.32-5-686-bigmem
E: Sub-process /usr/bin/dpkg returned an error code (1)

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.
Visit this user's website Find all posts by this user
Quote this message in a reply
04-11-2011, 04:13 AM
Post: #2
RE: PyGrub "grub-probe can't find drive for /dev/xvda1" error - Debian Squeeze
Thanks a lot.. worked great on my Xen vps
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  "xen_net: Memory squeeze in netback driver” messages quad3datwork 0 599 07-19-2011 11:33 AM
Last Post: quad3datwork
  "hwcap index 0 already defined as nosegneg" error and fix quad3datwork 0 803 02-04-2011 11:15 AM
Last Post: quad3datwork

Forum Jump:


User(s) browsing this thread: 2 Guest(s)

System Administrator (SysAdmin) Forum - SysAdminTalk.Net