[SOLVED] CentOS7 fails boot to grub2 after conversion
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I converted centos7 phisical machine with one HDD to vmware VM and process separated boot partition to another virtual disk. So boot fails in grub2 console, I have been able to boot OS normally with mounted supergrub2.iso but I want to fix bootloader.
Code:
grub> ls
(hd0) (hd0,msdos1) (hd1) (hd1,msdos1) (lvm/centos-swap) (lvm/centos-home) (lvm/centos-root)
(hd0,msdos1) is boot partition.
Code:
grub> set
...
prefix=(lvmid/*some garbage*)/boot/grub2
...
root=(lvmid/*some garbage*)
I tried
Code:
set root=(lvm/centos-root)
linux (hd0,msdos1)/vmlinuz...
initrd (hd0,msdos1)/initrd...
boot
/usr/sbin/grub-install --help
Usage: grub-install [OPTION...] [OPTION] [INSTALL_DEVICE]
Install GRUB on your drive.
--compress=no|xz|gz|lzo compress GRUB files [optional]
--dtb=FILE embed a specific DTB
-d, --directory=DIR use images and modu<snip>
my assumption is that when grub is installed to the device it is "hardcoded" with mapping to the grub.conf
since you created a virtualDisk this mapping is no longer valid
I believe grub-install would fix that
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.