

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.
