Posted on 07-23-2012 11:12 AM
Hi!!
Boss wants a report of all mac laptops we have that have a hard drive, as we'd like to replace them with an SSD.
Does anyone have any idea how one would create this report...maybe an extension attribute?
Thanks!
A
Posted on 07-23-2012 11:54 AM
If you do a
system_profiler SPSerialATADataType
You'll get something like
Serial-ATA:
Intel 6 Series Chipset:
Vendor: Intel
Product: 6 Series Chipset
Link Speed: 6 Gigabit
Negotiated Link Speed: 3 Gigabit
Description: AHCI Version 1.30 Supported
APPLE SSD SM256C:
Capacity: 251 GB (251,000,193,024 bytes)
Model: APPLE SSD SM256C
Revision: AXM09A1Q
Serial Number: S0TNNYABB29779
Native Command Queuing: Yes
Queue Depth: 32
Removable Media: No
Detachable Drive: No
BSD Name: disk0
Medium Type: Solid State
TRIM Support: Yes
Partition Map Type: GPT (GUID Partition Table)
S.M.A.R.T. status: Verified
Volumes:
disk0s1:
Capacity: 209.7 MB (209,715,200 bytes)
BSD Name: disk0s1
Content: EFI
Macintosh HD:
Capacity: 250.14 GB (250,140,434,432 bytes)
Available: 196.49 GB (196,489,560,064 bytes)
Writable: Yes
File System: Journaled HFS+
BSD Name: disk0s2
Mount Point: /
Content: Apple_HFS
Volume UUID: 065EFF5F-A718-38F6-8C8E-9928E93FBD0E
Recovery HD:
Capacity: 650 MB (650,002,432 bytes)
BSD Name: disk0s3
Content: Apple_Boot
Volume UUID: 3D372E6C-4795-3400-8878-327807A098C9
That "Medium Type" is what you're after. If it's SSD it will be "Solid State" if it's spinning disk it'll be "Rotational"
However, I don't know how this holds for third party SSDs. This is with an Apple-supplied SSD (MacBook Air).
Work up an EA from those results.
Posted on 07-23-2012 01:12 PM
Thank!!!!! got it to work!!!!
I simply just put it as:
**#!/bin/sh
HDKind=system_profiler SPSerialATADataType | grep "Medium Type"
echo "<result>$HDKind</result>"**
Posted on 07-24-2012 05:28 AM
Care to mark as an answer?
Posted on 10-24-2012 10:14 AM
Perhaps a better answer would be to get rid of the Medium Type: in the results...
#!/bin/bash
Medium=$(system_profiler SPSerialATADataType | grep Medium Type | sed -e 's/^[Medium Type: ]*//')
echo "<return>$Medium</return>"
Should be a bit cleaner.