HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

diskutil — Utility to manage local disks and volumes. Some subcommands such as `partitiondisk` have their own u

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandlocalanddiskutilclimanagedisksutility
macos

Problem

How to use the diskutil command: Utility to manage local disks and volumes. Some subcommands such as partitiondisk have their own usage documentation. More information: <https://keith.github.io/xcode-man-pages/diskutil.8.html>.

Solution

diskutil — Utility to manage local disks and volumes. Some subcommands such as partitiondisk have their own usage documentation. More information: <https://keith.github.io/xcode-man-pages/diskutil.8.html>.

List all currently available disks, partitions, and mounted volumes:
diskutil list


Repair the filesystem data structures of a volume:
diskutil repairVolume {{/dev/disk}}


Unmount a volume:
diskutil unmountDisk {{/dev/disk}}


Eject a CD/DVD (unmount first):
diskutil eject {{/dev/diskX}}

Code Snippets

List all currently available disks, partitions, and mounted volumes

diskutil list

Repair the filesystem data structures of a volume

diskutil repairVolume {{/dev/disk}}

Unmount a volume

diskutil unmountDisk {{/dev/disk}}

Eject a CD/DVD (unmount first)

diskutil eject {{/dev/diskX}}

Context

tldr-pages: osx/diskutil

Revisions (0)

No revisions yet.