Skip to main content
Question

Number of partitions report?

  • September 17, 2015
  • 3 replies
  • 29 views

roiegat
Forum|alt.badge.img+16

So in the storage section of a computer there is the number of partitions. But I'm trying to create a report to see who has more then 1 paritions on there machines.

Anyone know if it can be done casper itself, or do I need to write an extension attrbute for it? Anyone create something similar to this?

3 replies

Forum|alt.badge.img+10
  • Contributor
  • February 1, 2018

I am wanting to do this also. I can't seem to find a way yet. If anyone has an idea, let us know. Thanks!


Forum|alt.badge.img+14
  • Valued Contributor
  • February 1, 2018

This is kind of a pain for a few reasons.

  1. The if the user has a DMG mounted - it will show up in the storage report and in diskutil.
  2. APFS is kind of funny.

You may be able to do something like this (10.13.3)

#!/bin/sh


bootVolume=$(system_profiler SPSoftwareDataType | grep "Boot Volume" | awk -F': ' '{print $2}')


diskNum=$(diskutil info "$bootVolume" | grep -i "Part of Whole" | awk '{print $4}')

diskPartList=$(diskutil list $diskNum)

echo "$diskPartList"

EDIT
This would output all of the partitions on the parent disk of the boot volume. You could add a | wc -l at the end of the echo to see the count, but that will give to the number of lines.


Forum|alt.badge.img+10
  • Contributor
  • February 2, 2018

Thank you @tthurman , I am going to work with this some. I have a way to find active Bootcamp partitions but that doesn't tell me if someone sets up a partition for a separate Mac OS or Linux machine. I think our end answer will be setting up EFI firmware passwords on everything.