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
sudo diskutil list physical |grep FD # see SD card
0: FDisk_partition_scheme *31.9 GB disk2
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 int signal (^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_pt rather than the standard path of /Volumes/VolumeName ,
directory at that path must already exist.
| mountDisk disku Mount all mountable volumes.
| umount [force] vol force may 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
[journalDevice] vol
external causes 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.
internal will move the journal for device back locally.
| enableOwnership vol
The Database at /var/db/volinfo.database is 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.
-plist output 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 PTformat forces 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
GPT GUID 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.
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 pnSize are in the format of n.f units
Valid units are 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 force is 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 vol | write 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 :
- Single-pass zero-fill erase.
- Single-pass random-fill erase.
- US DoD 7-pass secure erase.
- Gutmann algorithm 35-pass secure erase.
- US DoE algorithm 3-pass secure erase.
| eraseOptical [quick] diskU
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |