I killed the better part of the weekend trying to upgrade my (first) AppleTV unit from the OEM 40 GB hard drive to a 160 GB drive I had laying around. And while there are a lot of directions on how to do it, none of them quite worked for me. I got all sorts of errors at various stages of the upgrades and partition creations, which led me to write this up. Plus, I’m putting this together for me as a concise guide for when I upgrade my second unit.
What you need:
- AppleTV unit
- Torx key – size 8 – sorry, but they used a torx key instead of an allen key or phillips screws
- An Apple Mac running OS X or later
- Some sort of connector/converter to plug your IDE drives into your Mac (preferrably via USB)
- new 2.5″ E-IDE hard drive
For #2, I got one of these from Micro Center:
http://www.microcenter.com/single_product_results.phtml?product_id=0296591
(it was cheap, everything stored in the handle, and it was green – I like green)
For #4, I got this thing, also from Micro Center:
http://www.microcenter.com/single_product_results.phtml?product_id=0278844
(I’m considering returning it and getting one for $5 more that also handles SATA drives but don’t think I need it)
Now, for taking the unit apart, just have a look here:
http://www.macworld.com/article/57079/2007/03/appletvharddrive.html
These are the initial directions I started with, but to copy the entire, 40 GB partition (where 36 GB of it can be pushed back out again after the install) took a huge amount of time (about 3 hours on a 2.6 Ghz MacBook Pro). Plus, at the very end, I started getting error messages when trying to up-size the 4th (Media) partition.
So after noodling around with this for half the day, I found a shorter set of directions here:
http://www.engadget.com/2007/03/23/how-to-upgrade-the-drive-in-your-apple-tv/
However, they don’t tell you how to restore the 3rd partition properly, and my AppleTV just wouldn’t start up after I did it. I really think its because the 3rd volume has to be called OSBoot but who knows. I didn’t want to ever open up the unit ever again, so I was going to do it right from beginning to end with no errors. Once again, I started from scratch combining what I’d learned and came up with the script outlined below. This script has you copying the first 3 partitions, and then creating the 4th partition with the remaining space.
First off, lets get the old 40 GB drive out of the AppleTV and hook it up to your Mac. Then, open up Terminal and run these commands:
(Everything below assumes the drive is your second drive, disk1 – if its not, then replace the paths accordingly)
# might as well go in and do all this as root - its just too time consuming not to sudo bash # copies the entire disk - this is 'Plan B' and not used again dd if=/dev/disk1 of=/Users/AppleTV-full.dmg bs=1024k # copies just the 3 necessary partitions dd if=/dev/disk1s1 of=/Users/AppleTV-efi.dmg bs=1m dd if=/dev/disk1s2 of=/Users/AppleTV-recovery.dmg bs=1m dd if=/dev/disk1s3 of=/Users/AppleTV-OSBoot.dmg bs=1m # remove original ATV disk diskutil eject disk1
Ok. You now have what you need from the old disk, but don’t format it or throw it in the bin just yet. Make sure everything works before doing anything else with it. Also, you’ll notice the first line makes a full backup. Yes, this takes a huge amount of time, but is worth doing in case something happens, and you need to restore the full thing. I haven’t had to use it, but who knows – its nice to have, and 40 GB is pretty easy to keep around these days.
Onto the new drive, now. This bit took forever to get right, and figure out the quickest way to do this, but it is the only one that didn’t throw ‘gpt bogus map’ errors, unmount unexpected when trying to format the last partition or give me ‘disk not available’ messages. I hope it helps someone out there:
# -----------------------------------------------
# partition by partition restore
# -----------------------------------------------
diskutil unmountDisk /dev/disk1
gpt remove -a /dev/disk1
gpt destroy /dev/disk1
gpt create /dev/disk1
# EFI Partition
diskutil unmountDisk /dev/disk1
gpt add -b 40 -i 1 -s 69632 -t efi /dev/disk1
dd if=/Users/AppleTV-efi.dmg of=/dev/disk1s1 bs=1m
# Apple_Recovery Partition
diskutil unmountDisk /dev/disk1
gpt add -b 69672 -i 2 -s 819200 -t 5265636F-7665-11AA-AA11-00306543ECAC /dev/disk1
dd if=/Users/AppleTV-recovery.dmg of=/dev/disk1s2 bs=1m
# OSBoot Partition
diskutil unmountDisk /dev/disk1
gpt add -b 888872 -i 3 -s 1843200 -t hfs /dev/disk1
dd if=/Users/AppleTV-OSBoot.dmg of=/dev/disk1s3 bs=1m
diskutil unmountDisk /dev/disk1
gpt show /dev/disk1
# get the starting value for the 4th partition from the last command and
# replace it for 2732072 highlighted in green below - this is the starting
# point for the 4th partition and will be specific to the drive you're using
diskutil unmountDisk /dev/disk1
gpt add -b 2732072 -i 4 -t hfs /dev/disk1
diskutil unmountDisk /dev/disk1
newfs_hfs -J -v Media /dev/disk1s4
And that’s it. Put it all back together, plug it in, and wait a good minute for it to boot up. Having done that, you’re all set. Good luck . . .