Demystifying the creation of Win8 computer OEM partition

  
Most of the computers pre-installed with Win8 now use the new UEFI firmware + GPT format disk, no longer like the previous BIOS + MBR. The benefits of using UEFI and GPT are many, such as enabling new features such as secure boot, and supporting more hard disk partitions and larger partition capacity.
Branded notebooks like Dell have some diagnostic tools that can be run before the system is booted. In fact, these tools are often stored in a hidden OEM partition on the hard drive. If you accidentally delete the system when you reinstall it yourself, how can you restore the OEM hidden attributes of the partition even if you copy the program files from elsewhere?

For the MBR format hard disk, search through Baidu We can get the solution; for GPT format hard drives, there is no effective solution on the network. In the following, I will reveal how to apply OEM partition attributes to GPT hard drives.
First, let's quickly review how to set up an OEM partition on the MBR disk: In the Diskpart command, execute "create partition primary id=xx size=xx" for the selected partition, where id identifies the OEM vendor. For example, id=DE is to declare to Windows that it is Dell's OEM partition. For more vendor code descriptions, you can execute the command "help create par pri" to understand:

So what about the GPT format disk?
The above command is of course no longer applicable. Is it as the Internet says, can only use the OEM to send some "One-click recovery" software to completely format and restore the disk partition, or use Ghost to reload the previous hard disk backup to set up? Some foreign forums The answer also indicated that you have to contact the OEM to recover. In fact, the answer is that we can set it ourselves, and the same is the tool that comes with the Diskpart system, but it is easily overlooked by everyone.
The new version of Diskpart has a command that is "gpt". With this command and the corresponding partition attribute code, you can easily set its properties. For example, we need to set the OEM partition attribute, let Windows automatically hide the partition, then we can create a primary partition (create par pri size=xxx), execute "Gpt attributes=0x0000000000000001" to set it as an OEM partition.
What is the meaning of 0x0000000000000001 here? We can view it by executing "help gpt":

In addition to setting a primary partition as an OEM partition with the 0x0000000000000001 attribute, we can also pass Other code applies other attributes to the partition:
64-bit ID effect
0x0000000000000001 Mark the partition as required partition/set OEM
0x8000000000000000 set to default without assigning a drive letter to it
0x4000000000000000 on the hidden volume Partition (the mount manager will not detect)
0x2000000000000000 declares the partition as a shadow copy of another partition
0x1000000000000000 is set to read-only to prevent data from being written
To cancel an applied attribute, Just add a minus sign "-" in front of the attribute ID in the gpt <64-bit attribute ID> command. It is not excluded that Microsoft will add more new properties for GPT disks in the next version of Windows.

Copyright © Windows knowledge All Rights Reserved