Disk Utility Tool (Mac OS X )

Command line Utility to manage local disks and volumes.

Options which make changes require ownership or root and most are DESTRUCTIVE!

Manipulates the volume-level structure of local disks.

Provides information about, and allows the administration of, the partitioning scheme of disks, optical discs, and RAID sets.

diskutil <verb> <options>

diskutil verb provides help

volreference

Disk Identifier

Device unit, session on that device, or a partition (slice) .

Form : diskU, diskUsS, diskUsQ, or diskUsQsS, where U, S, and Q are decimal integers .

The forms for optical session and partition are the same and are distinguished by context.

Some units (e.g. floppy disks, RAID sets) contain filesystem data upon their "whole" device instead of containing a partitioning scheme with partitions.

The top-to-botom appearance of partitions shows the on-disk ordering.
Disk identifiers need not appear in slice-numerical order.

list [-plist ] diskU
[internal | external]
[physical | virtual]
sudo diskutil list   # mojave 10.14.3 Beta(18D32a) 1/23/19
Password:
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *121.3 GB   disk0
   1:                        EFI EFI                        209.7 MB disk0s1
   2:                 Apple_APFS Container disk2         75.0 GB    disk0s2
   3:                 Apple_APFS Container disk3         42.0 GB    disk0s3
   4:                 Apple_APFS Container disk1          4.1 GB    disk0s4 (unused)

/dev/disk1 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +4.1 GB     disk1
                                 Physical Store disk0s4
   1:                APFS Volume Untitled                692.2 KB   disk1s1  free

/dev/disk2 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +75.0 GB    disk2
                                 Physical Store disk0s2
                                                 notice there is no disk2s0 
   1:                APFS Volume Macintosh HD            28.7 GB    disk2s1
   2:                APFS Volume DATA                    28.0 GB    disk2s2
   3:                APFS Volume Preboot                    46.1 MB disk2s3
   4:                APFS Volume Recovery                  516.8 MB disk2s4
   5:                APFS Volume VM                      1.1 GB     disk2s5

/dev/disk3 (synthesized):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      APFS Container Scheme -                      +42.0 GB    disk3
                                 Physical Store disk0s3
                                                 notice there is no disk3s0 
   1:                APFS Volume Untitled                 5.2 GB    disk3s1
   2:                APFS Volume Photos                  28.1 GB    disk3s2



info [-plist]   vol |  -all
 sudo diskutil info -all   
   Device Identifier:         disk0 Device Node: /dev/disk0
   Whole:                     Yes
   Part of Whole:             disk0
   Device / Media Name:       APPLE SSD SM0128G 
   Volume Name:               Not applicable (no file system) Mounted: Not applicable (no file system) File System: None 
   Content (IOContent):       GUID_partition_scheme
   OS Can Be Installed:       No
   Media Type:                Generic Protocol: PCI SMART Status: Verified 
   Disk Size:                 121.3 GB (121332826112 Bytes) (exactly 236978176 512-Byte-Units) Device Block Size:         512 Bytes 
   Read-Only Media:           No             Read-Only Volume:          Not applicable (no file system) 
   Device Location:           Internal       Removable Media:           Fixed 
   Solid State:               Yes            Virtual:No                  Hardware AES Support:      No 
********** 
          notice there ins no disk0s0 
   Device Identifier:         disk0s1 Device Node: /dev/disk0s1 Whole: No Part of Whole: disk0 
   Volume Name:               EFI Mounted: No 
   Partition Type:            EFI File System Personality:   MS-DOS FAT32 Type (Bundle):msdos Name (User Visible): MS-DOS (FAT32) 
   OS Can Be Installed:       No
   Volume UUID:               0E239BC6-F960-3107-89CF-1C97F78BB46B
   Disk / Partition UUID:     AC5B425C-8B83-4D99-85DA-F671ED24C69B
   Partition Offset:          20480 Bytes (40 512-Byte-Device-Blocks) 
   Disk Size:                 209.7 MB (209715200 Bytes) (exactly 409600 512-Byte-Units) 
   Volume Total Space:        0 B           Volume Free Space:         0 B 
********** 
   Device Identifier:         disk0s2 Device Node: /dev/disk0s2 Whole:No Part of Whole:disk0 
   File System:               None 
   Partition Type:            Apple_APFS
   Disk / Partition UUID:     780BB21F-50E3-4055-ACB6-819615DAA3C9
   Partition Offset:          209735680 Bytes (409640 512-Byte-Device-Blocks) 
   Disk Size:                 75.0 GB (74999996416 Bytes) (exactly 146484368 512-Byte-Units) 
********** 
   Device Identifier:         disk0s3 Device Node: /dev/disk0s3 
   File System:               None
   SMART Status:              Verified
   Disk / Partition UUID:     E32591C5-D2C5-497A-AE3B-FD29B314A5E8
   Partition Offset:          75209732096 Bytes (146894008 512-Byte-Device-Blocks) 
   Disk Size:                 42.0 GB (42014871552 Bytes) (exactly 82060296 512-Byte-Units)
**********
   Device Identifier:         disk0s4 Device Node: /dev/disk0s4
   File System:               None
   Disk / Partition UUID:     10790A23-1FD1-4F17-8C61-B741A9E4EC7A
   Partition Offset:          117224603648 Bytes (228954304 512-Byte-Device-Blocks)
   Disk Size:                 4.1 GB (4108201984 Bytes) (exactly 8023832 512-Byte-Units)
********** 

   Device Identifier:         disk1 Device Node:               /dev/disk1 Whole:                     Yes
   Device / Media Name:       APPLE SSD SM0128G
   File System:               None
   Content (IOContent):       EF57347C-0000-11AA-AA11-00306543ECAC
   Disk / Partition UUID:     C7D4F5C5-06F7-4583-983A-0B7859237AB5
   Disk Size:                 4.1 GB (4108201984 Bytes) (exactly 8023832 512-Byte-Units) Device Block Size:         4096 Bytes
   Virtual:                   Yes 
********** 
   Device Identifier:         disk1s1 Device Node:               /dev/disk1s1
   Volume Name:               Untitled Mounted:                   Yes Mount Point:               /Volumes/Untitled 
   Partition Type:            41504653-0000-11AA-AA11-00306543ECAC
   File System Personality:   Case-sensitive APFS
   Type (Bundle):             apfs                   Name (User Visible):       APFS (Case-sensitive)
   Owners:                    Enabled 
   OS Can Be Installed:       Yes
   Media Type:                Generic
   Volume UUID:               170A8371-1B3B-44CE-B9DA-85AE83B14FDA
   Disk / Partition UUID:     170A8371-1B3B-44CE-B9DA-85AE83B14FDA
   Disk Size:                 4.1 GB (4108201984 Bytes) (exactly 8023832 512-Byte-Units) Device Block Size:         4096 Bytes 
   Volume Total Space:        4.1 GB (4108201984 Bytes) (exactly 8023832 512-Byte-Units)
   Volume Used Space:            17.0 MB (17043456 Bytes) (exactly 33288 512-Byte-Units) (0.4%)
   Volume Free Space:         4.1 GB (4091158528 Bytes) (exactly 7990544 512-Byte-Units) (99.6%)
   Allocation Block Size:     4096 Bytes 
   Read-Only Volume:          No
