8

Using diskutil, or other command line tools, how can I determine which filesystem I'm using?

# sw_vers
ProductName:    Mac OS X
ProductVersion:    10.8.5
BuildVersion:    12F45
  • You are using the HFS+ filesystem. But, there is no indication if you are using core storage. – David Anderson May 5 '18 at 18:46
  • Thanks for your response. Are you able to determine this by my version number? Is there a command I can use to verify? – user287980 May 5 '18 at 18:47
  • APFS requires ProductVersion 10.13.0 or higher. You can determine HFS+, Core Storage and APFS from the output of diskutil list. – David Anderson May 5 '18 at 18:48
  • Thanks for your help. What's confusing is, using the Disk Utils app, the harddrive reads "(APFS)". – user287980 May 5 '18 at 18:56
  • Also confusing is, after encrypting the drive with FileVault and rebooting, diskutil cs list reports no Core Storage volumes found. – user287980 May 5 '18 at 18:59
9

The easiest way is using the diskutil command line as follows:

diskutil info /

You will see a report which will include something like this for an APFS formatted storage:

Volume Name:              Macintosh HD
Mounted:                  Yes
Mount Point:              /
Partition Type:           41504752-0000-11AA-AA23-01306543EFEA
File System Personality:  APFS
Type (Bundle):            apfs
Name (User Visible):      APFS
Owners:                   Enabled

See under Type to determine what kind of file system is on your root volume.

This will be displayed on an HFS formatted storage:

Volume Name:              Macintosh HD
Mounted:                  Yes
Mount Point:              /
Partition Type:           Apple_HFS
File System Personality:  Journaled HFS+
Type (Bundle):            hfs
Name (User Visible):      Mac OS Extended (Journaled)
Journal:                  Journal size 155648 KB at offset 0x3a38000
Owners:                   Enabled

If you want to automate this or use the results in a script, you can use following one-liner:

/usr/libexec/PlistBuddy -c "Print :FilesystemType" /dev/stdin <<< $(diskutil info -plist /)

Which will produce output:

apfs

or

hfs
  • 1
    What a strange idea, to hide a program like PlistBuddy in /usr/libexec! That's the place for programs usually run by daemons and the like, after all. – Harald Hanche-Olsen May 6 '18 at 8:14
  • @HaraldHanche-Olsen and it is such a wonderful tool, too! – boris42 May 6 '18 at 17:28
-2

or just launch disk utility - it will list the "Type" also

  • The question specifically states CLI :) – ankii Aug 8 at 3:06
  • DiskUtility for an external volume: "Type: USB External Physical Volume"; nothing about HFS or APFS – Greg Oct 10 at 21:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .