X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=guestfs.pod;h=fdac80a66b76b3030a19c4dd2451161dc74bccd4;hp=33b84d73fd64601792075c10a707eca26ba8050a;hb=b1e1ca2f74a921b3f784537d59c617df29ea1d60;hpb=b03995b67f9bc23d066b282bb7dad9b7c71c90da diff --git a/guestfs.pod b/guestfs.pod index 33b84d7..fdac80a 100644 --- a/guestfs.pod +++ b/guestfs.pod @@ -217,29 +217,27 @@ L. =head2 PARTITIONING -To create MBR-style (ie. normal PC) partitions use one of the -C variants. These calls use the external -L command. +In the common case where you want to create a single partition +covering the whole disk, you should use the C +call: -The simplest call is: - - char *lines[] = { ",", NULL }; - guestfs_sfdiskM (g, "/dev/sda", lines); - -This will create a single partition on C called -C covering the whole disk. + const char *parttype = "mbr"; + if (disk_is_larger_than_2TB) + parttype = "gpt"; + guestfs_part_disk (g, "/dev/sda", parttype); In general MBR partitions are both unnecessarily complicated and depend on archaic details, namely the Cylinder-Head-Sector (CHS) -geometry of the disk. C allows you to specify sizes -in megabytes instead of cylinders, which is a small win. +geometry of the disk. C can be used to +create more complex arrangements where the relative sizes are +expressed in megabytes instead of cylinders, which is a small win. C will choose the nearest cylinder to approximate the requested size. There's a lot of crazy stuff to do with IDE and virtio disks having different, incompatible CHS geometries, that you -probably don't want to know about. My advice: make a single partition -to cover the whole disk, then use LVM on top. +probably don't want to know about. -In future we aim to provide access to libparted. +My advice: make a single partition to cover the whole disk, then use +LVM on top. =head2 UPLOADING