Rowland Penny
2018-Jul-31 12:35 UTC
[Samba] samba-tool dbcheck "Indexed and full searches both failed"
On Tue, 31 Jul 2018 07:37:38 -0500 Denis Morejon via samba <samba at lists.samba.org> wrote:> Hi: > > I have two samba 4.7.4 DCs. One of them has problems. I can not use > samba-tool on it. Then, when I try to fix It's database It returns: > > ------------------------------------------------------------------------------------------------------------------- > root at zentyal1:/usr/lib/cgi-bin/account_operator# samba-tool dbcheck > --fix > > ltdb: > tdb(/usr/local/samba/private/sam.ldb.d/DC=DTCF,DC=ETECSA,DC=CU.ldb): > tdb_rec_read bad magic 0x434e5355 at offset=35404552 > > ERROR(ldb): uncaught exception - Indexed and full searches both > failed! > > ---------------------------------------------------------------------------------------------------------------------- > > root at zentyal1:/usr/lib/cgi-bin/account_operator# samba-tool dbcheck > --fix --cross-ncs > > ltdb: > tdb(/usr/local/samba/private/sam.ldb.d/DC=DOMAINDNSZONES,DC=DTCF,DC=ETECSA,DC=CU.ldb): > tdb_rec_read bad magic 0xd9fee666 at offset=3187652 > > ERROR(ldb): uncaught exception - Indexed and full searches both > failed! > ----------------------------------------------------------------------------------------------------------------------- > > When I try this in the second DC It returns no error. > > Can I copy these files (/usr/local/samba/private/sam.ldb.d/*) from > the second DC to the first one to solve the corruption ? Should these > files be equals ?NO and NO Whilst most of sam.ldb is the same on each DC, there are differences, some attributes are not replicated between DC's If one of your DC's is running okay, I would demote the faulty one (transferring or seizing any FSMO roles to the good DC). At this point, you can rename the faulty DC, clean out any Samba records and then rejoin it is another DC. Rowland
Rowland Penny
2018-Jul-31 14:54 UTC
[Samba] samba-tool dbcheck "Indexed and full searches both failed"
On Tue, 31 Jul 2018 10:04:37 -0500 Denis Morejon via samba <samba at lists.samba.org> wrote:> > Ok. When renaming DC1 could it keep its IP address? All my clients > have fixed IP configuration (No DHCP) and they are configured to IP1: > DNS1 (DC1) and IP2: DNS2 (DC2). So I need to keep the IP of DC1. Is > It a problem ?This shouldn't be a problem, what has been a problem was using the original DC name.> > Another question: > When you said clean out samba records, what files should I delete? > (/usr/local/samba/private/sam.ldb.d/* ?) > > >Ah, you are using a self compiled Samba, this is even easier, move /usr/local/samba to /usr/local/oldsamba , then run 'make install again. You will get a perfectly new /usr/local/samba again ;-) Rowland
Denis Morejon
2018-Jul-31 15:04 UTC
[Samba] samba-tool dbcheck "Indexed and full searches both failed"
El 31/07/18 a las 07:35, Rowland Penny via samba escribió:> On Tue, 31 Jul 2018 07:37:38 -0500 > Denis Morejon via samba <samba at lists.samba.org> wrote: > >> Hi: >> >> I have two samba 4.7.4 DCs. One of them has problems. I can not use >> samba-tool on it. Then, when I try to fix It's database It returns: >> >> ------------------------------------------------------------------------------------------------------------------- >> root at zentyal1:/usr/lib/cgi-bin/account_operator# samba-tool dbcheck >> --fix >> >> ltdb: >> tdb(/usr/local/samba/private/sam.ldb.d/DC=DTCF,DC=ETECSA,DC=CU.ldb): >> tdb_rec_read bad magic 0x434e5355 at offset=35404552 >> >> ERROR(ldb): uncaught exception - Indexed and full searches both >> failed! >> >> ---------------------------------------------------------------------------------------------------------------------- >> >> root at zentyal1:/usr/lib/cgi-bin/account_operator# samba-tool dbcheck >> --fix --cross-ncs >> >> ltdb: >> tdb(/usr/local/samba/private/sam.ldb.d/DC=DOMAINDNSZONES,DC=DTCF,DC=ETECSA,DC=CU.ldb): >> tdb_rec_read bad magic 0xd9fee666 at offset=3187652 >> >> ERROR(ldb): uncaught exception - Indexed and full searches both >> failed! >> ----------------------------------------------------------------------------------------------------------------------- >> >> When I try this in the second DC It returns no error. >> >> Can I copy these files (/usr/local/samba/private/sam.ldb.d/*) from >> the second DC to the first one to solve the corruption ? Should these >> files be equals ? > NO and NO > > Whilst most of sam.ldb is the same on each DC, there are differences, > some attributes are not replicated between DC's > > If one of your DC's is running okay, I would demote the faulty one > (transferring or seizing any FSMO roles to the good DC). At this point, > you can rename the faulty DC, clean out any Samba records and then > rejoin it is another DC. > > RowlandOk. When renaming DC1 could it keep its IP address? All my clients have fixed IP configuration (No DHCP) and they are configured to IP1: DNS1 (DC1) and IP2: DNS2 (DC2). So I need to keep the IP of DC1. Is It a problem ? Another question: When you said clean out samba records, what files should I delete? (/usr/local/samba/private/sam.ldb.d/* ?)>