Kernel update errors on a Debian Squeeze Xen Virtual Machine

When performing a apt-get upgrade on a Xen Debian Squeeze Virtual Machine, you might encounted errors like:

Setting up linux-image-2.6.32-5-amd64 (2.6.32-45) ...
Running depmod.
Running update-initramfs.
update-initramfs: Generating /boot/initrd.img-2.6.32-5-amd64
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 2.6.32-5-amd64 /boot/vmlinuz-2.6.32-5-amd64
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 2.6.32-5-amd64 /boot/vmlinuz-2.6.32-5-amd64
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... Generating /boot/grub/default file and setting the default boot entry to 0
entry not specified.
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-amd64.postinst line 799.
dpkg: error processing linux-image-2.6.32-5-amd64 (--configure):
 subprocess installed post-installation script returned error exit status 2
Setting up linux-image-2.6.32-5-xen-amd64 (2.6.32-45) ...
configured to not write apport reports
                                      Running depmod.
Running update-initramfs.
update-initramfs: Generating /boot/initrd.img-2.6.32-5-xen-amd64
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 2.6.32-5-xen-amd64 /boot/vmlinuz-2.6.32-5-xen-amd64
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 2.6.32-5-xen-amd64 /boot/vmlinuz-2.6.32-5-xen-amd64
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... Generating /boot/grub/default file and setting the default boot entry to 0
entry not specified.
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-xen-amd64.postinst line 799.
dpkg: error processing linux-image-2.6.32-5-xen-amd64 (--configure):
 subprocess installed post-installation script returned error exit status 2
configured to not write apport reports
                                      Errors were encountered while processing:
 linux-image-2.6.32-5-amd64
 linux-image-2.6.32-5-xen-amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)

 

This happensĀ because grub cannot find the virtual disk in order to rewrite the server’s initrd image.

Since Xen kernel management is transparent to your machine itself, you can safely remove grub by:

root@nicovs:~#apt-get remove grub-legacy grub-common

This is the output of the remove command:

root@nicovs:~# apt-get remove grub-legacy grub-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libtokyocabinet8 libpth20 mutt gettext-base os-prober libgpgme11
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  grub-common grub-legacy
0 upgraded, 0 newly installed, 2 to remove and 45 not upgraded.
2 not fully installed or removed.
After this operation, 5,931 kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 38041 files and directories currently installed.)
Removing grub-legacy ...
Removing grub-common ...
Processing triggers for man-db ...
Processing triggers for install-info ...
Setting up linux-image-2.6.32-5-amd64 (2.6.32-45) ...
Running depmod.
Running update-initramfs.
update-initramfs: Generating /boot/initrd.img-2.6.32-5-amd64
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 2.6.32-5-amd64 /boot/vmlinuz-2.6.32-5-amd64
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 2.6.32-5-amd64 /boot/vmlinuz-2.6.32-5-amd64
Setting up linux-image-2.6.32-5-xen-amd64 (2.6.32-45) ...
Running depmod.
Running update-initramfs.
update-initramfs: Generating /boot/initrd.img-2.6.32-5-xen-amd64
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 2.6.32-5-xen-amd64 /boot/vmlinuz-2.6.32-5-xen-amd64
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 2.6.32-5-xen-amd64 /boot/vmlinuz-2.6.32-5-xen-amd64

 

 

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top