I am experiencing some trouble with an external HDD. I'm afraid it is starting to getting corrupted or damaged :S.
In an application I am using statfs to retrieve information of that external HDD:
const char *mountPoint = "/media/hdd"; struct statfs s; statfs(mountPoint, &s);
However, from time to time, I have noticed in the application logs that the complete Linux system is blocked (in fact, due to not registering some events at the correct times). I have noticed it by myself by typing "df" command in one of these "critical" moments. The effect is that all partitions appear correctly, with exception for the HDD partition, whose line lasts some seconds before appearing.
Furthermore, the HDD is formatted as NTFS and I am using ntfs-3g to operate with it.
...and last but not least I have detected the following problem in dmesg:
klogd: page allocation failure: order:0, mode:0x20 CPU: 0 PID: 1660 Comm: klogd Not tainted 3.12.20-smp #6 Hardware name: PhoenixAward 945GS/945GS, BIOS 6.00 PG 02/03/2015 [...] Call Trace: [...] [<f866806e>] e1000_alloc_rx_buffers+0x18e/0x1e0 [e1000e] [<c1a30387>] ? napi_gro_receive+0x67/0x90 [<f8666200>] e1000_clean_rx_irq+0x220/0x340 [e1000e] [<f866cc5b>] e1000e_poll+0x7b/0x2e0 [e1000e] [...]
I would like to know if there is a non-blocking way of obtaining mounted devices information. In this case, I need the total size of the device and the available or used disk space.
Maybe this problem is not strictly related to "df" or accessing volumen data but it's more related to Linux OS features, such as memory allocation.
Any help would be grateful. Thanks in advance.