Archives / Search ›

Replacing the hard drive in an aluminum iMac

I always buy AppleCare for my laptops—one exception being my Wall Street, an oversight which I soon regretted when the display cable and hinges failed shortly after the warranty expired. Desktops are a different matter—the worst non-drive-related failure I’ve ever had in an Apple desktop has been a blown FireWire port on my desktop G4, though I have luckily avoided some lemons such as the leaky liquid-cooled desktop G5s and iMac G5s with power supply problems. Though my iMac uses a lot of mobile parts, I didn’t think AppleCare was necessary.

While I was away for the holidays, my 24″ iMac (Mid 2007) crashed. This annoyed me a bit at the time, but since OS X’s stability is still not great, I fully expected to come home, hit the power button and have a working machine again.

This didn’t happen. The iMac simply displayed a plain white screen at startup. Pressing the power button while the iMac was in this state immediately turned the machine off. My first thought was what an idiot I was for not getting AppleCare.

Eventually, I discovered that holding down Option for a minute or two would usually bring up the Startup Manager. A couple of times I coaxed the hard drive into booting, which failed while loading boot caches. I was able to boot to a Mac OS X DVD, but Disk Utility hung when I tried to open it.

At this point, I was pretty sure that the drive in my iMac had died. The drive, a 500 GB Western Digital WD5000AAKS, came with the machine and was barely half full at the time, so I wouldn’t have replaced it otherwise. While I’ve dealt with several drive failures on my family’s machines recently, it’s the first drive I’ve had die personally since 2000, when a 12 GB IBM drive on my Wall Street gave up the ghost (and its replacement failed several weeks later when I was on vacation in Sweden, with a horribly loud noise I originally thought was something else).

Thankfully I’d been living on my MacBook Pro for a few weeks, so a dead iMac wasn’t a huge impediment; I moved the big black screen to the dining room table while I waited for a replacement drive to arrive.

In performing the replacement, I found two walkthroughs useful: this one on the MacRumors forums, and this one on AMFITEATAR (a Serbian site, though the walkthrough is in English). Both are thorough and well-illustrated, though not entirely consistent or correct. If you’re doing this yourself, you may find the following a helpful supplement:

I needed only TORX T6 (securing the LVDS connector) and T9 screwdrivers (everywhere else). The AMFITEATAR walkthrough mentions T4 as well, a size I didn’t have in any case.

Two suction cups with attached plastic hooks, placed at opposite corners, were quite adequate for removing the glass; no need for more than that, string, and so forth. (The exact ones I used were InterDesign 17600 “Clear PowerLock Suction Hook”; the 16600 looks similar.)

It’s really not necessary (and rather difficult in any case) to unplug the power connector from the LCD. If you watch the cable extension carefully as you lift the LCD, you can easily rotate it 90° and place it on top of the iMac while you replace the drive.

The MacRumors walkthrough doesn’t mention this, but the easiest way to remove the hard drive (after disconnecting the SATA data and power connectors, removing the thermistor and its taped-down cable) is with the plastic handle. This does require quite a bit of force; the AMFITEATAR site says to “push down”, which will likely not be down if you’ve got the iMac on its back; instead, push towards the base of the iMac, using the aluminum foot as a brace if needed. If you do choose to undo the two TORX screws which attach the drive to the plastic handle before removing it, be careful of the iSight. (It’s still better than the early TiBooks for which the official Apple instructions had you bend a piece of the frame in order to remove the drive…)

The circuit board on the bottom of the Seagate replacement drive I used (750 GB 7200.11) was too large to permit attachment of the thermistor in the same place as on the original WD drive. However, two indentations on the bottom of the Seagate drive were exactly the size of the thermistor clip Apple provided. Hoping this wasn’t a coincidence, I used one of them as an attachment point.

Quite a bit of dust ended up on the LCD while I was working. After reattaching the aluminum front bezel, I stood the iMac up, tilted it past vertical and squirted compressed air on the LCD to shake off the dust. The interior glass accumulated much less dust than the LCD over the same period and required hardly any cleaning.

When replacing the glass, the clear iSight area is useful for determining which end is up.

Good luck!

Repurposing the 3G iPod dock

Since I got a 2G iPod touch, my 30 GB 3G iPod—now on its third battery and with the hard drive replaced with a 4 GB CF card and adapter—has been sitting forlornly in its dock on the desk next to me.
DSC_0698.jpg

Tonight, I was removing the iPod and other unused bits of hardware from my desk when I noticed a replacement “10/15 GB” dock cover in the iPod dock’s box. It’s been so long since I bought it, I had completely forgotten the predecessor to today’s Universal Dock adapters. The cover is plastic, held on by four snaps. When removed, it reveals a metal and plastic frame.

DSC_0705.jpg

The dock that came with the 3G iPod is on the left; the standalone dock is on the right. While the covers are identical save a taped-on “30 GB” label, one looks quite a bit better “naked.”

DSC_0706.jpg

Having not bought a dock for my iPod touch yet, I tried placing it (in a Griffin Reflect case) in the naked 3G dock, and it fit perfectly side-to-side.

