[Samba] Avoiding constant HDD access

Rowland Penny rpenny at samba.org
Wed Nov 7 10:10:41 UTC 2018


On Wed, 7 Nov 2018 12:46:50 +0300
Albert Berger via samba <samba at lists.samba.org> wrote:

> On Wed, Nov 07, 2018 at 08:54:11AM +0000, Rowland Penny via samba
> wrote:
> > On Wed, 7 Nov 2018 05:45:45 +0300
> > Albert Berger via samba <samba at lists.samba.org> wrote:
> > 
> > > I'm running a Samba server on Raspbian and observing that Samba
> > > during idle periods is constantly (every minute) writing to HDD
> > > (maybe doing some journaling?) what causes the HDD to constantly
> > > spin and never standby:
> > > 
> > > root at rpi:~# pidstat -dl 20
> > > Linux 4.4.50-v7+ (localhost) 	11/07/2018
> > > _armv7l_	(4 CPU) 
> > > 04:10:08 AM   UID  PID   kB_rd/s   kB_wr/s kB_ccwr/s iodelay
> > > Command 04:10:28 AM     0  832      0.00      0.20      0.20
> > > 0  /usr/sbin/smbd -D 
> > > 04:11:08 AM   UID  PID   kB_rd/s   kB_wr/s kB_ccwr/s iodelay
> > > Command 04:11:28 AM     0  832      0.00      0.20      0.20
> > > 0  /usr/sbin/smbd -D 
> > > 04:12:08 AM   UID  PID   kB_rd/s   kB_wr/s kB_ccwr/s iodelay
> > > Command 04:12:28 AM     0  832      0.00      0.20      0.20
> > > 0  /usr/sbin/smbd -D
> > > 
> > > Is there some way (via configuration setting or maybe recompiling
> > > with some parameter) to turn off this constant disk io?
> > > 
> > > /Al
> > > 
> > 
> > At first glance it looks like something is trying to write to a
> > share, but what is unclear from the info provided.
> > 
> > Can you post your smb.conf, without any commented lines and do not
> > try to attach it to the post, all attachments are stripped by the
> > mailing list.
> > 
> > Rowland
> > 
> > -- 
> 
> 
> My smb.cnf:
> 
> [global]
>    workgroup = WORKGROUP
>    server string = Samba Server
>    hosts allow = 192.168.1. 127.
>    printcap name = /dev/null
>    load printers = yes
>    printing = bsd
>    log file = /var/log/samba/%m.log
>    max log size = 1000
>    security = user
>   username level = 6
>   encrypt passwords = yes
>   smb passwd file = /etc/samba/smbpasswd
>   unix password sync = yes
>   passwd program = /usr/bin/passwd %u
>   passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password*
> %n\n *passwd:*all*authentication*tokens*updated*successfully*
> username map = /etc/samba/smbusers include = /etc/samba/smb.conf.%m
>    interfaces = 127.0.0.1/8 192.168.1.0/24
>    local master = no
>    os level = 33
>    domain master = no
>    preferred master = no
>    dns proxy = no 
> 
> [lib]
> path = /mnt/lib
> valid users = al
> write list = al
> read only = no
> available = yes
> browseable = yes
> writable = no
> guest ok = no
> printable = no
> locking = no
> strict locking = no
> directory mask = 0766
> 
> There are four more shares with similar settings.
> 
> When all client machines are disconnected from Samba server, the
> Samba's idle io activity remains the same: disk write every 60
> seconds. If this were a simptom of some failure, shouldn't there have
> remained some trace in the logs? I checked /var/log/samba directory,
> but there are no error reports in the last few days.
> 
> 'smbd --version' returns '4.2.14 - Debian'.
> 
> /Al
> 
> 

There isn't anything really wrong with your smb.conf, except these two
lines in the share:

read only = no
writable = no

'read only' is an inverted synonym for 'writable', the first line says
you can write to the share, but the second says you cannot. decide
which you want and remove the other.

From the output of 'pidstat' you posted, Samba isn't trying to read
anything from the share, but it is trying to write to the share, but
the write is being cancelled, 'writable = no' ?????

Rowland



More information about the samba mailing list