FastNetMon

Sunday 29 November 2009

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

Вот часто в Xen DomU возникает такой трабл при апдейте GRUB или ядра:


Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-2.6.26-2-xen-686
Errors were encountered while processing:
linux-image-2.6.26-2-xen-686
linux-image-2.6-xen-686
E: Sub-process /usr/bin/dpkg returned an error code (1)


Или вот такой:


apt-get dist-upgrade
Reading package lists... Done
Building dependency tree... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up linux-image-2.6.26-2-xen-686 (2.6.26-19lenny2) ...
update-initramfs: Generating /boot/initrd.img-2.6.26-2-xen-686
Searching for GRUB installation directory ... found: /boot/grub
warning: grub-probe can't find drive for /dev/sda1.
grub-probe: error: Cannot find a GRUB drive for /dev/sda1. Check your device.map.

dpkg: error processing linux-image-2.6.26-2-xen-686 (--configure):
subprocess post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of linux-image-2.6-xen-686:
linux-image-2.6-xen-686 depends on linux-image-2.6.26-2-xen-686; however:
Package linux-image-2.6.26-2-xen-686 is not configured yet.
dpkg: error processing linux-image-2.6-xen-686 (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
linux-image-2.6.26-2-xen-686
linux-image-2.6-xen-686
E: Sub-process /usr/bin/dpkg returned an error code (1)




ИМХО, самый правильный способ фикса проблемы в этом случае (если не используется PyGrub конечно, а ядра для DomU указаны явно):
apt-get remove grub

2 comments :

  1. Неправильные способы:
    echo "(hd0) /dev/sda" > /boot/grub/device.map
    cd /dev
    mknod sda b 202 0

    А когда grub-update радует сообщением "cannot find a GRUB drive for /dev/sda1", помогает такая процедура:

    rm -r /boot/grub/
    cd /dev
    mv sda1 hehe
    grub-set-default 0
    update-grub
    mv hehe sda1

    ReplyDelete
  2. Мне мой нравится больше :) От grub никто не зависит, его можно спокойно стереть.

    ReplyDelete

Note: only a member of this blog may post a comment.