
Note the identifier for that drive is “disk1s2” and we’ll carry that to the next series of commands to unmount and remount it. The output will look something like this:Ģ: Apple_HFS Macintosh HD 120.5 GB disk0s2ģ: Apple_Boot Recovery HD 650.0 MB disk0s3įor the sake of this example, we’ll focus on the attached drive named “OSXDaily”, which happens to be an external USB thumb drive that appears last in the list. We are doing this so we can get the drive identifier, which is typically something like disk1s2, or disk2s2, etc This will provide a list of all drives that are attached to the Mac, that are either mounted and unmounted, and all of their respective partitions.

The first thing you’ll need to do is list the connected drives. To do this you’ll need another volume attached or connected to the Mac in some form or another, then launch Terminal to get started (sits in /Applications/Utilities/). How to Unmount a Drive from Command Line on Mac This is infinitely useful for troubleshooting situations, for scripting and automation, and it’s a great trick for those of us who just like to tinker around in Terminal. By using the command line to remount the drive, the entire process can be completed remotely if necessary through SSH, and without ever having to physically disconnect a drive from the Mac. This trick works with external USB disks, hard drives, Firewire, Thunderbolt, DVD’s, CD’s, network drives, even USB thumb drives, literally any volume that can be mounted and accessed through the incredibly helpful diskutil command. But what if you want to be able to mount, unmount, and remount drives from the command line? That’s exactly what we’ll cover here.

Along the same lines, if you want to remount a drive you can usually just physically unplug the drive and plug it back again. For many users, the easiest way to unmount a drive in Mac is to either just drag a volume into the Trash, use the eject keys, disconnect the drive, or use one of the force eject methods.
