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
fail.
How to Fix a Corrupted wtmpx File

1.

Become superuser.
2.

Change to the /var/adm directory.
3.

Convert the wtmpx file from binary to ASCII format.

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

4.

Edit wtmpx.ascii to delete the corrupted records.
5.

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

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

See fwtmp(1M) for more information.

0 Comments:

Post a Comment

<< Home