Crmgo Blog

CentOS Samba Installation

CentOS Samba Installation

yum install samba My configuration file looks like this: /etc/samba/smb.conf [global] workgroup = WORKGROUP server string = MyServer netbios name = CentOS # socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 # socket options = TCP_NODELAY SO_RCVBUF=16384 SO_SNDBUF=16384 socket options = TCP_NODELAY…

CentOS Samba Installation

yum install samba

My configuration file looks like this:

/etc/samba/smb.conf

[global]
workgroup = WORKGROUP
server string = MyServer
netbios name = CentOS

# socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
# socket options = TCP_NODELAY SO_RCVBUF=16384 SO_SNDBUF=16384
socket options = TCP_NODELAY SO_RCVBUF=32768 SO_SNDBUF=32768
# socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=32768 SO_SNDBUF=32768
# socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=32768 SO_SNDBUF=32768
# socket options = TCP_NODELAY SO_RCVBUF=65536 SO_SNDBUF=65536
# socket options = TCP_NODELAY SO_RCVBUF=131072 SO_SNDBUF=131072

 

# logs split per machine
log file = /var/log/samba/log.%m
# max 50KB per log file, then rotate
max log size = 50

 

security = share
browseable = yes
public = yes
guest account = nobody

load printers = no
show add printer wizard = no
printcap name = /dev/null
disable spoolss = yes

interfaces = lo br0 192.168.0.0/24

[store]
comment = File Store
path = /home/store
browseable = yes
readonly = no
writable = yes
guest only = yes
guest ok = yes
public = yes

I want to draw attention to the socket options = TCP_NODELAY SO_RCVBUF=32768 SO_SNDBUF=32768 parameter. The fact is that I watch Blue-Ray images over the network, which can reach 30GB or more, so if the parameter is not selected correctly or is missing, there may be lagging during video playback, especially for files with the mkv extension. Despite the video lagging, copying from Samba reaches 90-100 MB/s over a gigabit connection. Thus, the socket options parameter needs to be tuned experimentally. After changing the parameter, you need to restart the smb service using the command service smb restart.

Also, lagging during video playback from a Samba share may occur if Samba has been running for a long time without a reboot, so you need to run service smb restart to eliminate the lagging. In general, Samba behaves strangely in this regard; if you don't want such problems, set up NFS instead.

Once the configuration file is in place, you need to add the Samba (smb) and NMB (nmb) services to the startup. In simple terms, the nmb service is needed so that the server is visible in the network neighborhood of other operating systems, such as Windows. Let's set up the startup:

chkconfig smb on
chkconfig nmb on
service smb start
service nmb start

Note: This post may be AI-assisted and then human-edited. Editorial responsibility: Dmytro Lomaka, Kaltenkirchen.