Struct gpt::GptDisk [−][src]
pub struct GptDisk<'a> { /* fields omitted */ }Expand description
A GPT disk backed by an arbitrary device.
Implementations
Add another partition to this disk. This tries to find the optimum partition location with the lowest block device. Returns the new partition id if there was sufficient room to add the partition. Size is specified in bytes.
remove partition from this disk. This tries to find the partition based on either a given partition number (id) or a partition guid. Returns the partition id if the partition is removed
Find free space on the disk. Returns a tuple of (starting_lba, length in lba’s).
Find next highest partition id.
Retrieve primary header, if any.
Retrieve backup header, if any.
Retrieve partition entries.
Retrieve disk logical block size.
pub fn update_disk_device(
&mut self,
device: DiskDeviceObject<'a>,
writable: bool
) -> DiskDeviceObject<'_>
pub fn update_disk_device(
&mut self,
device: DiskDeviceObject<'a>,
writable: bool
) -> DiskDeviceObject<'_>
Change the disk device that we are reading/writing from/to. Returns the previous disk device.
Update disk UUID.
If no UUID is specified, a new random one is generated.
No changes are recorded to disk until write() is called.
Update current partition table.
No changes are recorded to disk until write() is called.
Update current partition table without touching backups
No changes are recorded to disk until write() is called.
Update current partition table.
Allows for changing the partition count, use with caution.
No changes are recorded to disk until write() is called.
Persist state to disk, consuming this disk object.
This is a destructive action, as it overwrite headers and partitions entries on disk. All writes are flushed to disk before returning the underlying DiskDeviceObject.
Persist state to disk, leaving this disk object intact.
This is a destructive action, as it overwrites headers and partitions entries on disk. All writes are flushed to disk before returning.