**********

   Device Identifier:         disk2 Device Node:               /dev/disk2
   File System:               None 
   Content (IOContent):       EF57347C-0000-11AA-AA11-00306543ECAC
   OS Can Be Installed:       No
   Disk / Partition UUID:     39006797-0013-4FEB-8193-80E5EC146449
   Disk Size:                 75.0 GB (74999996416 Bytes) (exactly 146484368 512-Byte-Units) Device Block Size:         4096 Bytes 
   Virtual:                   Yes 
********** 
   Device Identifier:         disk2s1 Device Node:               /dev/disk2s1
   Volume Name:               Macintosh HD               Mount Point: / 
   Partition Type:            41504653-0000-11AA-AA11-00306543ECAC
   File System Personality:   Case-sensitive APFS
   Type (Bundle):             apfs                   Name (User Visible):       APFS (Case-sensitive)
   Owners:                    Enabled 
   OS Can Be Installed:       Yes
   Booter Disk:               disk2s3 Recovery Disk: disk2s4
   Volume UUID:               3D80E1A2-9E5D-4551-B0FA-86BB56F7D45C Disk / Partition UUID:     3D80E1A2-9E5D-4551-B0FA-86BB56F7D45C 
   Volume Total Space:        75.0 GB (74999996416 Bytes) (exactly 146484368 512-Byte-Units)
   Volume Used Space:         58.5 GB (58476572672 Bytes) (exactly 114212056 512-Byte-Units) (78.0%)
   Volume Free Space:         16.5 GB (16523423744 Bytes) (exactly 32272312 512-Byte-Units) (22.0%) Allocation Block Size:     4096 Bytes
**********
   Device Identifier:         disk2s2 Device Node:               /dev/disk2s2
   Volume Name:               DATA                   Mount Point:  /Volumes/DATA 
   Partition Type:            415…
   File System Personality:   APFS Type (Bundle):             apfs                   Name (User Visible):       APFS
   Owners:                    Enabled 
   OS Can Be Installed:       Yes
   Booter Disk:               disk2s3 Recovery Disk: disk2s4
   Volume UUID:               209066D7-AAD7-46FB-AC09-7FDADA96A54C Disk / Partition UUID:     209066D7-AAD7-46FB-AC09-7FDADA96A54C 
**********
   Device Identifier:         disk2s3 Device Node:               /dev/disk2s3
   Volume Name:               Preboot
   Partition Type:            415…
   File System Personality:   APFS …
   Owners:                    Disabled 
   Volume UUID:               EFB6D4D4-B18A-4EF6-998B-B7CC3F78840E Disk / Partition UUID:     EFB6D4D4-B18A-4EF6-998B-B7CC3F78840E 
   Volume Total Space:        0 B 
********** 
   Device Identifier:         disk2s4 Device Node:               /dev/disk2s4
   Volume Name:               Recovery 
   Partition Type:            415…
   File System Personality:   APFS …
   Owners:                    Disabled 
   Volume UUID:               D20E8594-9FBC-4A31-B3F8-2AA1D5BE4BAC Disk / Partition UUID:     D20E8594-9FBC-4A31-B3F8-2AA1D5BE4BAC 
   Volume Total Space:        0 B
**********
   Device Identifier:         disk2s5 Device Node:               /dev/disk2s5
   Volume Name:               VM Mount Point:               /private/var/vm 
   Partition Type:            415…
   File System Personality:   APFS…
   Owners:                    Enabled 
   Volume UUID:               32455EB5-06F0-4ABB-8C68-D5B2065BCFDB Disk / Partition UUID:     32455EB5-06F0-4ABB-8C68-D5B2065BCFDB 
   Volume Used Space:         58.5 GB (58476572672 Bytes) (exactly 114212056 512-Byte-Units) (78.0%)
   Volume Free Space:         16.5 GB (16523423744 Bytes) (exactly 32272312 512-Byte-Units) (22.0%) Allocation Block Size:     4096 Bytes
**********

   Device Identifier:         disk3 Device Node:               /dev/disk3
   File System:               None 
   Content (IOContent):       EF57347C-0000-11AA-AA11-00306543ECAC
   Disk / Partition UUID:     0188CCBD-2008-4DD8-A45D-85874CE5DDFB
   Disk Size:                 42.0 GB (42014871552 Bytes) (exactly 82060296 512-Byte-Units) Device Block Size:         4096 Bytes 
   Virtual:                   Yes
**********
   Device Identifier:         disk3s1 Device Node:               /dev/disk3s1
   Volume Name:               Untitled Mount Point:               /Volumes/Untitled 1 
   Partition Type:            415…
   File System Personality:   Case-sensitive APFS
   Owners:                    Enabled 
   OS Can Be Installed:       Yes
   Volume UUID:               E45F0503-5B3B-4EE7-85E3-D3609B3AF1EB Disk / Partition UUID:     E45F0503-5B3B-4EE7-85E3-D3609B3AF1EB 
   Volume Total Space:        42.0 GB (42014871552 Bytes) (exactly 82060296 512-Byte-Units)
   Volume Used Space:         33.4 GB (33418911744 Bytes) (exactly 65271312 512-Byte-Units) (79.5%)
   Volume Free Space:         8.6 GB (8595959808 Bytes) (exactly 16788984 512-Byte-Units) (20.5%) Allocation Block Size:     4096 Bytes
**********
   Device Identifier:         disk3s2 Device Node:               /dev/disk3s2
   Volume Name:               Photos Mount Point:               /Volumes/Photos 
   Partition Type:            415…
   File System Personality:   Case-sensitive APFS
   Owners:                    Enabled 
   OS Can Be Installed:       Yes
   Volume UUID:               9C3465C9-5EB7-485F-A39D-352A6E7E6EA2 Disk / Partition UUID:     9C3465C9-5EB7-485F-A39D-352A6E7E6EA2 
   Volume Total Space:        42.0 GB (42014871552 Bytes) (exactly 82060296 512-Byte-Units)
   Volume Used Space:         33.4 GB (33418911744 Bytes) (exactly 65271312 512-Byte-Units) (79.5%)
   Volume Free Space:         8.6 GB (8595959808 Bytes) (exactly 16788984 512-Byte-Units) (20.5%) Allocation Block Size:     4096 Bytes
********** 






activity Continuously display system-wide disk manipulation activity as reported by the Disk Arbitration framework, Coming on-line, being ejected, volumes being mounted or unmounted, volumes being renamed, etc.
until interrupted with a intsignal (^C).
For debugging such as the monitoring of applications dissenting (attempting to deny) activities for disks for which they have registered an interest, use the logging features of the diskarbitrationd
mount [readOnly]
      [-mountPoint vol_mt_pt]
      disknsm
