Bug 640961
| Summary: | Document that grub-install might be needed for old Linux guests after virt-resize | ||
|---|---|---|---|
| Product: | [Community] Virtualization Tools | Reporter: | Richard W.M. Jones <rjones> |
| Component: | libguestfs | Assignee: | Richard W.M. Jones <rjones> |
| Status: | CLOSED UPSTREAM | QA Contact: | |
| Severity: | medium | Docs Contact: | |
| Priority: | low | ||
| Version: | unspecified | CC: | mbooth, virt-maint |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2011-07-14 19:18:20 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Richard W.M. Jones
2010-10-07 11:28:03 UTC
Disk dumps show that the bootloader has been copied over fine. The first partition starts at sector 64 on the resized disk, was sector 63 on the original disk. This is expected, but could this be the cause of the failure? Maybe the old version of grub can't boot from the aligned sector? Interesting -- I was able to recover the new system
by rerunning grub-install from guestfish. I didn't
expect that this would work, but it did.
This suggests that we could add a --grub-install option
to virt-resize. It would need to mount up / and /boot
and run the $g->grub_install ("/", "/dev/sda") command.
-----
# guestfish -i -a /dev/vg_pin/RHEL5Xenbrewx64
Welcome to guestfish, the libguestfs filesystem interactive shell for
editing virtual machine filesystems.
Type: 'help' for a list of commands
'man' to read the manual
'quit' to quit the shell
Operating system: Red Hat Enterprise Linux Server release 5.5 (Tikanga)
/dev/VolGroup00/LogVol00 mounted on /
/dev/vda1 mounted on /boot
><fs> help grub-install
NAME
grub-install - install GRUB
SYNOPSIS
grub-install root device
DESCRIPTION
This command installs GRUB (the Grand Unified Bootloader) on "device",
with the root directory being "root".
Note: If grub-install reports the error "No suitable drive was found in
the generated device map." it may be that you need to create a
"/boot/grub/device.map" file first that contains the mapping between
grub device names and Linux device names. It is usually sufficient to
create a file containing:
(hd0) /dev/vda
replacing "/dev/vda" with the name of the installation device.
><fs> cat /boot/grub/device.map
# this device map was generated by anaconda
(hd0) /dev/vda
><fs> grub-install / /dev/vda
Simple change to virt-resize, targeting this at libguestfs 1.6. I decided to just document this: https://www.redhat.com/archives/libguestfs/2010-October/msg00033.html |