Advertisement

Get sizes of unmounted devices in a program

Started by April 14, 2003 04:19 PM
1 comment, last by griffenjam 21 years, 6 months ago
I''m writing a disk imager and need to be able to get the size of drive when it is unmounted. I''ve tried using fstat, stat, and lstat but none of them are working, what can I do? Exume my speling.
"The paths of glory lead but to the grave." - Thomas GrayMy Stupid BlogMy Online Photo Gallery
One way would be to read the partition table from the disk and figure the sizes from that. Of course, that requires proper priviledges.
Advertisement
Take a look at the information in /proc/ide/*

You should find a field indicating capacity somwhere.

This topic is closed to new replies.

Advertisement