Mount a single volume.
vol_mt_ptrather than the standard path of /Volumes/VolumeName,
directory at that path must already exist.
mountDisk disku Mount all mountable volumes.
umount [force] vol forcemay break open files; see umount.
umountDisk [force] disku
eject disku Media becomes offline .
Removable media will eject or become eligible for safe manual removal.
verifyDisk disku Partition Table, EFI integriey, Core Storage Physical Volumes and space for boot loaders.
/usr/sbin/Diskutil verifydisk disk0
Started partition map verification on disk0
Checking prerequisites
Checking the partition list
Checking the partition map size
Checking for an EFI system partition
Checking the EFI system partition's size
Checking the EFI system partition's file system
Checking the EFI system partition's folder content
Checking all HFS data partition loader spaces
Volume Photos on disk0s5 has 0 bytes of trailing loader space and it needs 134,217,728 bytes
Problems were found with the partition map which might prevent booting
Error: -69765: Partition map needs repair because a data partition needs loader space
repairDisk disku
sudo /usr/sbin/Diskutil repairdisk disk0
 Repairing the partition map might erase disk0s1 (the EFI ), proceed? (y/N) n
Repair canceled 
verifyVolume vol file System of a volume (e.g. fsck).
repairVolume vol Repair the data structure of a volume (e.g. fsck). Example:
sudo diskutil repairVolume  /Volumes/DGERMAN_2GB
Password:
Started file system repair on disk2s1 DGERMAN_2GB
Checking file system
** disk2s1
** Phase 1 - Preparing FAT
** Phase 2 - Checking Directories
** Phase 3 - Checking for Orphan Clusters
106 files, 1783744 KiB free (55742 clusters)
Volume repair complete
Updating boot support partitions for the volume as required
Finished file system repair on disk2s1 DGERMAN_2GB 

Started file system repair on disk0s9 Recovery_Mavericks
Repairing file system
Checking non-journaled HFS Plus Volume
Invalid B-tree node size
The volume   could not be verified completely
File system check exit code is 8
Updating boot support partitions for the volume as required
Error: -69845: File system verify or repair failed
Underlying error: 8: POSIX reports: Exec format error
renameVolume vol new_name Volume names are subject to file system-specific alphabet and length restrictions. Must be mounted

 > sudo diskutil mount disk0s11
 > sudo diskutil renameVolume untitled email+cache
Volume on disk0s10 renamed to email+cachei

 > sudo diskutil mount disk0s3
 > sudo /usr/sbin/Diskutil renameVolume disk0s3 'RECOVERY HD AB'
