I had CentOS 6 installed on an MBR hard disk. I converted the disk to GPT (with UEFI) and installed CentOS 7 on a new partition. CentOS 7 itself seems to work properly. Grub from CentOS 7 automatically created an entry for CentOS 6, but I get an error if I try to boot CentOS 6. The menu entry is: menuentry 'CentOS release 6.10 (Final) (on /dev/sda7)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-92dcc576-4e61-41f3-ae42-d06b3aec01ae' { insmod part_gpt insmod ext2 set root='hd0,gpt7' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt7 --hint-efi=hd0,gpt7 --hint-baremetal=ahci0,gpt7 92dcc576-4e61-41f3-ae42-d06b3aec01ae else search --no-floppy --fs-uuid --set=root 92dcc576-4e61-41f3-ae42-d06b3aec01ae fi linux /boot/vmlinuz-2.6.32-754.3.5.el6.centos.plus.x86_64 ro root=UUID=92dcc576-4e61-41f3-ae42-d06b3aec01ae rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=cf rd_NO_MD LANG=fr_FR.UTF-8 SYSFONT=latarcyrheb-sun16 rd_NO_LVM rd_NO_DM crashkernel=auto initrd /boot/initramfs-2.6.32-754.3.5.el6.centos.plus.x86_64.img } When I try to boot, I get a message that "linux" and "initrd" aren't valid commands. If I change them to "linuxefi" and initrdefi", I get this error: error: kernel too old error: you need to load the kernel first The information in the entry seems correct (partition, UUID, etc.). I've searched on Google quite a bit, but didn't find anything useful. Are there any suggestions? -- Yves Bellefeuille <yan at storm.ca>
Yves Bellefeuille
2018-Oct-11 02:50 UTC
[CentOS] (Solved) Booting CentOS 6 with Grub from CentOS 7
I myself wrote:> Grub from CentOS 7 automatically created an entry for CentOS 6, but > I get an error if I try to boot CentOS 6.It turns out that Grub2 checks the version of the kernel and refuses to proceed if it thinks that the kernel is too old. I don't know how old is considered too old, but the latest centosplus kernel for CentOS 6, vmlinuz-2.6.32-754.3.5.el6.centos.plus.x86_64, apparently qualifies. The solution was to install the latest kernel-ml kernel from ELRepo, https://elrepo.org/ , to change grub.cfg to reflect the new versions, and to change linux and initrd to linuxefi and initrdefi. I'm surprised this has apparently never arisen before. Am I really the first person to dual-boot CentOS 6 and 7? Thanks to Lingzhu Xiang for his bug report, https://bugzilla.redhat.com/show_bug.cgi?id=894300 , which put me on the right track. -- Yves Bellefeuille <yan at storm.ca>
On 11/10/18 15:50, Yves Bellefeuille wrote:> I myself wrote: > >> Grub from CentOS 7 automatically created an entry for CentOS 6, but >> I get an error if I try to boot CentOS 6. > > It turns out that Grub2 checks the version of the kernel and refuses > to proceed if it thinks that the kernel is too old. I don't know how > old is considered too old, but the latest centosplus kernel for CentOS > 6, vmlinuz-2.6.32-754.3.5.el6.centos.plus.x86_64, apparently > qualifies. > > The solution was to install the latest kernel-ml kernel from ELRepo, > https://elrepo.org/ , to change grub.cfg to reflect the new versions, > and to change linux and initrd to linuxefi and initrdefi. > > I'm surprised this has apparently never arisen before. Am I really the > first person to dual-boot CentOS 6 and 7?I think you'll find that in order to use linuxefi and initrdefi you need a kernel that is new enough to have efi support. If you have an older kernel (such as that which comes with CentOS 6) then you need to use linux16 and initrd16. Peter
Stephen John Smoogen
2018-Oct-11 18:42 UTC
[CentOS] Booting CentOS 6 with Grub from CentOS 7
On Tue, 9 Oct 2018 at 21:47, Yves Bellefeuille <yan at storm.ca> wrote:> > I had CentOS 6 installed on an MBR hard disk. I converted the disk to > GPT (with UEFI) and installed CentOS 7 on a new partition. >Was CentOS6 bootable after you converted the disk to GPT? My luck with getting it to work has not been good as the conversion usually changes something very important to the underlying OS which needs a reinstall or a bunch of 'fiddling' in rescue mode before I could get it to work at all. The EL6 kernel and initrd probably do not have the tools in them to deal with a GPT partition. Your 'best' bet is to boot into an EL6 rescue iso, edit the fstab to know it needs to mount a /boot/efi and make sure the kernel/initrd images in /boot are efi aware and stick the right stuff into /boot/efi that is needed. [There are several different people who have posted similar things in 2016 and such. I am not sure how much work they will take.] I am not sure if the /boot/efi partition needs to be different from the one you got for EL7. From various posts on mailing lists and such... it confuses a lot of tools when they are the same and on other systems it breaks if they are different. I don't have much more I can add to this. I would normally just backup the EL6, blow it away and run EL6 as a virtual machine from then on. I know this might not work for most people, but it is what I have ended up doing.> CentOS 7 itself seems to work properly. > > Grub from CentOS 7 automatically created an entry for CentOS 6, but I > get an error if I try to boot CentOS 6. > > The menu entry is: > > menuentry 'CentOS release 6.10 (Final) (on /dev/sda7)' --class > gnu-linux --class gnu --class os $menuentry_id_option > 'osprober-gnulinux-simple-92dcc576-4e61-41f3-ae42-d06b3aec01ae' { > insmod part_gpt > insmod ext2 > set root='hd0,gpt7' > if [ x$feature_platform_search_hint = xy ]; then > search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt7 > --hint-efi=hd0,gpt7 --hint-baremetal=ahci0,gpt7 > 92dcc576-4e61-41f3-ae42-d06b3aec01ae > else > search --no-floppy --fs-uuid --set=root > 92dcc576-4e61-41f3-ae42-d06b3aec01ae > fi > linux /boot/vmlinuz-2.6.32-754.3.5.el6.centos.plus.x86_64 ro > root=UUID=92dcc576-4e61-41f3-ae42-d06b3aec01ae rd_NO_LUKS > KEYBOARDTYPE=pc KEYTABLE=cf rd_NO_MD LANG=fr_FR.UTF-8 > SYSFONT=latarcyrheb-sun16 rd_NO_LVM rd_NO_DM crashkernel=auto > initrd /boot/initramfs-2.6.32-754.3.5.el6.centos.plus.x86_64.img > } > > When I try to boot, I get a message that "linux" and "initrd" aren't > valid commands. If I change them to "linuxefi" and initrdefi", I get > this error: > > error: kernel too old > error: you need to load the kernel first > > The information in the entry seems correct (partition, UUID, etc.). > > I've searched on Google quite a bit, but didn't find anything useful. > Are there any suggestions? > > -- > Yves Bellefeuille > <yan at storm.ca> > > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > https://lists.centos.org/mailman/listinfo/centos-- Stephen J Smoogen.
Stephen John Smoogen wrote:> On Tue, 9 Oct 2018 at 21:47, Yves Bellefeuille <yan at storm.ca> wrote: >> >> I had CentOS 6 installed on an MBR hard disk. I converted the disk to >> GPT (with UEFI) and installed CentOS 7 on a new partition. >>Um, say *what*?! This wasn't a complete rebuild? Next you'll tell us you buy hardware from Acme, the company that Wile E. Coyote buys hardware.> > Was CentOS6 bootable after you converted the disk to GPT? My luck with > getting it to work has not been good as the conversion usually changes > something very important to the underlying OS which needs a reinstall or a > bunch of 'fiddling' in rescue mode before I could get it to work at all. > > The EL6 kernel and initrd probably do not have the tools in them to > deal with a GPT partition. Your 'best' bet is to boot into an EL6 rescue<snip> I think they can. However, several things: what I've had to do on our new rebranded Supermicro boxen is to go into the BIOS, and tell it *not* to dual boot (that is, legacy BIOS or UEFI), and *not* legacy, but *only* UEFI. I will note that we've been using GPT on secondary drives since we started buying drives > 2TB, and that's been a number of years now.... mark