Home arrow OSX Tips arrow See a list of disk drives in OSX Terminal
See a list of disk drives in OSX Terminal PDF
Thursday, 10 November 2011
For example you have a USB stick and you want to create a newfs on it, it is usefull to know the drive name of that USB drive. Or you want to erase it with DD. There's a tool from command line for drive management called diskutil:

To list your drives:

  diskutil list

Your output of the command might be something like this:
using diskutil to list installed drives
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *500.1 GB   disk0
   1:                        EFI                         209.7 MB   disk0s1
   2:                  Apple_HFS Macintosh HD            499.2 GB   disk0s2
   3:                 Apple_Boot Recovery HD             650.0 MB   disk0s3
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:                                                   *4.0 GB     disk1

You can use diskutil for other tasks like mounting a disk, erasing a disk, eject, verify, etc.

Last Updated ( Thursday, 10 November 2011 )
< Prev

Other BSD Systems





Best BSD firewall?