Hi,

> Date: Fri, 5 Jun 2015 14:45:04 -0400
> From: garyd...@torfree.net
> 
> I have a computer that was set up with an the older style partition 
> table and wanted to convert it to GPT. Since the first partition started 
> at 2048, I figured this wouldn't be a problem. Just use gdisk to write a 
> new partition table after stealing some space from swap for an EFI boot 
> partition. Then reconfigure grub...

"reconfigure grub" in this case meant uninstalling grub-pc and installing
grub-efi, right?

And that EFI boot partition is mounted on /boot/EFI, is formatted as FAT32,
and has the correct partition type (EF01 in gdisk iirc)?

> [..] created new Linux and Swap partitions that I 
> installed Jessie to. These were extended partitions that gdisk converted 
> to primary (it displays them as primary but with the original numbers).
> 

There's no such thing as primary/extended/logical partitions with GPT.

> Now I don't even to get a grub rescue prompt. I've tried reinstalling 
> grub in a chroot after booting with system rescue cd but that didn't 
> work. I've reinstalled grub to /dev/sda but again without success. 
> Update-grub sees the partitions but doesn't give me a bootable system.
> 
> BTW: Grub is the grub-efi-amd64 package.
> 
> At one point I did get it to boot after using F12 to bring up a boot 
> menu and booting from the first HD, but I haven't been able to repeat that.

That probably wouldn't have worked anyway, as EFI doesn't "boot from
HD". That "boot from HD" option probably tried a legacy boot. Instead,
EFI relies on a list of bootloaders that's stored in nvram. You can use
efibootmgr to query or modify this list.

However, that gives you a nice chicken-and-egg problem. Modifying
the efi boot list can only be done through efi system calls, and the
efi system calls are only available if your system is booted in EFI
mode to begin with.

See http://blog.uncooperative.org/blog/2014/02/06/the-efi-system-partition/
for a description of the boot process. There is a default efi bootloader,
it should be located as /boot/efi/efi/boot/bootx64.efi assuming your
ESP is mounted correctly (see above). Grub is probably installed as
grubx64.efi, you may want to copy the grub efi loader to this
default location and try again.

If that fails, your next attempt at fixing this would be to find a copy of
shellx64.efi on the 'net. It's a part of Intel's EFI SDK, but easily available
as a separate download (eek! downloading unsigned binaries from
random sites). If you put it in the root of the ESP (i.e. 
/boot/efi/shellx64.efi),
your firmware/bios may offer you a separate option to boot this shell
instead. Note the use of "may", there is no standard for this.

That shell pretty much behaves as a dos prompt with tab completion,
you can try to start grubx64 from there.

That's pretty all the pointers I can give you. The process above is how
I converted one of my machines from legacy to efi boot. Be prepared
for a lot of reading, trialing, and erroring.


Best of luck,
Arno

                                          

Reply via email to