DSC_0707.jpg
DSC_0709.jpg

So, while my 3G iPod ambles off into retirement, its docks will see continued use.

NCIDpop 0.9.14

The OS X version of the NCIDpop network caller ID client, originally written by Alexei Kosut, has not seen much development in a while, and had fallen behind the Windows version. In August I added a call history window, network change robustness, localized date formatting and reverse lookup support. NCID’s maintainer has been pretty busy, but he’s now integrated the changes in the official release.

NCIDpop history

And if you’re wondering “why use NCID when I already have caller ID?” If you have SIP service (e.g., Vonage) at home, NCID gives you caller ID on the first ring on every computer display in the place. Since I get pretty frequent calls from people I don’t want to talk to, such as Spanish-speaking bill collectors who won’t take no for an answer, it’s been a great help in reducing my stress when the phone rings.

Building 32-bit OpenJDK on 64-bit Red Hat Enterprise Linux 5.2

In the next few weeks, I’ll be posting some shorter, more technical entries like this one—more related to Linux/Java/Python stuff rather than the Mac, as I’m spending most of my time in that world. As I’ll soon be embarking on dissertation writing, I can use the practice.

Our research machines were recently updated to 64-bit Red Hat Enterprise Linux 5.2. I used this opportunity to get rid of a bunch of locally built software sitting in my home directory, though I still must install my own Python, Emacs and (32-bit) Java.

On the day of the upgrade, everything moved over smoothly, to my surprise. Several weeks passed. Then a few days ago I promptly crashed the machine with OpenJDK on it by trying to reboot it in uniprocessor mode. Nobody’s around to poke the power button and I’m not back for a few weeks, so I have to rebuild all of OpenJDK, not just HotSpot, on another machine. This, like previous adventures building OpenJDK, has not exactly been fun.

Now, OpenJDK doesn’t really do cross-compilation—at least, it’s not well-tested. The best reference I found online was this message from last December, which provides a bizarrely formatted patch (what kind of pathname style is that?). Some files have moved around since then and some newer pieces of OpenJDK doesn’t seem to reference any of the variables set by it. I therefore used a combination of an updated patch and some brute force workarounds to get OpenJDK built.

The following packages provide libraries OpenJDK links against:

glibc-devel.i386
libstdc++-devel.i386
alsa-lib-devel.i386
libXi-devel.i386

You’ll also need a 32-bit bootstrap JDK; I used Sun Java 6 Update 11 installed with JPackage (which required hacking the spec file because the RPM version on RHEL5 doesn’t support architecture specification…).

Finally, I needed to build a 32-bit FreeType 2.3.x, which was a simple

CC="gcc -m32" ./configure --prefix=../freetype; make install

away.

Since I build OpenJDK somewhat often, I defined a shell alias which sets up all the necessary variables:

  njobs=$(( 3 * $(grep -c processor /proc/cpuinfo) / 2 ))
  alias ojmake='LANG=C JAVA_HOME= LD_LIBRARY_PATH= CPPFLAGS= LDFLAGS= '\
'ALT_FREETYPE_LIB_PATH='$SCRATCH'/openjdk/freetype/lib '\
'ALT_FREETYPE_HEADERS_PATH='$SCRATCH'/openjdk/freetype/include '\
'make DEV_ONLY=true BUILD_DEPLOY=false '\
'ALT_PARALLEL_COMPILE_JOBS='$njobs' HOTSPOT_BUILD_JOBS='$njobs

Note I’m mostly sanitizing my environment there so it doesn’t try to link against software installed in my home directory. You’ll need to substitute the paths to the FreeType version you built.

OpenJDK then compiles with this patch and ojmake ARCH_DATA_MODEL=32 CC="gcc -m32" CXX="g++ -m32". The latter two variables should not be necessary, but certain bits of OpenJDK (such as the new FreeType-based font renderer) don’t seem to listen to ARCH_DATA_MODEL=32.

If you get a message such as:

ERROR: FreeType version  2.3.0  or higher is required.
 make[2]: Entering directory `.../openjdk/jdk7/jdk/make/tools/freetypecheck'
Required version of freetype: 2.3.0
Detected freetype headers: 2.3.7
Detected freetype library: 2.2.1
Failed: too old library.

despite the fact that you do have these versions installed, you need to make clean (make sure to do so with the right flags otherwise it’ll just clean the 64-bit object dir!). Otherwise, freetype_versioncheck won’t be rebuilt, instead reporting the same wrong answer.

Bonus: the zsh function I used to generate the patch above from a Mercurial forest.

fdiff() {
  local -a trees
  trees=($(hg ftrees))
  local prefix=${trees[0]}
  for i ("" ${trees/$prefix}) ( # substitution collapses empty items
    cd $prefix/$i
    hg di --no-color | perl -pe 's|( [ab])/|$1'$i'/|g if /^(diff|---|\+\+\+)/'
  )
}

Goodbye, arnold

19:00 = sabi [nicholas@arnold.sabi.net] quit (Quit: goodbye, arnold old friend.)
[...]
overlord% console arnold
Enter njriley@console's password:
[Enter `^Ec?' for help]

