libparted 3.6
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions
disk.h File Reference

Go to the source code of this file.

Data Structures

struct  _PedDisk
 Represents a disk label (partition table). More...
 
struct  _PedDiskArchOps
 Architecture-specific operations. More...
 
struct  _PedDiskOps
 
struct  _PedDiskType
 
struct  _PedPartition
 PedPartition structure represents a partition. More...
 

Macros

#define PED_DISK_FIRST_FLAG   1
 
#define PED_DISK_LAST_FLAG   2
 
#define PED_DISK_TYPE_FIRST_FEATURE   1
 
#define PED_DISK_TYPE_LAST_FEATURE   32
 
#define PED_PARTITION_FIRST_FLAG   1
 
#define PED_PARTITION_LAST_FLAG   22
 

Typedefs

typedef struct _PedDisk PedDisk
 
typedef const struct _PedDiskArchOps PedDiskArchOps
 
typedef enum _PedDiskFlag PedDiskFlag
 
typedef const struct _PedDiskOps PedDiskOps
 
typedef struct _PedDiskType PedDiskType
 
typedef enum _PedDiskTypeFeature PedDiskTypeFeature
 
typedef struct _PedPartition PedPartition
 
typedef enum _PedPartitionFlag PedPartitionFlag
 
typedef enum _PedPartitionType PedPartitionType
 

Enumerations

enum  _PedDiskFlag { PED_DISK_CYLINDER_ALIGNMENT =1 , PED_DISK_GPT_PMBR_BOOT =2 , PED_DISK_CYLINDER_ALIGNMENT =1 , PED_DISK_GPT_PMBR_BOOT =2 }
 Disk flags. More...
 
enum  _PedDiskTypeFeature {
  PED_DISK_TYPE_EXTENDED =1 , PED_DISK_TYPE_PARTITION_NAME =2 , PED_DISK_TYPE_PARTITION_TYPE_ID =4 , PED_DISK_TYPE_PARTITION_TYPE_UUID =8 ,
  PED_DISK_TYPE_DISK_UUID =16 , PED_DISK_TYPE_PARTITION_UUID =32 , PED_DISK_TYPE_EXTENDED =1 , PED_DISK_TYPE_PARTITION_NAME =2 ,
  PED_DISK_TYPE_PARTITION_TYPE_ID =4 , PED_DISK_TYPE_PARTITION_TYPE_UUID =8 , PED_DISK_TYPE_DISK_UUID =16 , PED_DISK_TYPE_PARTITION_UUID =32
}
 
enum  _PedPartitionFlag {
  PED_PARTITION_BOOT =1 , PED_PARTITION_ROOT =2 , PED_PARTITION_SWAP =3 , PED_PARTITION_HIDDEN =4 ,
  PED_PARTITION_RAID =5 , PED_PARTITION_LVM =6 , PED_PARTITION_LBA =7 , PED_PARTITION_HPSERVICE =8 ,
  PED_PARTITION_PALO =9 , PED_PARTITION_PREP =10 , PED_PARTITION_MSFT_RESERVED =11 , PED_PARTITION_BIOS_GRUB =12 ,
  PED_PARTITION_APPLE_TV_RECOVERY =13 , PED_PARTITION_DIAG =14 , PED_PARTITION_LEGACY_BOOT =15 , PED_PARTITION_MSFT_DATA =16 ,
  PED_PARTITION_IRST =17 , PED_PARTITION_ESP =18 , PED_PARTITION_CHROMEOS_KERNEL =19 , PED_PARTITION_BLS_BOOT =20 ,
  PED_PARTITION_LINUX_HOME =21 , PED_PARTITION_NO_AUTOMOUNT =22 , PED_PARTITION_BOOT =1 , PED_PARTITION_ROOT =2 ,
  PED_PARTITION_SWAP =3 , PED_PARTITION_HIDDEN =4 , PED_PARTITION_RAID =5 , PED_PARTITION_LVM =6 ,
  PED_PARTITION_LBA =7 , PED_PARTITION_HPSERVICE =8 , PED_PARTITION_PALO =9 , PED_PARTITION_PREP =10 ,
  PED_PARTITION_MSFT_RESERVED =11 , PED_PARTITION_BIOS_GRUB =12 , PED_PARTITION_APPLE_TV_RECOVERY =13 , PED_PARTITION_DIAG =14 ,
  PED_PARTITION_LEGACY_BOOT =15 , PED_PARTITION_MSFT_DATA =16 , PED_PARTITION_IRST =17 , PED_PARTITION_ESP =18 ,
  PED_PARTITION_CHROMEOS_KERNEL =19 , PED_PARTITION_BLS_BOOT =20 , PED_PARTITION_LINUX_HOME =21 , PED_PARTITION_NO_AUTOMOUNT =22
}
 Partition flags. More...
 
