本文寫于2022年05月17日,閱讀時(shí)請(qǐng)注意時(shí)效。
問題復(fù)現(xiàn)
問題出現(xiàn)在將一臺(tái)AMD電腦上的Arch Linux虛擬機(jī)導(dǎo)出為.ova格式后遷移到一臺(tái)Intel電腦時(shí)無(wú)法通過bootloader(grub)進(jìn)入系統(tǒng)而是出現(xiàn)EFI Shell界面。后續(xù)查明為grub的問題,所以該方案對(duì)于其他發(fā)行版、CPU、VirtualBox版本大概也適用。
問題截圖如下:

efi-shell
問題解決
無(wú)需重裝grub,只要在問題系統(tǒng)中重新設(shè)置一遍grub即可。步驟如下
使用系統(tǒng)鏡像啟動(dòng),將各硬盤分區(qū)
mount好使用
arch-chroot進(jìn)入問題系統(tǒng)(其他發(fā)行版使用自己特定的命令即可,大多是chroot)-
執(zhí)行如下命令重新配置grub:
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB grub-mkconfig -o /boot/grub/grub.cfg umount之后重啟即可
解決過程的命令行如下:
root@archiso ~ # mount /dev/sda2 /mnt
root@archiso ~ # mount /dev/sda1 /mnt/boot
root@archiso ~ # arch-chroot /mnt
[root@archiso /]# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
Installing for x86_64-efi platform.
Installation finished. No error reported.
[root@archiso /]# grub-mkconfig -o /boot/grub/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux
Found initrd image: /boot/amd-ucode.img /boot/initramfs-linux.img
Found fallback initrd image(s) in /boot: amd-ucode.img initramfs-linux-fallback.img
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done
[root@archiso /]# exit
exit
root@archiso ~ # umount -R /mnt
root@archiso ~ # reboot now
可以看到我系統(tǒng)里安裝了amd-ucode,是不影響的。我還嘗試了安裝intel-ucode,問題并沒有得到解決。
在虛擬機(jī)中是無(wú)法使用*-ucode的,可以參考Microcode - ArchWiki