Posted on 06-21-2012 12:25 PM
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...
Solved! Go to Solution.
Posted on 06-21-2012 01:46 PM
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.
Posted on 06-21-2012 12:53 PM
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 )
Posted on 06-21-2012 01:29 PM
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
Posted on 06-21-2012 01:45 PM
@ rlandgraf - That's definitely better than the one I posted.
Posted on 06-21-2012 01:46 PM
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.
Posted on 06-21-2012 08:00 PM
use the bless command to get the current boot volume, example
bless -getBoot
Posted on 06-22-2012 01:53 PM
Thanks, one and all. I'll probably do something like:
/usr/sbin/diskutil info `bless -getBoot` | awk -F: '/File System/{print $2}' | sed 's/^ *//'