Friday, October 21, 2005

Fixing Corrupted Files and wtmpx Errors

Fixing Corrupted Files and wtmpx Errors

Unfortunately, system accounting is not foolproof. Occasionally, a
file becomes corrupted or lost. Some of the files can simply be
ignored or restored from backup. However, certain files must be fixed
to maintain the integrity of system accounting.

The wtmpx files seem to cause the most problems in the daily operation
of the system accounting. When the date is changed manually and the
system is in multiuser mode, a set of date change records is written
into the /var/adm/wtmpx file. The wtmpfix utility is designed to
adjust the time stamps in the wtmp records when a date change is
encountered. However, some combinations of date changes and reboots
slip through the wtmpfix utility and cause the acctcon program to
How to Fix a Corrupted wtmpx File


Become superuser.

Change to the /var/adm directory.

Convert the wtmpx file from binary to ASCII format.

# /usr/lib/acct/fwtmp < wtmpx > wtmpx.ascii


Edit wtmpx.ascii to delete the corrupted records.

Convert the wtmpx.ascii file back to a binary file.

# /usr/lib/acct/fwtmp -ic < wtmpx.ascii > wtmpx

See fwtmp(1M) for more information.


Post a Comment

<< Home