Académique Documents
Professionnel Documents
Culture Documents
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 volumelevel structure of local disks.
Provides information about, and allows the administration of, the partitioning scheme of disks, optical discs, and RAID sets.
list partitions
information
monitor activity
disk
repair verify
mountDisk / unmountDisk all mountable volumes
verifyDisk repairDisk
eject
erase zero secureErase eraseOptical randomDisk (writing random data to the media) secureErase
partitionDisk removing all volumes
partition:
split
merge
delete partition (not available!)
volume : resize rename repair erase reformat
mount/umount
reformat
resizeVolume
verifyVolume
repairVolume
eraseVolume
enableJournal/disableJournal/moveJournal HFS+
enableOwnership/ disableOwnership
RAID
createRAID
enableRAID Convert a disk to a degraded RAID mirror set
convertRAID Convert a RAID 1.x preTiger to a RAID 2.x Tiger
updateRAID Update settings
addToRAID Add a spare or member disk
removeFromRAID Remove a spare or member disk
checkRAID
repairMirror Repair damaged set
destroyRAID
coreStorage
volreference
disk identifier disk*, e.g. disk1s9.
device node entry containing the disk identifier. disk*, e.g. /dev/disk2s0.
volume mount point. /Volumes/*, e.g. /Volumes/Untitled.
Universally Unique Identifier or UUID. e.g. 85D67001-D93E-3687-A1C2-79D677F0C2E0
Disk Identifier
Device unit, session on that device, or a partition (slice) .
Uis the device unit. It may refer to hardware (e.g. a hard drive, optical drive, or memory card) or a "drive" constructed by
software (For Example: an AppleRAID set or a disk image).
Sslice; aka partition. The area that contains a file system .
It may contain specialized data for database programs, or data required for the system software (e.g. EFI or booter partitions,
or APM partition map data).
Qsession for optical media; (number of times recording has taken place).
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 toptobotom appearance of partitions shows the ondisk ordering.
Disk identifiers need not appear in slicenumerical order.
https://www.real-world-systems.com/docs/diskutil.1.html 1/15
25/11/2018 diskutil partition manager for apple mac OS X
/dev/disk2 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +40.4 GB disk2
Physical Store disk0s2
1: APFS Volume Macintosh HD 33.7 GB disk2s1
2: APFS Volume Preboot 23.8 MB disk2s2
3: APFS Volume Recovery 519.0 MB disk2s3
4: APFS Volume VM 1.1 GB disk2s4
disk0
#: type name size identifier
0: Apple_partition_scheme *55.9 GB disk0
1: Apple_partition_map 31.5 KB disk0s1
2: Apple_HFS MacHD 14.2 GB disk0s3
3: Apple_HFS DATA 3.8 GB disk0s5
4: Apple_HFS PHOTOS 3.8 GB disk0s7
5: Apple_UNIX_SVR2 120.0 MB disk0s8
6: Apple_HFS BACKUPS 23.3 GB disk0s10
7: Apple_Boot 8.5 MB disk0s13
8: Apple_UNIX_SVR2 1015.5 MB disk0s14
disk1 (SD card from camera)
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *2.0 GB disk1
1: DOS_FAT_16 DGERMAN181 2.0 GB disk1s1
disk2 (unmounted! xxx.dmg )
#: TYPE NAME SIZE IDENTIFIER
0: Apple_partition_scheme *1.5 MB disk2
1: Apple_partition_map 32.3 KB disk2s1
2: Apple_HFS Google Chrome 12.0.7... 1.5 MB disk2s2
https://www.real-world-systems.com/docs/diskutil.1.html 2/15
25/11/2018 diskutil partition manager for apple mac OS X
<array>
<string>disk0</string>
<string>disk1</string>
<string>disk2</string>
</array>
</dict>
</plist>
i.e. virtual
Mounted: Yes
Mount Point: /Volumes/DATA Escaped with Unicode: /Volumes/DATA
External firewire:
https://www.real-world-systems.com/docs/diskutil.1.html 3/15
25/11/2018 diskutil partition manager for apple mac OS X
> sudo /usr/sbin/Diskutil info disk1s5 data which is same as disk1s3 not shown
Volume Name: DGerman1b
Journal: Journal size 8192 KB at offset 0x97000
Owners: Disabled
Volume UUID: 197341EC-7AA0-370A-8551-5644467E4753
Total Size: 19.9 GB (19864723456 Bytes) (exactly 38798288 512-Byte-Units)
Volume Free Space: 1.6 GB (1643266048 Bytes) (exactly 3209504 512-Byte-Units)
activity Continuously display systemwide disk manipulation activity as reported by the Disk
Arbitration framework, Coming online, 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] Mount a single volume.
[-mountPoint vol_mt_pt] vol_mt_ptrather than the standard path of /Volumes/VolumeName,
diskn sm 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 vol
sudo /usr/sbin/Diskutil repairdisk disk0
Repairing the partition map might erase disk0s1 (the EFI ), proceed? (y/N) n
Repair canceled
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")
For some locations of devices (e.g. internal hard disks), consideration of ownership
settings on FSOs is the default.
For others (e.g. plugin 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 ondisk settings.
Enable ownership where a disk contains FSOs whose User and Group, and permissions,
is critically important, such as when the plugin disk contains system files to be changed
or added .
previously:
05924632A81B72DC: 00000001
A073446E9FC5B85D: 00000001
22984819A1006E1A: 00000001
CE5F4638B7C48818: 00000001
E08C36730A0B5D7C: 00000001
C5E0CD235635726E: 00000001
4500BAFE67D39774: 00000001
Settings are persistent See vsdbutil .
disableOwnership device
verifyPermissions [-plist] Verify the permissions of boot volume, written during the installation .
vol 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
https://www.real-world-systems.com/docs/diskutil.1.html 5/15
25/11/2018 diskutil partition manager for apple mac OS X
For each partition, a triplet of the desired File System format, volume name, and size
must be specified.
F SF ormatare 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, (40962048)*nfiles will require ADDITIONAL unused
space)
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
https://www.real-world-systems.com/docs/diskutil.1.html 6/15
25/11/2018 diskutil partition manager for apple mac OS X
volume as the startup disk.
blocksize
0. Singlepass zerofill erase.
1. Singlepass randomfill erase.
2. US DoD 7pass secure erase.
3. Gutmann algorithm 35pass secure erase.
4. US DoE algorithm 3pass secure erase.
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 wholedisk 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 a disk which is imported into an APFS Container. An APFS Container can import more than one Physical Store,
Store e.g. for Fusionstyle 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 2part 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). Instead, all APFS Volumes 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 the optional reserve and quota size values.
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 fillingup of the parent Container due solely to this
Volume at the expense of sibling Volumes.
https://www.real-world-systems.com/docs/diskutil.1.html 7/15
25/11/2018 diskutil partition manager for apple mac OS X
Efficient file copy cloning (copyonwrite) is supported (see copyfile (3)'s COPYFILE_CLONE).
filelevel encryption is supported.
The "whole" identifier number is arbitrary, and
the "slice" numbers count up from 1 with each new Volume.
Deleting Volumes may cause gaps in the numbering until the next eject/attach cycle.
This form appears the same as a partition (map) scheme and partitions, but is unrelated.
Snapshot represents a readonly 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 readonly 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).
All currentlyattached 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
|
+-- Container disk1 23AAD3A6-2D81-4AFA-9D30-21A1B3A94E40
====================================================
APFS Container Reference: disk1
Size (Capacity Ceiling): 39444262912 B (39.4 GB)
Minimum Size: 31849742336 B (31.8 GB)
Capacity In Use By Volumes: 30725939200 B (30.7 GB) (77.9% used)
Capacity Not Allocated: 8718323712 B (8.7 GB) (22.1% free)
|
+-< Physical Store disk0s5 888FE62A-3A23-47DA-8601-63F63D9D1616
| -----------------------------------------------------------
| APFS Physical Store Disk: disk0s5
| Size: 39444262912 B (39.4 GB)
|
+-> Volume disk1s1 CCD1EED2-39D7-3EC3-BBF2-F265F414EA11
| ---------------------------------------------------
| APFS Volume Disk (Role): disk1s1 (No specific role)
| Name: HighSierra (Case-sensitive)
| Mount Point: Not Mounted
| Capacity Consumed: 17029689344 B (17.0 GB)
| FileVault: No
|
+-> Volume disk1s2 7B878459-97EC-4B12-B730-7278011FEADD
| ---------------------------------------------------
| APFS Volume Disk (Role): disk1s2 (Preboot)
| Name: Preboot (Case-insensitive)
| Mount Point: Not Mounted
| Capacity Consumed: 18915328 B (18.9 MB)
| FileVault: No
|
+-> Volume disk1s3 AED964B1-29D5-4B16-B50C-37627C936D89
| ---------------------------------------------------
| APFS Volume Disk (Role): disk1s3 (Recovery)
| Name: Recovery (Case-insensitive)
| Mount Point: Not Mounted
| Capacity Consumed: 518975488 B (519.0 MB)
| FileVault: No
|
+-> Volume disk1s4 57E6EFAE-8830-4E53-A4D7-63095F221630
| ---------------------------------------------------
| APFS Volume Disk (Role): disk1s4 (VM)
| Name: VM (Case-insensitive)
| Mount Point: Not Mounted
| Capacity Consumed: 1073762304 B (1.1 GB)
| FileVault: No
|
+-> Volume disk1s5 6F7F7CCB-C123-4596-B273-A94688463320
---------------------------------------------------
APFS Volume Disk (Role): disk1s5 (No specific role)
Name: Photos (Case-sensitive)
Mount Point: Not Mounted
Capacity Consumed: 11993341952 B (12.0 GB)
FileVault: No
https://www.real-world-systems.com/docs/diskutil.1.html 8/15
25/11/2018 diskutil partition manager for apple mac OS X
Minimum Size: 40364978176 B (40.4 GB)
Capacity In Use By Volumes: 35478876160 B (35.5 GB) (87.9% used)
Capacity Not Allocated: 4886102016 B (4.9 GB) (12.1% free)
|
+-< Physical Store disk0s2 4D9C9472-E6C8-4F2C-954A-A5C37EDD1B97
| -----------------------------------------------------------
| APFS Physical Store Disk: disk0s2
| Size: 40364978176 B (40.4 GB)
|
+-> Volume disk2s1 E7F558E6-492D-360A-A1EA-20C437216253
| ---------------------------------------------------
| APFS Volume Disk (Role): disk2s1 (No specific role)
| Name: Macintosh HD (Case-insensitive)
| Mount Point: /
| Capacity Consumed: 33768878080 B (33.8 GB)
| FileVault: No
|
+-> Volume disk2s2 3CCBBFE0-EB86-4EC0-8FBC-25D4DD65E8F7
| ---------------------------------------------------
| APFS Volume Disk (Role): disk2s2 (Preboot)
| Name: Preboot (Case-insensitive)
| Mount Point: Not Mounted
| Capacity Consumed: 23752704 B (23.8 MB)
| FileVault: No
|
+-> Volume disk2s3 31D420A6-EB80-4288-B259-2B87DF955B86
| ---------------------------------------------------
| APFS Volume Disk (Role): disk2s3 (Recovery)
| Name: Recovery (Case-insensitive)
| Mount Point: Not Mounted
| Capacity Consumed: 519004160 B (519.0 MB)
| FileVault: No
|
+-> Volume disk2s4 5CBACF34-7229-4341-8C3C-16AAB4299BBD
---------------------------------------------------
APFS Volume Disk (Role): disk2s4 (VM)
Name: VM (Case-insensitive)
Mount Point: /private/var/vm
Capacity Consumed: 1073762304 B (1.1 GB)
FileVault: No
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 lastresort 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
Shrinks are constrained by the amount of data usage by all APFS
Volumes on the targeted or implied Container. Contributing to this
https://www.real-world-systems.com/docs/diskutil.1.html 9/15
25/11/2018 diskutil partition manager for apple mac OS X
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.
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 noop for scripting convenience. The new Volume is mounted
after creation; unless -nomount is specified.
If mountpoint is specified it must exist
If you need more control, delete and (re)add the Volume.
You will be prompted for a passphrase unless -passphrase or pipe
passphrase to stdin and use -stdinpassphrase.
The usual purpose of an APFS Cryptographic User is to authenticate
for unlocking its APFS Volume; any of its users can do so.
https://www.real-world-systems.com/docs/diskutil.1.html 10/15
25/11/2018 diskutil partition manager for apple mac OS X
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 fixedconstant UUID values; and
"Open Directory" users, whose UUID values match corresponding
local macOS Open Directory account user GUIDs.
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 .
The APFS Volume must be unlocked before beginning.
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 faulttolerance. may have more than two disks to increase faulttolerance.
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 faulttolerant.
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.
https://www.real-world-systems.com/docs/diskutil.1.html 11/15
25/11/2018 diskutil partition manager for apple mac OS X
create Create a new RAID set consisting of multiple disks and/or RAID sets.
mirror|stripe|concat setNameis used for both the name of the created RAID volume and the RAID set itself (as displayed
setName format devices 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 nonRAID 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 nonRAID volume.
repairMirror Repair a degraded mirror by replacing a broken or missing member. Broken devices in the mirrored
raidVolume newDevice 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 Add a new member or hot spare to an existing RAID set.
raidVolume 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.
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 subverbs :
https://www.real-world-systems.com/docs/diskutil.1.html 12/15
25/11/2018 diskutil partition manager for apple mac OS X
info | information [-plist] UUID | device
SIZES
When specifying partition triplets, the following relative forms may also be used:
nn%
R specifies the remainder of the whole-disk. It need not be in the last triplet. It must only appear in at most one triplet in the
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
Examples
Resize a volume and create a volume after it, using all remaining space
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
sudo diskutil partitionDisk disk3 3 HFS+ Untitled 10G UFS UntitledUFS 10G MS-DOS DOS 10G
https://www.real-world-systems.com/docs/diskutil.1.html 13/15
25/11/2018 diskutil partition manager for apple mac OS X
sudo diskutil partitionDisk disk3 APM HFS+ vol1 25% Journaled HFS+ vol2 25% Journaled HFS+ vol3 50% Free Space vol
sudo diskutil partitionDisk disk3 GPT HFS+ vol1 25% MS-DOS vol2 25% HFS+ vol3 50% Free Space volX 0%
Create a RAID
Destroy a RAID
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
mountflags :
removable | fixed
readonly | writeable
suid | nosuid
dev | nodev
fsck_msdos
DOS/Windows (FAT) file system consistency check
verifies and repairs FAT file systems (more commonly known as DOS file systems).
If more serious problems are found, indicates that it was not successful, and exits.
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?.
https://www.real-world-systems.com/docs/diskutil.1.html 14/15
25/11/2018 diskutil partition manager for apple mac OS X
-y provide Y as the answer
-p Preen the specified file systems.
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
This web page hand crafted by Dennis German This page last modified on 09/10/2018 02:10:58
©2015 RealWorldSystems, All rights reserved.
https://www.real-world-systems.com/docs/diskutil.1.html 15/15