sfdisk
Description:
public bool sfdisk (string device, int32 cyls, int32 heads, int32 sectors, string[] lines) throws Error
Warning: sfdisk is deprecated.
create partitions on a block device
In new code, use part_add instead
This is a direct interface to the sfdisk(8) program for creating partitions on block devices.
device
should be a block device, for example /dev/sda.
cyls
, heads
and sectors
are the number of cylinders, heads and sectors on the device, which are passed
directly to sfdisk as the *-C*, *-H* and *-S* parameters. If you pass @0 for any of these, then the corresponding parameter is omitted. Usually
for ‘large’ disks, you can just pass @0 for these, but for small (floppy-sized) disks, sfdisk (or rather, the kernel) cannot work out the
right geometry and you will need to tell it.
lines
is a list of lines that we feed to sfdisk
. For more information refer to the sfdisk(8) manpage.
To create a single partition occupying the whole disk, you would pass lines
as a single element list, when the single element
being the string "," (comma).
See also: sfdisk_l, sfdisk_N, part_init
Parameters:
this |
A GuestfsSession object |
lines |
an array of strings |
Returns:
true on success, false on error |