From 05ebb39746b8896afd498550bc9f6f62844ed893 Mon Sep 17 00:00:00 2001 From: Reinhart Previano Koentjoro Date: Thu, 7 Mar 2024 11:54:23 +0700 Subject: [PATCH] diskutil-partitiondisk: add page (#12467) --- pages/osx/diskutil-partitiondisk.md | 26 ++++++++++++++++++++++++++ pages/osx/diskutil.md | 1 + 2 files changed, 27 insertions(+) create mode 100644 pages/osx/diskutil-partitiondisk.md diff --git a/pages/osx/diskutil-partitiondisk.md b/pages/osx/diskutil-partitiondisk.md new file mode 100644 index 0000000000..7dec91e05b --- /dev/null +++ b/pages/osx/diskutil-partitiondisk.md @@ -0,0 +1,26 @@ +# diskutil partitionDisk + +> Utility to manage partitions inside disks and volumes. +> Part of `diskutil`. +> APM is only supported for macOS, MBR is optimized for DOS, while GPT is compatible for most modern systems. +> More information: . + +- Reformat a volume using APM/MBR/GPT partitioning scheme, leaving no partitions inside (this will erase all data on the volume): + +`diskutil partitionDisk {{/dev/disk_device}} 0 {{APM|MBR|GPT}}` + +- Reformat a volume, then create a single partition using a specific filesystem filling up all free space: + +`diskutil partitionDisk {{/dev/disk_device}} 1 {{APM|MBR|GPT}} {{partition_filesystem}} {{partition_name}}` + +- Reformat a volume, then create a single partition using a specific filesystem under specific size (e.g. `16G` for 16GB or `50%` to fill half of total volume size): + +`diskutil partitionDisk {{/dev/disk_device}} 1 {{APM|MBR|GPT}} {{partition_filesystem}} {{partition_name}} {{partition_size}}` + +- Reformat a volume, then create multiple partitions: + +`diskutil partitionDisk {{/dev/disk_device}} {{number_of_partitions}} {{APM|MBR|GPT}} {{partition_filesystem1}} {{partition_name1}} {{partition_size1}} {{partition_filesystem2}} {{partition_name2}} {{partition_size2}} ...` + +- List all supported file systems for partitioning: + +`diskutil listFilesystems` diff --git a/pages/osx/diskutil.md b/pages/osx/diskutil.md index 05a9226946..77f964dab6 100644 --- a/pages/osx/diskutil.md +++ b/pages/osx/diskutil.md @@ -1,6 +1,7 @@ # diskutil > Utility to manage local disks and volumes. +> Some subcommands such as `diskutil partitiondisk` have their own usage documentation. > More information: . - List all currently available disks, partitions and mounted volumes: