int fdisk_gpt_is_hybrid (
struct fdisk_context *cxt);
The regular GPT contains PMBR (dummy protective MBR) where the protective MBR does not address any partitions.
Hybrid GPT contains regular MBR where this partition table addresses the same partitions as GPT. It's recommended to not use hybrid GPT due to MBR limits.
The libfdisk does not provide functionality to sync GPT and MBR, you have to
directly access and modify (P)MBR (see
#define GPT_FLAG_REQUIRED 1
GPT attribute; marks a partition as system partition (disk partitioning utilities must preserve the partition as is)
#define GPT_FLAG_NOBLOCK 2
GPT attribute; EFI firmware should ignore the content of the partition and not try to read from it
#define GPT_FLAG_LEGACYBOOT 3
GPT attribute; use the partition for legacy boot method
#define GPT_FLAG_GUIDSPECIFIC 4
GPT attribute; for bites 48-63, defined and used by the individual partition type.
The flag GPT_FLAG_GUIDSPECIFIC forces libfdisk to ask (by ask API) for a bit number. If you want to toggle specific bit and avoid any dialog, then use the bit number (in range 48..63). For example:
// start dialog to ask for bit number fdisk_toggle_partition_flag(cxt, n, GPT_FLAG_GUIDSPECIFIC);
// toggle bit 60 fdisk_toggle_partition_flag(cxt, n, 60);