My VPS runs its own kernel with PvGrub enabled on the host machine. When apt-get upgrades the kernel package, grub-probe will throw an error message:

grub-probe: error: Cannot find a GRUB drive for /dev/xvda1

And abort the upgrade procedure. This is due to the missing root device /dev/xvda. This bug has been submited to debian (#601974), but there seems no much progress.

I found an ugly way to solve this by making a fake node of /dev/xvda:

1
mknod /dev/xvda b 202 0

On Debian Lenny this works fine, but on Debian Squeeze grub-probe is not sufficiently tricked by the presense of /dev/xvda , as it actually tries to read from the drive it seems. Some additional steps is needed.

1. Make sure the device.map file contains:

(hd0) /dev/xvda

2.

1
vim `which update-grub`

Find the following section, and edit as shown.

113
114
115
116
117
118
119
120
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
}

Then an apt-get -f install will get things back to normal.