Report for displaying storage type...HD vs. SSD.

ooshnoo
Valued Contributor

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

4 REPLIES 4

jarednichols
Honored Contributor

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.

ooshnoo
Valued Contributor

Thank!!!!! got it to work!!!!

I simply just put it as:

**#!/bin/sh

HDKind=system_profiler SPSerialATADataType | grep "Medium Type"

echo "<result>$HDKind</result>"**

jarednichols
Honored Contributor

Care to mark as an answer?

ctangora
Contributor III

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.