Skip to main content
Question

Identifying Bootcamp Macs

  • April 28, 2011
  • 3 replies
  • 3 views

I'm looking for a way to identify all my bootcamp macs. Casper identifies
partitions, but I don't see any way to build a smart group off of that. I
haven't used extension attributes much. I'm thinking I can set one up
with something like:

diskutil list | grep disk0 | grep Microsoft | awk -F 'Microsoft Basic Data
' '{print $2}'

This should give me partition name, size and disk number if there is a
Windows NTFS partition. Anyone else come up with anything better for
accomplishing this? Or perhaps I am missing an easier way to do it.

Chad

3 replies

Forum|alt.badge.img+31
  • Honored Contributor
  • April 28, 2011

I would use df to see if a NTFS partition was there

if [[ df | grep -c "NTFS" == 1 ]]

then echo "<result> has windows partition</result>" else echo "no windows partition detected, not adding an attribute..."

fi

exit 0

?xml version="1.0" encoding="ISO-8859-1"?>


  • April 28, 2011

I'm not seeing that a regular df command tells you the volume is ntfs. It
does, however, look like you can use df -T ntfs to list only volumes that
are ntfs. Looks like this would also work for my purpose.

Thanks.


Forum|alt.badge.img+31
  • Honored Contributor
  • April 28, 2011

Yeah my code was probably off as I don't have any NTFS partitions to test it with. However, when we did dual boot I used a dummy receipt system that listed file system types via df command.

sorry for that

?xml version="1.0" encoding="ISO-8859-1"?>