How to find installed storage devices in OSX?

How to find mounted storage devices and get information about them? I basically want the same behavior as on the sidebar of the crawler.

*** Update: usually I need to show device names and types

Right now I'm browsing the / Volumes / directory and just listing what's there, but that leaves me with two problems:

  • I have unwanted elements, for example. Mobilebackups
  • I can not identify the device

The second problem really bothers me. If I could identify an element, I could also sort out unnecessary elements, but I don’t even know if it is mounted on a DMG, USB device or network device.

I have already examined a few examples, but I will not go anywhere. The apple sample FSMegaInfo already provides some information, but I'm not sure if I can identify the type of device. I am also not sure how to get the necessary information to scan the device. Also DADiskCopyDescription does not give me the necessary information.

I also use the NSWorkspace notification to receive information about new mounted or unmounted devices, but the notification does not provide any information.

Is there a simple way?

Thanks for the help.

Seb

+5
source share
3 answers

Set the NSFileManager to which volumes are installed .

+8
source

You should check the command line application diskutil. It has a list option that will show you the type, name, size, identifier, etc. Installed volumes. Hope you can rip off the options at this point.

+1
source

All Articles