A GlusterFS volume can serve Linux clients directly while Windows and macOS users still need an SMB/CIFS share name. Exporting the mounted volume through Samba gives those clients a normal network share without asking them to install the native GlusterFS client.

This setup uses one Samba gateway host with a GlusterFS FUSE mount under /srv/gluster. Samba then exports that local mount point from /etc/samba/smb.conf, so the share depends on both the GlusterFS mount and the smbd service being active on the gateway.

Use a single gateway for a small deployment unless clustered Samba with CTDB is already part of the design. The Samba vfs_glusterfs module can access a volume through libgfapi without a FUSE mount when the module is packaged and configured, but the FUSE mount path keeps the share definition portable across package sets and easier to verify with normal Linux tools.

Steps to export a GlusterFS volume as a Samba share:

  1. Confirm that the GlusterFS volume is started from a trusted-pool node.
    $ sudo gluster volume info volume1
    
    Volume Name: volume1
    Type: Replicate
    Status: Started
    Number of Bricks: 1 x 2 = 2
    Transport-type: tcp
    Bricks:
    Brick1: node1:/srv/gluster/brick1
    Brick2: node2:/srv/gluster/brick1
    ##### snipped #####
  2. Install Samba, smbclient, the GlusterFS client, and the FUSE configuration package on the gateway host.
    $ sudo apt update && sudo apt install --assume-yes samba smbclient glusterfs-client fuse3
    Reading package lists... Done
    Building dependency tree... Done
    The following NEW packages will be installed:
      fuse3 glusterfs-client samba smbclient
    ##### snipped #####
    Setting up glusterfs-client ...
    Setting up samba ...
    Setting up smbclient ...

    The package names shown match Ubuntu and Debian. On RHEL-family systems, use the equivalent samba, samba-client, glusterfs-fuse, and fuse packages from the enabled repositories.

  3. Enable the FUSE setting that permits Samba worker processes to access the mounted volume.
    $ sudoedit /etc/fuse.conf
    user_allow_other

    The fuse3 package creates /etc/fuse.conf on current Ubuntu systems. Without user_allow_other, the allow_other mount option may be rejected or unavailable to non-root access paths.

  4. Create the mount point that Samba will export.
    $ sudo mkdir -p /srv/gluster/volume1
  5. Mount the GlusterFS volume with allow_other.
    $ sudo mount -t glusterfs -o allow_other node1:/volume1 /srv/gluster/volume1

    Replace node1:/volume1 with a reachable GlusterFS node and an existing volume name. The first node supplies the volume file; the mounted client still talks to the bricks listed by the volume.

  6. Verify that the mount point is backed by GlusterFS.
    $ findmnt -T /srv/gluster/volume1
    TARGET                 SOURCE        FSTYPE          OPTIONS
    /srv/gluster/volume1  node1:/volume1 fuse.glusterfs  rw,relatime,allow_other
  7. Create a local Unix group for accounts allowed to use the share.
    $ sudo groupadd --system gluster-smb
    $ getent group gluster-smb
    gluster-smb:x:999:
  8. Create the local account used for the SMB login example.
    $ sudo adduser --disabled-password --ingroup gluster-smb --gecos "" smbshare
    Adding user `smbshare' ...
    Adding new user `smbshare' (1001) with group `gluster-smb' ...
    ##### snipped #####

    Use existing per-person Unix accounts, domain accounts, or a dedicated service account instead of a shared example user when auditability matters.

  9. Set the mount root group ownership for SMB writers.
    $ sudo chgrp gluster-smb /srv/gluster/volume1
  10. Set group-write permissions and the setgid bit on the mount root.
    $ sudo chmod 2770 /srv/gluster/volume1

    The leading 2 keeps new files and directories under the gluster-smb group.

  11. Add the Unix account to the Samba password database.
    $ sudo smbpasswd -a smbshare
    New SMB password:
    Retype new SMB password:
    Added user smbshare.
  12. Back up the Samba configuration before editing it.
    $ sudo cp --archive /etc/samba/smb.conf /etc/samba/smb.conf.bak
  13. Open the Samba configuration file.
    $ sudoedit /etc/samba/smb.conf
  14. Add the GlusterFS share definition.
    [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

    Do not set guest ok = yes on a writable GlusterFS-backed share unless anonymous network writes are intentional and restricted elsewhere.

  15. Validate the Samba configuration.
    $ sudo testparm --suppress-prompt
    Load smb config files from /etc/samba/smb.conf
    Loaded services file OK.
    Weak crypto is allowed by GnuTLS (e.g. NTLM as a compatibility fallback)
    
    Server role: ROLE_STANDALONE
    ##### snipped #####
    [volume1]
            comment = GlusterFS volume1
            create mask = 0660
            directory mask = 02770
            force group = gluster-smb
            path = /srv/gluster/volume1
            read only = No
            valid users = @gluster-smb
  16. Restart smbd to load the share definition.
    $ sudo systemctl restart smbd

    Restarting smbd can disconnect active SMB clients on the gateway.

  17. Confirm that smbd is running after the restart.
    $ systemctl is-active smbd
    active
  18. Allow SMB access from the client subnet when UFW is enabled.
    $ sudo ufw allow from 192.168.1.0/24 to any app Samba
    Rules updated

    Replace 192.168.1.0/24 with the LAN or VPN subnet that should reach the share. Avoid opening Samba to all networks on an internet-facing host.

  19. List the exported shares from an allowed client.
    $ smbclient -L //files.example.net -U smbshare
    Password for [WORKGROUP\smbshare]:
    
            Sharename       Type      Comment
            ---------       ----      -------
            print$          Disk      Printer Drivers
            volume1         Disk      GlusterFS volume1
            IPC$            IPC       IPC Service (files.example.net server)
    SMB1 disabled -- no workgroup available

    Replace files.example.net with the Samba gateway hostname or address. The SMB1 disabled line can appear after a successful SMB2 or SMB3 share listing.
    Related: How to browse SMB shares with smbclient

  20. Create and remove a test directory through the SMB share.
    $ smbclient //files.example.net/volume1 -U smbshare
    Password for [WORKGROUP\smbshare]:
    Try "help" to get a list of possible commands.
    smb: \> mkdir smoke-test
    smb: \> ls
      .                                   D        0  Tue Jun 16 09:50:00 2026
      ..                                  D        0  Tue Jun 16 09:45:00 2026
      smoke-test                          D        0  Tue Jun 16 09:50:00 2026
    
                    123530212 blocks of size 1024. 107116992 blocks available
    smb: \> rmdir smoke-test
    smb: \> exit

    Windows clients can connect to the same share as \\files.example.net\volume1 using an SMB account allowed by valid users.