Skip to main content
Solved

EA for file system format type?

  • June 21, 2012
  • 6 replies
  • 16 views

Forum|alt.badge.img+5

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...

Best answer by mm2270

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.

6 replies

Forum|alt.badge.img+7
  • Contributor
  • 40 replies
  • June 21, 2012

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 )


Forum|alt.badge.img+14
  • Contributor
  • 65 replies
  • June 21, 2012

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


Forum|alt.badge.img+7
  • Contributor
  • 40 replies
  • June 21, 2012

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


mm2270
Forum|alt.badge.img+24
  • Legendary Contributor
  • 7886 replies
  • Answer
  • June 21, 2012

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.


Forum|alt.badge.img+31
  • Honored Contributor
  • 2721 replies
  • June 22, 2012

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

bless -getBoot

Forum|alt.badge.img+5
  • Author
  • Contributor
  • 59 replies
  • June 22, 2012

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

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