Top | ![]() |
![]() |
![]() |
![]() |
enum | LDMError |
#define | LDM_TYPE |
struct | LDM |
struct | LDMDiskGroup |
enum | LDMVolumeType |
struct | LDMVolume |
struct | LDMPartition |
struct | LDMDisk |
LDMPrivate |
LDM *
ldm_new (void
);
Instantiate a new LDM object. LDM scans devices and stores detected metadata.
gboolean ldm_add (LDM *o
,const gchar *path
,GError **err
);
Scan device path
and add its metadata to LDM object o
.
gboolean ldm_add_fd (LDM *o
,int fd
,guint secsize
,const gchar *path
,GError **err
);
Scan a device which has been previously opened for reading and add its
metadata to LDM object o
.
o |
An LDM object |
|
fd |
A file descriptor for reading from the device |
|
secsize |
The size of a sector on the device |
|
path |
The path of the device (for messages) |
|
err |
A GError to receive any generated errors |
GArray *
ldm_get_disk_groups (LDM *o
);
Get an array of discovered disk groups.
GArray *
ldm_disk_group_get_volumes (LDMDiskGroup *o
);
Get an array of all volumes in a disk group.
GArray *
ldm_disk_group_get_partitions (LDMDiskGroup *o
);
Get an array of all partitions in a disk group.
GArray *
ldm_disk_group_get_disks (LDMDiskGroup *o
);
Get an array of all disks in a disk group.
gchar *
ldm_disk_group_get_name (const LDMDiskGroup *o
);
Get the Windows-assigned name of a disk group.
gchar *
ldm_disk_group_get_guid (const LDMDiskGroup *o
);
Get the Windows-assigned GUID of a disk group.
GArray *
ldm_volume_get_partitions (LDMVolume *o
);
Get an array of all partitions in a volume.
gchar *
ldm_volume_get_name (const LDMVolume *o
);
Get the Windows-assigned name of a volume.
gchar *
ldm_volume_get_guid (const LDMVolume *o
);
Get the Windows-assigned GUID of a volume.
LDMVolumeType
ldm_volume_get_voltype (const LDMVolume *o
);
Get the volume type. This can be:
guint64
ldm_volume_get_size (const LDMVolume *o
);
Get the volume size in sectors.
guint8
ldm_volume_get_part_type (const LDMVolume *o
);
Get the 'partition type' of the volume. This is the same 8-bit value that is used to describe partition types on an MBR disk. It is 0x07 for NTFS volumes.
gchar *
ldm_volume_get_hint (const LDMVolume *o
);
Get the volume mounting hint. This value specifies how Windows expects the volume to be mounted. For a volume with an assigned drive letter, it might be 'E:'.
guint64
ldm_volume_get_chunk_size (const LDMVolume *o
);
Get the chunk size, in sectors, used by striped and raid5 volumes. For other volume types it will be 0.
GString *
ldm_volume_dm_get_name (const LDMVolume *o
);
Get the name of the device mapper device which will be created for this volume. Note that returned name is unmangled. Device mapper will mangle actual device name if it contains invalid characters.
gchar * ldm_volume_dm_get_device (const LDMVolume * const o
,GError **err
);
Get the host device mapper device which was created for this volume (e.g. /dev/mapper/ldm_vol_Red-nzv8x6obywgDg0_Volume3). It is dynamic runtime property and it will be NULL if device mapper device is absent.
gboolean ldm_volume_dm_create (const LDMVolume *o
,GString **created
,GError **err
);
Create a device mapper device for a volume. If this function is called for
volume whose device already exists it will still return success. However,
created
will not be set.
o |
An LDMVolume |
|
created |
The name of the created device, if any. |
[out] |
err |
A GError to receive any generated errors |
gboolean ldm_volume_dm_remove (const LDMVolume *o
,GString **removed
,GError **err
);
Remove a device mapper device for a volume. If this function is called for a
volume whose device does not already exist, it will still return success.
However, removed
will not be set.
o |
An LDMVolume |
|
removed |
The name of the removed device, if any. |
[out] |
err |
A GError to receive any generated errors |
void ldm_volume_override_uuid (LDMVolume * const o
,const uuid_t uuid_override
);
Set the UUID used for device mapper. If no override is set, the volume's GUID will be used.
LDMDisk *
ldm_partition_get_disk (LDMPartition *o
);
Get the LDMDisk underlying a partition.
gchar *
ldm_partition_get_name (const LDMPartition *o
);
Get the Windows-assigned name of a partition.
guint64
ldm_partition_get_start (const LDMPartition *o
);
Get the start sector of a disk, measured from the start of the underlying disk.
guint64
ldm_partition_get_size (const LDMPartition *o
);
Get the size of a partition in sectors.
gchar * ldm_partition_dm_get_device (const LDMPartition * const o
,GError **err
);
Get the host device mapper device which was created for this partition (e.g. /dev/mapper/ldm_part_Red-nzv8x6obywgDg0_Disk1-01). It is dynamic runtime property and it will be NULL if device mapper device is absent.
gchar *
ldm_disk_get_name (const LDMDisk *o
);
Get the Windows-assigned name of a disk.
gchar *
ldm_disk_get_guid (const LDMDisk *o
);
Get the Windows-assigned GUID of a disk.
gchar *
ldm_disk_get_device (const LDMDisk *o
);
Get the name of the host device (e.g. /dev/sda) of a disk. This will be NULL if the disk has been identified from metadata on another disk, but has not been discovered during scanning.
guint64
ldm_disk_get_data_start (const LDMDisk *o
);
Get the start sector of the data portion of a disk.
guint64
ldm_disk_get_data_size (const LDMDisk *o
);
Get the size, in sectors, of the data portion of a disk.
guint64
ldm_disk_get_metadata_start (const LDMDisk *o
);
Get the start sector of the metadata portion of a disk.
An internal error |
||
There was an IO error accessing a device |
||
The device is not part of an LDM disk group |
||
The LDM metadata is corrupt |
||
Detected two disks from the same disk group with inconsistent metadata |
||
Unsupported LDM metadata |
||
A disk is missing from a disk group |
||
An error reported by an external library |
struct LDMPartition { GObject parent; LDMPartitionPrivate *priv; };
An LDM Parition.