Bug 33125 - GRUB cannot determine boot device on KVM paravirtualized storage
GRUB cannot determine boot device on KVM paravirtualized storage
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Grub
UCS 3.2
Other Linux
: P5 minor (vote)
: UCS 3.2
Assigned To: Sönke Schwardt-Krummrich
Stefan Gohmann
: interim-4
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-05 12:57 CET by Arvid Requate
Modified: 2013-11-19 06:42 CET (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arvid Requate univentionstaff 2013-11-05 12:57:09 CET
On a virtual KVM machine created with paravirtualized storage (ucs-kt-create -P) GRUB cannot determine the  boot device automatically.

These are the messages during update from UCS 3.1-1 to UCS 3.2-0:
===========================================================================
Starting update to UCS version 3.2-0

HINT:
Please check the release notes carefully BEFORE updating to UCS 3.2-0:
 English version: http://download.univention.de/doc/release-notes-3.2-0_en.pdf
 German version:  http://download.univention.de/doc/release-notes-3.2-0.pdf

Please also consider documents of following release updates and
3rd party components.

Update will wait here for 60 seconds...
Press CTRL-c to abort or press ENTER to continue


Checking for space on /var/cache/apt/archives: OK
Checking for space on /boot: OK
Checking for space on /: OK
Checking for package status: OK
Checking LDAP schema: OK
WARNING: Cannot determine the GRUB boot device clearly.
                   After the update has been completed, please install GRUB with
                   the following command on your boot device:

                   grub-install <DEVICE>
Create update/grub/boot
Starting pre-upgrade of grub-common: done.
Starting pre-upgrade of python-univention-directory-manager-uvmm: done.

Starting update process, this may take a while.
Check /var/log/univention/updater.log for more information.
Running postup.sh script:/usr/sbin/grub-bios-setup: Warnung: Es wird versucht, GRUB auf einer Platte mit mehreren Partitionsbezeichnungen zu installieren. Dies wird derzeit noch nicht unterstützt..
/usr/sbin/grub-bios-setup: Fehler: Einbettung ist nicht möglich, jedoch für die Installation auf mehreren Laufwerken erforderlich.
Warning: Installation of GRUB on device "/dev/sr0" failed!
Please run 'grub-install <DEVICE>' manually, to update GRUB on your boot device.
done.
Checking for release updates:                           none
Checking for package updates:                           none
Setting update/available
root@slalve22:~# grub-install /dev/vda
installation beendet. Keine Fehler aufgetreten.
===========================================================================
Comment 1 Philipp Hahn univentionstaff 2013-11-05 14:06:20 CET
(In reply to Arvid Requate from comment #0)
> Warning: Installation of GRUB on device "/dev/sr0" failed!
...
> root@slalve22:~# grub-install /dev/vda

sr0 != vda, so why did grub choose sr0 on update?
It looks like grub found a bootable CDROM in /dev/sr0 and tried to install there instead of /dev/vda. This is understanable since the CDROM is a hybrid ISO, which contains both an ISO-9660 and a MSDOS partition table to support installing from USB sticks. So to grub is looks like a hard disk, which looks like a perfect candidate for installing.

Bug is in univention-updater/script/preup.sh, where sr0 is not filtered out.
# grep sr0 /proc/partitions 
  11        0    1924864 sr0
Comment 2 Sönke Schwardt-Krummrich univentionstaff 2013-11-06 14:00:18 CET
Two bugs have been fixed:
1) some device names are ignored if looking for a GRUB signature:
/dev/fd* → Floppy
/dev/sr* → CDROM/DVD
/dev/scd* → CDROM/DVD
/dev/dm-* → device mapper

2) if more than one possible device has been found, none of them is used.
grub-install will only be called, if one one device has been found or update/grub/boot has been set manually prior to the update.

Changelogentry has been updated.
Comment 3 Stefan Gohmann univentionstaff 2013-11-07 16:17:13 CET
OK. Test was successful.
Comment 4 Stefan Gohmann univentionstaff 2013-11-19 06:42:45 CET
UCS 3.2 has been released:
 http://docs.univention.de/release-notes-3.2-en.html
 http://docs.univention.de/release-notes-3.2-de.html

If this error occurs again, please use "Clone This Bug".