1847546 Members
3621 Online
110265 Solutions
New Discussion

Re: lastb error

 
deepak_9
Frequent Advisor

lastb error

Hi ,

Getting the following error while trying to execute "lastb" command . Pl suggest a remedy.:-

dbnode:toor-/>lastb
console Thu Jan 1 05:00 pid exceeds MAXPID: wtmp file corrupted
Never Ever give Up !!!!!
7 REPLIES 7
Peter Kloetgen
Esteemed Contributor

Re: lastb error

Hi Deepak,

the message tells you your problem: A corrupted wtmp- file. You could try to fix the problem with the wtmpfix- command. More information in:

man wtmp
man utmp

Do you use ITO/OVO? Then call your support, they made a tool to repair these files....


Allways stay on the bright side of life!

Peter
I'm learning here as well as helping
Stefan Saliba
Trusted Contributor

Re: lastb error

This might be becuase you have a corrupt wtmp file. Check if /var maybe is full.

what I suggest is either try using wtmpfix or else flush the current wtmp. take a copy of the current wtmp say move it to wtmp.old then flush the file using " cat /dev/null > /var/adm/wtmp "

do not delete the file and re-create manually. IT will not work.

to read the contents of the old file i.e. wtmp.old try

#/usr/sbin/acct/fwtmp < /var/adm/wtmp > /tmp/outfile then read the file

Good luck

Stefan

Michael Tully
Honored Contributor

Re: lastb error

Hi,

Have a look at the man page for 'fwtmp'
You have a corrupted wtmp file.

Michael
Anyone for a Mutiny ?
deepak_9
Frequent Advisor

Re: lastb error

Guys,

Have done follwoing things but didn't help.

1] wtmpfix /var/adm/wtmp
2] > /var/adm/wtmp

Still facing the same prob.
Never Ever give Up !!!!!
Andreas Voss
Honored Contributor

Re: lastb error

Hi,

as i know the command lastb refers to /var/adm/btmp (not wtmp).
The error message to wtmp may be wrong.
Try to fix the btmp file.

Regards
Michael Tully
Honored Contributor

Re: lastb error

Do you have any messages in your systemlog
in relation to your 'nproc' not being
able to create new processes.
Anyone for a Mutiny ?
Tor-Arne Nostdal
Trusted Contributor

Re: lastb error

Hi,
I face the same problem on one of our machines.
If I use commands that seems to do a lookup in the wtmp file - it hangs or return an error message.

uptime and w - cause hang
last - cause "pid exceeds MAXPID: wtmp file corrupted"

BTW: when you tried the wtmpfix command, did you tried to output the result into the same file that you tried to fix ...???

Have anyone tried
1) create a fixed copy of wtmp
wtmpfix -c /var/adm/wtmp > /var/adm/wtmp.fix
2) backup the old wtmp
cpio -p /var/adm/wtmp /var/adm/wtmp.old

Then 3a) or 3b)
3a) put the fixed version into wtmp
cp /var/adm/wtmp.fix /var/adm/wtmp

3b) empty the bad versionrm /var/adm/wtmp
cat /dev/null >/var/adm/wtmp

/Tor-Arne
I'm trying to become President of the state I'm in...