Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 259613 - sys-boot/grub-0.97-r9 doesn't work on KVM's virtio devices (/dev/vda)
Summary: sys-boot/grub-0.97-r9 doesn't work on KVM's virtio devices (/dev/vda)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Gentoo's Team for Core System packages
URL: http://bugs.debian.org/cgi-bin/bugrep...
Whiteboard: done:0.97-r10
Keywords:
: 302755 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-02-19 17:03 UTC by Elias Probst
Modified: 2012-03-17 18:47 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Elias Probst 2009-02-19 17:03:42 UTC
When trying to install GRUB inside a KVM VM on a virtio device ( /dev/vda ) these are the results:

'grub-install /dev/vda' → "/dev/vda does not have any corresponding BIOS drive."

'grub> root (hd0)' → 'Error 21: Selected disk does not exist'

There's a patch provided by Debian:
http://patch-tracking.debian.net/patch/series/view/grub/0.97-51/use_grub-probe_in_grub-install.diff

I've tried to apply it but wasn't successful - some hunks were rejected.
Maybe someone with a little more knowledge gets it working.

Reproducible: Always
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-05-10 04:19:00 UTC
As of debian's 0.97-47, use_grub-probe_in_grub-install.diff was useless. Did it change between then and 51?
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-05-10 04:19:10 UTC
Oh, and have you tested -r9?
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-06-26 23:19:35 UTC
No response from user.
Comment 4 Elias Probst 2009-06-27 10:34:05 UTC
Sorry for not responding to this bug - it must have been slipped through my fingers.

Just tried 0.97-r9 and it worked, when doing this:

Add this line to /boot/grub/device.map:
(hd0) /dev/vda

Open GRUB shell and specify the root device:
grub> root (hd0,0)
 Filesystem type is ext2fs, partition type 0x83

Run the GRUB shell setup routine:
grub> setup (hd0)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/e2fs_stage1_5" exists... yes
 Running "embed /boot/grub/e2fs_stage1_5 (hd0)"...  18 sectors are embedded.
succeeded
 Running "install /boot/grub/stage1 (hd0) (hd0)1+18 p (hd0,0)/boot/grub/stage2 /boot/grub/menu.lst"... suc
ceeded
Done.
Comment 5 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-01-29 21:44:43 UTC
*** Bug 302755 has been marked as a duplicate of this bug. ***
Comment 6 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-01-29 21:46:43 UTC
I guess we don't need multiple bugs for the same issue. Re-opening this one.
Comment 7 Riccardo 2010-02-07 17:16:07 UTC
I have the same issue here:

emerge -pv grub
[ebuild   R   ] sys-boot/grub-0.97-r9  USE="ncurses -custom-cflags -netboot -static" 0 kB

cat /boot/grub/device.map
(hd0) /dev/vda

grub --no-floppy
grub> root (hd0,0)
Error 21: Selected disk does not exist
grub> find /boot/grub/stage1
Error 15: File not found

grub-install --no-floppy /dev/vda
expr: non-numeric argument
/dev/vda1 does not have any corresponding BIOS drive.

I install grub successfully by booting kvm without if=virtio and after install correctly grub I reboot with if=virtio ;)

Truzzone
Comment 8 Harley Peters 2010-03-08 22:13:49 UTC
(In reply to comment #7)
> I have the same issue here:
> 
> emerge -pv grub
> [ebuild   R   ] sys-boot/grub-0.97-r9  USE="ncurses -custom-cflags -netboot
> -static" 0 kB
> 
> cat /boot/grub/device.map
> (hd0) /dev/vda
> 
> grub --no-floppy
> grub> root (hd0,0)
> Error 21: Selected disk does not exist
> grub> find /boot/grub/stage1
> Error 15: File not found
> 
> grub-install --no-floppy /dev/vda
> expr: non-numeric argument
> /dev/vda1 does not have any corresponding BIOS drive.
> 
> I install grub successfully by booting kvm without if=virtio and after install
> correctly grub I reboot with if=virtio ;)
> 
> Truzzone
> 

Try:
grub --device-map=/boot/grub/device.map
Also make sure there is only one entry for hd(0) in device.map
The above worked for me.
Comment 9 Petteri Räty (RETIRED) gentoo-dev 2010-03-25 16:32:55 UTC
Fedora should have a patch for this in their rpms:
https://bugzilla.redhat.com/show_bug.cgi?id=479760
Comment 10 Riccardo 2010-05-18 10:15:04 UTC
> Try:
> grub --device-map=/boot/grub/device.map
> Also make sure there is only one entry for hd(0) in device.map
> The above worked for me.
> 
ok, with this command works ok under virtio.
Thanks
Comment 11 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-06-25 06:21:23 UTC
Now committed and published as new patchset: grub-0.97-patches-1.10.tar.bz2
Ebuild sys-boot/grub-0.97-r10 committed.
Comment 12 Jiri 2012-03-17 18:47:38 UTC
Hi,

grub version:sys-boot/grub-0.97-r10

I'm just installing a new system in kvm, so my disk is /dev/vda and have still this problem.

echo "(hd0)    /dev/vda">> /boot/grub/device.map
solves the problem.