Can't boot UEFI VM after migration - grub configuration problem#160
Open
sparimi-rh wants to merge 1 commit into
Open
Can't boot UEFI VM after migration - grub configuration problem#160sparimi-rh wants to merge 1 commit into
sparimi-rh wants to merge 1 commit into
Conversation
UEFI boot mode based Linux VM, which reference /boot and /boot/efi partitions by device files (e.g. /dev/sdaX) in /etc/fstab, fail to boot post migration as virt-v2v re-writes the grub boot loader if it finds references to device files instead of disk UUIDs. The libguestfs appliance is configured to use BIOS boot mode. This causes the target VM's grub to be configured in BIOS boot mode. The target VM fails to boot in Qemu/KVM environment. The solution is to replace the BIOS boot mode specific grub commands which loads Linux kernel and init RAM disk, with UEFI boot mode specific commands. This is done only if source VM is in UEFI mode. Fixes: https://redhat.atlassian.net/browse/RHEL-173538 Signed-off-by: Srihari Parimi <sparimi@redhat.com>
rwmjones
reviewed
Jul 9, 2026
| if g#exists grub_cfg then ( | ||
| try | ||
| ignore (g#sh (sprintf "sed -i 's/\\blinux16\\b/linuxefi/g; | ||
| s/\\binitrd16\\b/initrdefi/g' %s" |
Member
There was a problem hiding this comment.
We wouldn't normally want to run commands out of the guest like this. Augeas lets us programatically edit files in the guest which is considerably safer.
A bigger question that isn't answered is why do we need to change these linux16 commands? What is that doing exactly?
Also the commit message doesn't really explain anything, at least not in terms that I can understand. An example would go a long way.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
UEFI boot mode based Linux VM, which reference /boot and /boot/efi partitions by device files (e.g. /dev/sdaX) in /etc/fstab, fail to boot post migration as virt-v2v re-writes the grub boot loader if it finds references to device files instead of disk UUIDs. The libguestfs appliance is configured to use BIOS boot mode. This causes the target VM's grub to be configured in BIOS boot mode. The target VM fails to boot in Qemu/KVM environment. The solution is to replace the BIOS boot mode specific grub commands which loads Linux kernel and init RAM disk, with UEFI boot mode specific commands. This is done only if source VM is in UEFI mode.
Fixes: https://redhat.atlassian.net/browse/RHEL-173538