Web lists-archives.com

[Samba] Problem with data base after abnormal shutdown





Hello;
last week the power (energy) of the servers fail and it shutdown all. When the power restart in the check I find that the samba4 AD DC have problems. It work, but the users in some of the container or OU dissapear, I mean, when I check with the RSAT the OU in with the user most be, is empty
 When I try to run # samba-tool dbcheck this is what I have:

[root@gtmad ~]# samba-tool dbcheck
ltdb: tdb(/var/lib/samba/private/sam.ldb.d/DC=GTM,DC=ONAT,DC=GOB,DC=CU.ldb): tdb_rec_read bad magic 0x303038 at offset=2613200

ERROR(ldb): uncaught exception - Indexed and full searches both failed!

File "/usr/lib64/python2.7/site-packages/samba/netcmd/__init__.py", line 176, in _run
    return self.run(*args, **kwargs)
File "/usr/lib64/python2.7/site-packages/samba/netcmd/dbcheck.py", line 157, in run
    controls=controls, attrs=attrs)
File "/usr/lib64/python2.7/site-packages/samba/dbchecker.py", line 188, in check_database res = self.samdb.search(base=DN, scope=scope, attrs=['dn'], controls=controls)

[root@gtmad ~]# samba-tool dbcheck --cross-ncs
ltdb: tdb(/var/lib/samba/private/sam.ldb.d/DC=GTM,DC=ONAT,DC=GOB,DC=CU.ldb): tdb_rec_read bad magic 0x303038 at offset=2613200

ERROR(ldb): uncaught exception - Indexed and full searches both failed!

File "/usr/lib64/python2.7/site-packages/samba/netcmd/__init__.py", line 176, in _run
    return self.run(*args, **kwargs)
File "/usr/lib64/python2.7/site-packages/samba/netcmd/dbcheck.py", line 157, in run
    controls=controls, attrs=attrs)
File "/usr/lib64/python2.7/site-packages/samba/dbchecker.py", line 188, in check_database res = self.samdb.search(base=DN, scope=scope, attrs=['dn'], controls=controls)

[root@gtmad ~]# samba-tool dbcheck --cross-ncs --fix --yes
ltdb: tdb(/var/lib/samba/private/sam.ldb.d/DC=GTM,DC=ONAT,DC=GOB,DC=CU.ldb): tdb_rec_read bad magic 0x303038 at offset=2613200

ERROR(ldb): uncaught exception - Indexed and full searches both failed!

File "/usr/lib64/python2.7/site-packages/samba/netcmd/__init__.py", line 176, in _run
    return self.run(*args, **kwargs)
File "/usr/lib64/python2.7/site-packages/samba/netcmd/dbcheck.py", line 157, in run
    controls=controls, attrs=attrs)
File "/usr/lib64/python2.7/site-packages/samba/dbchecker.py", line 188, in check_database res = self.samdb.search(base=DN, scope=scope, attrs=['dn'], controls=controls)

 Always the same result.

But when I query for some of users that dissapear of the OU with samba-tool user edit this is the result:

[root@gtmad ~]# samba-tool user edit orelvis

dn: CN=Orelvis Caraballo Pileta,OU=juridico,OU=gtm,DC=gtm,DC=onat,DC=gob,DC=cu
objectClass: top
objectClass: person
objectClass: organizationalPerson
objectClass: user
cn: Orelvis Caraballo Pileta
sn: Caraballo Pileta
givenName: Orelvis
instanceType: 4
whenCreated: 20151116213548.0Z
displayName: Orelvis Caraballo Pileta
uSNCreated: 4030
name: Orelvis Caraballo Pileta
objectGUID: d7685d1c-8042-49d4-8d21-3c5b7f43316f
codePage: 0
countryCode: 0
lastLogoff: 0
primaryGroupID: 513
objectSid: S-1-5-21-401494700-3510482446-2017854258-1137
accountExpires: 9223372036854775807
sAMAccountName: orelvis
sAMAccountType: 805306368
userPrincipalName: orelvis@xxxxxxxxxxxxxxx
objectCategory: CN=Person,CN=Schema,CN=Configuration,DC=gtm,DC=onat,DC=gob,DC=
 cu
userAccountControl: 512
memberOf: CN=juridico,OU=juridico,OU=gtm,DC=gtm,DC=onat,DC=gob,DC=cu
memberOf: CN=GFI_ESEC_ImagingDevices_FullAccess,CN=Users,DC=gtm,DC=onat,DC=gob
 ,DC=cu
homeDrive: S:
homeDirectory: \\gtmdato\salva_usuario\orelvis
userWorkstations: p117
pwdLastSet: 131617067116906820
lockoutTime: 0
lastLogonTimestamp: 131650797897292230
whenChanged: 20180309143629.0Z
uSNChanged: 139697
badPasswordTime: 131650927578286600
badPwdCount: 0
lastLogon: 131653371434683940
logonCount: 149623
distinguishedName: CN=Orelvis Caraballo Pileta,OU=juridico,OU=gtm,DC=gtm,DC=on
 at,DC=gob,DC=cu

 As can see, still in OU juridico.

I create again the users that have been dissapear from his container or OU, but the problem with the command still there. Is there something that I can do to solve this? I do well creating the users again?

Rommel Rodriguez Toirac
rommelrt@xxxxxxxx


--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba