[Mono-list] Unable to get block device size in UnixStream
robertj at gmx.net
Thu Jan 31 13:41:45 UTC 2013
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:
Maybe the device must be mounted to be able to get meaningful values...
If you don't care about POSIX and only want to handle Linux,
reading the ProcFS files
should return the size of the device in 512-byte blocks.
It works for me with an unmounted device.
More information about the Mono-list