The HP boot setup happily boots either UEFI/GPT or BIOS/MBR disks. But, it looks like, if there's any UEFI-bootable disk in the system, that gets booted in preference to the MBR disk. The default CentOS installation creates an MBR-based boot setup, which worked fine if it was the only disk in the machine, but it never booted if the Windows disk was installed.
So I needed to make the CentOS system do the UEFI boot thing. It eventually worked - and I didn't even need to reload the CentOS filesystem from the backup - but it *can't* be intended to be this hard. And I'm not sure if future kernel upgrades will be properly seen by grub.efi. The CentOS wiki says that UEFI installation should work for CentOS >=6.5, but doesn't say how to make it happen. (I didn't worry about secureboot, it's turned off in the BIOS.)
Things I'd love to know (details below):
* is there a CentOS 6 way of asking for an install to use GPT, and to install the EFI version of Grub, rather than MBR + BIOS Grub?
* How on earth can grub.efi find its grub.conf? I hacked around this, copying grub.conf into the vfat partition and mount --bind'ing it while Linux is running, but it seems fragile and awkward.
What I did, in brief:
installed CentOS 6 on a disk, giving it a small vfat partition (for EFI) and a large CentOS root partition + etc. This creates an MBR (non-GPT) setup
used "unit s" and "print" in parted to determine exact partition locations
used parted to relabel the disk as GPT, and create new GPT partitions in exactly the same locations as the originals
used gdisk's "n" command to create a protective MBR instead of the original one. Not sure if this was necessary.
Copied the CentOS EFI version of Grub onto the EFI partition in efibootmgr's default location, like
Code: Select all
mount /dev/sdX1 /mnt
mkdir -p /mnt/EFI/redhat
cp /boot/efi/EFI/redhat/grub.efi /mnt/EFI/redhat/grub.efi
Code: Select all
efibootmgr -c -d /dev/sdX -L centos
It did work to put a copy of grub.conf into the same directory (on the EFI partition) as grub.efi:
Code: Select all
cp /boot/grub/grub.conf /mnt/EFI/redhat/grub.conf
Code: Select all
mkdir /efiboot
mount /dev/sdX1 /efiboot
mount --bind /efiboot/EFI/redhat/grub.conf /boot/grub/grub.conf
Other tip: Windows 10 seems to reset the boot-next-time flag to boot Windows by default, every time it shuts down. This is a nuisance if you want to use Grub as an interactive boot manager. Found good advice here on turning off "Fast Startup", which makes Windows leave things alone.
http://askubuntu.com/questions/666631/h ... p-notebook