24 #ifndef STORAGE_PARTITION_H 25 #define STORAGE_PARTITION_H 28 #include "storage/Devices/BlkDevice.h" 40 PRIMARY, EXTENDED, LOGICAL
43 std::string get_partition_type_name(
PartitionType partition_type);
125 unsigned int get_number()
const;
134 unsigned int get_id()
const;
139 void set_id(
unsigned int id);
209 const Impl& get_impl()
const;
211 virtual Partition* clone()
const override;
220 bool is_partition(
const Device* device);
Only for MS-DOS.
Definition: Partition.h:71
Partition * to_partition(Device *device)
Converts pointer to Device to pointer to Partition.
BIOS boot partition (https://en.wikipedia.org/wiki/BIOS_boot_partition), only for GPT...
Definition: Partition.h:102
Only set during probing.
Definition: Partition.h:98
For MS-DOS, GPT, DASD and implicit.
Definition: Partition.h:83
void set_type(PartitionType type)
For MS-DOS and GPT.
Definition: Partition.h:77
void set_legacy_boot(bool legacy_boot)
Set the legacy boot flag of the partition.
static bool compare_by_number(const Partition *lhs, const Partition *rhs)
Compare (less than) two Partitions by number.
Only for MS-DOS.
Definition: Partition.h:65
PartitionType
Partition type (primary, extended, logical)
Definition: Partition.h:39
Only for MS-DOS.
Definition: Partition.h:62
LVM partition, for MS-DOS, GPT and DASD.
Definition: Partition.h:89
A start/length pair with a block size.
Definition: Region.h:73
Region get_unused_surrounding_region() const
Returns the unused region surrounding the partition (including the partition itself).
PPC PReP Boot partition, for MS-DOS and GPT.
Definition: Partition.h:80
Windows basic data partition, only for GPT.
Definition: Partition.h:105
EFI System Partition, for MS-DOS and GPT.
Definition: Partition.h:95
The master container of the libstorage.
Definition: Devicegraph.h:153
Swap partition, for MS-DOS, GPT and DASD.
Definition: Partition.h:86
Only for MS-DOS.
Definition: Partition.h:68
An abstract Block Device.
Definition: BlkDevice.h:41
void set_boot(bool boot)
Set the boot flag of the partition.
An abstract base class of storage devices, and a vertex in the Devicegraph.
Definition: Device.h:75
Microsoft reserved partition, only for GPT.
Definition: Partition.h:108
Only for MS-DOS.
Definition: Partition.h:74
Definition: Partitionable.h:40
bool is_legacy_boot() const
Query the legacy boot flag of the partition.
A partition of a Partitionable, e.g. Disk or Md.
Definition: Partition.h:114
RAID partition, for MS-DOS, GPT and DASD.
Definition: Partition.h:92
The storage namespace.
Definition: Actiongraph.h:37
static Partition * find_by_name(Devicegraph *devicegraph, const std::string &name)
Find a Partition by its name.
Definition: PartitionTable.h:81
bool is_boot() const
Query the boot flag of the partition.
IdNum
Enum with values used as partition ids.
Definition: Partition.h:59
static Partition * create(Devicegraph *devicegraph, const std::string &name, const Region ®ion, PartitionType type)
region is sector-based.
void set_id(unsigned int id)