Skip to main content
Solved

Lion Recovery Partition Ext. Attribute - Misreporting?

  • January 26, 2012
  • 4 replies
  • 21 views

Forum|alt.badge.img+15

Running this extension attribute I am finding that it reports as "Not Present" on systems with multiple drives, and possibly OSX Lion server. Is anyone seeing the same thing?

Best answer by jhbush

I've seen this as well. I edited my extension attribute like so:

#!/bin/sh

recoveryHDPresent=/usr/sbin/diskutil list | grep "Recovery HD"

if [ "$recoveryHDPresent" != "" ]; then echo "<result>Present</result>"
else echo "<result>Not Present</result>"
fi

4 replies

jhbush
Forum|alt.badge.img+27
  • Esteemed Contributor
  • Answer
  • January 27, 2012

I've seen this as well. I edited my extension attribute like so:

#!/bin/sh

recoveryHDPresent=/usr/sbin/diskutil list | grep "Recovery HD"

if [ "$recoveryHDPresent" != "" ]; then echo "<result>Present</result>"
else echo "<result>Not Present</result>"
fi


Forum|alt.badge.img+15
  • Author
  • Valued Contributor
  • January 27, 2012

Yup - I probably should have noticed that disk0 business too! :)

This works, thanks for your help!


Forum|alt.badge.img+12
  • Contributor
  • May 10, 2016

For anyone who comes across this later, I found that the following worked on 10.11.4

#!/bin/sh

recoveryHDPresent='/usr/sbin/diskutil list | grep "Recovery HD"'

if [ "$recoveryHDPresent" != "" ]; then echo "<result>Present</result>"

else echo "<result>Not Present</result>"

fi

mm2270
Forum|alt.badge.img+24
  • Legendary Contributor
  • May 10, 2016

@dhanes You might want to edit your script to change the single quotes into backticks, or preferable command parenthesis. I.e, either

recoveryHDPresent=`/usr/sbin/diskutil list | grep "Recovery HD"`

or

recoveryHDPresent=$(/usr/sbin/diskutil list | grep "Recovery HD")

The way its posted right now, its not actually running a command. Its just a single quoted string.