enum  _PedPartitionType {
  PED_PARTITION_NORMAL = 0x00 , PED_PARTITION_LOGICAL = 0x01 , PED_PARTITION_EXTENDED = 0x02 , PED_PARTITION_FREESPACE = 0x04 ,
  PED_PARTITION_METADATA = 0x08 , PED_PARTITION_PROTECTED = 0x10 , PED_PARTITION_NORMAL = 0x00 , PED_PARTITION_LOGICAL = 0x01 ,
  PED_PARTITION_EXTENDED = 0x02 , PED_PARTITION_FREESPACE = 0x04 , PED_PARTITION_METADATA = 0x08 , PED_PARTITION_PROTECTED = 0x10
}
 Partition types. More...
 

Functions

PedDisk_ped_disk_alloc (const PedDevice *dev, const PedDiskType *type)
 
void _ped_disk_free (PedDisk *disk)
 
PedPartition_ped_partition_alloc (const PedDisk *disk, PedPartitionType type, const PedFileSystemType *fs_type, PedSector start, PedSector end)
 
int _ped_partition_attempt_align (PedPartition *part, const PedConstraint *external, PedConstraint *internal)
 
void _ped_partition_free (PedPartition *part)
 
int ped_disk_add_partition (PedDisk *disk, PedPartition *part, const PedConstraint *constraint)
 Adds PedPartition part to PedDisk disk.
 
int ped_disk_check (const PedDisk *disk)
 Perform a sanity check on a partition table.
 
int ped_disk_clobber (PedDevice *dev)
 Remove all identifying signatures of a partition table,.
 
int ped_disk_commit (PedDisk *disk)
 
int ped_disk_commit_to_dev (PedDisk *disk)
 Write the changes made to the in-memory description of a partition table to the device.
 
int ped_disk_commit_to_os (PedDisk *disk)
 Tell the operating system kernel about the partition table layout of disk.
 
int ped_disk_delete_all (PedDisk *disk)
 Removes and destroys all partitions on disk.
 
int ped_disk_delete_partition (PedDisk *disk, PedPartition *part)
 Removes part from disk, and destroys part.
 
void ped_disk_destroy (PedDisk *disk)
 Close disk.
 
PedDiskped_disk_duplicate (const PedDisk *old_disk)
 Clone a PedDisk object.
 
PedPartitionped_disk_extended_partition (const PedDisk *disk)
 
PedDiskFlag ped_disk_flag_get_by_name (const char *name)
 Returns the flag associated with name.
 
const char * ped_disk_flag_get_name (PedDiskFlag flag)
 Returns a name for a flag, e.g.
 
PedDiskFlag ped_disk_flag_next (PedDiskFlag flag)
 Iterates through all disk flags.
 
int ped_disk_get_flag (const PedDisk *disk, PedDiskFlag flag)
 Get the state (1 or 0) of a flag on a disk.
 
int ped_disk_get_last_partition_num (const PedDisk *disk)
 Get the highest available partition number on disk.
 
PedGeometryped_disk_get_max_partition_geometry (PedDisk *disk, PedPartition *part, const PedConstraint *constraint)
 Get the maximum geometry part can be grown to, subject to constraint.
 
int ped_disk_get_max_primary_partition_count (const PedDisk *disk)
 Get the maximum number of (primary) partitions the disk label supports.
 
bool ped_disk_get_max_supported_partition_count (const PedDisk *disk, int *supported)
 Get the highest supported partition number on disk.
 
PedPartitionped_disk_get_partition (const PedDisk *disk, int num)
 Returns the partition numbered num.
 
PedAlignmentped_disk_get_partition_alignment (const PedDisk *disk)
 Get the alignment needed for partition boundaries on this disk.
 
PedPartitionped_disk_get_partition_by_sector (const PedDisk *disk, PedSector sect)
 Returns the partition that contains sect.
 
int ped_disk_get_primary_partition_count (const PedDisk *disk)
 Get the number of primary partitions.
 
uint8_t * ped_disk_get_uuid (const PedDisk *disk)
 Get the uuid of the disk disk.
 
int ped_disk_is_flag_available (const PedDisk *disk, PedDiskFlag flag)
 Check whether a given flag is available on a disk.
 
