[Samba] frequent tdb corruption

Andrew Bartlett abartlet at samba.org
Wed May 15 18:18:20 MDT 2013

On Tue, 2013-05-14 at 10:59 +0100, Adam Thorn wrote:
> Hi,
> I'm seeing regular tdb corruption; typical log messages are:
> tdb(/var/db/samba/sessionid.tdb): tdb_rec_read bad magic 0x42424242 at
> offset=672032
> tdb(/var/db/samba/connections.tdb): tdb_rec_read bad magic 0x0 at
> offset=1111638594
> tdb(/var/db/samba/locking.tdb): tdb_rec_read bad magic 0x42424242 at
> offset=1034396
> which then prevents fileserving from working properly (N.B. the bad
> magic is not limited to those three tdbs). At the moment I'm running
> Samba 3.6.6 on FreeBSD 9.0, but I've seen exactly the same behaviour
> with 3.6.9 and 3.6.13, and also the same behaviour on FreeBSD 9.1 as
> well. I also currently have the tdb-1.2.9,1 FreeBSD port installed at
> present, but have seen the same problem with tdb-1.2.11,1

> I don't think (but have not absolutely conclusively ruled out) that it's
> a hardware problem on the server itself; the samba service (and the
> associated IP addresses) is managed by heartbeat, so I've tried running
> samba on the two nominally identical servers in the HA cluster - I see
> the same problematic behaviour on both nodes. 

Can you please clarify:

 - Is the filesystem on this disk in any way shared?
 - Is the block device involved in any way shared?
 - Has the server ever had a unexpected poweroff?
 - Do Samba processes ever crash?

If the answer is no to all these, then I would strongly suspect a
hardware or OS/kernel issue.  TDB is in general a very reliable
database, and these issues are certainly unexpected. 

Similarly, if the answer is no unexpected poweroff, then the barrier=1
thing is a red herring, that is about data safety on unexpected

Could you put your TDB files on a different file system, to rule in our
out ZFS (or the glue between FreeBSD and ZFS)?


Andrew Bartlett

Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org

More information about the samba mailing list