grub-pc.postinst script fails to detect virtio vda disk in KVM guest
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
grub2 (Ubuntu) |
Expired
|
High
|
Unassigned |
Bug Description
A statement explaining the impact of the bug on users and justification for backporting the fix to the stable release: Multiple people report they cannot install grub2 on virtio disk on Ubuntu 10.04 LTS
An explanation of how the bug has been addressed in the development branch, including the relevant version numbers of packages modified in order to implement the fix.: Fixed (at least) in udev 167-0ubuntu3 in Natty 11.04
A minimal patch applicable to the stable version of the package. If preparing a patch is likely to be time-consuming, it may be preferable to get a general approval from the SRU team first.: see provided patch
Detailed instructions how to reproduce the bug. These should allow someone who is not familiar with the affected package to reproduce the bug and verify that the updated package fixes the problem. Please mark this with a line "TEST CASE:": on KVM/qemu with /dev/vda only try running "dpkg-reconfigure grub-pc" the scripts in that package will fail because /dev/disk/by-id does not exist due to missing udev rules.
A discussion of the regression potential of the patch and how users could get inadvertently affected.: only two additional lines of udev rules and only affects /dev/vd* devices.
Binary package hint: grub-pc
The grub-pc.postinst script fails to detect virtio "vda" disk in a KVM guest because it looks for entries in /dev/disk/by-id/* and there is absolutely no /dev/disk/by-id directory at all when the only disk is a vda virtio one.
You can test this either by creating a new KVM VM guest running Ubuntu 10.04 with only virtio vda disk or by converting an existing hda disk VM guest into a vda one and then trying to purge and re-install grub-pc.
If the KVM VM guest running Ubuntu 10.04 is configured to boot from LVM this issue is not seen; the failure requires a guest with a bare /dev/vda disk.
Applying the patch (attached) to grub-pc.postinst in the KVM VM guest allows you to install (or re-install) grub-pc; without it the grub-pc package will not configure.
Patch is against grub-pc 1.98-1ubuntu6
ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: grub-pc 1.98-1ubuntu6
ProcVersionSign
Uname: Linux 2.6.32-22-generic i686
NonfreeKernelMo
Architecture: i386
Date: Sun Jul 11 12:15:58 2010
ProcEnviron:
PATH=(custom, user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: grub2
description: | updated |
description: | updated |
description: | updated |
tags: | added: testcase |
I would like to fix this somehow, although it seems to me that it's also a udev bug that it doesn't provide by-id links for virtio disks. However, using by-uuid is definitely wrong; by-uuid links only identify filesystems, and the most important entries in this context are those for the top-level disk device which does not typically contain a filesystem.