]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - libfdisk/samples/mkpart.c
libfdisk: add sample-fdisk-mkpart-fullspec
[thirdparty/util-linux.git] / libfdisk / samples / mkpart.c
index 4ca3ed35db2ce96cf143602977e2461044b5f83c..44a97d6fd41e98e2d1137d983aa9348428b3c081 100644 (file)
@@ -3,7 +3,24 @@
  *
  * This file may be redistributed under the terms of the
  * GNU Lesser General Public License.
- */
+ *
+ *
+ * Libfdisk sample to create partitions by specify size, for example:
+ *
+ *     mkpart --label dos --device /dev/sdc 2M 2M 2M 10M 1M -
+ *
+  * creates 6 partitions:
+  *    - 3 primary  (3x 2M)
+  *    - 1 extended (1x 10M)
+  *    - 2 logical  (1x 1M, 1x remaining-space-in-extended-partition)
+  *
+  * Notes:
+  *     The sample specifies size and partno for MBR, and size only for another
+  *     labels (e.g. GPT).
+  *
+  *     The Ask-API does not use anything else than warning/info. The
+  *     partitionning has to be done non-interactive.
+  */
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>