[ Version ( since = "1.0.78" ) ]
public bool part_add (string device, string prlogex, int64 startsect, int64 endsect) throws Error
add a partition to the device
This command adds a partition to device
. If there is no partition table on the device, call
part_init first.
The prlogex
parameter is the type of partition. Normally you should pass p
or primary
here, but
MBR partition tables also support l
(or logical
) and e
(or extended
) partition types.
startsect
and endsect
are the start and end of the partition in *sectors*. endsect
may be
negative, which means it counts backwards from the end of the disk (@-1 is the last sector).
Creating a partition which covers the whole disk is not so easy. Use part_disk to do that.
this |
A GuestfsSession object |
true on success, false on error |