Module Disk.Partition

Disk partitions.

Partition schemes

type disk := t
type scheme =
  1. | Mbr
  2. | Gpt

The type for disk partition schemes.

val pp_scheme : scheme B0_std.Fmt.t

pp_scheme prints partition schemes for inspection.

val read_scheme : disk -> (scheme, string) Stdlib.result

read_partition_scheme d is the parition scheme of d.

Partition types

type type' =
  1. | Efi_system
  2. | Legacy_mbr
  3. | Microsoft_bdp
  4. | Unused
  5. | Unknown of Uuidm.t
    (*

    The type for partition types.

    *)
val type_of_type_guid : Uuidm.t -> type'

type_of_type_guid guid maps know partition type GUIDs to type' values.

val type_guid_of_type : type' -> Uuidm.t

type_guid_of_type t is the GUID of t.

val pp_type : type' B0_std.Fmt.t

pp_type formats types for inspection.

Partitions

type t

The type for disk partitions entries.

Note. MBR partitions are mapped to this format. A suitable type_guid is tried or other Uuidm.max is used.

val type_guid : t -> Uuidm.t

type_guid p is the partition type GUID.

val guid : t -> Uuidm.t

guid p is the Unique partition GUID.

val first_lba : t -> lba

first_lba p is the first LBA of the partition.

val last_lba : t -> lba

last_lba p is the last LBA of the partition.

val attributes : t -> int64

attributes p are the attributes of the partition.

val name : t -> string

name p is the UTF-8 encoded partition name.

val pp : ?disk:disk -> unit -> t B0_std.Fmt.t

pp formats partitions for inspection.

val read_entries : disk -> (scheme * t list, string) Stdlib.result

read_entries d are the partition entries of disk d, unused entries are not reported.