Forrest logo
back to the diskutil tool

diskutil:tldr:e9a27

diskutil: Unmount a volume.
$ diskutil unmountDisk ${-dev-disk_device}
try on your machine

The command "diskutil unmountDisk ${-dev-disk_device}" is used in the macOS Terminal to unmount a disk or storage device connected to your computer.

Let's break down the command:

  • "diskutil": This is the command-line utility in macOS used for managing disks, volumes, and partitions.

  • "unmountDisk": This is a subcommand of "diskutil" used to unmount a disk device. When you unmount a disk, it is no longer accessible by the system or applications, but it remains physically connected to the computer.

  • "${-dev-disk_device}": This is a placeholder for the disk device identifier. In macOS, disk devices are identified using a unique identifier such as "disk1", "disk2", etc. The "${-dev-disk_device}" is replaced by the actual device identifier when executing the command. For example, if the device identifier is "disk1", the command would be: "diskutil unmountDisk disk1".

By running this command in the Terminal, you can unmount the specified disk device and ensure it is no longer accessible until it is remounted.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the diskutil tool