[Mono-list] Unable to get block device size in UnixStream

Ulrich Hertlein u.hertlein at gmail.com
Thu Jan 31 23:47:36 UTC 2013


Hi guys,

On Fri, Feb 1, 2013 at 12:41 AM, Robert Jordan <robertj at gmx.net> wrote:

> On 31.01.2013 12:45, Christian Schmid wrote:
>
>> Hi Jon
>>
>> Unfortunately, it did not work. Although /dev/sda2 is a 500 gb device,
>> statfvs("dev/sda2", out stat) and fstatvfs(fd, out stat) returned the
>> following:
>>
>> bavail=2560
>> bfree=2560
>> blocks=2560
>> bsize=4096
>> files=8262645
>> frsize=4096
>>
>
> Maybe the device must be mounted to be able to get meaningful values...
>

The usage is incorrect: you give it a path (or fd) of a file *ON* the
filesystem you're interested in.

If you pass it /dev/sda it probably gives you info on the /dev pseudo
filesystem (or maybe the root filesystem where /dev is mounted).

Cheers,
/ulrich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20130201/eda61900/attachment.html>


More information about the Mono-list mailing list