GPT - doing things right
To be honest - I'm absolutely not an authority to teach how to do things right in GUID Partition Table. But I did it wrong, and I corrected it, so maybe someone will find it useful.
Welcome to the new world, world where MBR is obsolete, BIOS is obsolete, and... well, let face it - windows is obsolete. The brand new world has GPT, (U)EFI, and all flavours of Linux.
As it is now well known from my previous rant - I bought a new laptop and chosen Arch linux as a new victim. The path is easy - download bootable image, cast it on bootable media, shrink windows partition (hey, I paid for it! useful as a victim as well), reboot and install.
Hmm, maybe not that easy. When it comes to partitioning - first surprise - GPT. Ok, fdisk prints some crap, what else on the memory - parted. That's it, parted, allocate system, swap partitions, set type, create make fs and swap on them, install the system.
Installed, grub.. hmm... ok, there's fine howto on arch wiki to install uefi grub. Not that nice actually (too many contradicting opinions), but it gives you general idea. Bad news - it didn't work for me. Good news - EFI Shell 2.0 (on arch boot CD) allows you to fix it - all the required data was there.
After shell magic linux starts booting, windows however stops. I've spend several days trying to figure that out. At the end it appears parted just corrpupted Protected MBR. It looks like there's a bug in parted - it shows the disk properly, disk type as GPT, etc, etc... But - windows does not see the partitions. The symptoms:
- diskpart doesn't see GPT on disk and reports it as MBR
- accordingly it only shows first 4 partitions (as primary)
- windows loader BSODs with STOP 0xc000000f and Lenovo recovery with 0xc000000c
- Linux fdisk shows list of GPT partitions (instead of single PMBR partition)
The fix appeared to be trivial - instal gdisk, modify the disk (i.e. finally change linux partition type from windows data - as assigned by parted - to linux data), verify disk and pmbr (should show single partition), write changes.
On next reboot Lenovo recovery automatically fired up and fixed BCD for shrunk windows partition. No even need to use windows install disks and diskpart/bcdedit.Link... Wed May 8 23:41:10 2013