Mac: How to get a BSD block device name for a mount path
Question
I have a mount point path like "/Volumes/Something" which i already known is a root directory for a mounted local volume. I need to figure out the BSD block device node name for volume mounted at that directory for example "disk1s1". Any advice on how can i dig this up? I also wouldn't mind some additional information like device total size, but i already have a way to know it if i know a block device name.
Thank you.
Solution
Use statfs
syscall. Look at http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man2/statfs.2.html
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow