Aimless noise and insights into my little world

Showing posts with label repair jobs. Show all posts
Showing posts with label repair jobs. Show all posts

Monday, November 19, 2007

Fixing a broken update

So I screwed up an update (due to having a full system disk - oops!) and all of a sudden my mac will only boot to a flashing bue screen of doom. Not good. So I did some searching around and found out that:
1. Mac updates aren't rollback-able
2. You can run software update as a CLI tool
3. You can mount and install things from DMG's via CLI tools

Skipping over point 1, here's how I restored my system:

First, I was a bit lucky. I could log in from a remote terminal. I ssh'ed in and looked in /var/log/system.log to see what the hell was going on - seemed that the login window was somehow crashing - nice:

Nov 19 14:15:01 Hilbert crashdump[5914]: loginwindow crashed
Nov 19 14:15:01 Hilbert /System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow: Login Window Application Started
Nov 19 14:15:02 Hilbert crashdump[5914]: crash report written to: /Library/Logs/CrashReporter/loginwindow.crash.log



I was fairly sure that the problem was due to the failed update, so looked for a rollback tool (404 really useful tool not found). I then looked for a way to reinstall that update.

Following this life hack I tried to reinstall the update. Sadly this isn't possible using the softwareupdate tool, but I include it here for completeness - it might be a useful thing to know one day...

Next up I downloaded the DMG of the update from the apple site (wget is so good), mounted it:

hdiutil attach MacOSXUpd10.4.11Intel.dmg


Checked I had the room:

df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/disk0s2 74G 73G 1.1G 99% /
devfs 100K 100K 0B 100% /dev
fdesc 1.0K 1.0K 0B 100% /dev
512K 512K 0B 100% /.vol
automount -nsl [201] 0B 0B 0B 100% /Network
automount -fstab [212] 0B 0B 0B 100% /automount/Servers
automount -static [212] 0B 0B 0B 100% /automount/static
/dev/disk1s3 205M 144M 61M 70% /Volumes/Mac OS X 10.4.11 Update (Intel)


And then set it installing:

sudo installer -pkg MacOSXUpd10.4.11Intel.pkg -target "/"


It seemed to take a while (it took some time with the GUI interface, too, though there I could see a progress bar), but it seemed to do the trick, the update completed and the login ran fine. I rebooted the machine, to finish the update, and after a wait that was a bit to long, everything was back to normal - phew!

Lessons learnt:
1. Never turn off sshd
2. Install Leopard, run regular backups
3. Never install a software update with a full system disk