Tag Archives: OS X

Replacing a harddisk in a Mac Mini Server

Behind the scenes, my household network services are provided by a pair of Apple Mac Mini Servers, one for internal services (DNS, DHCP, file sharing, backups) and one for external services (DNS, mail, web hosting, ownCloud). I also have an older Mac Mini attached to my home theatre. I like the Mac Mini’s a lot. They are inexpensive as servers go, draw little power, and are quiet, cheap and reliable.

Apple Mac Mini Server

Apple Mac Mini Server

Sadly, the internal server’s boot disk died a couple of weeks ago. It failed slowly over a couple of hours and thankfully did not corrupt the server’s time machine based backups on its way out. I have prepared for this eventuality by keeping a cold spare  in the form of an older Mac Mini that sits on the shelf, ready to be put into service if one of the active Mac Minis has a problem. So, after an attempt to resuscitate the dying hard disk, I gave up on it and restored the most recent backup of the server onto the cold spare.

The restore process is pretty simple. First, I choose to boot the cold spare from a USB key that I had prepared with a bootable installation image of OS X Mavericks. I used the included script that’s buried in the Maverick install image to create the bootable USB key. The directions for using it can be found from Apple or with a bit more detail from MacWorld. You will need to have either saved, or downloaded the current Mavericks installer before you follow those instructions.

Once the USB key and cold spare are ready to boot, I booted with the “option” key held down and picked the prepared USB key from the list of available boot devices. When restoring a server with more than one disk, you need to do a little bit of extra work to restore the second disk before you start the restoration of the boot disk as detailed in this Apple Knowledge Base article. After restoration, the cold spare booted up without problems. I corrected it’s network settings (it has a USB ethernet connection, long story for another post…), checked that services were running, “inherited” the current time machine backups and my internal services were back in operation.

Next up, I ordered up an SSD to replace the failed disk. SSDs have come a long way in terms of reliability and are well worth the added expense given the marked speed improvement they offer. I chose a Samsung 750GB EVO 840 drive based on the recommendation of the good folks at Mac Mini Colo. I bought the drive from OWC and followed their installation video. The install is indeed “challenging” and took me about 90 minutes.

Mac Mini Disassembled

My Mac Mini disassembled

A word of warning, I ended up doing the disk installation twice due to pulling the wrong drive the first time. If you can, before you remove the dead disk, look at the system with disk utility which will indicate which drive bay (upper or lower) a disk is located in. That would have saved me some time.

The server with the SSD has been running for a few days now without problem and I plan to swap it back into production service, using the same time machine restoration process, this weekend.

Mavericks syslog server configuration

For you OS X server admins out there, the syntax to enable syslogd to act as a syslog server has changed under Mavericks and OS X Server v3.

As before, convert the plist from binary into xml using plutil:

sudo plutil -convert xml1 /System/Library/LaunchDaemons/com.apple.syslogd.plist

The open the plist in your favorite editor and look for <key>Sockets</key>. The \<dict\> block after this key holds the information that used be in the dict block following <key\>NetworkListener</key>, except now the information goes in a sub-block called BSDSystemLogger. The default BSDSystemLogger block looks like this:

<key>BSDSystemLogger</key>
<dict>
        <key>SockPathMode</key>
        <integer>438</integer>
        <key>SockPathName</key>
        <string>/var/run/syslog</string>
        <key>SockType</key>
        <string>dgram</string>
</dict>

This creates a UNIX socket in /var/run. To enable remote logging, we want a network socket on the syslog port. To get that, simply change the above block to this:

<key>BSDSystemLogger</key>
<dict>
        <key>SockType</key>
        <string>dgram</string>
        <key>SockServiceName</key>
        <string>syslog</string>
</dict>

Save the plist. You can re-convert it to binary if you like or just leave it in XML. Unload and reload the plist and syslog will start and accept remote syslog data.