Posted on 04-28-2011 09:02 AM
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
Posted on 04-28-2011 09:11 AM
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"?>
Posted on 04-28-2011 09:20 AM
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.
Posted on 04-28-2011 09:24 AM
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"?>