arnold console login: nicholas
Password: 
Last login: Sat May 17 22:24:06 from [...]
{nicholas#console@arnold:1025} ~%sudo /usr/sbin/shutdown -i6 -g0 -y      7:21PM

Shutdown started.    Sun May 18 19:21:17 CDT 2008

Changing to init state 6 - please wait
Broadcast Message from root (console) on arnold Sun May 18 19:21:18...
THE SYSTEM arnold IS BEING SHUT DOWN NOW ! ! !
Log off now or risk your files being damaged

{nicholas#console@arnold:1026} ~%                                        7:21PM
INIT: New run level: 6
The system is coming down.  Please wait.
System services are now being stopped.
Killing: 103
Stopping baculafd.
Stopping openvpn.
May 18 19:21:28 arnold openvpn[302]: event_wait : Interrupted system call (code=4)
Waiting for PIDS: 302.
postfix/postfix-script: stopping the Postfix mail system
No screen session found.
May 18 19:21:31 arnold syslogd: going down on signal 15
The system is down.
syncing file systems... done

Today I shut down arnold.sabi.net for good.1 It’s just a computer, but I’m strangely emotional about it.

I first wrote in March 2003 about buying arnold on eBay. A generous friend has been hosting arnold for free at his residence since then—first about a mile away in Champaign, then moving in July 2003 to Virginia where it’s been ever since. It’s served me well with no hardware failures until some ECC errors prodded me into moving the last service (dynamic DNS) off it yesterday.

As I mentioned back in September, I’ve been working on reducing my administrative load. I’m now nearly finished migrating services, but two aging machines—calamity and shrug—remain to be decommissioned.

I’ve mentioned calamity a few times over the years; it predates arnold by a couple of years, having ably served as my parents’ DNS, email, Web, VPN and monitoring server. There’ve been no hardware failures, though I’ve upgraded the hard drives and SCSI card once and switched the backup medium from xfsdump on an external MO drive to the network via Bacula. I moved the email and Web services off a few months ago; when I swap the Mac mini for my old G4 in a few months, I’ll have a slightly newer machine to host its remaining services. (You can see calamity on the right in this photo from May 2006, to the left of hamton, a hand-me-down PC which died before it could be put to any use.)

shrug (which is not a Tiny Toon Adventures character; blame doomsey) is a P3/700 still running FreeBSD 4.11. It hosts my primary email environment, which has had a long and varied history.

In the 90s, I read mail in a bunch of places—some via Eudora and POP, some via Unix mailreaders including pine, mutt and (ex)mh. My accounts included tiac.net, netcom.com, macirc.com, three Brandeis accounts, online service Internet gateways (CompuServe, AOL, eWorld, BIX and Delphi at various times) and some others I’d rather not mention. Over time, I reduced the number of accounts I checked to three, for personal, school and work use. My “forever” personal email address was nriley@shore.net, served by a small ISP in Massachusetts. Mail for school lived on students.uiuc.edu until November 1999, then griffin.canis.uiuc.edu until January 2001.

sabi.net was served starting in mid-1999 by alexandria.invantage.com, an old 486DX2/66 in the corner at my then-employer. (My old reliable USR Courier in that picture was a fallback for our flaky RADSL connection.) At the time I didn’t use sabi.net much for email; my sabi.net mail, what little of it there was, forwarded to my shore.net account. Eventually, Shore.Net got bought and destroyed; I learned the lesson that I should never rely on someone else’s domain name for my email. (Update, July 2009: there’s a happy ending, Shore.Net is back, albeit as a shadow of itself).

Since I was switching labs at the time I didn’t have a server at school to use, but luckily I could borrow Invantage’s new colocated server for a few months. chronos.invantage.com thus became sabi.net’s MX in January 2001. chronos also hosted my first truly consolidated email setup, with procmail and Mutt folder-hooks configured to deliver mail from three accounts into separate inboxes: invantage.com (the mailspool, i.e., !), uiuc.edu (=INBOX) and sabi.net (=+/INBOX). I dumped my Shore.Net account in March and switched sabi.net’s MX to pair.com in August 2001, where it remains. pair is still around, still independent, still conservative and reliable; its CEO still posts in the newsgroups. I plan to keep my account there for the foreseeable future.

With sabi.net’s MX switched, I could finally migrate my email setup from chronos, moving it to theremin.cs.uiuc.edu and finally to shrug.csl.uiuc.edu (later shrug.acm.uiuc.edu) in September 2003. On shrug I added an IMAP server and several generations of spam and virus filtering. I’ll be moving off shrug over the next few weeks to a similar setup where I won’t be the machine’s primary administrator. (shrug was originally like that, too, but its owner graduated and left maintenance to me.)

Planning and executing these migrations is tedious and mind-numbing, so I’m glad they’re coming to a close along with graduate school; I’ll have more time in future to focus on things I really care about. Another good thing about getting rid of machines is that I don’t need to come up with a new naming scheme as I thought I would. My laptops since then have all been named Shirley; my Intel iMac is Mary.

1Actually, runlevel 6 reboots; I’ve still got to wipe the disks.

‹ Newer Posts  •  Older Posts ›