24 #ifndef STORAGE_PARTITION_H 25 #define STORAGE_PARTITION_H 28 #include "storage/Devices/BlkDevice.h" 290 unsigned int get_id()
const;
299 void set_id(
unsigned int id);
353 void set_label(
const std::string& label);
358 const std::string&
get_uuid()
const;
416 const Impl& get_impl()
const;
418 virtual Partition* clone()
const override;
Only for MS-DOS.
Definition: Partition.h:95
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:132
Only set during probing.
Definition: Partition.h:128
Linux USR Partition (x86), only for GPT.
Definition: Partition.h:207
Linux Root Partition (x86), only for GPT.
Definition: Partition.h:174
Linux Root Partition (s390x), only for GPT.
Definition: Partition.h:171
For MS-DOS, GPT, DASD and implicit.
Definition: Partition.h:113
void set_type(PartitionType type)
Set the partiton type.
std::string get_partition_id_name(IdNum partition_id)
Convert the IdNum partition_id to a string.
For MS-DOS and GPT.
Definition: Partition.h:104
Linux USR Partition (s390), only for GPT.
Definition: Partition.h:201
unsigned int get_id() const
Get the partition id.
void set_legacy_boot(bool legacy_boot)
Set the legacy boot flag of the partition.
PartitionTable * get_partition_table()
Return the partition table the partition belongs to.
static bool compare_by_number(const Partition *lhs, const Partition *rhs)
Compare (less than) two Partitions by number.
Linux Root Partition (aarch64), only for GPT.
Definition: Partition.h:150
Linux Server Data, only for GPT.
Definition: Partition.h:144
Linux USR Partition (ppc), only for GPT.
Definition: Partition.h:186
Only for MS-DOS.
Definition: Partition.h:92
PartitionType
Enum with partition types.
Definition: Partition.h:42
Only for MS-DOS.
Definition: Partition.h:89
void set_label(const std::string &label)
Set the partition label.
LVM partition, for MS-DOS, GPT and DASD.
Definition: Partition.h:119
Linux Root Partition (ppc64be), only for GPT.
Definition: Partition.h:156
LinuxPartitionIdCategory
Enum with categories for Linux partitions.
Definition: Partition.h:228
Linux USR Partition (riscv32), only for GPT.
Definition: Partition.h:195
Linux USR Partition (x86_64), only for GPT.
Definition: Partition.h:210
IdNum get_linux_partition_id(LinuxPartitionIdCategory linux_partition_id_category, SystemInfo &system_info)
Get the partition id for the Linux partition of the given category (root, usr, ...) depending on the architecture.
Linux Root Partition (arm), only for GPT.
Definition: Partition.h:147
std::string get_partition_type_name(PartitionType partition_type)
Convert the PartitionType partition_type to a string.
A start/length pair with a block size.
Definition: Region.h:84
Linux Root Partition (x86_64), only for GPT.
Definition: Partition.h:177
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:107
Linux USR Partition (s390x), only for GPT.
Definition: Partition.h:204
Windows basic data partition, only for GPT.
Definition: Partition.h:135
Linux USR Partition (ppc64le), only for GPT.
Definition: Partition.h:192
bool is_partition(const Device *device)
Checks whether device points to a Partition.
Intel Rapid Start Technology, for MS-DOS and GPT.
Definition: Partition.h:116
EFI System Partition, for MS-DOS and GPT.
Definition: Partition.h:125
The main container of the libstorage-ng.
Definition: Devicegraph.h:169
Swap partition, for MS-DOS, GPT and DASD.
Definition: Partition.h:110
Only for MS-DOS.
Definition: Partition.h:98
const std::string & get_label() const
Get the partition label.
An abstract Block Device.
Definition: BlkDevice.h:48
unsigned int get_number() const
Get the partition number.
const std::string & get_uuid() const
Get the partition UUID.
void set_boot(bool boot)
Set the boot flag of the partition.
Linux Root Partition (s390), only for GPT.
Definition: Partition.h:168
Linux USR Partition (arm), only for GPT.
Definition: Partition.h:180
An abstract base class for storage devices.
Definition: Device.h:81
PartitionType get_type() const
Get the partition type.
Partitionable * get_partitionable()
Return the partitionable the partition belongs to.
Microsoft reserved partition, only for GPT.
Definition: Partition.h:138
Only for MS-DOS.
Definition: Partition.h:101
Definition: Partitionable.h:39
Linux USR Partition (ppc64be), only for GPT.
Definition: Partition.h:189
bool is_legacy_boot() const
Query the legacy boot flag of the partition.
Linux Root Partition (ppc64le), only for GPT.
Definition: Partition.h:159
A partition of a Partitionable, e.g.
Definition: Partition.h:248
Linux USR Partition (riscv64), only for GPT.
Definition: Partition.h:198
RAID partition, for MS-DOS, GPT and DASD.
Definition: Partition.h:122
Linux Root Partition (riscv64), only for GPT.
Definition: Partition.h:165
Linux Home, only for GPT.
Definition: Partition.h:141
The storage namespace.
Definition: Actiongraph.h:38
Linux Root Partition (riscv32, only for GPT.
Definition: Partition.h:162
static Partition * find_by_name(Devicegraph *devicegraph, const std::string &name)
Find a Partition by its name.
Definition: PartitionTable.h:87
Linux Root Partition (ppc), only for GPT.
Definition: Partition.h:153
Linux USR Partition (aarch64), only for GPT.
Definition: Partition.h:183
bool is_boot() const
Query the boot flag of the partition.
IdNum
Enum with values used as partition ids.
Definition: Partition.h:86
static Partition * create(Devicegraph *devicegraph, const std::string &name, const Region ®ion, PartitionType type)
Create a device of type Partition.
void set_id(unsigned int id)
Set the partition id.