Exporting a GlusterFS volume as a Samba share exposes distributed storage to SMB/CIFS clients such as Windows systems. A single SMB share endpoint can front a replicated or distributed volume, keeping storage management on the GlusterFS side while providing a familiar file-share interface.
Samba exports files from a local directory path defined in /etc/samba/smb.conf, so the GlusterFS volume must be mounted on the host running smbd. The common approach is a GlusterFS client mount via FUSE to a stable mount point, which is then published as an SMB share name.
FUSE mounts often need the allow_other option (plus /etc/fuse.conf configured) so Samba worker processes can access the mount with per-user credentials. Independent Samba servers exporting the same volume can break locking semantics unless Samba clustering (for example CTDB) is used; prefer a single gateway host for a simple deployment. Firewall access to TCP port 445 is required for clients to connect. Authenticated shares reduce the risk of anonymous writes.
$ sudo apt update && sudo apt install --assume-yes samba smbclient glusterfs-client ##### snipped ##### Setting up samba ... ##### snipped #####
Examples use Ubuntu or Debian package names.
$ sudo sed -i 's/^#user_allow_other/user_allow_other/' /etc/fuse.conf $ grep -n '^user_allow_other$' /etc/fuse.conf 15:user_allow_other
$ sudo mkdir -p /srv/gluster/volume1
$ sudo mount -t glusterfs -o allow_other node1:/volume1 /srv/gluster/volume1
The node1:/volume1 value is a placeholder for a reachable GlusterFS server plus an existing volume name.
$ findmnt -T /srv/gluster/volume1 TARGET SOURCE FSTYPE OPTIONS /srv/gluster/volume1 node1:/volume1 fuse.glusterfs rw,relatime,allow_other
$ sudo groupadd --system gluster-smb $ getent group gluster-smb gluster-smb:x:999:
$ sudo adduser --disabled-password --ingroup gluster-smb --gecos "" smbshare Adding user `smbshare' ... Adding new user `smbshare' (1001) with group `gluster-smb' ... ##### snipped #####
$ sudo chgrp gluster-smb /srv/gluster/volume1
$ sudo chmod 2770 /srv/gluster/volume1
The leading 2 in 2770 preserves group ownership for new files created under the directory.
$ sudo smbpasswd -a smbshare New SMB password: Retype new SMB password: Added user smbshare.
$ sudo cp --archive /etc/samba/smb.conf /etc/samba/smb.conf.bak
$ sudo nano /etc/samba/smb.conf [volume1] comment = GlusterFS volume1 path = /srv/gluster/volume1 browseable = yes read only = no guest ok = no valid users = @gluster-smb force group = gluster-smb create mask = 0660 directory mask = 2770
Setting guest ok = yes on a writable share permits anonymous write access for any client that can reach the SMB ports, effectively turning the share into a public drop box.
$ sudo testparm --suppress-prompt Load smb config files from /etc/samba/smb.conf Loaded services file OK. Server role: ROLE_STANDALONE
No error output indicates the configuration parses successfully.
$ sudo systemctl restart smbd
Restarting smbd disconnects active SMB sessions.
$ sudo systemctl status smbd --no-pager
● smbd.service - Samba SMB Daemon
Loaded: loaded (/lib/systemd/system/smbd.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2025-12-25 10:15:01 UTC; 4s ago
##### snipped #####
$ sudo ufw allow Samba Rules updated Rules updated (v6)
Systems using firewalld typically open the samba service profile instead of UFW rules.
$ smbclient -L //localhost -U smbshare
Enter SMB password:
Sharename Type Comment
--------- ---- -------
volume1 Disk GlusterFS volume1
IPC$ IPC IPC Service (Samba Server)
$ smbclient //localhost/volume1 -U smbshare -c 'ls' Enter SMB password: . D 0 Thu Dec 25 10:18:44 2025 .. D 0 Thu Dec 25 10:18:44 2025
Windows clients can connect using \\files.example.net\volume1 with a user that belongs to the gluster-smb group.