enableJournal vol on an HFS+ volume.
disableJournal [force] vol On an HFS+ volume, Volume need not be mounted
Force: journaling is disabled directly on disk, the volume must not be mounted.
moveJournal external|internal
      [journalDevicevol
externalcauses the creation of a 512MB Apple_Journal partition out of journalDevice and an HFS+ partition will be created out of the remaining space if available; journalDevice must be a partition. The journal for device will then be moved externally onto the newly created Apple_Journal partition.

internalwill move the journal for device back locally.

enableOwnership vol The Database at /var/db/volinfo.databaseis modified as per User and Group ID settings of files, directories, and links (file system objects, or "FSOs")
> sudo diskutil enableOwnership /Volumes/untitled
File system user/group ownership enabled

For some locations of devices (e.g. internal hard disks), consideration of ownership settings on FSOs is the default.
For others (e.g. plug-in USB disks), it is not.


When ownership is enabled, the Owner and Group ID settings that exist on the disk are taken into account for determining access, and exact settings are written to the disk as FSOs are created.
When ownership is disabled, Owner and Group ID settings on FSOs appear to the user and programs as the current user and group instead of their actual on-disk settings.

Enable ownership where a disk contains FSOs whose User and Group, and permissions, is critically important, such as when the plug-in disk contains system files to be changed or added .

 > cat /var/db/volinfo.database
F1D7320CDC506E87: 00000001
A073446E9FC5B85D: 00000001
3D5B432DF5D25BA5: 00000001
CE5F4638B7C48818: 00000001
D156FA5D2FFD2DE8: 00000001
156A2EAF1753895A: 00000001
05924632A81B72DC: 00000001
E0C32DAAF5C0E0AB: 00000001

previously:
05924632A81B72DC: 00000001
A073446E9FC5B85D: 00000001
22984819A1006E1A: 00000001
CE5F4638B7C48818: 00000001
E08C36730A0B5D7C: 00000001
C5E0CD235635726E: 00000001
4500BAFE67D39774: 00000001

Settings are persistent See vsdbutil .
disableOwnership device
verifyPermissions [-plist] vol Verify the permissions of boot volume, written during the installation .
Deprecated as of El Captian
listFilesystems [-plist] Show personalities available for formating when using the eraseVolume and partitioning verbs.
This is a subset of personalities exported by the various filesystem bundles installed.
Also shown are some shortcut aliases for common personalities.
-plistoutput is in xml.

File Systems formats
These (case insensative) personalities can be used for erasing and partitioning.

PERSONALITY                     USER VISIBLE NAME                               
-----------------------------------------------------------
Free Space | free               Free Space  
HFS+                            Mac OS Extended 
hfsx | Case-sensitive HFS+          Mac OS Extended (Case-sensitive)                
jhfsx| Case-sensitive Journaled HFS+ Mac OS Extended (Case-sensitive, Journaled)     
jhfs+| Journaled HFS+             Mac OS Extended (Journaled)                     

ExFAT                           ExFAT                                           
MS-DOS                          MS-DOS (FAT)                                    
MS-DOS FAT12                    MS-DOS (FAT12)                                  
MS-DOS FAT16                    MS-DOS (FAT16)                                  
MS-DOS FAT32                    MS-DOS (FAT32) (or) fat32 
eraseVolume format name  vol and write out an empty filesystem. See Format.
Use %noformat%to skip initialization (to skip newfs).
A format of Free Space will cause removal of the partition from the partition table.
The boot volume cannot be erased.
Operations modifying the entire disk (which may result in disaster).

Did you back up the partition table? See gdisk

partitionDisk diskU [numberOfPartitions]
[APM[fmt]]|MBR[Fmt]| GPT[Fmt]
  [PTFormat]
 [FSFormat1 vName1 pSize1
   FSFormat2 vName2 pSize2
   FSFormat2 vName3 pSize3
…]
Re-partition a disk. All volumes on this disk will be destroyed.
The device parameter specifies that a whole disk is to be partitioned.
The optional PTformatforces a particular Partitioning Table Format
  • APM Apple Partition Map , for a start up disk on PowerPC-based, a non-startup disk with any Mac, or a multiplatform compatible startup disk.
  • MBR Master Boot Record . DOS/Windows-compatible
  • GPTGUID Partitioning Table. for start up disk on Intel-based Mac.

For each partition, a triplet of the desired File System format, volume name, and size must be specified.
  • FSFormatare shown at listFilesystems and are created with the appropriate newfs_* (example newfs_hfs).
    The partition type is set according to the filesystem.
  • vName: volume names must conform to file system specific restrictions.
    %noformat%: the partition is left uninitalized.
    Names are ignored but dummy names must be present.
  • pSizeare floating point numbers followed by a letter or percent sign
    (example: 16G, 55.3T, 678M, 75%, R). Rwill use the Remainder of space on disk

    The last partition will be lengthened to the end of the disk.
    To create a partition of a specific size, include an additional partition with size of R

File System blocksize will be 4,096.
To change block size after creating a partition use: newfs
newfs_hfs -v VolumeName -b 8192 /dev/disk0s2

This will cause the average unused space per file to be 4,096 (i.e. 1/2 block).

When determing size:
( 3/18/16 DATA vol has 189,624 files
df reports 21,014,072 1k blocks used of 44,384,728 This is a space accounting only. However   ( 21,014,072 1k blocks / 189,624 files total = 110 blk/file average aka ) means 2048*nfiles = unused space, (4096-2048)*nfiles will require ADDITIONAL unused space)

resizeVolume vol
 [ size|limits|mapsize|R
 [numberOfPartitions]
 [p1Format p1Name p1Size
  p2Format p2Name p2Size
  p3Format p3Name p3Size …
]
Only supported on GPT partition tables with a Journaled HFS+ volume filesystem .

A size of limits displays the range of valid values for the current filesystem.

> sudo diskutil resizeVolume disk0s7 limits
For device disk0s7 HDIMAGES_2:
        Current size:  56.4 GB (56443121664 Bytes)
        Minimum size:  28.6 GB (28597399552 Bytes)
        Maximum size:  56.4 GB (56443121664 Bytes)
A size of mapsize displays:
> sudo diskutil resizeVolume disk0s7 mapsize
For whole device disk0:
        Whole disk size:         320.1 GB (320072933376 Bytes)
        Partition map size:      320.1 GB (320072933376 Bytes)
A size of R will ATTEMPT to resize the partition to the maximun available. (DGG: didn't work )

Valid pnSizeare in the format of n.f units
Valid unitsare B(ytes), K(ilobytes), M(egabytes), G(igabytes), T(erabytes)
Example: 10G(10 gigabytes), 4.23T(4.23 terabytes), 5M(5 megabytes)

When decreasing size, optionally supply a list of new partitions to create.

Example:

/Volumes/HDIMAGES_2/var > sudo diskutil resizevolume disk0s7 40G                        
Resizing to 40000000000 bytes
Started partitioning on disk0s7 HDIMAGES_2
Verifying the disk
Verifying file system
Using live mode
Performing live verification
Checking Journaled HFS Plus volume
Checking extents overflow file
Checking catalog file
Checking multi-linked files
Checking volume bitmap
Checking volume information
The volume HDIMAGES_2 appears to be OK
File system check exit code is 0
Resizing
Finished partitioning on disk0s7 HDIMAGES_2
/dev/disk0 (internal, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *320.1 GB   disk0
   1:                        EFI EFI                     209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            50.0 GB    disk0s2
   3:                  Apple_HFS Recovery HD             650.0 MB   disk0s3
   4:                  Apple_HFS Photos                  92.9 GB    disk0s4
   5:                  Apple_HFS HDIMAGES                64.0 GB    disk0s5
   6:                  Apple_HFS DATA                    45.4 GB    disk0s6
   7:                  Apple_HFS HDIMAGES_2              40.0 GB    disk0s7 

When decreasing the size, new partitions may optionally be created to fill the newly-freed space.
To do this, specify the numberOfPartitions, format, name, and size as with partitionDisk

 /Volumes/HDIMAGES_2/var > sudo diskutil resizevolume disk0s7 40G  1 jhfs+  caches+mail R
You cannot specify the remainder size option in the triples section with this verb

Resizing a volume that is currently set as the computer's startup disk will invalidate that setting; use the Startup Disk System Preferences panel or bless to reset the resized volume as the startup disk.

blocksize

splitPartition vol
 [numberOfPartitions]
 [p1Format…
Destructively split a volume into multiple partitions.
mergePartitions [force] format name fromDevice toDevice Merge two or more partitions on a disk.
All data on merged partitions other than the first will be lost. The first will be erased if it doesn't have a resizable type (e.g. JHFS+) or if forceis given.
Format and name apply only when the first partition is being erased.
Merged partitions are required to be ordered sequentially on disk (see diskutil list for the actual on-disk ordering).
reformat volwrite an empty file system using the same type and name
eraseDisk
    [[APM]Format |
    [MBR]Format |
    [GPT]Format] disknsm
Removing all volumes and writing a new partitioning scheme containing one new empty filesystem volume.
If the partitioning scheme is not specified, then an appropriate one for the current machine is chosen.
See Format .
zeroDisk diskU Erase a device, writing zeros to the media. The device can be a whole-disk or a partition. In either case, in order to be useful again, zero'd whole-disks will need to be partitioned, or zero'd partitions will need to be erased (newfs'd), e.g. by using the partitionDisk or eraseDisk verbs. If you desire a more sophisticated erase algorithm or if you need to erase only free space not in use for files, use the secureErase verb.
randomDisk [times] diskU Erase a whole disk, writing random data to the media. Times is the optional (defaults to 1) number of times to write random information. device can be a whole-disk or a partition. In either case, in order to be useful again, randomized wholedisks will need to be partitioned, or randomized partitions will need to be erased (newfs'd), e.g. by using the partitionDisk or eraseDisk verbs. If you desire a more sophisticated erase algorithm or if you need to erase only free space not in use for files, use the secureErase verb.
secureErase [freespace] level diskU Erase, using a secure method, either a whole-disk (including any and all partitions), or, only the free space (not in use for files) on a currently-mounted volume. Erasing a whole-disk will leave it useless until it is partitioned again. Erasing freespace on a volume will leave it exactly as it was from an end-user perspective, with the exception that it will not be possible to recover deleted files or data using utility software. If you need to erase all contents of a partition but not its hosting whole-disk, use the zeroDisk or randomDisk verbs.
Level :
  1. Single-pass zero-fill erase.
  2. Single-pass random-fill erase.
  3. US DoD 7-pass secure erase.
  4. Gutmann algorithm 35-pass secure erase.
  5. US DoE algorithm 3-pass secure erase.
eraseOptical [quick] diskU

APFS

APFS | ap apfsVerb [...]
Container imports one or more APFS Physical Store disks and exports APFS Volume disks.

While attached, the "handle" by which a Container is identified is its Reference disk (device).

Reference disk is a synthesized whole-disk which is exported by APFS for identification purposes only; it has no storage. It is associated with the AppleAPFSContainerScheme node in the IO Registry.
An APFS Volume device identifiers appear to be of a related form, do not use the Container Reference as a basis to create device identifiers ; use the listing verbs with plist options

Physical Store a disk which is imported into an APFS Container. An APFS Container can import more than one Physical Store, e.g. for Fusion-style Containers.

An APFS Physical Store disk is not necessarily a disk from a partition map; it could be e.g. an AppleRAID Set disk. Do not assume that an APFS Physical Store's disk identifier is a 2-part form such as disk0s2.

Volume an [un]mountable file system volume which is exported from an APFS Container.
APFS Volumes have no specified "size" (capacity), they consume capacity out of the remaining free space of their parent Container, consuming or returning such capacity as user file data is added or deleted.
This means that all Volumes within a Container compete for the Container's remaining capacity. Manage Volume allocation with reserve and quota.

reserve size requests an assured minimum capacity for an APFS Volume.
If successfully created, the Volume is guaranteed to be able to store at least this many bytes of user file data. beyond this, the Volume might be able to store even more until constrained by reaching zero free space in its parent Container or by reaching a quota, if any.
Use a reserve to prevent running out of capacity due to competition from other Volumes or from a Container shrink attempt.

Quota size applies a maximum capacity to a Volume, limiting the number of bytes of user file data which can be stored on the Volume.
It may not be able to reach this limit if its parent Container becomes full first.
Quota enforces accounting or to manage against "unfair" premature filling-up of the parent Container due solely to this Volume at the expense of sibling Volumes.

Efficient file copy cloning (copy-on-write) is supported (see copyfile (3)'s COPYFILE_CLONE).

File-level encryption is supported.

Snapshot represents a read-only copy of its parent APFS Volume, frozen at the moment of its creation.

Snapshots are neither listed nor discoverable when their Volume is not mounted.
Snapshots are uniquely identified within their parent Volume's namespace by either a numeric identifier (preferred) or by their name; Snapshots can be renamed.

Snapshots are mountable; provide a read-only historic version of the Volume

You can revert the present state of an APFS Volume back to equality with a Snapshot in its history.
This is a destructive reset/restore operation: Once a Volume is reverted, it cannot be brought forward.
Any Snaphots between the revert point and the present are lost as well.

Deleting a Snapshot; removes the possibility of ever reverting to that Snapshot's state,

Snapshot mount point's "source device" is the Snapshot name followed by '@' and the "parent" Volume's device node,
e.g. SnapName123@/dev/disk2s1 ". See mount_apfs -s (8) and fs_snapshot_create (2).

list [-plist] [containerReferenceDevice] Display APFS objects as a tree. AFPS Container(s) are shown with their imported Physical Store(s) and exported Volume(s).

All currently-attached APFS Containers in the system are listed unless you specify a containerReferenceDevice, which limits the output to that specific APFS Container family.

If -plist is specified, then a property list will be emitted

 sudo diskutil apfs  list disk1   # mojave 10.14.3 Beta(18D32a) 1/23/19 
|
+-- Container disk1 C7D4F5C5-06F7-4583-983A-0B7859237AB5
    ====================================================
    APFS Container Reference:     disk1
    Size (Capacity Ceiling):      4108201984 B (4.1 GB)
    Capacity In Use By Volumes:   17043456 B (17.0 MB) (0.4% used)
    Capacity Not Allocated:       4091158528 B (4.1 GB) (99.6% free)
    |
    +-< Physical Store disk0s4 10790A23-1FD1-4F17-8C61-B741A9E4EC7A
    |   -----------------------------------------------------------
    |   APFS Physical Store Disk:   disk0s4
    |   Size:                       4108201984 B (4.1 GB)
    |
    +-> Volume disk1s1 170A8371-1B3B-44CE-B9DA-85AE83B14FDA
        ---------------------------------------------------
        APFS Volume Disk (Role):   disk1s1 (No specific role)
        Name:                      Untitled (Case-sensitive)
        Mount Point:               /Volumes/Untitled
        Capacity Consumed:         692224 B (692.2 KB)
        FileVault: No


> sudo diskutil apfs  list disk2  
|
+-- Container disk2 39006797-0013-4FEB-8193-80E5EC146449
    ====================================================
    APFS Container Reference:     disk2
    Size (Capacity Ceiling):      74999996416 B (75.0 GB)
    Capacity In Use By Volumes:   58608070656 B (58.6 GB) (78.1% used)
    Capacity Not Allocated:       16391925760 B (16.4 GB) (21.9% free)
    |
    +-< Physical Store disk0s2 780BB21F-50E3-4055-ACB6-819615DAA3C9
    |   -----------------------------------------------------------
    |   APFS Physical Store Disk:   disk0s2
    |   Size:                       74999996416 B (75.0 GB)
    |
    +-> Volume disk2s1 3D80E1A2-9E5D-4551-B0FA-86BB56F7D45C
    |   ---------------------------------------------------
    |   APFS Volume Disk (Role):   disk2s1 (No specific role)
    |   Name:                      Macintosh HD (Case-sensitive)
    |   Mount Point:               /
    |   Capacity Consumed:         28788011008 B (28.8 GB) |   FileVault: No
    |
    +-> Volume disk2s2 209066D7-AAD7-46FB-AC09-7FDADA96A54C
    |   ---------------------------------------------------
    |   APFS Volume Disk (Role):   disk2s2 (No specific role)
    |   Name:                      DATA (Case-insensitive)
    |   Mount Point:               /Volumes/DATA
    |   Capacity Consumed:         28061200384 B (28.1 GB) |   FileVault: No
    |
    +-> Volume disk2s3 EFB6D4D4-B18A-4EF6-998B-B7CC3F78840E
    |   ---------------------------------------------------
    |   APFS Volume Disk (Role):   disk2s3 (Preboot)
    |   Name:                      Preboot (Case-insensitive)
    |   Mount Point:               Not Mounted
    |   Capacity Consumed:         46075904 B (46.1 MB) |   FileVault: No
    |
    +-> Volume disk2s4 D20E8594-9FBC-4A31-B3F8-2AA1D5BE4BAC
    |   ---------------------------------------------------
    |   APFS Volume Disk (Role):   disk2s4 (Recovery)
    |   Name:                      Recovery (Case-insensitive)
    |   Mount Point:               Not Mounted
    |   Capacity Consumed:         516849664 B (516.8 MB) |   FileVault: No
    |
    +-> Volume disk2s5 32455EB5-06F0-4ABB-8C68-D5B2065BCFDB
        ---------------------------------------------------
        APFS Volume Disk (Role):   disk2s5 (VM)
        Name:                      VM (Case-insensitive)
        Mount Point:               /private/var/vm
        Capacity Consumed:         1073762304 B (1.1 GB) FileVault: No           


/Volumes/DATA/dgerman > sudo diskutil apfs  list disk3
|
+-- Container disk3 0188CCBD-2008-4DD8-A45D-85874CE5DDFB
    ====================================================
    APFS Container Reference:     disk3
    Size (Capacity Ceiling):      42014871552 B (42.0 GB)
    Capacity In Use By Volumes:   33418809344 B (33.4 GB) (79.5% used)
    Capacity Not Allocated:       8596062208 B (8.6 GB) (20.5% free)
    |
    +-< Physical Store disk0s3 E32591C5-D2C5-497A-AE3B-FD29B314A5E8
    |   -----------------------------------------------------------
    |   APFS Physical Store Disk:   disk0s3
    |   Size:                       42014871552 B (42.0 GB)
    |
    +-> Volume disk3s1 E45F0503-5B3B-4EE7-85E3-D3609B3AF1EB
    |   ---------------------------------------------------
    |   APFS Volume Disk (Role):   disk3s1 (No specific role)
    |   Name:                      Untitled (Case-sensitive)
    |   Mount Point:               /Volumes/Untitled 1
    |   Capacity Consumed:         5249179648 B (5.2 GB) |   FileVault: No
    |
    +-> Volume disk3s2 9C3465C9-5EB7-485F-A39D-352A6E7E6EA2
        ---------------------------------------------------
        APFS Volume Disk (Role):   disk3s2 (No specific role)
        Name:                      Photos (Case-sensitive)
        Mount Point:               /Volumes/Photos
        Capacity Consumed:         28073394176 B (28.1 GB) FileVault: No





convert device [-dryrun] Non-destructively convert an HFS volume to an APFS Container with a single APFS Volume.
The APFS Container can then be manipulated (e.g. adding and deleting APFS Volumes) as usual.
The source HFS volume can be located on a partition or on a CoreStorage logical volume (LV); in the latter case, the CoreStorage logical volume group (LVG) is dismantled.
create device [device] name creates an empty APFS Container and then adds one APFS Volume with the given name.
The Volume will have default attributes i.e. no encryption, no capacity reserve nor quota, etc.
This is a combination of createContainer and addVolume .
createContainer [-main] device [-secondary] [device] Create an empty APFS Container. The device(s) specified become APFS Physical Stores. Specifing more than one device creates a Fusion Container -main and -secondary performance algorithms to be on "slower" hardware.
usually not solid solid state, is usually larger, and is used to store associated "auxiliary" data such as any Windows partition(s) for Boot Camp Assistant.
deleteContainer [-force] containerReferenceDevice | physicalStoreDevice [name] Destroy a Container including all of its Volumes.

Volumes are unmounted first. If one or more is busy the operation is aborted.

Container's former Physical Store disks will be reformatted as HFS.

New name, default :Untitled .

If there were multiple Physical Stores, a space and a number suffix is added for each.

If Container is damaged, a Container Reference for it might not exist or it might not be functional. reclaim former APFS Physical Store disk(s) by specifying -force ;
this activates an alternate last-resort mode.
In this mode, if you had more than one Physical Store (e.g. the Fusion case) and the Container is sufficiently damaged, you might have to delete each Physical Store manually. avoid

sudo diskutil apfs deleteCOntainer disk1
Started APFS operation on disk1
Deleting APFS Container with all of its APFS Volumes
Unmounting Volumes
Unmounting Volume "Untitled" on disk1s1
Deleting Volumes
Deleting Container
Wiping former APFS disks
Switching content types
Reformatting former APFS disks
Initialized /dev/rdisk0s4 as a 4 GB case-insensitive HFS Plus volume with a 8192k journal
Mounting disk
1 new disk created or changed due to APFS operation !!
Disk from APFS operation: disk0s4
Finished APFS operation on disk1
resizeContainer containerReferenceDevice | physicalStoreDevice limits [-plist] | size
  [part1Format part1Name part1Size
   part2Format part2Name part2Size
   part3Format part3Name part3Size …]
The operation is live, non-destructive, and does not mount or unmount any APFS Volumes.

size of limits outputs a range of valid values.

size of 0 to grow the targeted Physical Store such that all remaining space is filled to the next partition or the end of the partition map.

Shrinks are constrained by the amount of data usage by all APFS Volumes on the targeted or implied Container. Contributing to this includes quotas, reserves, the usage of Snapshots (e.g. by Time Machine), and metadata overhead.

When shrinking, new partitions may be created to fill the newly-freed space by specifing the format, name, and size parameters as for partitionDisk

Grows are constrained by the amount of partition map free space trailing the targeted or implied Physical Store partition.

All Volumes on the Container must be unlocked.

addVolume ?containerReferenceDevice filesystem name
[-passprompt] | [-passphrase passphrase] | [-stdinpassphrase] [-passphraseHint passphraseHint]
[-reserve reserve] [-quota quota] [-role roles]
[-nomount] [-mountpoint mountpoint]
The filesystem parameter sets the permanent APFS personality for this new APFS Volume; you should specify APFS or Case-sensitive APFS.

The new Volume will be unencrypted unless one of the passphrase options is specified
the user which is added will be the "Disk User".
passphraseHint can be displayed while Volume is locked.

volume's file usage to a maximum amount; no more than that many bytes will be available for file data, even if there is otherwise enough space in the parent Container.
the reserve is not larger than quota.

Volumes carry certain metadata hint flags;
supply the role parameter with any combination of one or more of B R V or 0 as a no-op for scripting convenience. The new Volume is mounted after creation; unless -nomount is specified.
If mountpoint is specified it must exist

deleteVolume volumeDevice Remove the Volume from its Container. All of the Volume's data will be lost.
eraseVolume volumeDevice
-name newName
[-passprompt] | [-passphrase passphrase] |
[
-stdinpassphrase] [-passphraseHint passphraseHint]
Erase the contents of a Volume. the Volume is not removed from its Container.

The "new" Volume will inherit the file system type (Case-sensitiveness ) but not attributes such as name, reserve, quota, or encryption status.

If you need more control, delete;add the Volume.

changeVolumeRole |
chrole                         volumeDevice roles
Change the role metadata flags
The roles should be any combination of b r v B R Vi unspecified flags are unchanged, lower-case flags are cleared, and UPPER-CASE sets flags.
clear will remove all flags, 0 no-op for scripting convenience.
unlockVolume |
unlock                         volumeDevice
[-user disk | -user cryptoUserUUID|
 -recoverykeychain file]
[-passphrase passphrase] | [-stdinpassphrase]
[-nomount | -mountpoint mountpoint]
[-verify] [-plist]
Unlock and mount an encrypted and locked Volume or verify a passphrase. WIthout -user all cryptographic users on that Volume are searched for a match;

-user disk then the Disk UUID (which equals the Volume UUID) user is assumed;
-user UUID that specific user is assumed;

-recoverykeychain then the Institutional Recovery user (see below) is assumed.
-recoverykeychain file full path to a keychain file if an Institutional Recovery Key has been previously set up on the Volume.
The keychain must be unlocked; see security(1) and fdesetup(8) for more information.

-verify will test passphrase correctness without affecting the locked or unlocked state.

To re-lock the volume, unmount it, e.g. with diskutil unmount or diskutil apfs lockVolume.

lockVolume |
lock volumeDevice
Unmount and lock a Volume.
listCryptoUsers |
listUsers |
listCryptoKeys |
listKeys
       [-plist]       volumeDevice
Show all cryptographic users and special-purpose (e.g. recovery) "users" (keys) associated with the Volume, each by their Cryptographic User UUID and usage "type".

The usual purpose of an APFS Cryptographic User is to authenticate for unlocking its APFS Volume; any of its users can do so.

An APFS Volume need not be encrypted in order to contain crypto users; other than the Disk User, they should be added before encrypting.

Types of Cryptographic Users include "Disk" user, whose UUID value always matches its Volume's UUID;
iCloud or personal "Recovery Keys", which store partial crypto keys and are associated with corresponding
"Recovery Users" and have fixed-constant UUID values; and
"Open Directory" users, whose UUID values match corresponding local macOS Open Directory account user GUIDs.

changePassphrase | changeCryptoUserPassphrase | passwd volumeDevice -user disk | cryptoUserUUID
[-oldPassphrase oldPassphrase | -oldStdinpassphrase] [-newPassphrase newPassphrase | -newStdinpassphrase]
Change the passphrase of the given cryptographic user associated with the given Volume.
setPassphraseHint | setCryptoUserPassphraseHint | hint volumeDevice -user disk | cryptoUserUUID -hint hintMessage | -clear Set an arbitrary hint string to aid recall of a passphrase for the given cryptographic user associated with the given APFS Volume. Specifying -clear will clear any existing hint (no hint is the default).
encryptVolume | encrypt | enableFileVault volumeDevice -user disk | existingCryptoUserUUID [-passphrase existingOrNewPassphrase | -stdinpassphrase] Start encryption of a currently-unencrypted APFS Volume ("Enable FileVault").
The operation may be accomplished immediately or in the background".

Supply an existing cryptographic user UUID, in which case you must supply its corresponding passphrase, or
disk (or the Disk/Volume UUID) and the corresponding passphrase of the "Disk User"

if no users exist on this Volume, supply disk (or the Disk/Volume UUID), and a "Disk User" will be created with a new passphrase .
Use this acquire the first such user if a volume has no cryptographics users .

decryptVolume | decrypt | disableFileVault volumeDevice [-user disk | existingCryptoUserUUID] [-passphrase existingPassphrase | -stdinpassphrase] Start decryption of a currently-encrypted APFS Volume ("Disable FileVault").
The operation may be accomplished immediately, or "in the background".

The APFS Volume must be unlocked before beginning.

listSnapshots |
list[Volume]Snaps[hots] [-plist] volume
Show all snapshots that are currently associated with the Volume, including its numeric XID identifier and name.
sudo diskutil apfs listSnapshots disk2s1
Snapshots for disk2s1 (2 found)
|
+-- Name: com.apple.TimeMachine.2018-09-09-083844
|   XID:  700944
|   NOTE: This snapshot sets the minimal allowed size of APFS Container disk2
|
+-- Name: com.apple.TimeMachine.2018-09-09-115808
    XID:  701375

deleteSnapshot volumeDevice -xid xid | -name name Remove the given Snapshot

Apple RAID
appleRAID raidVerb […]
Create, manipulate and destroy AppleRAID volumes (Software RAID).
  • stripe- Striped Volume (RAID 0)
  • mirror- Mirrored Volume (RAID 1)
  • concat- Concatenated Volume (ining)
Only the "mirror" type increases fault-tolerance. may have more than two disks to increase fault-tolerance.
Striped and concatentated volumes are, in fact, more vulnerable to faults than single disk volumes.

From these basic types, "stacked" or "nested" RAID volumes can be created.
Stacked RAID sets that make use of mirrored RAID sets are fault-tolerant.
More common combinations of stacked RAID sets:

  • RAID 50 - striped RAID set of hardware RAID 5 disks.
  • RAID 10 - striped RAID set of mirrored RAID sets.
  • RAID 0+1 - mirrored RAID set of striped RAID sets.
  • Concatenated Mirror - A concatenation of mirrored RAID sets.
When creating new RAID sets or adding disks, it is better to specify the entire disk. This allows the software to reformat the entire disk using the most current partition layouts.

In addition to whole disk and partition device names, AppleRAID uses UUIDs to refer to existing RAID sets and their members. They may be specified by mount point (e.g. /Volume/raidset). Using the UUID is preferred because disk device names may change over time when disks are added, disks are removed or when the system is rebooted.
If RAID members have been physically disconnected from the system or are no longer responding, you must use the member's UUID as the command argument. Messages in the system log will refer to RAID sets and their member disks by UUID.

RAID is not a replacement for backing up data. Backups should be always be performed on a regular basis and before modifying any RAID.

list [UUID] Display volumes with current status and associated member disks.
If UUID is specified, only list that RAID. diskutil listRAID is a deprecated synonym for diskutil appleRAID list.
create mirror|stripe|concat setName format devices … Create a new RAID set consisting of multiple disks and/or RAID sets.
setNameis used for both the name of the created RAID volume and the RAID set itself (as displayed in list). Example: diskutil createRAID stripe MyArray JHFS+ disk1 disk2 disk3 disk4
delete raidVolume Destroy an existing RAID set. If the RAID set is a mirror with a resizable filesystem, delete will attempt to convert each of the member partitions back into a non-RAID volume while retaining the contained filesystem.
For concatenated RAID sets with a resizable filesystem, delete will attempt to shrink the filesystem to fit on the first member partition and convert that to a non-RAID volume.
repairMirror raidVolume newDevice Repair a degraded mirror by replacing a broken or missing member. Broken devices in the mirrored set can also be rebuilt by specifying newDevice. When replacing members of a mirrored set, the new disk must be the same size or larger than the existing disks in the RAID set.
add type newDevice raidVolume Add a new member or hot spare to an existing RAID set.
Typecan be either member or spare. New disks are added live, the RAID volume does not need to be unmounted.
Mirrored volumes support adding both members and hot spares,
When adding to a mirrored RAID set, the new disk must be the same size or larger than the existing disks in the RAID set. Adding a hot spare to a mirror will enable autorebuilding for that mirror.

Concatenated volumes only support adding members. Adding a new member to a concatenated RAID set appends the member and expands the RAID volume.

remove oldDevice raidVolume Remove a member or spare from an existing RAID set. Old disks are removed live, the RAID volume does not need to be unmounted. For missing devices, oldDevice must be device's UUID. Online mirror members with a resizable filesystem will be converted to non-RAID volumes, spare and offline members will be marked free. For concatenated RAID sets, only the last member can be removed. For resizable filesystems remove will first aiempt to shrink the concatenated RAID set so that the filesystem fits on the remaining disks.
enable mirror|concat device Convert a non-RAID disk partition containing a resizable filesystem (like JHFS+) into an unpaired mirror or single disk concatenated RAID set. Disks that were originally partitioned on Mac OS X 10.2 Jaguar or earlier or were partitioned to be Mac OS 9 compatible may not be resizable.
update key value raidVolume Update the key value parameters of an existing RAID set. Valid keys are:
  • AutoRebuild 0|1- If true, the system attempts to rebuild degraded mirrored volumes automatically. When looking for devices for rebuild, AppleRAID first looks for hot spares and then degraded members.
  • Settingtimeout ssseconds system waits (in seconds) for a missing device before degrading a mirrored raid set. Also controls the amount of time you have to disconnect all devices from an unmounted mirror without degrading it.
  • coreStorage
    cs coreStorageVerb […] CoreStorage verbs can be used to create, manipulate and destroy CoreStorage volumes.

    CoreStorage maintains a world of virtual disks, somewhat like RAID, in which one can easily add or remove imported backing store disks, as well as exported usable volumes, to or from a pool (or several pools). This provides the user with flexibility in allocating their hardware; user or operating system data can span multiple physical disks seamlessly, for example.

      Types of objects, instances of which are uniquely represented by a UUID:
    • Logical Volume Group (LVG)
    • Physical Volume (PV)
    • Logical Volume Family (LVF)
    • Logical Volume (LV)
    The Logical Volume Group (LVG) is the top or "pool" level; zero or more may exist during any OS boot time session.

    An LVG imports one or more Physical Volumes (PVs). A PV represents a device that feeds the LVG storage space; a PV is normally real media but it can be a disk image or even an AppleRAID Set. A disk offered to be a PV must be a partition and the encompassing scheme must be GPT.

    An LVG exports zero or more Logical Volume Families (LVFs). An LVF contains properties which govern and bind together all of its descendant Logical Volumes (LVs). These properties provide settings for Full Disk Encryption (FDE) (such as whether the LVG is encrypted, which users have access, etc) and other services. However, at the present time, for new LVF creation, only zero or one LVF per LVG is supported.

    A Logical Volume Family (LVF) exports one or more Logical Volumes (LVs). However, at the present time, only and exactly one LV per LVF is supported.

    A Logical Volume (LV) exports a dev node, upon which a file system (such as Journaled HFS+) resides.

    For more information on specifying device arguments, see the DEVICES section below. CoreStorage is not a replacement for backing up your data. Backups should be always be performed on a regular basis and before modifying any CoreStorage volumes using these commands.

    CoreStorage sub-verbs :

    list [-plist | UUID] Display tree view of the CoreStorage world for all current logical volume groups (LVGs) with member disks (PVs) and exported volumes (LVFs and LVs), with properties and status for each level.
    With -plista property list will be emitted instead of the formatted tree output;
    the UUIDs can be used with the diskutil coreStorage information verb to get properties for the object represented by that UUID.
    With UUIDlist only that UUID
    info | information [-plist] UUID | device
                               Display properties of the CoreStorage object (LVG, PV, LVF, or LV) 
          list                     (Show status of CoreStorage volumes)
         info[rmation]            (Get CoreStorage information by UUID or disk)
         convert                  (Convert a volume into a CoreStorage volume)
         revert                   (Revert a CoreStorage volume to its native type)
         create                   (Create a new CoreStorage logical volume group)
         delete                   (Delete a CoreStorage logical volume group)
         createVolume             (Create a new CoreStorage logical volume)
         deleteVolume             (Delete a volume from a logical volume group)
         encryptVolume            (Encrypt a CoreStorage logical volume)
         decryptVolume            (Decrypt a CoreStorage logical volume)
         unlockVolume             (Attach/mount a locked CoreStorage logical volume)
         changeVolumePassphrase   (Change a CoreStorage logical volume's passphrase)
    
    diskutil coreStorage  with no options will provide help on that verb
         
    
    
    
    
    


    SIZES

    FLoating point number followed by: When specifying partition triplets, the following relative forms may also be used: Examples: 10G (10 gigabytes), 4.23T (4.23 terabytes), 5M (5 megabytes), 25.4% (25.4 percent of whole disk size).

    FORMAT

    The format parameter for the erasing and partitioning verbs is the filesystem personality name found in a filesystem bundle's /System/Library/Filesystems/fs.fs/Contents/Info.plistor i
    by using listFilesystems, which also lists shortcut aliases for common personalities (these shortcuts are defined by diskutil for use with it only). Common examples include JHFS+, MS-DOS, etc.

    Examples

    Resize a volume and create a volume after it, using all remaining space
    sudo diskutil resizeVolume /Volumes/SomeDisk 50g MS-DOS DOS 0b

    Resize a volume and leave all remaining space as unused
    sudo diskutil resizeVolume /Volumes/SomeDisk 12g

    Merge two partitions into a new partition
    diskutil mergePartitions JHFS+ not disk1s3 disk1s5

    Split a partition into three new ones
    sudo diskutil splitPartition /Volumes/SomeDisk JHFS+ vol1 12g MS-DOS vol2 8g JHFS+ vol3 0b

    Erase a disk
    sudo diskutil eraseDisk UFS UntitledUFS disk3

    Erase a volume
    sudo diskutil eraseVolume HFS+ UntitledHFS /Volumes/SomeDisk

    Partition a disk with three partitions
    sudo diskutil partitionDisk disk3 3 HFS+ Untitled 10G UFS UntitledUFS 10G MS-DOS DOS 10G

    Partition with APM partitioning scheme
    sudo diskutil partitionDisk disk3 APM HFS+ vol1 25% Journaled HFS+ vol2 25% Journaled HFS+ vol3 50% Free Space volX 0%

    Partition with GPT partitioning scheme
    sudo diskutil partitionDisk disk3 GPT HFS+ vol1 25% MS-DOS vol2 25% HFS+ vol3 50% Free Space volX 0%

    Create a RAID
    diskutil createRAID mirror MirroredVolume JHFS+ disk1 disk2

    Destroy a RAID
    diskutil destroyRAID /Volumes/MirroredVolume

    Repair a damaged RAID
    diskutil repairMirror /Volumes/MirroredVolume disk3

    Convert volume into RAID volume
    diskutil enableRAID mirror /Volumes/ExistingVolume

    SEE ALSO

    authopen(1), hdid(8), hdiutil(1), ufs.util(8), msdos.util(8), hfs.util(8), drutil(1), diskarbitrationd(8), mount(8), umount(8), newfs(8), vsdbutil(8), fsck(8)
    defaults


    msdos.util -- DOS/Windows (FAT) file system utility

    [-m mountflag1 mountflag2 mountflag3 mountflag4] device node mount
    [-p mountflag1 mountflag2 mountflag3 mountflag4] device probe for mounting
    [-u] deviceunmount
    [-n] device name set name

    mountflags :

    fsck_msdos

    DOS/Windows (FAT) file system consistency check

    verifies and repairs FAT file systems (more commonly known as DOS file systems).

    -p normally started by fsck during automatic reboot, when a FAT file system is detected.
    When preening file systems, fixs common inconsistencies non-interactively.
    If more serious problems are found, indicates that it was not successful, and exits.
    -q quickly check whether the volume was unmounted cleanly.
    If the volume was unmounted cleanly, then the exit status is 0.
    If the volume was not unmounted cleanly, then the exit status will be non-zero.
    A message is printed to standard output describing whether the volume was clean or dirty.
    -f ignored
    -n provide N as the answer to operator questions, except CONTINUE?.
    -y provide Y as the answer
    -p Preen the specified file systems.

    Single User Mode

    Hold CMD - S when booting.
    Start the following five services first:
    launchctl load /System/Library/LaunchDaemons/com.apple.notifyd.plist
    launchctl load /System/Library/LaunchDaemons/com.apple.kextd.plist
    launchctl load /System/Library/LaunchDaemons/com.apple.diskarbitrationd.plist
    launchctl start com.apple.diskarbitrationd
    launchctl load /System/Library/LaunchDaemon/com.apple.DirectoryServices.plist
    launchctl load /System/Library/LaunchDaemons/com.apple.configd.plist
    

    HISTORY

    Starting with Mac OS X 10.6, the input and output notation of disk and partition sizes use power-of-10 suffixes.
    In the past this has been power-of-2, for display or accepted as input.

    See also

    booting OS X utility partition

    Disk Utility (Graphic User Interface) application

    See bless, gpt
    HDIutil for disk images.