Anyone know of a way to tell which /dev/diskxxx is the startup?
I really don't need to know specifically which partition, but I need to weed out the startup volume's device from a partitioning list. And I can't find a good way to tell which DEV is booted from.
I was assuming /dev/disk0 was always the boot drive, but that's not the case. I just net booted while I had an external plugged in, and opened a terminal window from the netboot, only to find /dev/disk0 disappeared when I unplugged the external... (it's booted off /dev/disk1)
(and it's freaking out deploy studio too, which apparently was making a similar assumption, and may end up needing to be rerun)
What I've tried:
stat -f "%s" / -> gets me the device id of the boot volume
stat -f "%s" /dev/disk0 -> gets me some other weird device ID shared by all the devices....
diskutil list /dev/disk0 -> gets me a lot of info but not the device ID, nor whether or not it's booted, and I really can't rely on volume names to be unique identifiers, so nothing in that output is unique or completely reliable - important when partitioning disks!
any other ideas?