We have recently moved our network shares to an AWS FSx file server and ever since then I have been unable to mount it using cifs on our balena devices.
Trying a mount with:
mkdir /mnt/my-share mount -t cifs -o username=test //<server_address>/<share_name>/ /mnt/my-share/
Always returns a mount error(2): No such file or directory. With the following kernel messages:
[347779.475853] CIFS: Attempting to mount //<server_address>/<share_name>/ [347779.546190] CIFS: VFS: BAD_NETWORK_NAME: \\<server_address>\<share_name> [347779.564867] CIFS: VFS: cifs_mount failed w/return code = -2
These might sound like a network issue but I am actually able to mount exactly the same share when I try some userspace tools like smbnetfs or smbclient.
Previously, when we were still working with our old self-hosted SMB share, we were able to make the mount work by explicitly specifying the SMB dialect with
vers=1.0, however, that does not work anymore since AWS FSx doesn’t support SMB1.
I had the suspicion that the used cifs kernel module doesnt support SMB3 since I cant see any SMB3 or SMB211 kernel config flags when running:
> zcat /proc/config.gz | grep CIFS CONFIG_CIFS=y # CONFIG_CIFS_STATS2 is not set CONFIG_CIFS_ALLOW_INSECURE_LEGACY=y CONFIG_CIFS_WEAK_PW_HASH=y CONFIG_CIFS_UPCALL=y CONFIG_CIFS_XATTR=y CONFIG_CIFS_POSIX=y CONFIG_CIFS_DEBUG=y # CONFIG_CIFS_DEBUG2 is not set # CONFIG_CIFS_DEBUG_DUMP_KEYS is not set CONFIG_CIFS_DFS_UPCALL=y # CONFIG_CIFS_ROOT is not set
Unfortunately, an out-of-tree module installation does not seem to be an option since cifs is a built-in module now and as I am not even sure if I am following the right track I also didnt want to try and rebuild the kernel from source (also because I have no idea how linux and especially this yocto kernel that balena uses actually work )
Has anyone else already encountered this problem and can suggest any workarounds?
Any idea is much appreciated!
PS: I cant use smbclient for my application since it doesnt allow to actually mount a network share and smbnetfs would in theory do the trick but unfortunately it runs extremely unstable and I sometimes need to retry transferring files for hours until they eventually make their way onto the network share.