EA for file system format type?

jonscott
New Contributor

Has anyone written an extension attribute to pull the file system format of the boot volume, i.e. Mac OS Extended (Journaled) vs. Mac OS Extended (Case-sensitive, Journaled), etc? This may be overkill, but SEP v12.1 apparently has an issue with the "case-sensitive" option - and I thought I'd nip an admittedly unlikely nuisance in the bud, if possible.

I believe I can work something out with diskutil, but thought I'd see if others had solved this before...

1 ACCEPTED SOLUTION

mm2270
Legendary Contributor III

Assuming all of your Mac boot volume disk ids are disk0s2, the following would pull something you could use:

/usr/sbin/diskutil info disk0s2 | awk -F: '/File System/{print $2}' | sed 's/^ *//'

I assume if a disk was Case Sensitive Journaled, it would report that. This should work on both 10.6.x and 10.7.x, based on the very limited tests I did.

View solution in original post

6 REPLIES 6

justinworkman
Contributor

This line would work. I'm not good with awk, but I'm sure there's a better way with awk.

mount | grep -m 1 / | cut -f2 -d ( | cut -f1 -d )

rlandgraf
Contributor

This is the command that I use assuming the boot disk is 02 which it usually is.

system_profiler SPSerialATADataType | grep -B1 "disk0s2" | grep "File" | cut -d":" -f2

justinworkman
Contributor

@ rlandgraf - That's definitely better than the one I posted.

mm2270
Legendary Contributor III

Assuming all of your Mac boot volume disk ids are disk0s2, the following would pull something you could use:

/usr/sbin/diskutil info disk0s2 | awk -F: '/File System/{print $2}' | sed 's/^ *//'

I assume if a disk was Case Sensitive Journaled, it would report that. This should work on both 10.6.x and 10.7.x, based on the very limited tests I did.

tlarkin
Honored Contributor

use the bless command to get the current boot volume, example

bless -getBoot

jonscott
New Contributor

Thanks, one and all. I'll probably do something like:

/usr/sbin/diskutil info `bless -getBoot` | awk -F: '/File System/{print $2}' | sed 's/^ *//'