71

How can I get information if my HD format is case sensitive or case insensitive?

I want to make sure my Mac running Mountain Lion has a case sensitive file system.

bmike
  • 235,889
GusDeCooL
  • 2,768
  • 5
    As bmike mentioned, using a case sensitive file system is more likely a bad idea -- a number of softwares (most famously from Adobe) will not work on a case sensitive file system. The case sensitive status of the file system is not a 'cool extra feature' for jo random user -- it is something for power users who know what they are doing. For joe random user a case sensitive file system is more likely a liability than not. – user1256923 Nov 12 '12 at 17:55

8 Answers8

77

You can use terminal to read the File System Personality:

diskutil info /

Look for the fields named below:

   File System Personality:  Journaled HFS+
   Type (Bundle):            hfs
   Name (User Visible):      Mac OS Extended (Journaled)

If the file system is case sensitive, you will see Case-sensitive Journaled HFS in the first pasted line and Mac OS Extended (Case-sensitive, Journaled) in the third.

Disk Utility will also show you this from the info window for any File System it can see.

If you see

File System Personality:   APFS
Type (Bundle):             apfs
Name (User Visible):       APFS

you are also case insensitive. There's a version of APFS Case-Sensitive

morhook
  • 103
bmike
  • 235,889
  • 14
    I don't want to discourage you from using case-sensitive file systems, but be aware that most software tests don't do a good job of covering this edge case and most experienced administrators will advise against enabling this on your boot volume due to past bad experiences supporting this configuration. I usually make an external drive or a dmg when I truly need case-sensitivity for cross platform needs or a very specific code base. You may have good reasons for needing this, but I wanted to make sure others are aware that there can be problems with being too sensitive with your file system. – bmike Nov 12 '12 at 17:31
  • 1
    Yes, i need that for testing web development. Most of hosting use case sensitive. So i want to match it. But like you said: if case sensitive make some software didn't work, seems like case sensitive will be useless :) – GusDeCooL Nov 13 '12 at 15:10
  • 3
    Yours is actually the only reason I have made either test partitions and/or disk images and chosen a case-sensitive filesystem. I keep my system default, but test development, deployment and scripts on a web root based on the alternate file system's path. I'd also add, I haven't run OS X on case-sensitive FS since Snow Leopard days, so I may just be out of date and afraid for nothing due to past experiences. Sounds like you're well armed to give either scenario a go - dive in or compartmentalize your testing. – bmike Nov 13 '12 at 16:39
  • 2
    If you need an environment for testing web development, running a virtual machine is an alternative to consider as well, since there might be other quirks and differences between your Mac and the environment on production servers. Have a look at VirtualBox + Vagrant. – Gerry Nov 15 '12 at 04:44
  • 2
    Note, In OS X 10.8.x (Mountain Lion) I had to do diskutil info as list did not show the expected information. – Nick Feb 07 '13 at 13:40
  • 1
    @bmike, did you mean diskutil info / instead of diskutil list /? – AlcubierreDrive Feb 22 '14 at 11:00
  • 1
    On catalina, both diskutil info / and diskutil list / do not seem to be showing the File System Personality field. Perhaps due to changes with the fact it's now using APFS volumes? – Adam Parkin Jan 27 '21 at 19:45
38

Something like this should work:

Testing

touch abc1
touch abC1
ls ab*

Interpreting Results

  • 1 file - case insensitive
  • 2 files - case sensitive
nohillside
  • 100,768
John
  • 489
  • 1
    I tried the same approach in Mac OS 10.12.6. although I have a case sensitive file system only 1 file gets created. How is this possible? – Sanandrea Aug 11 '17 at 14:19
  • 1
    A more direct test would be mkdir mydir && mkdir myDir, which would explicitly error out on a case-insensitive FS. – Ruslan Aug 23 '22 at 10:01
18

Update for El Capitan, see the attached screen shot from Disk Utility's Info-window.

enter image description here

d-b
  • 3,348
  • 6
  • 38
  • 62
12

run diskutil info <device> and your answer will be shown.

File System Personality will reflect one of the known personalities.

If you see: File System Personality: Journaled HFS+ that means it's case insensitive. To answer your question, you want to see File System Personality: Case-sensitive Journaled HFS+.

