Hacker News new | ask | show | jobs
by johnchristopher 1394 days ago
I have given up on Samba on my home network. It's just 2 pi, 2 laptops but client randomly loses connection to folders or dolphin/nautilus stop seeing folders, hit refresh, there it is again, etc.

I just use sshfs and I am done with it.

I just want to easily move files around my network and samba took too many hours of my life to look at what's wrong this year with client version or spaces in shared folders. It's always something.

3 comments

I took the time to debug all the Samba issues between my Pis and Linux + Windows desktop computers. Most of the time there are two separate problems:

1. Samba share is not discovered in the network. All my problems were gone after installing wsdd2.

2. Permissions. Especially Windows clients implicitly try to login with an empty password to check if the share can accessed without one. This can lead to problems with the "map to guest" directive in the Samba configuration. Also the Windows credential storage sometimes saves passwords that did not work and implicitly tries to login.

But don't get me started on the Gnome/gvfs client implementation of Samba. I have given up on that.

- https://bugs.launchpad.net/gvfs/+bug/1828107

- https://gitlab.gnome.org/GNOME/gvfs/-/issues/307

I put together a small writeup in case someone wants to take a deep-dive: https://blog.hiebl.cc/posts/why-your-samba-config-does-not-w...

(reacting to your writeup)

- gvfs might not support ws-discovery for smb discovery, but neither does macos. They both support dns-sd/bonjour/zeroconf for that; so getting up avahi up and running with advertising the smb service is the easiest way to handle both. Synology does this OOB, for example.

- gvfs is not an implementation of samba. It is a frontend to libsmbclient library from the samba package. Unfortunately, libsmbclient does read smb.conf and adjusts itself accordingly, without the consumers of the library having a say in it. The best way to debug gvfs problems is to start with empty smb.conf.

NFS gets a bad rep. I use it everywhere with 0 problems or configuration headaches. Sure, I wouldn't use it in situations where security is a concern, but for me and all my computers? It's wonderful. And SO much faster than sshfs.
Sorry for the rant, obviously NFS is fine for a homelab.

Nobody should use NFS ever if it can be avoided. Run screaming. The entire idea of “remote file system that is transparent to applications that just write files normally” fundamentally just does not work on Linux. There is too much software that assumes the characteristics and reliability of local filesystems like ext4 and xfs and there not enough control exposed by the kernel to handle when things go wrong. It’s the wrong layer.

Remote block storage as well as application layer object storage work really really well but the filesystem APIs are a mess intertwined with so many different parts of the system and assumptions made 40 years ago.

I came here to say roughly the same thing. I really just use sftp these days.

For years I used Avahi to run afp shares on my Linux machines for my Macs, but I don’t even bother anymore. I have ssh setup on all my computers, it’s all I really need. Sometimes I’ll mount it, but 90% of the time I just scp over the file I want.