Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 536144 - sys-boot/grub-0.97-r14 grub-install doesn't know about Xen domU `/dev/xvd*`
Summary: sys-boot/grub-0.97-r14 grub-install doesn't know about Xen domU `/dev/xvd*`
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: Other Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-09 18:14 UTC by Tony Butler
Modified: 2016-10-05 16:44 UTC (History)
2 users (show)

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


Attachments
Patch which fixes this. (grub-install-xendisk.patch,682 bytes, patch)
2015-01-09 18:14 UTC, Tony Butler
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Butler 2015-01-09 18:14:15 UTC
Created attachment 393572 [details, diff]
Patch which fixes this.

Install grub:0 (grub2 doesn't work well, or at all, with XenServer 6.2 PVM mode and their 'pygrub' thing)

Manually setup device_map to include `(hd0) /dev/xvda` (this is the only way to bypass "BIOS drive does not exist" junk, as Xen domU in PV mode has no BIOS)

Run `grub-install /dev/xvda` and it will throw a few expr errors and (falsely) accuse the stage1 file of being corrupt:

```
expr: non-integer argument
expr: non-integer argument
The file /boot/grub/stage1 not read correctly.
```

This is a lie and the included patch fixes the problem.  The script simply doesn't look for the xvd[a-z] pattern and as such doesn't map the drive.  Since, on XenServer in PV mode (and in HV mode with native drivers) your disks are all xvd* and none of the many others it looks for.

Assuming upstream is sealed on such old software, but also noting that one of the main reasons for running the "ancient" grub is to run under XenServer, I think it would be nice if Gentoo included this hotfix for others in a similar jam (the error/solution was non-obvious, unlike the manual device_map workaround).
Comment 1 Ian Stakenvicius (RETIRED) gentoo-dev 2016-10-04 21:10:03 UTC
Does grub:2 work with XenServer any better now?  IE, is it still worth adding this patch or should manual installation and workarounds just be expected?
Comment 2 Alex Xu (Hello71) 2016-10-05 16:44:19 UTC
1. using pygrub I'm almost certain you don't need grub-install since the MBR is not read in the first place; just use grub-mkconfig to generate the config for pygrub to read.

2. pygrub is obsolete now, just use pvgrub 2.