PedSector ped_disk_max_partition_length (const PedDisk *disk)
 Return the maximum representable length (in sectors) of a partition on disk \disk.
 
PedSector ped_disk_max_partition_start_sector (const PedDisk *disk)
 Return the maximum representable start sector of a partition on disk \disk.
 
int ped_disk_maximize_partition (PedDisk *disk, PedPartition *part, const PedConstraint *constraint)
 Grow PedPartition part geometry to the maximum possible subject to constraint.
 
int ped_disk_minimize_extended_partition (PedDisk *disk)
 Reduce the size of the extended partition to a minimum while still wrapping its logical partitions.
 
PedDiskped_disk_new (PedDevice *dev)
 Read the partition table off a device (if one is found).
 
PedDiskped_disk_new_fresh (PedDevice *dev, const PedDiskType *type)
 Create a new partition table on dev.
 
PedPartitionped_disk_next_partition (const PedDisk *disk, const PedPartition *part)
 Return the next partition after part on disk.
 
void ped_disk_print (const PedDisk *disk)
 Prints a summary of disk's partitions.
 
PedDiskTypeped_disk_probe (PedDevice *dev)
 Return the type of partition table detected on "dev".
 
int ped_disk_remove_partition (PedDisk *disk, PedPartition *part)
 Removes PedPartition part from PedDisk disk.
 
int ped_disk_set_flag (PedDisk *disk, PedDiskFlag flag, int state)
 Set the state (1 or 0) of a flag on a disk.
 
int ped_disk_set_partition_geom (PedDisk *disk, PedPartition *part, const PedConstraint *constraint, PedSector start, PedSector end)
 Sets the geometry of part (i.e.
 
int ped_disk_type_check_feature (const PedDiskType *disk_type, PedDiskTypeFeature feature)
 This function checks if a particular type of partition table supports a feature.
 
PedDiskTypeped_disk_type_get (const char *name)
 Return the disk type with a name of "name".
 
PedDiskTypeped_disk_type_get_next (PedDiskType const *type)
 Return the next disk type registers, after "type".
 
void ped_disk_type_register (PedDiskType *type)
 
void ped_disk_type_unregister (PedDiskType *type)
 
void ped_partition_destroy (PedPartition *part)
 Destroy a PedPartition object.
 
PedPartitionFlag ped_partition_flag_get_by_name (const char *name)
 Returns the flag associated with name.
 
const char * ped_partition_flag_get_name (PedPartitionFlag flag)
 Returns a name for a flag, e.g.
 
PedPartitionFlag ped_partition_flag_next (PedPartitionFlag flag)
 Iterates through all flags.
 
int ped_partition_get_flag (const PedPartition *part, PedPartitionFlag flag)
 Get the state (1 or 0) of a flag on a partition.
 
const char * ped_partition_get_name (const PedPartition *part)
 Returns the name of a partition part.
 
char * ped_partition_get_path (const PedPartition *part)
 Return a path that can be used to address the partition in the operating system.
 
uint8_t ped_partition_get_type_id (const PedPartition *part)
 Get the type-id of the partition part.
 
uint8_t * ped_partition_get_type_uuid (const PedPartition *part)
 Get the type-uuid of the partition part.
 
uint8_t * ped_partition_get_uuid (const PedPartition *part)
 Get the uuid of the partition part.
 
int ped_partition_is_active (const PedPartition *part)
 Return whether or not the partition is "active".
 
int ped_partition_is_busy (const PedPartition *part)
 Check whether a partition is mounted or busy in some other way.
 
int ped_partition_is_flag_available (const PedPartition *part, PedPartitionFlag flag)
 Check whether a given flag is available on a partition.
 
PedPartitionped_partition_new (const PedDisk *disk, PedPartitionType type, const PedFileSystemType *fs_type, PedSector start, PedSector end)
 Create a new PedPartition on disk.
 
int ped_partition_set_flag (PedPartition *part, PedPartitionFlag flag, int state)
 Set the state (1 or 0) of a flag on a partition.
 
int ped_partition_set_name (PedPartition *part, const char *name)
 Sets the name of a partition.
 
int ped_partition_set_system (PedPartition *part, const PedFileSystemType *fs_type)
 Sets the system type on the partition to fs_type.
 
int ped_partition_set_type_id (PedPartition *part, uint8_t id)
 Set the type-id of the partition part.
 
int ped_partition_set_type_uuid (PedPartition *part, const uint8_t *uuid)
 Set the type-uuid of the partition part.
 
const char * ped_partition_type_get_name (PedPartitionType type)
 Returns a name that seems mildly appropriate for a partition type type.