When browsing large windows (samba) shares with Ubuntu Nautilus (that’s the equivalent of the Windows File Explorer) I observed that shares which include many files and directories (a few hundred) take a few seconds to browse over WiFi, but almost instantly display over a fast LAN. A similar difference in speed is noticeable when searching for files with Nautilus.
Interestingly this doesn’t seem to be the case with sshfs mounts or when mounting a remote share as a local mount with cifs or browsing with smb-client.
The solution is to create a mount point in /media, eg. /media/Photos and mount it in /etc/fstab
//fileserver/Photos /media/Photos cifs vers=3.0,guest,soft,nofail,noauto,x-systemd.automount,x-systemd.device-timeout=5s,iocharset=utf8,cache=loose,fsc,users 0 0
cifs-specific mount options are described here: https://linux.die.net/man/8/mount.cifs and general fstab options are described here: https://wiki.archlinux.org/index.php/fstab
Some options explained:
Directly specifying the protocol version with “vers” reduces negotiation time (I hope, haven’t tried). The “guest” option mounts the share without user credentials (that’s ok in my case, you might want to provide user credentials instead). The “soft” option makes sure that access to the shares time out when the share is not available instead of hanging indefinitely. “noauto,x-systemd.automount” postpones mounting until the share is accessed. “nofail” makes sure the boot process doesn’t fail if the mount fails (useful since it is a network share and the server or network might be down). “x-systemd.device-timeout” reduces the wait time to 5 seconds in case the mount fails due to network issues. “iocharset” enables non-latin characters in file names. “cache” and “fsc” enable aggressive caching (you might want to skip those in a shared access environment). “users” is a weird one: Nautilus fails mounting with a note about the user not being “root” if that option is missing.
2 thoughts on “Nautilus browsing large windows share is slow”
This was super helpful. The default smb config that nautilus was using on Ubuntu 20.04 was resulting in 330 MiB/s transfers on my 10 Gb/s LAN. Copying from terminal with smbclient, and sshfs mounts, were unaffected – same as you – only the nautilus GUI was underperforming. Applying this fix restored the expected 1.1 GiB/s (9.44 Gb/s) that I expected. Thanks!
LikeLiked by 1 person
Chris, thanks for reporting the figures of your experiments.