Guid что это такое windows

Что такое таблица разделов GUID или GPT ? В этом посте мы увидим, что такое раздел GPT и как они сравниваются с дисками MBR, а также как отформатировать, удалить, удалить или преобразовать диск GPT в диск MBR. GUID Таблица разделов или GPT использует GUID и является стандартом для размещения таблицы разделов на физическом жестком диске.

Содержание

  1. Что такое раздел GPT
  2. Ограничения MBR Disk
  3. MBR Disk и GPT Диски
  4. Как конвертировать GPT диск в MBR диск

Что такое раздел GPT

Раздел GPT. Источник изображения: Википедия

GPT-раздел – это стандарт для размещения таблицы разделов на физическом жестком диске с использованием глобально уникальных идентификаторов. MBR – это сокращение от основной загрузочной записи , а MBR-диски содержат различные сектора, содержащие загрузочные данные. Первый сектор, то есть ближе к началу диска, содержит информацию о диске и его разделах для использования ОС. Однако MBR-диски имеют свои ограничения, и многие новые модели компьютеров переходят на GPT-диски.

Ограничения MBR Disk

Диск в формате MBR может иметь только четыре основных раздела и может управлять данными только до 2 ТБ . С ростом потребностей в хранении данных диски GPT (таблица разделов GUID) теперь продаются с новыми компьютерами, которые могут занимать более 2 ТБ памяти. Диски MBR резервируют первый сектор диска для хранения информации о разделах диска и расположении файлов операционной системы.

Другими словами, прошивка и операционные системы полагаются на этот первый сектор для правильной работы диска. Если MBR поврежден, вы можете потерять общий доступ к данным на диске.

В случае GPT-дисков информация о диске реплицируется более одного раза, и, следовательно, такие диски работают, даже если первый сектор поврежден. GPT-диск может содержать до 128 основных разделов .

Устаревшие операционные системы могут не поддерживать GPT-диски, но почти все текущие операционные системы, начиная с 64-разрядной Windows XP и далее до Windows 8.1, поддерживают использование GPT-дисков.

MBR Disk и GPT Диски

Основные точки сравнения между MBR Disk и GPT Disk следующие:

1. MBR-диск может содержать только до 4 основных разделов, в то время как GPT-диски могут иметь до 128 основных разделов.

2. Если вам нужно более четырех разделов, вы должны создать расширенный раздел на дисках MBR, а затем создать логические разделы, тогда как на дисках GPT такого принуждения нет.

3. Первый сектор и только первый сектор MBR-дисков содержат информацию о жестком диске, в то время как в GPT-дисках информация о жестком диске и его разделах реплицируется более одного раза, поэтому он работает, даже если первый сектор поврежден

4. MBR-диск не сможет управлять дисками емкостью более 2 ТБ, в то время как для дисков GPT такого ограничения нет

5. Все операционные системы поддерживают диски MBR, в то время как для GPT совместимы только 64-разрядные Windows XP и более поздние версии Windows.

6. Для поддержки загрузки только Windows 8 поддерживает 32-разрядную загрузку, в противном случае все предыдущие версии, такие как Windows 7, Windows Vista, 32-разрядные версии Windows XP, не могут загружаться с GPT-дисков.

Как конвертировать GPT диск в MBR диск

Чтобы преобразовать GPT-диск в MBR, в первую очередь вам придется удалить все разделы. Перед тем, как сделать это, вам нужно будет выполнить резервное копирование всех данных с диска на другой диск или носитель. Вы можете выполнить резервное копирование с помощью сторонних инструментов или Windows Backup Tool.

Перейдите в Панель управления и из Администрирования выберите Управление компьютером и в появившемся окне выберите Управление дисками. В появившемся окне, которое показывает все диски и разделы диска на правой панели, щелкните правой кнопкой мыши и выберите «Удалить» для каждого раздела диска, который вы хотите преобразовать в MBR.

Как только все разделы будут удалены, у вас останется один целый диск (показанный как неразделенный блок в окне «Управление дисками»). Щелкните правой кнопкой мыши на этом диске и выберите «Преобразовать в MBR-диск». Пройдет немного времени, прежде чем Windows преобразует диск в MBR, а затем отформатирует его, чтобы сделать его пригодным для использования.

Теперь вы можете создавать разделы, используя обычную команду Shrink Disk или бесплатное стороннее программное обеспечение для управления разделами, такое как EaseUS Partition Tool или Aomei Partition Assistant. Для получения более подробной информации ознакомьтесь с нашей статьей о том, как конвертировать MBR в GPT Disk в Windows 8 без потери данных.

Вам может потребоваться преобразовать в MBR, если на компьютере используется 32-разрядная операционная система Windows. Лучшим способом было бы использовать два диска, один MBR для загрузки (системный диск), а другой GPT для хранения.Но если у вас есть только один диск, преобразуйте его в MBR, иначе он может не загрузиться после установки, скажем, 32-битной операционной системы Windows 7 на диск. Поэтому, пожалуйста, будьте осторожны.

Это была просто базовая информация о дисках GPT. Если вам нужно больше, вы можете обратиться к следующим ресурсам:

  • FAQ по Windows и GPT на MSDN
  • Как преобразовать диск таблицы разделов GUID в диск с основной загрузочной записью на TechNet
  • Установка и установка Windows с использованием стиля раздела MBR или GPT на TechNet.

Этот пост поможет вам, если вы получили раздел Выбранный GPT, отформатированный на диске, не относится к типу PARTITION BASIC DATA GUID.

