5

Using gdisk's i command I can view a partition's "unique GUID" (identifying the partition) and "GUID/type code" (hinting the partition's type/usage/format) and the t command in gdisk allows me to change that type code, but only with a list of pre-defined type codes. Is it possible to manually change the type GUID of a partition in case gdisk's list of pre-defined type codes doesn't include that type? (Preferably some method that does not involve opening a hex-editor.)

For example the version of gdisk on the live CD of Elementary OS 5.0 doesn't include the type GUID for LUKS partitions, CA7D7CCB-63ED-4C53-861C-1742536059CC, but the version of gdisk on the ArchLinux live CD does and it is listed as type code 8309.

Cubi73
  • 491
  • 8
  • 23

1 Answers1

8

You can enter CA7D7CCB-63ED-4C53-861C-1742536059CC in gdisk instead of the internal type code.

Here is an example where i change my EFI system partition C12A7328-F81F-11D2-BA4B-00A0C93EC93B to LUKS:

Command (? for help): i
Partition number (1-7): 1
Partition GUID code: C12A7328-F81F-11D2-BA4B-00A0C93EC93B (EFI System)
Partition unique GUID: 57DA3874-BAD6-4C30-90C6-F7B894246615
First sector: 34 (at 17.0 KiB)
Last sector: 534527 (at 261.0 MiB)
Partition size: 534494 sectors (261.0 MiB)
Attribute flags: 0000000000000000
Partition name: ''

Command (? for help): t
Partition number (1-7): 1
Current type is 'EFI System'
Hex code or GUID (L to show codes, Enter = 8300): CA7D7CCB-63ED-4C53-861C-1742536059CC
Changed type of partition to 'Unknown'

Command (? for help): i
Partition number (1-7): 1
Partition GUID code: CA7D7CCB-63ED-4C53-861C-1742536059CC (Unknown)
Partition unique GUID: 57DA3874-BAD6-4C30-90C6-F7B894246615
First sector: 34 (at 17.0 KiB)
Last sector: 534527 (at 261.0 MiB)
Partition size: 534494 sectors (261.0 MiB)
Attribute flags: 0000000000000000
Partition name: ''

Note that the prompt says Hex code or GUID.

Freddy
  • 1,495