Search code examples
pythonmacosmount

Getting mount type information in python on OSX


Is there a way in which I can get some information about the mounts I have in the folder /Volumes in OSX?

I want to be able to tell the difference between disk images like dmgs and other types, like hard disks or network mounts.

I tried parsing the output of mount -v and looking if read-only is in the line but I doubt that's a particularly accurate way of telling, and also not a good method either.

Is there any module or method that will give me this information?


Solution

  • Have a look at the diskutil(8) and hdiutil(1) tools.