HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
cancel
Showing results for 
Search instead for 
Did you mean: 

last command & wtmps

 
SOLVED
Go to solution
CU_1
Occasional Advisor

last command & wtmps

when I run last command it gives me the error meassage:
(Invalid record size. Unable to continue ...)
so, I checked the file size and I found it 7863772, and the size of LV for /var= 6144000!!!! somthing I can't understand.
7 REPLIES
Robert-Jan Goossens
Honored Contributor

Re: last command & wtmps

Hi,

# bdf /var ---> sizes in kilobytes

# ls -l ----> sizes in bytes


Regards,
Robert-Jan
Robert-Jan Goossens
Honored Contributor
Solution

Re: last command & wtmps

Abdul,

Do you need to keep the old information in the wtmp, btmp and wtmps files?

Otherwise zero them.

# cat /dev/null > /var/adm/btmp
etc.

If you want to try to preserve previous bad login attempts, you will need to make use of the 'fwtmp' command:
# /usr/sbin/acct/fwtmp < /var/adm/wtmp > /tmp/wtmp.tmp
# vi /tmp/wtmp.tmp # Clean up records
# /usr/bin/acct/fwtmp -ic < /tmp/wtmp.tmp > /var/adm/wtmp
# rm /tmp/wtmp.tmp
etc.

Regards,
Robert-Jan
CU_1
Occasional Advisor

Re: last command & wtmps

but I still have a problem with (last) command that is read successful comand from /var/adm/wtmps???
Robert-Jan Goossens
Honored Contributor

Re: last command & wtmps

also check the btmp and wtmps files.

# /usr/sbin/acct/fwtmp < /var/adm/btmp > /tmp/btmp.tmp
# vi /tmp/btmp.tmp # Clean up records
# /usr/bin/acct/fwtmp -ic < /tmp/btmp.tmp > /var/adm/btmp
# rm /tmp/btmp.tmp

# /usr/sbin/acct/fwtmp < /var/adm/wtmps > /tmp/wtmps.tmp
# vi /tmp/wtmps.tmp # Clean up records
# /usr/bin/acct/fwtmp -ic < /tmp/wtmps.tmp > /var/adm/wtmp
# rm /tmp/wtmps.tmp
madhuchakkaravarthy
Trusted Contributor

Re: last command & wtmps

Benoy Daniel
Trusted Contributor

Re: last command & wtmps

Looks like your file system and LV size are not same. Verify your LV size and extend file system same as LV.

Re: last command & wtmps

>I checked the file size and I found it 7863772, and the size of LV for /var= 6144000!

There is no connection between the corruption in wtmps(4) and the size of a LV.
See the replies by Robert-Jan and MC.

>Benoy: Looks like your file system and LV size are not same.

I'm not sure why you would think that.