incumbent
  • 475
6

UPDATE: As some people have noted, the answer I proposed below is flawed. @John however has a similar answer without the flaw.

You can do a test in a shell:

  • Open the Terminal

  • Enter the following commands:

     touch abc1
     touch ABC2
     ls a*
    

If the ls command displays both files, abc1 and ABC2, then your drive is case insensitive (i.e. case does not matter). If only abc1 is displayed, then it is case sensitive (i.e. case does matter).

Before you close Terminal, enter rm abc1 and rm ABC2 to clean up after the test.

bmike
  • 235,889
  • An empirical solution - very nice. – bmike Nov 15 '12 at 04:56
  • 4
    How do abc1 and ABC2 collide? Shouldn't it be abc1 and ABC1? – getWeberForStackExchange Sep 19 '13 at 19:27
  • @weberwithoneb is correct. This check is a good idea but wrong. Should be ABC1. – Leopd Nov 07 '13 at 17:12
  • 5
    abc1 and ABC2 are not meant to collide. I could have chosen Allan and armour instead as filenames. it is the ls a* command that will tell you weather the file system is case sensitive. If it is, only armour will be listed using my last example, since there is a lower case letter a in ls a*. However, if the OS is not case sensitive, the ls a* command will list both Allan and armour. – Jean-François Beauchamp Nov 07 '13 at 23:48
  • 1
    My system is the default (insensitive), but my bash console still only displays sensitive results (and also the auto completion functionality). – lulalala Jan 20 '14 at 02:17
  • @patrix Why did you moderate and modify man answer? It was perfectly valid as it was. Please do not change my answer, and propose another one if you have another solution. – Jean-François Beauchamp Apr 08 '15 at 13:26
  • @wim I just realized that it was you who modified my answer and patrix who approved your edit. So I am asking you the same question. – Jean-François Beauchamp Apr 08 '15 at 13:41
  • Both your way and the version edited by @wim will work. From looking at the comments here, it seems that your version is kind of hard to understand/follow. But if you want to stick with your version, that's fine. – nohillside Apr 08 '15 at 14:20
  • @patrix John already proposed a solution similar to mine once Wim had edited it. Please let the democracy operate, and let people vote for the solution they prefer. Are you earning reputation points by doing these edits in other people's solutions? It would be nice to be able to down-vote moderators edits. – Jean-François Beauchamp Apr 08 '15 at 14:56
  • See http://apple.stackexchange.com/help/editing for the concept of editing. You can always rollback edits you don't agree with. – nohillside Apr 08 '15 at 16:11
  • To get back to the problem in the question: It seems as if your method doesn't work in 10.10 anymore, see http://pastebin.com/L8suGPMM. Or it may depend on bash's setting of nocaseglob. – nohillside Apr 08 '15 at 17:31
  • 2
    @Jean-FrançoisBeauchamp To answer your query: I've edited because your answer was & is incorrect. I'm using Journaled HFS+ which is a case insensitive file system, but it is case preserving. Your method creates two files, abc1 and ABC2, but ls a* only shows the one file. I was just trying to help, however, I don't want to edit against your own wishes and you seem to be sensitive about it - so I will leave the answer as is and leave a downvote instead. – wim Apr 09 '15 at 02:15
  • 2
    @wim Ok, thanks for the explanation! You are right, my answer is flawed. I still prefer an explanation than not my post being edited without understanding why. Patrix is also right about nocaseglob. – Jean-François Beauchamp Apr 09 '15 at 13:06
2

What does work for me is:

echo -n This file system is case->tmp; echo -n in>>TMP; echo sensitive>>tmp; cat tmp
nohillside
  • 100,768
jwatt
  • 161
  • 4
1

Fastest way is using Terminal.app:

diskutil info /Volumes/NAME-OF-VOLUME

or (if you want to only see the relevant line)

diskutil info /Volumes/NAME-OF-VOLUME | grep 'User Visible'
nohillside
  • 100,768
0

You can also use Disk Utility to check the partition format. If the format is case-sensitive, it will say so in the format name, otherwise nothing will be indicated.

You can see the menus on this link: http://www.kenstone.net/fcp_homepage/partitioning_tiger.html

Beware that it is not the "Mac" that is case-sensitive or not, it is each partition on your drives.