Using logs and pax to fix a broken system

Oct 23, '03 10:30:00AM

Contributed by: Europol

My 4GB system partition was, during four months, mysteriously reaching a space usage of 99% percent, which made my G3 very slow and unstable.

I was experimenting with moving my virtual memory swap file with Swap Cop to another partition, which made it unstable, too. Later - with the help of the du command (which recognizes only directories it has the rights to, and so must evoked after a su root) - I found out that automatically logged error messages were the reason for my space problem.

A cron job I used for keeping my Palm up to date generated an error message which was written to /var -> spool -> clientmqueue. As far as I see, this directory is used to wait for items being sent to the root by sendmail. a rm * released an amount of more than 1GB of free space. So this problem was solved. But my System was still freezing (periodically every 30 minutes). The reason were some files I missed while uninstalling SwapCop's swap partition. Before recognizing this, I tried to fix this problem by installing the OS X 10.2.8 update. But during this installation, my System crashed, and from that moment on, there was no login window at the start.

[robg adds: I haven't tried this myself! It's an interesting story of how to save a potentially fubared system, though. Read the rest of the article for the required repair steps...]

Because I didn“t have my System CDs with me, I had to fix this serious problem some other way. I rebooted in single user mode (hold Command-S during startup, then /sbin/fsck -y ; /sbin/mount -uw / ; automount). I failed getting the command installer -pkg [PACKAGEPATHANDNAME] -target / to install the 10.2.8 update. After doing a good job in recognizing the package, it mysteriously refused to write the config file in the tmp folder and stopped.

So I had to go into detail. In the file var -> log -> system.log, the last documented error before the freezing hinted to the fact that loginwindow had some problem. locate loginwindow.app gave me the path to the loginwindow command. Starting it by hand lead to the message that a file in the AppKit-Framework was missing. I guessed that the Installer was about to update this file when my system crashed. So I had to gunzip manually the Archive.pax.gz file inside the Package. Typing pax -r -f Archive.pax -p /path/to/missing/file extracted the missing file, which I had to then cp to the right place and - WUUP - after hours of stupid trials, another try of loginwindow revealed that the error message had vanished and my system was working again.

Afterwards, I fixed the Swap Cop problem, installed the whole 10.2.8 update package in the GUI, and went to sleep!.

Comments (3)


Mac OS X Hints
http://hints.macworld.com/article.php?story=2003102023453278