Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 3.74 KB

diskutil-partitiondisk.md

File metadata and controls

34 lines (23 loc) · 3.74 KB
layout title description content_hash last_modified_at tldri18n_status
page
osx/diskutil-partitiondisk (English)
Utility to manage partitions inside disks and volumes.
d8bc7ca711867478ebf7a486cd13c38f0d0d1323
2024-03-08
2

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: https://keith.github.io/xcode-man-pages/diskutil.8.html.

  • 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_device0APM|MBR|GPT

  • Reformat a volume, then create a single partition using a specific filesystem filling up all free space:

diskutil partitionDisk /dev/disk_device1APM|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_device1APM|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