Friday, June 14, 2013

GPT, UEFI, MBR, oh my!

One of my first tasks in my new role is to get started building out my demo laptop. I was issued a nice workstation-grade Lenovo W530. It came preinstalled with the standard Microsoft Windows 8 Enterprise image. As my demo machine, I want a base OS of Server 2012 instead, so I set out wipe the machine and reinstall.

Since the preinstalled OS was Windows 8, the BIOS was configured for Secure Boot from UEFI Only devices. In addition, UEFI is required if you want to use GPT style disks instead of the legacy MBR style disks. So this Lenovo came out of the box configured with every modern bell and whistle.

First things first, I need the Lenovo to boot from USB. So to add that support, I jumped into the BIOS and went to the Boot menu under Startup.  It shows the list of boot devices in the list, but it's necessary to scroll down some to find the excluded items and add back in the appropriate USB HDD.

The next important decision is whether to install Windows Server 2012 on the GPT disk or use DISKPART to reconfigure it back to MBR. (The DISKPART commands to convert from GPT to MBR and vice-versa are readily available using your search engine of choice.) GPT supports larger disk sizes, but the solid-state disk in this machine isn't that large, so I could go either way. However, you need to know which you are doing because it determines how you set up your bootable USB and your BIOS.

If you are converting your disk from either MBR or GPT, this will wipe all your data. Make sure starting with a clean slate is REALLY what you want to do.  Also, while my goal is to install Server 2012, these settings and instructions would also apply if you are trying to install a different version of Windows 8.

For Lenovo, the BIOS settings need to go like this for GPT:
  • Secure Boot - Off
  • UEFI/Legacy Boot - UEFI Only
Also, your USB media NEEDS to be formatted FAT32. (This limits the size of a single file on the USB to 4GB, so watch the size of your image.wim file if you customize it.)

And like this for MBR:
  • Secure Boot - Off
  • UEFI/Legacy Boot - Both (with Legacy First)
Your USB media can be formatted NTFS, FAT32 isn't a requirement.

Take note, if you boot from NTFS media and try to install the OS on a GPT disk, you won't be able to select a partition to install to, you'll warned that you can't install to a GPT disk and have to cancel out of the installer.  Even if you are doing everything correctly from FAT32 media, you'll get a warning that the BIOS might not have the drivers to load the OS. This warning is safe to ignore - you can still continue through the install process and the setup will create all the necessary partitions to support GPT.

Once all my pre-reqs were sorted out, I reboot the machine and the Server 2012 install files start to load.  After I clicked INSTALL to get things going, I received an error message that read:

The product key entered does not match any of the Windows images available for installation. Enter a different product key.

Well, huh? Now granted, it's been a while since I've attempted to install a Server OS on a laptop, but I surely didn't miss a place to enter a product key! After some research I found this KB article, where it details the logic for locating product keys when installing Windows 8 and Windows Server 2012.

1.Answer file (Unattended file, EI.cfg, or PID.txt)
2.OA 3.0 product key in the BIOS/Firmware
3.Product key entry screen

Turns out the Lenovo has a preinstalled OEM license for Windows 8 Pro in the firmware. Seems that this saves OEM from having to put stickers on the bottoms of machines with software keys and ensures that the OEM licenses stays with the machine it was sold with. Enterprises that deploy images with another licensing model usually are using some kind of deployment tool and image with an answer file, allowing them to bypass the check against the firmware key.

For my scenario, I wanted the quickest easiest way to provide my key. Turns out the PID.txt file is a no-brainer. You can reference this (http://technet.microsoft.com/en-us/library/hh824952.aspx) for all the details, but all you need to do is create a text file called PID.txt with these two lines:

[PID]
Value=XXXXX-XXXXX-XXXXX-XXXXX-XXXXX


Put your product key in for the value and save it your \Sources folder of your install media. From there it was smooth sailing. After your OS is installed, feel free to turn back on the Secure Boot back in the BIOS.

4 comments:

  1. Not that you're probably going to need it, but if you remove the battery on your laptop, you'll find the Windows 8 OEM CoA sticker. Lenovo stopped putting them on the bottom of the laptop and started putting them under the battery at least a year ago.

    ReplyDelete
  2. You made me look, but no sticker under the battery either!

    ReplyDelete
  3. Weird... I know that's where it is on all of our T-series ThinkPads.

    ReplyDelete