I want to use snapraid on my turris omnia, thus I cross compiled snapraid for armhf (turris is equiped with a an armv7 running an openwrt fork). The result is runnable snapraid version (at the moment the current beta because I intend to use btrfs without subvolumes).
$ file snapraid
snapraid: ELF 32-bit LSB executable, ARM, EABI5 version 1(SYSV), dynamically linked (uses shared libs), not stripped
However, snapraid always fails to start, because it is unable to read the config file (which is correct):
# ./snapraid status
Self test...
Error opening the configuration file '/etc/snapraid.conf'. Invalid argument.
I did some research a found out that snapraid is trying to use a function which is not implemented on 32bit arm called fadvise64_64:
# strace ./snapraid status
execve("./snapraid", ["./snapraid", "status"], [/* 13 vars */]) = 0
set_tls(0xb6fe7b64, 0, 0xb6fe7918, 0, 0xb6fe7a98) = 0
set_tid_address(0xb6fe7ab4) = 17182
open("/etc/ld-musl-armhf.path", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/libgcc_s.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
...
clock_gettime(CLOCK_MONOTONIC_RAW, {227984, 541119920}) = 0
open("/etc/snapraid.conf", O_RDONLY|O_LARGEFILE) = 3
fadvise64_64(3, 0, 0, POSIX_FADV_NORMAL) = -1 ENOSYS (Function not implemented)
close(3) = 0
writev(2, [{"Error opening the configuration "..., 77}, {NULL, 0}], 2Error opening the configuration file '/etc/snapraid.conf'. Invalid argument.
) = 77
exit_group(1) = ?
+++ exited with 1 +++
So is this my fault? Did I do something wrong when compiling snapraid? Or is this a bug? I would be super happy if I can run snapraid on my turris omnia since I more or less bought it to be my NAS.
Thank you for any help!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I want to use snapraid on my turris omnia, thus I cross compiled snapraid for armhf (turris is equiped with a an armv7 running an openwrt fork). The result is runnable snapraid version (at the moment the current beta because I intend to use btrfs without subvolumes).
However, snapraid always fails to start, because it is unable to read the config file (which is correct):
I did some research a found out that snapraid is trying to use a function which is not implemented on 32bit arm called fadvise64_64:
So is this my fault? Did I do something wrong when compiling snapraid? Or is this a bug? I would be super happy if I can run snapraid on my turris omnia since I more or less bought it to be my NAS.
Thank you for any help!
Just look at the man page of fadvise64. There is a ARM section.
If you compile the sources, I think you can just comment this call out as a first try.
Hi Hans,
Please try with the beta 71 at http://beta.snapraid.it/
I changed the fadvise calls to ignore the ENOSYS error that seems to be returned in the armhf case.
Ciao,
Andrea
Awesome Andrea, thank you very much for the quick fix.
Does this function not being available affect the performance of snapraid?
Hi Hans,
Difficult to say, but you can obtain the same effect increasing manually the readahead size, like with:
echo 256 > /sys/block/sdX/queue/read_ahead_kb
Where sdX are the disk devices used in your array.
Ciao,
Andrea
Last edit: Andrea Mazzoleni 2016-10-27