Preinstalled Windows 8 and Linux UEFI dual boot on a laptop

It might be worth doing a cold shutdown (hit the power button) in Windows to see if you can boot afterwards, just as a test. Obviously you wouldn't want to do this on a regular basis, but it might be helpful to confirm that Windows is overwriting your revised ESP data. If it's actually damaging the filesystem on Windows shutdown, then this sounds like a Windows bug that should be reported to Microsoft. If it's just replacing the bootmgfw.efi file, then that's technically within Microsoft's purvue, so it's not really a bug.

More broadly speaking, though, have you tried using linux's efibootmgr program to register rEFInd with the EFI under its own name (say, EFI/refind on the ESP)? This is described in rEFInd's documentation, in the section on manual Linux installation. Alternatively, you could install using the install.sh script. Either method will require an EFI-mode boot to succeed, but you should be able to do this using a rEFInd CD or boot from an emergency disc in EFI mode.

If efibootmgr doesn't work, try using bcfg in an EFI shell program, as described on this Arch wiki page.

If these procedures don't work, try using efibootmgr or bcfg to remove the entry for bootmgfw.efi from the NVRAM and then install rEFInd as EFI/BOOT/bootx64.efi. In theory, the computer might then launch rEFInd, which should work normally and enable booting either OS. There are two potential gotchas, though: The firmware might favor EFI/Microsoft/boot/bootmgfw.efi over EFI/BOOT/bootx64.efi; and Windows might check its boot options and add its own boot loader back to the NVRAM when it boots. Still, this method is worth a try.

The EFI spec requires computers to honor their NVRAM settings (which are managed by efibootmgr in Linux, bcfg in an EFI shell, or similar programs), so if these utilities don't work, your firmware is broken, and you may want to consider returning the computer for another model. (Be sure to tell Sony why you returned the computer if you do so, though!) This type of problem is actually fairly common; I've got a Gigabyte board with a "Hybrid EFI" that keeps forgetting its NVRAM settings, for instance. At least with this board, though, it's possible to bypass the problem by naming my boot manager/loader of choice EFI/BOOT/bootx64.efi.

If you can't get it working and are unwilling or unable to replace the computer, I do have two other suggestions for workarounds:

  • You could keep a bootable CD or USB flash drive on hand with rEFInd on it, and use it when you want to boot Linux. This may require using a function key to tell the computer to boot from the removable media rather than from the hard disk whenever you boot, though.
  • You could wipe the partitions from the disk, repartition using MBR, and re-install both OSes in BIOS mode rather than in EFI mode. This will remove any EFI flakiness from the picture and enable you to use a BIOS-mode GRUB as your boot loader. This will probably require a retail copy of the Windows 8 installer, though; at least for Windows 7, the OEM copies were inflexible about the installation mode (BIOS vs. EFI). Alternatively, it may be possible to convert from an EFI-mode boot to a BIOS-mode boot without re-installing. The opposite switch is possible (I was going to post a link to a site where it's described, but this site won't let me post more than two links; sorry), and I seem to recall running across descriptions of doing an EFI-to-BIOS conversion somewhere, but I don't have a URL handy. A Google search may turn something up.

I stumbled across this page after posting my first answer, and it has another possible cause for at least part of your problem: Apparently Windows 8 uses a shutdown method that's more akin to a suspend-to-disk operation. The result is that mounted partitions can become corrupted if you shut down Windows and then boot Linux. Although the ESP isn't normally mounted in Windows 7, AFAIK, it could be that Windows 8 does things differently, or maybe the ESP is mounted in Windows 7 and just seems to be hidden. In any event, you can disable this feature of Windows 8 by typing the following command in an Administrator Command Prompt window:

powercfg /h off