A globally unique identifier (GUID) is a special type of identifier used in software applications in order to provide a reference number which is unique in any context (hence, «Globally»), for example, in defining the internal reference for a type of access point in a software application, or for creating unique keys in a database. While each generated GUID is not guaranteed to be unique, the total number of unique keys (2128 or 3.4×1038 is so large that the probability of the same number being generated twice is very small. For example, considering the observable universe contains about 5 × 1022 stars, every star could have a GUID (though there would still be a collision due to the birthday paradox).

The term GUID usually refers to Microsoft’s implementation of the Universally Unique Identifier (UUID) standard; however, many other pieces of software use the term GUID including Oracle Database, dBase, OpenView Operations, and Novell eDirectory. The GUID is also the basis of the GUID Partition Table, Intel’s replacement for Master Boot Records under EFI.

Basic structure[]

The GUID is a 16-[byte (128-bit) number. The most commonly used structure of the data type is:

Bits Description
32 Data1
16 Data2
16 Data3
8 × 8 Data4

The most significant byte in every field is stored last; the last 8 bytes are stored consecutively.

One to three of the most significant bits of the second byte in Data 4 define the type variant of the GUID:

Pattern Description
0 Network Computing System backward compatibility
10 Standard
110 Microsoft Component Object Model backward compatibility; this includes the GUID’s for important interfaces like IUnknown and IDispatch.
111 Reserved for future use.

The most significant four bits of Data3 define the version number, and hence the algorithm used.[1]

Text encoding[]

Guids are most commonly written in text as a sequence of hexadecimal digits such as:

3F2504E0-4F89-11D3-9A0C-0305E82C3301

This text notation contains the following fields, separated by hyphens:

Hex digits Description
8 Data1
4 Data2
4 Data3
4 Initial two bytes from Data4
12 Remaining six bytes from Data4

For the first three fields, the most significant digit is on the left. The last two fields are treated as eight separate bytes, each having their most significant digit on the left, and they follow each other from left to right. Note that the digit order of the fourth field may be unexpected, since it’s treated differently than in the structure.

Often braces are added to enclose the above format, as such:

{3F2504E0-4F89-11D3-9A0C-0305E82C3301}

When printing fewer characters is desired, GUIDs are sometimes encoded into a base64 string of 22 to 24 characters (depending on padding). For instance:

7QDBkvCA1+B9K/U0vrQx1A
7QDBkvCA1+B9K/U0vrQx1A==

Algorithm[]

The OSF-specified algorithm for generating new GUIDs has been widely criticized. In these (V1) GUIDs, the user’s network card MAC address is used as a base for the last group of GUID digits, which means, for example, that a document can be tracked back to the computer that created it. This privacy hole was used when locating the creator of the Melissa worm]. Most of the other digits are based on the time while generating the GUID.

V1 GUIDs which contain a MAC address and time can be identified by the digit «1» in the first position of the third group of digits, for example {2f1e4fc0-81fd-11da-9156-00036a0f876a}. GUIDs using the later algorithm, which is mostly a random number, have a «4» in the same position, for example {38a52be4-9352-453e-af97-5c3b448652f0}. More specifically, the ‘data3’ bit pattern would be 0001xxxxxxxxxxxx in the first case, and 0100xxxxxxxxxxxx in the second.

Uses[]

Depending on the context, groups of GUIDs may be used to represent similar but not quite identical things. For example, in the Windows registry, in the key sequence «My Computer\HKEY_Classes_Root\CLSID», the DAO database management system identifies the particular version and type of accessing module of DAO to be used by a group of about a dozen GUIDs which begin with 5 zeros, a three-digit identifier for that particular version and type, and the remainder of the guid, which ends with the same value for every case, 0000-0010-8000-00AA006D2EA4, so that the set of GUIDs used by this database system runs from {00000010-0000-0010-8000-00AA006D2EA4} through {00000109-0000-0010-8000-00AA006D2EA4} although not all GUIDs in that range are used.

In the Microsoft Component Object Model (COM), GUIDs are used to uniquely distinguish different software component interfaces. This means that two (possibly incompatible) versions of a component can have exactly the same name but still be distinguishable by their GUIDs.

The use of GUIDs permits certain types of object orientation to be used in a consistent manner. For example, in the creation of components for Microsoft Windows using COM, all components must implement the IUnknown interface in order to be able to find all other interfaces and features of that component, and they do this by creating a GUID which may be called upon to provide an entry point. The IUnknown interface is defined as a GUID with the value of {00000000-0000-0000-C000-000000000046}, and rather than having a named entry point called «IUnknown», the preceding GUID is used, thus every component that provides an IUnknown entry point gives the same GUID, and every program that looks for an IUnknown interface in a component always uses that GUID to find the entry point, knowing that an application using that particular GUID must always consistently implement IUnknown in the same manner and the same way.

GUIDs are also inserted into documents from Microsoft Office programs, as these are regarded as objects as well. Even audio or video streams in the Advanced Systems Format (ASF) are identified by their GUIDs.

GUIDs are frequently stored in files as text, but sometimes they are stored in binary. For example some files, including Advanced Systems Format (ASF) files, is a series of values in little endian byte order — a 32-bit unsigned integer, followed by two 16-bit unsigned integers, followed by eight unsigned bytes. On IA-32 hardware, like most desktop PCs, this means that the order of the bytes in memory and in the file is the same. Note that this does not match the text display format, because if the first field looks like {12345678-… this would be stored as 78 56 34 12 (hexademical). Software running on big endian hardware which reads such GUIDs and creates and writes new ones or compares them with GUIDs created locally may need to reverse the byte order of the first three values, if it stores the fields of the data structure in its native byte order.

Subtypes[]

There are several flavors of GUIDs used in COM:

  • IID – interface identifier; (The ones that are registered on a system are stored in the Windows Registry at the key HKEY_CLASSES_ROOT\Interface)
    • REFIID – a pointer to an IID
  • CLSID – class identifier; (Stored in the registry at HKEY_CLASSES_ROOT\CLSID)
  • LIBID – type library identifier;
  • CATID – category identifier; (its presence on a class identifies it as belonging to certain class categories)

DCOM introduces many additional GUID subtypes:

  • AppID – application identifier;
  • MID – machine identifier;
  • IPID – interface pointer identifier; (applicable to an interface engaged in RPC)
  • CID – causality identifier; (applicable to a RPC session)
  • OID – object identifier; (applicable to an object instance)
  • OXID – object exporter identifier; (applicable to an instance of the system object that performs RPC)
  • SETID – ping set identifier; (applicable to a group of objects)

These GUID subspaces may overlap, as the context of GUID usage defines its subtype. For example, there might be a class using same GUID for its CLSID as another class is using for its IID – all without a problem. On the other hand, two classes using same CLSID couldn’t co-exist.

XML syndication formats[]

There is also a guid element in some versions of the RSS specification, and mandatory id element in Atom, which should contain a unique identifier for each individual article or weblog post. In RSS the contents of the guid can be any text, and in practice is typically a copy of the article URL. Atom’s IDs need to be valid URIs (usually URLs pointing to the entry, or URNs containing any other unique identifier).

See also[]

  • Universally Unique Identifier (UUID)
  • Object identifier (OID)

External links[]

  • Online .NET GUID Generator
  • Online GUID Generator
  • Online GUID Generator tool, web service and client implementations
  • International Standard «Generation and registration of Universally Unique Identifiers (UUIDs) and their use as ASN.1 Object Identifier components» (ITU-T Rec. X.667 | ISO/IEC 9834-8, technically compatible with IETF RFC 4122)
  • A Universally Unique IDentifier (UUID) URN Namespace (IETF RFC 4122)
  • UUID (GUID) Generator on the Web
  • Online GUID Generator
  • UUID Generator on the ITU-T website
  • (GUID) Generator for Firefox XPI Extensions
  • DmaId for InstanceId Values (DCE Universally Unique IDentifiers, UUIDs)
  • Syntax and semantics of the DCE variant of Universal Unique Identifiers (UUIDs)
  • UUID – generate UUIDs (or GUIDs) in Java
  1. Cite error: Invalid <ref> tag; no text was provided for refs named structure
The layout of a disk with the GUID Partition Table. In this example, each logical block is 512 bytes in size and each entry has 128 bytes. The corresponding partition entries are assumed to be located in LBA 2–33. Negative LBA addresses indicate a position from the end of the volume, with −1 being the last addressable block.

The GUID Partition Table (GPT) is a standard for the layout of partition tables of a physical computer storage device, such as a hard disk drive or solid-state drive, using universally unique identifiers, which are also known as globally unique identifiers (GUIDs). Forming a part of the Unified Extensible Firmware Interface (UEFI) standard (Unified EFI Forum-proposed replacement for the PC BIOS), it is nevertheless also used for some BIOSs, because of the limitations of master boot record (MBR) partition tables, which use 32 bits for logical block addressing (LBA) of traditional 512-byte disk sectors.

All modern personal computer operating systems support GPT. Some, including macOS and Microsoft Windows on the x86 architecture, support booting from GPT partitions only on systems with EFI firmware, but FreeBSD and most Linux distributions can boot from GPT partitions on systems with either the BIOS or the EFI firmware interface.

History[edit]

The Master Boot Record (MBR) partitioning scheme, widely used since the early 1980s, imposed limitations for use of modern hardware. The available size for block addresses and related information is limited to 32 bits. For hard disks with 512‑byte sectors, the MBR partition table entries allow a maximum size of 2 TiB (2³² × 512‑bytes) or 2.20 TB (2.20 × 10¹² bytes).[1]

In the late 1990s, Intel developed a new partition table format as part of what eventually became the Unified Extensible Firmware Interface (UEFI). The GUID Partition Table is specified in chapter 5 of the UEFI 2.8 specification.[2] GPT uses 64 bits for logical block addresses, allowing a maximum disk size of 264 sectors. For disks with 512‑byte sectors, the maximum size is 8 ZiB (264 × 512‑bytes) or 9.44 ZB (9.44 × 10²¹ bytes).[1] For disks with 4,096‑byte sectors the maximum size is 64 ZiB (264 × 4,096‑bytes) or 75.6 ZB (75.6 × 10²¹ bytes).

In 2010, hard-disk manufacturers introduced drives with 4,096‑byte sectors (Advanced Format).[3] For compatibility with legacy hardware and software, those drives include an emulation technology (512e) that presents 512‑byte sectors to the entity accessing the hard drive, despite their underlying 4,096‑byte physical sectors.[4] Performance could be degraded on write operations, when the drive is forced to perform two read-modify-write operations to satisfy a single misaligned 4,096‑byte write operation.[5] Since April 2014, enterprise-class drives without emulation technology (4K native) have been available on the market.[6][7]

Readiness of the support for 4 KB logical sectors within operating systems differs among their types, vendors and versions.[8] For example, Microsoft Windows supports 4K native drives since Windows 8 and Windows Server 2012 (both released in 2012) in UEFI.[9]

Features[edit]

Like MBR, GPT uses logical block addressing (LBA) in place of the historical cylinder-head-sector (CHS) addressing. The protective MBR is stored at LBA 0, and the GPT header is in LBA 1, with a backup GPT header stored at the final LBA. The GPT header has a pointer to the partition table (Partition Entry Array), which is typically at LBA 2. Each entry on the partition table has a size of 128 bytes.
The UEFI specification stipulates that a minimum of 16,384 bytes, regardless of sector size, are allocated for the Partition Entry Array.[10] Thus, on a disk with 512-byte sectors, at least 32 sectors are used for the Partition Entry Array, and the first usable block is at LBA 34 or higher, while on a 4,096-byte sectors disk, at least 4 sectors are used for the Partition Entry Array, and the first usable block is at LBA 6 or higher.

MBR variants[edit]

Protective MBR (LBA 0)[edit]

For limited backward compatibility, the space of the legacy Master Boot Record (MBR) is still reserved in the GPT specification, but it is now used in a way that prevents MBR-based disk utilities from misrecognizing and possibly overwriting GPT disks. This is referred to as a protective MBR.[11]

A single partition of type EEh, encompassing the entire GPT drive (where «entire» actually means as much of the drive as can be represented in an MBR), is indicated and identifies it as GPT. Operating systems and tools which cannot read GPT disks will generally recognize the disk as containing one partition of unknown type and no empty space, and will typically refuse to modify the disk unless the user explicitly requests and confirms the deletion of this partition. This minimizes accidental erasures.[11] Furthermore, GPT-aware OSes may check the protective MBR and if the enclosed partition type is not of type EEh or if there are multiple partitions defined on the target device, the OS may refuse to manipulate the partition table.[12]

If the actual size of the disk exceeds the maximum partition size representable using the legacy 32-bit LBA entries in the MBR partition table, the recorded size of this partition is clipped at the maximum, thereby ignoring the rest of the disk. This amounts to a maximum reported size of 2 TiB, assuming a disk with 512 bytes per sector (see 512e). It would result in 16 TiB with 4 KiB sectors (4Kn), but since many older operating systems and tools are hard coded for a sector size of 512 bytes or are limited to 32-bit calculations, exceeding the 2 TiB limit could cause compatibility problems.[11]

Hybrid MBR (LBA 0 + GPT)[edit]

In operating systems that support GPT-based boot through BIOS services rather than EFI, the first sector may also still be used to store the first stage of the bootloader code, but modified to recognize GPT partitions. The bootloader in the MBR must not assume a sector size of 512 bytes.[11]

[edit]

GPT header format

Offset Length Contents
0 (0x00) 8 bytes Signature («EFI PART», 45h 46h 49h 20h 50h 41h 52h 54h or 0x5452415020494645ULL[a] on little-endian machines)
8 (0x08) 4 bytes Revision number of header — 1.0 (00h 00h 01h 00h) for UEFI 2.10
12 (0x0C) 4 bytes Header size in little endian (in bytes, usually 5Ch 00h 00h 00h or 92 bytes)
16 (0x10) 4 bytes CRC32 of header (offset +0 to +0x5b) in little endian, with this field zeroed during calculation
20 (0x14) 4 bytes Reserved; must be zero
24 (0x18) 8 bytes Current LBA (location of this header copy)
32 (0x20) 8 bytes Backup LBA (location of the other header copy)
40 (0x28) 8 bytes First usable LBA for partitions (primary partition table last LBA + 1)
48 (0x30) 8 bytes Last usable LBA (secondary partition table first LBA − 1)
56 (0x38) 16 bytes Disk GUID in mixed endian[12]
72 (0x48) 8 bytes Starting LBA of array of partition entries (usually 2 for compatibility)
80 (0x50) 4 bytes Number of partition entries in array
84 (0x54) 4 bytes Size of a single partition entry (usually 80h or 128)
88 (0x58) 4 bytes CRC32 of partition entries array in little endian
92 (0x5C) * Reserved; must be zeroes for the rest of the block (420 bytes for a sector size of 512 bytes; but can be more with larger sector sizes)

The partition table header defines the usable blocks on the disk. It also defines the number and size of the partition entries that make up the partition table (offsets 80 and 84 in the table).[2]: 119 

Partition entries (LBA 2–33)[edit]

GUID partition entry format

Offset Length Contents
0 (0x00) 16 bytes Partition type GUID (mixed endian[12])
16 (0x10) 16 bytes Unique partition GUID (mixed endian)
32 (0x20) 8 bytes First LBA (little endian)
40 (0x28) 8 bytes Last LBA (inclusive, usually odd)
48 (0x30) 8 bytes Attribute flags (e.g. bit 60 denotes read-only)
56 (0x38) 72 bytes Partition name (36 UTF-16LE code units)

After the primary header and before the backup header, the Partition Entry Array describes partitions, using a minimum size of 128 bytes for each entry block.[13] The starting location of the array on disk, and the size of each entry, are given in the GPT header. The first 16 bytes of each entry designate the partition type’s globally unique identifier (GUID). For example, the GUID for an EFI system partition is C12A7328-F81F-11D2-BA4B-00A0C93EC93B. The second 16 bytes are a GUID unique to the partition. Then follow the starting and ending 64 bit LBAs, partition attributes, and the 36 character (max.) Unicode partition name. As is the nature and purpose of GUIDs and as per RFC 4122, no central registry is needed to ensure the uniqueness of the GUID partition type designators.[14][2]: 2200

The 64-bit partition table attributes are shared between 48-bit common attributes for all partition types, and 16-bit type-specific attributes:

Partition attributes

Bit Content
0 Platform required (required by the computer to function properly, OEM partition for example, disk partitioning utilities must preserve the partition as is)
1 EFI firmware should ignore the content of the partition and not try to read from it
2 Legacy BIOS bootable (equivalent to active flag (typically bit 7 set) at offset +0h in partition entries of the MBR partition table)[15]
3–47 Reserved for future use
48–63 Defined and used by the individual partition type

Microsoft defines the type-specific attributes for basic data partition as:[16][17]

Basic data partition attributes

Bit Content
60 Read-only
61 Shadow copy (of another partition)
62 Hidden
63 No drive letter (i.e. do not automount)

Google defines the type-specific attributes for ChromeOS kernel as:[18]

ChromeOS kernel partition attributes

Bit Content
56 Successful boot flag
55–52 Tries remaining
51–48 Priority (15: highest, 1: lowest, 0: not bootable)

Operating-system support[edit]

UNIX and Unix-like systems[edit]

Details of GPT support on UNIX and Unix-like operating systems

OS family Version or edition Platform Read and write support Boot support Note
FreeBSD Since 7.0 IA-32, x86-64, ARM Yes Yes In a hybrid configuration, both GPT and MBR partition identifiers may be used.
Linux Most of the x86 Linux distributions
Fedora 8+ and Ubuntu 8.04+[19]
IA-32, x86-64, ARM Yes Yes Tools such as gdisk, GNU Parted,[20][21] util-linux v2.23+ fdisk,[22][23] SYSLINUX, GRUB 0.96 + patches and GRUB 2 have been GPT-enabled. Limited to 256 partitions per disk.[24]
macOS Since 10.4.0 (some features since 10.4.6)[25] IA-32, x86-64, PowerPC, Apple silicon Yes Yes Only Intel and Apple silicon Macintosh computers can boot from GPT.
MidnightBSD Since 0.4-CURRENT IA-32, x86-64 Yes Requires CSM In a hybrid configuration, both GPT and MBR partition identifiers may be used.
NetBSD Since 6.0[26] IA-32,[27] x86-64,[28] ARM Yes Yes
OpenBSD Since 5.9 IA-32, x86-64, ARM Yes Yes [29]
Solaris Since Solaris 10 IA-32, x86-64, SPARC Yes Yes [30]
HP-UX Since HP-UX 11.20 IA-64 Yes Yes [31]

Windows: 32-bit versions[edit]

Windows 7 and earlier do not support UEFI on 32-bit platforms, and therefore do not allow booting from GPT partitions.[32]

Details of GPT support on 32-bit editions of Microsoft Windows[32]

OS version Release date Platform Read or write support Boot support Note
Windows 9x 1995-08-24 IA-32 No[b] No
Windows XP 2001-10-25 IA-32 No No
Windows Server 2003 2003-04-24 IA-32 No No
Windows Server 2003 SP1 2005-03-30 IA-32 Yes No MBR takes precedence in hybrid configuration.
Windows Vista 2006-07-22 IA-32 Yes No MBR takes precedence in hybrid configuration.
Windows Server 2008 2008-02-27 IA-32 Yes No MBR takes precedence in hybrid configuration.
Windows 7 2009-10-22 IA-32 Yes No MBR takes precedence in hybrid configuration.
Windows 8 2012-08-01 IA-32 Yes Requires UEFI[33] MBR takes precedence in hybrid configuration.
Windows 8.1 2013-08-27 IA-32 Yes Requires UEFI[34] MBR takes precedence in hybrid configuration.
Windows 10 2015-07-29 IA-32 Yes Requires UEFI[35] MBR takes precedence in hybrid configuration.

Windows: 64-bit versions[edit]

Limited to 128 partitions per disk.[32]

Details of GPT support on 64-bit editions of Microsoft Windows[32]

OS version Release date Platform Read and write support Boot support Note
Windows XP 64-Bit Edition for Itanium systems, Version 2002 2001-10-25 IA-64 Yes Yes MBR takes precedence in hybrid configuration.
Windows XP 64-Bit Edition, Version 2003 2003-03-28 IA-64 Yes Yes MBR takes precedence in hybrid configuration.
Windows XP Professional x64 Edition
Windows Server 2003
2005-04-25[36] x64 Yes No MBR takes precedence in hybrid configuration.
Windows Server 2003 2005-04-25 IA-64 Yes Yes MBR takes precedence in hybrid configuration.
Windows Vista 2006-07-22 x64 Yes Requires UEFI[c] MBR takes precedence in hybrid configuration.
Windows Server 2008 2008-02-27 x64 Yes Requires UEFI MBR takes precedence in hybrid configuration.
Windows Server 2008 2008-02-27 IA-64 Yes Yes MBR takes precedence in hybrid configuration.
Windows 7 2009-10-22 x64 Yes Requires UEFI[d] MBR takes precedence in hybrid configuration.
Windows Server 2008 R2 2009-10-22 IA-64 Yes Yes MBR takes precedence in hybrid configuration.
Windows 8
Windows Server 2012
2012-08-01 x64 Yes Requires UEFI[37] MBR takes precedence in hybrid configuration.
Windows 8.1 2013-08-27 x64 Yes Requires UEFI[38] MBR takes precedence in hybrid configuration.
Windows 10 2015-07-29 x64 Yes Requires UEFI[39] MBR takes precedence in hybrid configuration.
Windows Server 2016 2016-10-12 x64 Yes Requires UEFI MBR takes precedence in hybrid configuration.
Windows Server 2019 2018-10-02 x64 Yes Requires UEFI MBR takes precedence in hybrid configuration.
Windows Server 2022 2021-08-18[40] x64 Yes Requires UEFI MBR takes precedence in hybrid configuration.
Windows 11 2021-10-05 x64, ARM64 Yes Yes UEFI is a system requirement for Windows 11.

Partition type GUIDs[edit]

«Partition type GUID» means that each partition type is strictly identified by a GUID number unique to that type, and therefore partitions of the same type will all have the same «partition type GUID». Each partition also has a «partition unique GUID» as a separate entry, which as the name implies is a unique id for each partition.

Operating system Partition type Globally unique identifier (GUID)[e]
Unused entry 00000000-0000-0000-0000-000000000000
MBR partition scheme 024DEE41-33E7-11D3-9D69-0008C781F39F
EFI System partition C12A7328-F81F-11D2-BA4B-00A0C93EC93B
BIOS boot partition[f] 21686148-6449-6E6F-744E-656564454649
Intel Fast Flash (iFFS) partition (for Intel Rapid Start technology)[41][42] D3BFE2DE-3DAF-11DF-BA40-E3A556D89593
Sony boot partition[g] F4019732-066E-4E12-8273-346C5641494F
Lenovo boot partition[g] BFBFAFE7-A34F-448A-9A5B-6213EB736C22
Windows Microsoft Reserved Partition (MSR)[44] E3C9E316-0B5C-4DB8-817D-F92DF00215AE
Basic data partition[44][h] EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
Logical Disk Manager (LDM) metadata partition[44] 5808C8AA-7E8F-42E0-85D2-E1E90434CFB3
Logical Disk Manager data partition[44] AF9B60A0-1431-4F62-BC68-3311714A69AD
Windows Recovery Environment[44] DE94BBA4-06D1-4D40-A16A-BFD50179D6AC
IBM General Parallel File System (GPFS) partition 37AFFC90-EF7D-4E96-91C3-2D7AE055B174
Storage Spaces partition[46] E75CAF8F-F680-4CEE-AFA3-B001E56EFC2D
Storage Replica partition[47] 558D43C5-A1AC-43C0-AAC8-D1472B2923D1
HP-UX Data partition 75894C1E-3AEB-11D3-B7C1-7B03A0000000
Service partition E2A1E728-32E3-11D6-A682-7B03A0000000
Linux[48][49][50][51] Linux filesystem data[h] 0FC63DAF-8483-4772-8E79-3D69D8477DE4
RAID partition A19D880F-05FC-4D3B-A006-743F0F84911E
Root partition (Alpha)[48] 6523F8AE-3EB1-4E2A-A05A-18B695AE656F
Root partition (ARC)[48] D27F46ED-2919-4CB8-BD25-9531F3C16534
Root partition (ARM 32‐bit)[48] 69DAD710-2CE4-4E3C-B16C-21A1D49ABED3
Root partition (AArch64)[48] B921B045-1DF0-41C3-AF44-4C6F280D3FAE
Root partition (IA-64)[48] 993D8D3D-F80E-4225-855A-9DAF8ED7EA97
Root partition (LoongArch 64‐bit)[48] 77055800-792C-4F94-B39A-98C91B762BB6
Root partition (mipsel: 32‐bit MIPS little‐endian)[48] 37C58C8A-D913-4156-A25F-48B1B64E07F0
Root partition (mips64el: 64‐bit MIPS little‐endian)[48] 700BDA43-7A34-4507-B179-EEB93D7A7CA3
Root partition (PA-RISC)[48] 1AACDB3B-5444-4138-BD9E-E5C2239B2346
Root partition (32‐bit PowerPC)[48] 1DE3F1EF-FA98-47B5-8DCD-4A860A654D78
Root partition (64‐bit PowerPC big‐endian)[48] 912ADE1D-A839-4913-8964-A10EEE08FBD2
Root partition (64‐bit PowerPC little‐endian)[48] C31C45E6-3F39-412E-80FB-4809C4980599
Root partition (RISC-V 32‐bit)[48] 60D5A7FE-8E7D-435C-B714-3DD8162144E1
Root partition (RISC-V 64‐bit)[48] 72EC70A6-CF74-40E6-BD49-4BDA08E8F224
Root partition (s390)[48] 08A7ACEA-624C-4A20-91E8-6E0FA67D23F9
Root partition (s390x)[48] 5EEAD9A9-FE09-4A1E-A1D7-520D00531306
Root partition (TILE-Gx)[48] C50CDD70-3862-4CC3-90E1-809A8C93EE2C
Root partition (x86)[48] 44479540-F297-41B2-9AF7-D131D5F0458A
Root partition (x86-64)[48] 4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709
/usr partition (Alpha)[48] E18CF08C-33EC-4C0D-8246-C6C6FB3DA024
/usr partition (ARC)[48] 7978A683-6316-4922-BBEE-38BFF5A2FECC
/usr partition (ARM 32‐bit)[48] 7D0359A3-02B3-4F0A-865C-654403E70625
/usr partition (AArch64)[48] B0E01050-EE5F-4390-949A-9101B17104E9
/usr partition (IA-64)[48] 4301D2A6-4E3B-4B2A-BB94-9E0B2C4225EA
/usr partition (LoongArch 64‐bit)[48] E611C702-575C-4CBE-9A46-434FA0BF7E3F
/usr partition (mipsel: 32‐bit MIPS little‐endian)[48] 0F4868E9-9952-4706-979F-3ED3A473E947
/usr partition (mips64el: 64‐bit MIPS little‐endian)[48] C97C1F32-BA06-40B4-9F22-236061B08AA8
/usr partition (PA-RISC)[48] DC4A4480-6917-4262-A4EC-DB9384949F25
/usr partition (32‐bit PowerPC)[48] 7D14FEC5-CC71-415D-9D6C-06BF0B3C3EAF
/usr partition (64‐bit PowerPC big‐endian)[48] 2C9739E2-F068-46B3-9FD0-01C5A9AFBCCA
/usr partition (64‐bit PowerPC little‐endian)[48] 15BB03AF-77E7-4D4A-B12B-C0D084F7491C
/usr partition (RISC-V 32‐bit)[48] B933FB22-5C3F-4F91-AF90-E2BB0FA50702
/usr partition (RISC-V 64‐bit)[48] BEAEC34B-8442-439B-A40B-984381ED097D
/usr partition (s390)[48] CD0F869B-D0FB-4CA0-B141-9EA87CC78D66
/usr partition (s390x)[48] 8A4F5770-50AA-4ED3-874A-99B710DB6FEA
/usr partition (TILE-Gx)[48] 55497029-C7C1-44CC-AA39-815ED1558630
/usr partition (x86)[48] 75250D76-8CC6-458E-BD66-BD47CC81A812
/usr partition (x86-64)[48] 8484680C-9521-48C6-9C11-B0720656F69E
Root varity partition for dm-varity (Alpha)[48] FC56D9E9-E6E5-4C06-BE32-E74407CE09A5
Root varity partition for dm-varity (ARC) [48] 24B2D975-0F97-4521-AFA1-CD531E421B8D
Root varity partition for dm-varity (ARM 32‐bit) [48] 7386CDF2-203C-47A9-A498-F2ECCE45A2D6
Root varity partition for dm-varity (AArch64) [48] DF3300CE-D69F-4C92-978C-9BFB0F38D820
Root varity partition for dm-varity (IA-64) [48] 86ED10D5-B607-45BB-8957-D350F23D0571
Root varity partition for dm-varity (LoongArch 64‐bit) [48] F3393B22-E9AF-4613-A948-9D3BFBD0C535
Root varity partition for dm-varity (mipsel: 32‐bit MIPS little‐endian) [48] D7D150D2-2A04-4A33-8F12-16651205FF7B
Root varity partition for dm-varity (mips64el: 64‐bit MIPS little‐endian) [48] 16B417F8-3E06-4F57-8DD2-9B5232F41AA6
Root varity partition for dm-varity (PA-RISC) [48] D212A430-FBC5-49F9-A983-A7FEEF2B8D0E
Root varity partition for dm-varity (64‐bit PowerPC little‐endian) [48] 906BD944-4589-4AAE-A4E4-DD983917446A
Root varity partition for dm-varity (64‐bit PowerPC big‐endian) [48] 9225A9A3-3C19-4D89-B4F6-EEFF88F17631
Root varity partition for dm-varity (32‐bit PowerPC) [48] 98CFE649-1588-46DC-B2F0-ADD147424925
Root varity partition for dm-varity (RISC-V 32‐bit) [48] AE0253BE-1167-4007-AC68-43926C14C5DE
Root varity partition for dm-varity (RISC-V 64‐bit) [48] B6ED5582-440B-4209-B8DA-5FF7C419EA3D
Root varity partition for dm-varity (s390) [48] 7AC63B47-B25C-463B-8DF8-B4A94E6C90E1
Root varity partition for dm-varity (s390x) [48] B325BFBE-C7BE-4AB8-8357-139E652D2F6B
Root varity partition for dm-varity (TILE-Gx) [48] 966061EC-28E4-4B2E-B4A5-1F0A825A1D84
Root varity partition for dm-varity (x86-64) [48] 2C7357ED-EBD2-46D9-AEC1-23D437EC2BF5
Root varity partition for dm-varity (x86) [48] D13C5D3B-B5D1-422A-B29F-9454FDC89D76
/usr varity partition for dm-varity (Alpha) [48] 8CCE0D25-C0D0-4A44-BD87-46331BF1DF67
/usr varity partition for dm-varity (ARC) [48] FCA0598C-D880-4591-8C16-4EDA05C7347C
/usr varity partition for dm-varity (ARM 32‐bit) [48] C215D751-7BCD-4649-BE90-6627490A4C05
/usr varity partition for dm-varity (AArch64) [48] 6E11A4E7-FBCA-4DED-B9E9-E1A512BB664E
/usr varity partition for dm-varity (IA-64) [48] 6A491E03-3BE7-4545-8E38-83320E0EA880
/usr varity partition for dm-varity (LoongArch 64‐bit) [48] F46B2C26-59AE-48F0-9106-C50ED47F673D
/usr varity partition for dm-varity (mipsel: 32‐bit MIPS little‐endian) [48] 46B98D8D-B55C-4E8F-AAB3-37FCA7F80752
/usr varity partition for dm-varity (mips64el: 64‐bit MIPS little‐endian) [48] 3C3D61FE-B5F3-414D-BB71-8739A694A4EF
/usr varity partition for dm-varity (PA-RISC) [48] 5843D618-EC37-48D7-9F12-CEA8E08768B2
/usr varity partition for dm-varity (64‐bit PowerPC little‐endian) [48] EE2B9983-21E8-4153-86D9-B6901A54D1CE
/usr varity partition for dm-varity (64‐bit PowerPC big‐endian) [48] BDB528A5-A259-475F-A87D-DA53FA736A07
/usr varity partition for dm-varity (32‐bit PowerPC) [48] DF765D00-270E-49E5-BC75-F47BB2118B09
/usr varity partition for dm-varity (RISC-V 32‐bit) [48] CB1EE4E3-8CD0-4136-A0A4-AA61A32E8730
/usr varity partition for dm-varity (RISC-V 64‐bit) [48] 8F1056BE-9B05-47C4-81D6-BE53128E5B54
/usr varity partition for dm-varity (s390) [48] B663C618-E7BC-4D6D-90AA-11B756BB1797
/usr varity partition for dm-varity (s390x) [48] 31741CC4-1A2A-4111-A581-E00B447D2D06
/usr varity partition for dm-varity (TILE-Gx) [48] 2FB4BF56-07FA-42DA-8132-6B139F2026AE
/usr varity partition for dm-varity (x86-64) [48] 77FF5F63-E7B6-4633-ACF4-1565B864C0E6
/usr varity partition for dm-varity (x86) [48] 8F461B0D-14EE-4E81-9AA9-049B6FB97ABD
Root varity signature partition for dm-varity (Alpha)[48] D46495B7-A053-414F-80F7-700C99921EF8
Root varity signature partition for dm-varity (ARC)}[48] 143A70BA-CBD3-4F06-919F-6C05683A78BC
Root varity signature partition for dm-varity (ARM 32‐bit)[48] 42B0455F-EB11-491D-98D3-56145BA9D037
Root varity signature partition for dm-varity (AArch64)[48] 6DB69DE6-29F4-4758-A7A5-962190F00CE3
Root varity signature partition for dm-varity (IA-64)[48] E98B36EE-32BA-4882-9B12-0CE14655F46A
Root varity signature partition for dm-varity (LoongArch 64‐bit)[48] 5AFB67EB-ECC8-4F85-AE8E-AC1E7C50E7D0
Root varity signature partition for dm-varity (mipsel: 32‐bit MIPS little‐endian)[48] C919CC1F-4456-4EFF-918C-F75E94525CA5
Root varity signature partition for dm-varity (mips64el: 64‐bit MIPS little‐endian)[48] 904E58EF-5C65-4A31-9C57-6AF5FC7C5DE7
Root varity signature partition for dm-varity (PA-RISC)[48] 15DE6170-65D3-431C-916E-B0DCD8393F25
Root varity signature partition for dm-varity (64‐bit PowerPC little‐endian)[48] D4A236E7-E873-4C07-BF1D-BF6CF7F1C3C6
Root varity signature partition for dm-varity (64‐bit PowerPC big‐endian)[48] F5E2C20C-45B2-4FFA-BCE9-2A60737E1AAF
Root varity signature partition for dm-varity (32‐bit PowerPC)[48] 1B31B5AA-ADD9-463A-B2ED-BD467FC857E7
Root varity signature partition for dm-varity (RISC-V 32‐bit)[48] 3A112A75-8729-4380-B4CF-764D79934448
Root varity signature partition for dm-varity (RISC-V 64‐bit)[48] EFE0F087-EA8D-4469-821A-4C2A96A8386A
Root varity signature partition for dm-varity (s390)[48] 3482388E-4254-435A-A241-766A065F9960
Root varity signature partition for dm-varity (s390x)[48] C80187A5-73A3-491A-901A-017C3FA953E9
Root varity signature partition for dm-varity (TILE-Gx)[48] B3671439-97B0-4A53-90F7-2D5A8F3AD47B
Root varity signature partition for dm-varity (x86-64)[48] 41092B05-9FC8-4523-994F-2DEF0408B176
Root varity signature partition for dm-varity (x86)[48] 5996FC05-109C-48DE-808B-23FA0830B676
/usr varity signature partition for dm-varity (Alpha)[48] 5C6E1C76-076A-457A-A0FE-F3B4CD21CE6E
/usr varity signature partition for dm-varity (ARC)[48] 94F9A9A1-9971-427A-A400-50CB297F0F35
/usr varity signature partition for dm-varity (ARM 32‐bit)[48] D7FF812F-37D1-4902-A810-D76BA57B975A
/usr varity signature partition for dm-varity (AArch64)[48] C23CE4FF-44BD-4B00-B2D4-B41B3419E02A
/usr varity signature partition for dm-varity (IA-64)[48] 8DE58BC2-2A43-460D-B14E-A76E4A17B47F
/usr varity signature partition for dm-varity (LoongArch 64‐bit)[48] B024F315-D330-444C-8461-44BBDE524E99
/usr varity signature partition for dm-varity (mipsel: 32‐bit MIPS little‐endian)[48] 3E23CA0B-A4BC-4B4E-8087-5AB6A26AA8A9
/usr varity signature partition for dm-varity (mips64el: 64‐bit MIPS little‐endian)[48] F2C2C7EE-ADCC-4351-B5C6-EE9816B66E16
/usr varity signature partition for dm-varity (PA-RISC)[48] 450DD7D1-3224-45EC-9CF2-A43A346D71EE
/usr varity signature partition for dm-varity (64‐bit PowerPC little‐endian)[48] C8BFBD1E-268E-4521-8BBA-BF314C399557
/usr varity signature partition for dm-varity (64‐bit PowerPC big‐endian)[48] 0B888863-D7F8-4D9E-9766-239FCE4D58AF
/usr varity signature partition for dm-varity (32‐bit PowerPC)[48] 7007891D-D371-4A80-86A4-5CB875B9302E
/usr varity signature partition for dm-varity (RISC-V 32‐bit)[48] C3836A13-3137-45BA-B583-B16C50FE5EB4
/usr varity signature partition for dm-varity (RISC-V 64‐bit)[48] D2F9000A-7A18-453F-B5CD-4D32F77A7B32
/usr varity signature partition for dm-varity (s390)[48] 17440E4F-A8D0-467F-A46E-3912AE6EF2C5
/usr varity signature partition for dm-varity (s390x)[48] 3F324816-667B-46AE-86EE-9B0C0C6C11B4
/usr varity signature partition for dm-varity (TILE-Gx)[48] 4EDE75E2-6CCC-4CC8-B9C7-70334B087510
/usr varity signature partition for dm-varity (x86-64)[48] E7BB33FB-06CF-4E81-8273-E543B413E2E2
/usr varity signature partition for dm-varity (x86)[48] 974A71C0-DE41-43C3-BE5D-5C5CCD1AD2C0
/boot, as an Extended Boot Loader (XBOOTLDR) partition[48][49] BC13C2FF-59E6-4262-A352-B275FD6F7172
Swap partition[48][49] 0657FD6D-A4AB-43C4-84E5-0933C84B4F4F
Logical Volume Manager (LVM) partition E6D6D379-F507-44C2-A23C-238F2A3DF928
/home partition[48][49] 933AC7E1-2EB4-4F13-B844-0E14E2AEF915
/srv (server data) partition[48][49] 3B8F8425-20E0-4F3B-907F-1A25A76F98E8
Per‐user home partition[48] 773F91EF-66D4-49B5-BD83-D683BF40AD16
Plain dm-crypt partition[52][53][54] 7FFEC5C9-2D00-49B7-8941-3EA10A5586B7
LUKS partition[52][53][54][55] CA7D7CCB-63ED-4C53-861C-1742536059CC
Reserved 8DA63339-0007-60C0-C436-083AC8230908
GNU/Hurd[56] Linux filesystem data[57] 0FC63DAF-8483-4772-8E79-3D69D8477DE4
Linux Swap partition[58] 0657FD6D-A4AB-43C4-84E5-0933C84B4F4F
FreeBSD Boot partition[59] 83BD6B9D-7F41-11DC-BE0B-001560B84F0F
BSD disklabel partition[59] 516E7CB4-6ECF-11D6-8FF8-00022D09712B
Swap partition[59] 516E7CB5-6ECF-11D6-8FF8-00022D09712B
Unix File System (UFS) partition[59] 516E7CB6-6ECF-11D6-8FF8-00022D09712B
Vinum volume manager partition[59] 516E7CB8-6ECF-11D6-8FF8-00022D09712B
ZFS partition[59] 516E7CBA-6ECF-11D6-8FF8-00022D09712B
nandfs partition[60] 74BA7DD9-A689-11E1-BD04-00E081286ACF
macOS
Darwin
Hierarchical File System Plus (HFS+) partition 48465300-0000-11AA-AA11-00306543ECAC
Apple APFS container
APFS FileVault volume container
7C3457EF-0000-11AA-AA11-00306543ECAC
Apple UFS container 55465300-0000-11AA-AA11-00306543ECAC
ZFS[i] 6A898CC3-1DD2-11B2-99A6-080020736631
Apple RAID partition 52414944-0000-11AA-AA11-00306543ECAC
Apple RAID partition, offline 52414944-5F4F-11AA-AA11-00306543ECAC
Apple Boot partition (Recovery HD) 426F6F74-0000-11AA-AA11-00306543ECAC
Apple Label 4C616265-6C00-11AA-AA11-00306543ECAC
Apple TV Recovery partition 5265636F-7665-11AA-AA11-00306543ECAC
Apple Core Storage Container
HFS+ FileVault volume container
53746F72-6167-11AA-AA11-00306543ECAC
Apple APFS Preboot partition 69646961-6700-11AA-AA11-00306543ECAC
Apple APFS Recovery partition 52637672-7900-11AA-AA11-00306543ECAC
Solaris
illumos
Boot partition 6A82CB45-1DD2-11B2-99A6-080020736631
Root partition 6A85CF4D-1DD2-11B2-99A6-080020736631
Swap partition 6A87C46F-1DD2-11B2-99A6-080020736631
Backup partition 6A8B642B-1DD2-11B2-99A6-080020736631
/usr partition[i] 6A898CC3-1DD2-11B2-99A6-080020736631
/var partition 6A8EF2E9-1DD2-11B2-99A6-080020736631
/home partition 6A90BA39-1DD2-11B2-99A6-080020736631
Alternate sector 6A9283A5-1DD2-11B2-99A6-080020736631
Reserved partition 6A945A3B-1DD2-11B2-99A6-080020736631
6A9630D1-1DD2-11B2-99A6-080020736631
6A980767-1DD2-11B2-99A6-080020736631
6A96237F-1DD2-11B2-99A6-080020736631
6A8D2AC7-1DD2-11B2-99A6-080020736631
NetBSD[61][j] Swap partition 49F48D32-B10E-11DC-B99B-0019D1879648
FFS partition 49F48D5A-B10E-11DC-B99B-0019D1879648
LFS partition 49F48D82-B10E-11DC-B99B-0019D1879648
RAID partition 49F48DAA-B10E-11DC-B99B-0019D1879648
Concatenated partition 2DB519C4-B10F-11DC-B99B-0019D1879648
Encrypted partition 2DB519EC-B10F-11DC-B99B-0019D1879648
ChromeOS[62] ChromeOS kernel FE3A2A5D-4F32-41A7-B725-ACCC3285A309
ChromeOS rootfs 3CB8E202-3B7E-47DD-8A3C-7FF2A13CFCEC
ChromeOS firmware CAB6E88E-ABF3-4102-A07A-D4BB9BE3C1D3
ChromeOS future use 2E0A753D-9E48-43B0-8337-B15192CB1B5E
ChromeOS miniOS 09845860-705F-4BB5-B16C-8A8A099CAF52
ChromeOS hibernate 3F0F8318-F146-4E6B-8222-C28C8F02E0D5
Container Linux by CoreOS[63] /usr partition (coreos-usr) 5DFBF5F4-2848-4BAC-AA5E-0D9A20B745A6
Resizable rootfs (coreos-resize) 3884DD41-8582-4404-B9A8-E9B84F2DF50E
OEM customizations (coreos-reserved) C95DC21A-DF0E-4340-8D7B-26CBFA9A03E0
Root filesystem on RAID (coreos-root-raid) BE9067B9-EA49-4F15-B4F6-F36F8C9E1818
Haiku[64] Haiku BFS 42465331-3BA3-10F1-802A-4861696B7521
MidnightBSD[65][j] Boot partition 85D5E45E-237C-11E1-B4B3-E89A8F7FC3A7
Data partition 85D5E45A-237C-11E1-B4B3-E89A8F7FC3A7
Swap partition 85D5E45B-237C-11E1-B4B3-E89A8F7FC3A7
Unix File System (UFS) partition 0394EF8B-237E-11E1-B4B3-E89A8F7FC3A7
Vinum volume manager partition 85D5E45C-237C-11E1-B4B3-E89A8F7FC3A7
ZFS partition 85D5E45D-237C-11E1-B4B3-E89A8F7FC3A7
Ceph[k] Journal 45B0969E-9B03-4F30-B4C6-B4B80CEFF106
dm-crypt journal 45B0969E-9B03-4F30-B4C6-5EC00CEFF106
OSD 4FBD7E29-9D25-41B8-AFD0-062C0CEFF05D
dm-crypt OSD 4FBD7E29-9D25-41B8-AFD0-5EC00CEFF05D
Disk in creation 89C57F98-2FE5-4DC0-89C1-F3AD0CEFF2BE
dm-crypt disk in creation 89C57F98-2FE5-4DC0-89C1-5EC00CEFF2BE
Block CAFECAFE-9B03-4F30-B4C6-B4B80CEFF106
Block DB 30CD0809-C2B2-499C-8879-2D6B78529876
Block write-ahead log 5CE17FCE-4087-4169-B7FF-056CC58473F9
Lockbox for dm-crypt keys FB3AABF9-D25F-47CC-BF5E-721D1816496B
Multipath OSD 4FBD7E29-8AE0-4982-BF9D-5A8D867AF560
Multipath journal 45B0969E-8AE0-4982-BF9D-5A8D867AF560
Multipath block CAFECAFE-8AE0-4982-BF9D-5A8D867AF560
Multipath block 7F4A666A-16F3-47A2-8445-152EF4D03F6C
Multipath block DB EC6D6385-E346-45DC-BE91-DA2A7C8B3261
Multipath block write-ahead log 01B41E1B-002A-453C-9F17-88793989FF8F
dm-crypt block CAFECAFE-9B03-4F30-B4C6-5EC00CEFF106
dm-crypt block DB 93B0052D-02D9-4D8A-A43B-33A3EE4DFBC3
dm-crypt block write-ahead log 306E8683-4FE2-4330-B7C0-00A917C16966
dm-crypt LUKS journal 45B0969E-9B03-4F30-B4C6-35865CEFF106
dm-crypt LUKS block CAFECAFE-9B03-4F30-B4C6-35865CEFF106
dm-crypt LUKS block DB 166418DA-C469-4022-ADF4-B30AFD37F176
dm-crypt LUKS block write-ahead log 86A32090-3647-40B9-BBBD-38D8C573AA86
dm-crypt LUKS OSD 4FBD7E29-9D25-41B8-AFD0-35865CEFF05D
OpenBSD Data partition 824CC7A0-36A8-11E3-890A-952519AD3F61
QNX Power-safe (QNX6) file system[68] CEF5A9AD-73BC-4601-89F3-CDEEEEE321A1
Plan 9 Plan 9 partition C91818F9-8025-47AF-89D2-F030D7000C2C
VMware ESX vmkcore (coredump partition) 9D275380-40AD-11DB-BF97-000C2911D1B8
VMFS filesystem partition AA31E02A-400F-11DB-9590-000C2911D1B8
VMware Reserved 9198EFFC-31C0-11DB-8F78-000C2911D1B8
Android-IA[69][70][71][72] Bootloader 2568845D-2332-4675-BC39-8FA5A4748D15
Bootloader2 114EAFFE-1552-4022-B26E-9B053604CF84
Boot 49A4D17F-93A3-45C1-A0DE-F50B2EBE2599
Recovery 4177C722-9E92-4AAB-8644-43502BFD5506
Misc EF32A33B-A409-486C-9141-9FFB711F6266
Metadata 20AC26BE-20B7-11E3-84C5-6CFDB94711E9
System 38F428E6-D326-425D-9140-6E0EA133647C
Cache A893EF21-E428-470A-9E55-0668FD91A2D9
Data DC76DDA9-5AC1-491C-AF42-A82591580C0D
Persistent EBC597D0-2053-4B15-8B64-E0AAC75F4DB1
Vendor C5A0AEEC-13EA-11E5-A1B1-001E67CA0C3C
Config BD59408B-4514-490D-BF12-9878D963F378
Factory 8F68CC74-C5E5-48DA-BE91-A0C8C15E9C80
Factory (alt)[73] 9FDAA6EF-4B3F-40D2-BA8D-BFF16BFB887B
Fastboot / Tertiary[74][75] 767941D0-2085-11E3-AD3B-6CFDB94711E9
OEM AC6D7924-EB71-4DF8-B48D-E267B27148FF
Android 6.0+ ARM Android Meta 19A710A2-B3CA-11E4-B026-10604B889DCF
Android EXT 193D1EA4-B3CA-11E4-B075-10604B889DCF
Open Network Install Environment (ONIE) Boot 7412F7D5-A156-4B13-81DC-867174929325
Config D4E6E2CD-4469-46F3-B5CB-1BFF57AFC149
PowerPC PReP boot 9E1A2D38-C612-4316-AA26-8B49521E5A8B
freedesktop.org OSes (Linux, etc.) Shared boot loader configuration[76] BC13C2FF-59E6-4262-A352-B275FD6F7172
Atari TOS Basic data partition (GEM, BGM, F32) 734E5AFE-F61A-11E6-BC64-92361F002671
VeraCrypt Encrypted data partition 8C8F8EFF-AC95-4770-814A-21994F2DBC8F
OS/2 ArcaOS Type 1 90B6FF38-B98F-4358-A21F-48F35B4A8AD3
Storage Performance Development Kit (SPDK) SPDK block device[77] 7C5222BD-8F5D-4087-9C00-BF9843C7B58C
barebox bootloader barebox-state[78] 4778ED65-BF42-45FA-9C5B-287A1DC4AAB1
U-Boot bootloader U-Boot environment[79][80] 3DE21764-95BD-54BD-A5C3-4ABE786F38A8
SoftRAID[citation needed] SoftRAID_Status B6FA30DA-92D2-4A9A-96F1-871EC6486200
SoftRAID_Scratch 2E313465-19B9-463F-8126-8A7993773801
SoftRAID_Volume FA709C7E-65B1-4593-BFD5-E71D61DE9B02
SoftRAID_Cache BBBA6DF5-F46F-4A89-8F59-8765B2727503
Fuchsia standard partitions[81] Bootloader (slot A/B/R) FE8A2634-5E2E-46BA-99E3-3A192091A350
Durable mutable encrypted system data D9FD4535-106C-4CEC-8D37-DFC020CA87CB
Durable mutable bootloader data (including A/B/R metadata) A409E16B-78AA-4ACC-995C-302352621A41
Factory-provisioned read-only system data F95D940E-CABA-4578-9B93-BB6C90F29D3E
Factory-provisioned read-only bootloader data 10B8DBAA-D2BF-42A9-98C6-A7C5DB3701E7
Fuchsia Volume Manager 49FD7CB8-DF15-4E73-B9D9-992070127F0F
Verified boot metadata (slot A/B/R) 421A8BFC-85D9-4D85-ACDA-B64EEC0133E9
Zircon boot image (slot A/B/R) 9B37FFF6-2E58-466A-983A-F7926D0B04E0
Fuchsia legacy partitions[81][l]
fuchsia-esp C12A7328-F81F-11D2-BA4B-00A0C93EC93B
fuchsia-system 606B000B-B7C7-4653-A7D5-B737332C899D
fuchsia-data 08185F0C-892D-428A-A789-DBEEC8F55E6A
fuchsia-install 48435546-4953-2041-494E-5354414C4C52
fuchsia-blob 2967380E-134C-4CBB-B6DA-17E7CE1CA45D
fuchsia-fvm 41D0E340-57E3-954E-8C1E-17ECAC44CFF5
Zircon boot image (slot A) DE30CC86-1F4A-4A31-93C4-66F147D33E05
Zircon boot image (slot B) 23CC04DF-C278-4CE7-8471-897D1A4BCDF7
Zircon boot image (slot R) A0E5CF57-2DEF-46BE-A80C-A2067C37CD49
sys-config 4E5E989E-4C86-11E8-A15B-480FCF35F8E6
factory-config 5A3A90BE-4C86-11E8-A15B-480FCF35F8E6
bootloader 5ECE94FE-4C86-11E8-A15B-480FCF35F8E6
guid-test 8B94D043-30BE-4871-9DFA-D69556E8C1F3
Verified boot metadata (slot A) A13B4D9A-EC5F-11E8-97D8-6C3BE52705BF
Verified boot metadata (slot B) A288ABF2-EC5F-11E8-97D8-6C3BE52705BF
Verified boot metadata (slot R) 6A2460C3-CD11-4E8B-80A8-12CCE268ED0A
misc 1D75395D-F2C6-476B-A8B7-45CC1C97B476
emmc-boot1 900B0FC5-90CD-4D4F-84F9-9F8ED579DB88
emmc-boot2 B2B2E8D1-7C10-4EBC-A2D0-4614568260AD

See also[edit]

  • Advanced Active Partition (AAP)
  • Apple Partition Map (APM)
  • Boot Engineering Extension Record (BEER)
  • BSD disklabel
  • Device Configuration Overlay (DCO)
  • Extended Boot Record (EBR)
  • Host Protected Area (HPA)
  • Partition alignment
  • Rigid Disk Block (RDB)
  • Volume Table of Contents (VTOC)

Notes[edit]

  1. ^ Adding ULL suffix to an integer constant makes it of type unsigned long long int.
  2. ^ Third party implementation exists (GPTTSD)
  3. ^ Only if using its service pack 1 or 2
  4. ^ In a multi-disk setup, non-UEFI bootloader (boot drive) requires MBR-based partitioning, while a system drive can use GUID partitioning.
  5. ^ The GUIDs in this table are written as per RFC 4122, i.e. big-endian byte order, recognizable by the position of the version bits. For example, the GUID for an EFI System partition (C12A7328-F81F-11D2-BA4B-00A0C93EC93B), when serialized in GPT data structures (little-endian), corresponds to the hex sequence 28 73 2A C1 1F F8 D2 11 BA 4B 00 A0 C9 3E C9 3B. The first three blocks are byte-swapped to little-endian, the last is a byte array. See details in TN2166[12]
  6. ^ The formation of this GUID does not follow the GUID definition; it is formed by using the ASCII codes for the string «Hah!IdontNeedEFI«. Such formation of «GUID» value breaks down the guaranteed uniqueness of GUID.
  7. ^ a b Some computer manufacturers have their own GUIDs for partitions that are analogous to the EFI System Partition, but that hold boot loaders to launch manufacturer-specific recovery tools.[43]
  8. ^ a b Previously, Linux used the same GUID for the data partitions as Windows (Basic data partition: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7). Linux never had a separate unique partition type GUID defined for its data partitions. This created problems when dual-booting Linux and Windows in UEFI-GPT setup. The new GUID (Linux filesystem data: 0FC63DAF-8483-4772-8E79-3D69D8477DE4) was defined jointly by GPT fdisk and GNU Parted developers.[45] It is identified as type code 0x8300 in GPT fdisk.
  9. ^ a b The GUID for /usr on Solaris is used as a generic GUID for ZFS by macOS.
  10. ^ a b NetBSD and MidnightBSD had used the FreeBSD GUIDs before their unique GUIDs were created.
  11. ^ The Ceph filesystem uses GUIDs to mark the state of preparation a disk is in.[66][67]
  12. ^ The legacy Fuchsia GUIDs had two oddities: UUIDs were not generated randomly (several runs of bits were common between partitions), and partitions were uniquely identified by type GUID. The standardized scheme uses randomly-generated GUIDs, and slotted partitions (e.g. zircon_{a,b,r}) share the same type and are distinguished by name and unique GUID.[82]

References[edit]

  1. ^ a b «FAQ: Drive Partition Limits» (PDF). www.uefi.org. 2010. Retrieved 12 December 2020.
  2. ^ a b c «Unified Extensible Firmware Interface (UEFI) Specification» (PDF). www.uefi.org. 29 August 2022. p. 110. Retrieved 23 June 2023.
  3. ^ Swinburne, Richard (1 April 2010). «The Facts: 4K Advanced Format Hard Disks». www.bit-tech.net. Retrieved 12 December 2020.
  4. ^ Smith, Ryan (18 December 2009). «Western Digital’s Advanced Format: The 4K Sector Transition Begins». www.anandtech.com. Archived from the original on 28 December 2020. Retrieved 12 December 2020.{{cite web}}: CS1 maint: bot: original URL status unknown (link)
  5. ^ «Western Digital’s Advanced Format: The 4K Sector Transition Begins». Anandtech.com. Anandtech.
  6. ^ «Enterprise Capacity 3.5 HDD Data Sheet» (PDF). Seagate Technology. April 23, 2014. p. 2. Archived (PDF) from the original on 2014-08-12. Retrieved August 10, 2014.
  7. ^ «WD Re Datacenter Distribution Specification Sheet» (PDF). Western Digital. January 21, 2016. p. 2. Archived (PDF) from the original on 2015-09-06. Retrieved February 14, 2016.
  8. ^ «Advanced format (4K) disk compatibility update (Windows)». November 28, 2012. Archived from the original on 2013-01-11. Retrieved January 3, 2013.
  9. ^ «Microsoft support policy for 4K sector hard drives in Windows». Microsoft. Archived from the original on 2011-08-19. Retrieved October 24, 2013.
  10. ^ «UEFI specification». UEFI.org.
  11. ^ a b c d Smith, Roderick (3 July 2012). «Make the most of large drives with GPT and Linux». IBM. Retrieved 14 December 2020.
  12. ^ a b c d «Technical Note TN2166: Secrets of the GPT». Apple Developer. Apple. 2006-11-06. Retrieved 2014-04-16.
  13. ^ The GPT header contains a field that specifies the size of a partition table entry. The minimum required is 128 bytes, but implementations must allow for other values. See «Mac Developer Library». Developer.Apple.com. Apple. Retrieved 2014-07-13.
  14. ^ Leach, P.; Mealling, M.; Salz, R. (July 2005). A Universally Unique IDentifier (UUID) URN Namespace. Internet Engineering Task Force. doi:10.17487/RFC4122. RFC 4122. Retrieved 18 December 2020.
  15. ^ Elliott, Rob (4 January 2010). «e09127r3 EDD-4 Hybrid MBR Boot Code Annex» (PDF). www.t13.org. Archived from the original (PDF) on 20 August 2020. Retrieved 16 December 2020.
  16. ^ «GPT | Microsoft Docs».
  17. ^ «CREATE_PARTITION_PARAMETERS (vds.h) — Win32 apps | Microsoft Docs».
  18. ^ «Disk Format». Chromium.org. Retrieved 2022-02-09.
  19. ^ «Ubuntu on MacBook». Community Documentation. Ubuntu.
  20. ^ «GNU Parted FAQ».
  21. ^ «mklabel». Parted Manual. GNU.
  22. ^ «fdisk: add GPT support». kernel.org. 2013-09-27. Retrieved 2013-10-18.
  23. ^ Bueso, Davidlohr (2013-09-28). «fdisk updates and GPT support». Retrieved 2013-10-18.
  24. ^ «DISK_MAX_PARTS define». Archived from the original on 2020-03-26. Retrieved 2020-03-26.
  25. ^ «Myths and Facts About Intel Macs». rEFIt. Source forge.
  26. ^ «Significant changes from NetBSD 5.0 to 6.0»..
  27. ^ «Significant changes from NetBSD 5.0 to 6.0 (NetBSD/i386)»..
  28. ^ «Significant changes from NetBSD 5.0 to 6.0 (NetBSD/amd64)»..
  29. ^ «OpenBSD 5.9»..
  30. ^ «Booting from a ZFS Root File System». Oracle. Archived from the original on 2011-12-10.
  31. ^ «idisk(1M)». Hewlett-Packard.
  32. ^ a b c d «Windows and GPT FAQ». msdn.microsoft.com. 1 June 2017. Retrieved 14 December 2020.
  33. ^ Windows 8 32-bit supports booting from UEFI-based PC (x86-32 only) using GPT-based disks.
  34. ^ Windows 8.1 32-bit supports booting from UEFI-based PC (x86-32 only) using GPT-based disks.
  35. ^ Windows 10 32-bit supports booting from UEFI-based PC (x86-32 only) using GPT-based disks.
  36. ^ Microsoft raises the speed limit with the availability of 64-bit editions of Windows Server 2003 and Windows XP Professional Archived 2010-11-10 at the Wayback Machine
  37. ^ Windows 8 64-bit supports booting from UEFI-based PC (x86-64 only) using GPT-based disks.
  38. ^ Windows 8.1 64-bit supports booting from UEFI-based PC (x86-64 only) using GPT-based disks.
  39. ^ Windows 10 64-bit supports booting from UEFI-based PC (x86-64 only) using GPT-based disks.
  40. ^ Microsoft’s ‘Weirdest Release’: Windows Server 2022 Quietly Becomes Generally Available
  41. ^ «Archived copy» (PDF). Archived from the original (PDF) on 2013-07-28.{{cite web}}: CS1 maint: archived copy as title (link)
  42. ^ «F6F: Funtoo Linux and Intel Rapid Start Technology». Blog.adios.tw. 2012-10-30. Retrieved 2014-01-29.
  43. ^ GPT fdisk: parttypes.cc, line 198
  44. ^ a b c d e «PARTITION_INFORMATION_GPT — Win32 apps». Microsoft Docs. Retrieved 2021-08-21.
  45. ^ Smith, Rod (23 June 2011). «Need for a unique Linux GPT GUID type code (PATCH included)». bug-parted (Mailing list). lists.gnu.org. Retrieved 12 April 2016.
  46. ^ Sergei Antonov (2014-07-31). «libfdisk: (gpt) add Microsoft Storage Spaces GUID». util-linux/util-linux.git — The util-linux code repository. Retrieved 2021-08-21.
  47. ^ Known issues with Storage Replica
  48. ^ a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad ae af ag ah ai aj ak al am an ao ap aq ar as at au av aw ax ay az ba bb bc bd be bf bg bh bi bj bk bl bm bn bo bp bq br bs bt bu bv bw bx by bz ca cb cc cd ce cf cg ch ci cj ck cl cm cn co cp cq cr cs ct cu cv cw cx cy cz da db dc dd de df dg dh di dj dk dl dm dn do dp The Discoverable Partitions Specification (DPS)
  49. ^ a b c d e systemd-gpt-auto-generator(8)
  50. ^ Home Directories
  51. ^ The Boot Loader Specification
  52. ^ a b «[dm-crypt] LUKS GPT GUID». Saout.de. Archived from the original on 2014-02-03. Retrieved 2014-01-29.
  53. ^ a b «[dm-crypt] LUKS GPT GUID». Saout.de. Archived from the original on 2014-02-03. Retrieved 2014-01-29.
  54. ^ a b «pyuefi source code».
  55. ^ «udisks-2.7.4 source code». GitHub. 10 July 2022.
  56. ^ The GNU/Hurd User’s Guide: Installing, Internet Install
  57. ^ Hurd and GRUB use the same Linux ext2 file system to run and it no longer supports «UFS». file system
  58. ^ Hurd uses the same Linux swap file system
  59. ^ a b c d e f «FreeBSD System Manager’s Manual gpart(8)». Retrieved 2021-08-21.
  60. ^ «Add a partition type for nandfs to the apm, bsd, gpt and vtoc8 schemes. · freebsd/freebsd-src@f24a822 · GitHub». GitHub. Retrieved 2021-08-21.
  61. ^ «CVS log for src/sys/sys/disklabel_gpt.h». Cvsweb.netbsd.org. Retrieved 2014-01-29.
  62. ^ «Disk Format — The Chromium Projects». Chromium.org. Retrieved 2014-01-29.
  63. ^ «Constants and IDs». CoreOS. Retrieved 2018-07-26.
  64. ^ src/add-ons/kernel/partitioning_systems/gpt/gpt_known_guids.h
  65. ^ http://www.midnightbsd.org/cgi-bin/cvsweb.cgi/src/sys/sys/gpt.h.diff?r1=1.4;r2=1.5[permanent dead link] src/sys/sys/gpt.h
  66. ^ Script to set up a ceph disk: ceph-disk, lines 76-81
  67. ^ ceph-disk labels
  68. ^ QNX Power-safe filesystem
  69. ^ «gpt.ini (github.com/android-ia/device-androidia-mixins)». GitHub.
  70. ^ «gpt.ini (github.com/android-ia/device-androidia)». GitHub.
  71. ^ «gpt.ini (github.com/android-ia/vendor_intel_baytrail)». GitHub.
  72. ^ «gpt-sample.ini (github.com/android-ia/platform_bootable_userfastboot)». GitHub.
  73. ^ «gpt_ini2bin.py (android.googlesource.com/platform/hardware/bsp/intel)».
  74. ^ «gpt.c (github.com/android-ia/platform_bootable_userfastboot)». GitHub.
  75. ^ «gpt_ini2bin.py (github.com/android-ia/vendor_intel_common)». GitHub.
  76. ^ «The Boot Loader Specification». freedesktop.org. Retrieved 2017-01-05.
  77. ^ «SPDK Block Device User Guide». Retrieved 2021-01-20.
  78. ^ «Barebox State Framework». Retrieved 2021-05-21.
  79. ^ Villemoes, Rasmus (2020-11-17). «RFC: Partition type GUID for U-Boot environment». U-Boot mailing list (Mailing list). Retrieved 2021-09-28.
  80. ^ «U-boot 2021.07 source code: include/part_efi.h». Retrieved 2021-09-28.
  81. ^ a b zircon/system/public/zircon/hw/gpt.h
  82. ^ «[paver] add support for new partition scheme». Retrieved 2021-10-22.

External links[edit]

  • Microsoft TechNet: Disk Sectors on GPT Disks (archived page)
  • Microsoft Windows Deployment: Converting MBR to GPT without dats loss
  • Microsoft TechNet: Troubleshooting Disks and File Systems
  • Microsoft TechNet: Using GPT Drives
  • Microsoft: FAQs on Using GPT disks in Windows
  • Microsoft Technet: How Basic Disks and Volumes Work A bit MS-specific but good figures relate GPT to older MBR format and protective-MBR, shows layouts of complete disks, and how to interpret partition-table hexdumps.
  • Apple Developer Connection: Secrets of the GPT
  • Make the most of large drives with GPT and Linux
  • Convert Windows Vista SP1+ or 7 x86_64 boot from BIOS-MBR mode to UEFI-GPT mode without Reinstall
  • Support for GPT (Partition scheme) and HDD greater than 2.19 TB in Microsoft Windows XP
  • Setting up a RAID volume in Linux with >2TB disks

Опубликовано:

Исправлено:

Версия документа: 1

Как‐то в один прекрасный день корпорация Open Software Foundation придумала концепцию UUID — Universally Unique Identifier, вселенски уникального идентификатора. Она взяла 128‐битное число и написала для его вычисления специальный алгоритм, более‐менее равномерно выдающий значения из такого огромного диапазона. Вероятность выдачи алгоритмом двух одинаковых чисел невелика, на практике можно говорить, что любое новое число UUID будет уникально.

Корпорация Microsoft взяла на вооружение эту мысль и число UUID без изменения, назвала его немного по‐другому: GUID, то есть Globally Unique Identifier, глобально уникальный идентификатор.

Применение

Корпорация Microsoft применяет GUID в следующих случаях:

  • идентификатор классов (CLSID — Class Identifier);
  • идентификатор интерфейсов (IID — Interface Identifier);
  • идентификатор библиотек типов (LIBID — Library Identifier);
  • много где ещё.

Ты тоже можешь использовать GUID в своих целях, например, так:

  • идентификатор записей в базе данных;
  • идентификатор сущностей;
  • серийный номер чего‐либо.

Определение GUID

GUID — это беззнаковое целое 128‐битное число. Ничего таинственного и сверхъестественного.

Тип данных «128‐битное число» в языке программирования не предусмотрен, но программисты из Microsoft элегантно выкрутились из ограничения, представив такое число в виде стуктуры.

Структура GUID

В заголовочном файле win\guiddef.bi (входит в windows.bi) тип данных GUID объявлен в виде структуры:

Type _GUID
    Data1 As ULong
    Data2 As UShort
    Data3 As UShort
    Data4(0 To 7) As UByte
End Type

Type GUID As _GUID

По порядку следования байт числа:

  • 32‐битное беззнаковое целое (ULong);
  • 16‐битное беззнаковое целое (UShort);
  • 16‐битное беззнаковое целое (UShort, второй раз);
  • восемь штук 8‐битных беззнаковых целых (UByte).

IID и CLSID

IID (идентификатор интерфейса) и CLSID (идентификатор класса) — это псевдонимы GUID:

Type IID As GUID

Type CLSID As GUID

REFGUID, REFIID и REFCLSID

Поскольку размер GUID — 16 байтов и в обычный параметр «не влезают», мы будем передавать его в функции не по значению, а как указатель на структуру, а лучше как константный указатель на константные данные. Программистам из Microsoft показалось утомительным писать каждый раз что‐то вроде ByVal As Const IID Const Ptr, поэтому они определили в заголовочнике типы данных для таких указателей (Reference — отсюда приставка REF) на GUID, IID и CLSID:

Type REFGUID As Const GUID Const Ptr

Type REFIID As Const IID Const Ptr

Type REFCLSID As Const IID Const Ptr

Теперь можно объявлять параметр функции так: ByVal As REFIID.

Объявление GUID

В тексте

В тексте GUID записывается в виде строки из шестнадцатеричных цифр XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX, разбитой дефисоминусами на группы по пять штук. В формате реестра цифры обрамляют фигурными скобками.

Ты уже наверняка где‐нибудь встречал похожие строки GUID:

{00000000-0000-0000-C000-000000000046}

{00020400-0000-0000-C000-000000000046}

{717473E7-54B3-4580-A086-2199430834DA}

{4C9E6590-A9C5-40AD-9E13-AB55F6AAC05F}

Первая группа кодирует 32‐битное беззнаковое целое, вторая и третья группы — два 16‐битных беззнаковых целых, четвёртая и пятая — восемь 8‐битных беззнаковых целых.

В коде

Посмотрим как объявляется IID интерфейса IXmlHttpRequest и CLSID класса XmlHttpRequest, который реализует этот интерфейс:

Dim IID_IXmlHttpRequest As IID = Type( _
	&hED8C108D, &h4349, &h11D2, _
	{&h91, &hA4, &h00, &hC0, &h4F, &h79, &h69, &hE8} _
)

Dim CLSID_XMLHTTPREQUEST As CLSID = Type( _
	&hED8C108E, &h4349, &h11D2, _
	{&h91, &hA4, &h00, &hC0, &h4F, &h79, &h69, &hE8} _
)

Но этот вариант недостаточно гибкий, так как работает на уровне одного файла (одной единицы трансляции).

Через макросы

В случае, когда одно и то же значение GUID необходимо использовать в нескольких файлах, то его объявляют в одном из общих заголовочных файлов как внешнюю константную переменную:

Extern IID_IBaseStream Alias "IID_IBaseStream" As Const IID

Затем создают заголовочный файл Guids.bas с макросами:

#ifndef GUIDS_BI
#define GUIDS_BI

#include once "windows.bi"

#ifndef DEFINE_GUID
#define DEFINE_GUID(n, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) Extern n Alias #n As Const GUID : _ 
	Dim n As Const GUID = Type(l, w1, w2, {b1, b2, b3, b4, b5, b6, b7, b8})
#endif

#ifndef DEFINE_IID
#define DEFINE_IID(n, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) Extern n Alias #n As Const IID : _ 
	Dim n As Const IID = Type(l, w1, w2, {b1, b2, b3, b4, b5, b6, b7, b8})
#endif

#ifndef DEFINE_CLSID
#define DEFINE_CLSID(n, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) Extern n Alias #n As Const CLSID : _ 
	Dim n As Const CLSID = Type(l, w1, w2, {b1, b2, b3, b4, b5, b6, b7, b8})
#endif

#ifndef DEFINE_LIBID
#define DEFINE_LIBID(n, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) Extern n Alias #n As Const GUID : _ 
	Dim n As Const GUID = Type(l, w1, w2, {b1, b2, b3, b4, b5, b6, b7, b8})
#endif

#endif

И уже файле реализации Guids.bas прописывают непосредственно значения GUID через макросы:

#include "Guids.bi"

' {B6AC4CEF-9B3D-4B41-B2F6-DEA27D085EB7}
DEFINE_IID(IID_IBaseStream, _
	&hb6ac4cef, &h9b3d, &h4b41, &hb2, &hf6, &hde, &ha2, &h7d, &h8, &h5e, &hb7 _
)

Функции для работы с GUID

Ввместе с заголовочником windows.bi для работы необходимо подключить win\ole2.bi.

CoCreateGUID

Создаёт GUID.

Declare Function CoCreateGuid( _
    ByVal pguid As GUID Ptr _
)As HRESULT

Параметры

pguid
Указатель на переменную, куда будет записан созданный GUID.

Возвращаемое значение

В случае успеха функция возвращает константу S_OK, в случае ошибки — что‐то другое.

Однако тип возвращаемого значения HRESULT говорит, что проверять успешность выполненения функции следует макросами SUCCEEDED и FAILED, а не сравнивать результат напрямую с константой.

Макросы IsEqualGUID, IsEqualIID, IsEqualCLSID и InlineIsEqualGUID

Предназначены для сравнения двух GUID, IID или CLSID.

Declare Function IsEqualGUID( _
    ByVal rguid1 As REFGUID, _
    ByVal rguid2 As REFGUID _
)As Boolean

Declare Function IsEqualIID( _
    ByVal rguid1 As REFIID, _
    ByVal rguid2 As REFIID _
)As Boolean

Declare Function IsEqualCLSID( _
    ByVal rguid1 As REFCLSID, _
    ByVal rguid2 As REFCLSID _
)As Boolean

Declare Function InlineIsEqualGUID( _
    ByVal rguid1 As REFGUID, _
    ByVal rguid2 As REFGUID _
)As Boolean

Макросы IsEqualGUID, IsEqualIID и IsEqualCLSID сравнивают два GUID через функцию memcmp(), а InlineIsEqualGUID делает это в коде, побайтово.

StringFromGUID2

Заполняет буфер строкой из GUID в формате реестра.

Declare Function StringFromGUID2( _
    ByVal rguid As REFGUID , _
    ByVal lpsz As LPOLESTR, _
    ByVal cchMax As Long _
)As Long

Параметры

rguid
Указатель на GUID.
lpsz
Указатель на буфер, куда будет записана строка.
cchMax
Длина буфера.

Возвращаемое значение

В случае успеха функция возвратит количество записанных символов, включая нулевой.

В случае ошибки, когда буфер под строку слишком мал, вернёт 0.

StringFromIID и StringFromCLSID

Возвращают строку из IID или CLSID в формате реестра.

Declare Function StringFromIID( _
    ByVal rclsid As REFIID , _
    ByVal lplpsz As LPOLESTR Ptr _
)As HRESULT

Declare Function StringFromCLSID( _
    ByVal rclsid As REFCLSID, _
    ByVal lplpsz As LPOLESTR Ptr _
)As HRESULT

Параметры

rclsid
Указатель на IID или CLSID.
lplpsz
Указатель на переменную‐указатель, по которому будет записан адрес созданной строки. После использования строку следует уничтожить функцией CoTaskMemFree().

Возвращаемое значение

В случае успеха функция возвращает константу S_OK.

В случае ошибки, когда недостаточно памяти, вернёт E_OUTOFMEMORY.

Однако тип возвращаемого значения HRESULT говорит, что проверять успешность выполненения функции следует макросами SUCCEEDED и FAILED, а не сравнивать результат напрямую с константой.

IIDFromString и CLSIDFromString

Заполняют структуры IID или CLSID из строки GUID в формате реестра.

Declare Function IIDFromString( _
    ByVal lpsz As LPCOLESTR, _
    ByVal lpiid As LPIID _
)As HRESULT

Declare Function CLSIDFromString( _
    ByVal lpsz As LPCOLESTR, _
    ByVal pclsid As LPCLSID _
)As HRESULT

Параметры

lpsz
Указатель на строку с IID или CLSID.
lpiid или pclsid
Указатель на переменную типа GUID, куда будет записан GUID.

Возвращаемое значение

В случае успеха функция возвращает константу S_OK, в случае ошибки — что‐то другое.

Однако тип возвращаемого значения HRESULT говорит, что проверять успешность выполненения функции следует макросами SUCCEEDED и FAILED, а не сравнивать результат напрямую с константой.

Примеры

Генератор GUID

В этом простом примере посмотрим как создать GUID и вывести его на консоль.

#include "windows.bi"
#include "win\ole2.bi"

' Наш IID интерфейса
Dim IID_IFace As IID = Any
CoCreateGUID(@IID_IFace)

' Получаем строку
Dim pstrIID_IFace As WString Ptr = Any
StringFromIID(@IID_IFace, @pstrIID_IFace)

' Выводим на консоль
Print *pstrIID_IFace

' Очищаем память
CoTaskMemFree(pstrIID_IFace)

A GUID is a «Globally Unique ID». Also called a UUID (Universally Unique ID).

It’s basically a 128 bit number that is generated in a way (see RFC 4112 http://www.ietf.org/rfc/rfc4122.txt) that makes it nearly impossible for duplicates to be generated. This way, I can generate GUIDs without some third party organization having to give them to me to ensure they are unique.

One widespread use of GUIDs is as identifiers for COM entities on Windows (classes, typelibs, interfaces, etc.). Using GUIDs, developers could build their COM components without going to Microsoft to get a unique identifier. Even though identifying COM entities is a major use of GUIDs, they are used for many things that need unique identifiers. Some developers will generate GUIDs for database records to provide them an ID that can be used even when they must be unique across many different databases.

Generally, you can think of a GUID as a serial number that can be generated by anyone at anytime and they’ll know that the serial number will be unique.

Other ways to get unique identifiers include getting a domain name. To ensure the uniqueness of domain names, you have to get it from some organization (ultimately administered by ICANN).

Because GUIDs can be unwieldy (from a human readable point of view they are a string of hexadecimal numbers, usually grouped like so: aaaaaaaa-bbbb-cccc-dddd-ffffffffffff), some namespaces that need unique names across different organization use another scheme (often based on Internet domain names).

So, the namespace for Java packages by convention starts with the orgnaization’s domain name (reversed) followed by names that are determined in some organization specfic way. For example, a Java package might be named:

com.example.jpackage

This means that dealing with name collisions becomes the responsibility of each organization.

XML namespaces are also made unique in a similar way — by convention, someone creating an XML namespace is supposed to make it ‘underneath’ a registered domain name under their control. For example:

xmlns="http://www.w3.org/1999/xhtml"

Another way that unique IDs have been managed is for Ethernet MAC addresses. A company that makes Ethernet cards has to get a block of addresses assigned to them by the IEEE (I think it’s the IEEE). In this case the scheme has worked pretty well, and even if a manufacturer screws up and issues cards with duplicate MAC addresses, things will still work OK as long as those cards are not on the same subnet, since beyond a subnet, only the IP address is used to route packets. Although there are some other uses of MAC addresses that might be affected — one of the algorithms for generating GUIDs uses the MAC address as one parameter. This GUID generation method is not as widely used anymore because it is considered a privacy threat.

One example of a scheme to come up with unique identifiers that didn’t work very well was the Microsoft provided ID’s for ‘VxD’ drivers in Windows 9x. Developers of third party VxD drivers were supposed to ask Microsoft for a set of IDs to use for any drivers the third party wrote. This way, Microsoft could ensure there were not duplicate IDs. Unfortunately, many driver writers never bothered, and simply used whatever ID was in the example VxD they used as a starting point. I’m not sure how much trouble this caused — I don’t think VxD ID uniqueness was absolutely necessary, but it probably affected some functionality in some APIs.

  • Guitar hero 3 для windows 10
  • Gv rx60p128de драйвер windows 10
  • Gv r577ud 1gd драйвер windows 10
  • Guillemot force feedback racing wheel драйвер windows 10 x64
  • H3h3 танцует на фоне windows 10