问题
I am working on a new project, which relates to creating drive images for backup.
As a part of it, i need to write code which can give much useful information related to disk geometry - cylinders, no. of sectors, partitions, and file systems and even drive specific info, like which partition is present on which drive. i need some APIs.
If you can post a code too in addition to APIs that will be great.
P.S: Something similar to what Novell - Zenworks (Imaging) does
回答1:
There is no glibc facility for that. Use libblkid.
来源:https://stackoverflow.com/questions/9478519/need-libc-apis-to-access-disk-geometry-and-partitioning-related-info