How-to: Upgrade the drive in your Apple TV

While millions thousands of people were enjoying their Apple TVs last night, we decided to take ours apart for some pictures and to upgrade the drive. Seriously, 40 GB is smaller than our iPod and we don't like to have to pick and choose what to sync. While there is little doubt that this will void our warranty, isn't it worth it? We have just updated our process, which is much much faster and no longer requires iPartition, thanks to some comments by Epomymous. We decided to double the size of the HDD from 40 GB to 80 GB; we picked up a new 5400 RPM IDE laptop drive and went to town.
You're going to need a few other items to perform this upgrade -- besides the Apple TV and the new drive, of course. First you'll need a TORX 8 and 10 driver to remove the screws and some spray adhesive to reapply the rubber mat on the bottom of the unit. You will also need either an external 2.5 inch drive enclosure or a USB to IDE adapter like the one shown with a 3.5 inch to 2.5 inch adapter.

You can also use two 2.5 inch to 3.5 inch drive adapters and a computer with dual IDE channels to do a disk to disk copy which would be much faster, but you don't get a backup of the original drive.
First we need to disassemble the Apple TV by peeling off the rubber from the bottom. Start on one corner and peal slowly so you don't tear it. There will be 4 TORX screws, one in each corner; don't remove the other 4 closer to the middle just yet.

After you remove the first four screws, gently pull the bottom away from the top. The hard drive is attached to the bottom so be mindful of the IDE cable.

Fold the bottom cover over so you don't stress the cable and gently pull the IDE cable from the main board of the Apple TV. After you're done admiring the internals, remove those other four screws on the back while holding the hard drive. Finally, unplug the IDE cable from the drive and plug it into your USB adapter.

Now we need to copy the disk -- and while there are probably 100 ways to do this, we are going to show our Linux roots by using our favorite command, "dd."
Sine we are only using one 2.5 inch to 3.5 inch hard drive adapter, first we are going to make a image of the disk onto our internal hard drive, then swap drives to copy the image back to the new disc. This will obviously take twice as long, but also gives us a backup of the original drive. If you have two USB to IDE adapters or a computer with two laptop drive adapters you can do a disk to disk copy which is much faster.
Plug the USB adapter into your Mac. From the Terminal, use diskutil to verify what disc we are working with:
*on Linux use fdisk -l instead*
diskutil list
Look for the disk that looks like this, it will have a partition named OSBoot and Media.

This tells us that the Apple TV drive is disk2 or more specifically. /dev/disk2
The tool we are going to use to copy the disk is dd, which simply means copy the input device to the output device. We are using disk2 for input and an image file in our home directory for the output. Make sure you have enough room for the entire 37GB file. Here is the command we are going to run form the terminal:
dd if=/dev/disk2 of=/Users/Engadget/AppleTV.img bs=1024k
To be clear, this command instructs the system to copy the entire disk, including all the partitions on disk2 to a image file stored at /Users/Engadget/AppleTV.img and the bs=1024k helps speed it along. If you want to only copy the parts of the drive you need add the count=1335 switch like the next command, we left it out despite the copy time so we could have a complete backup image of the original drive.
You should see the following screen when it's completed; unfortunately, there's no progress indicator.

Optional step: If you have a way to connect both drives to the computer at the same time, then use this command instead, assuming that disk2 is the source drive and disk3 is the destination:
dd if=/dev/disk2 count=1335 of=/dev/disk3 bs=1024k
When the image is finished we need to swap the drives and copy the image back to the new, bigger hard disk. Use diskutil again to verify the drive and then this command to start the copy.
** Update ** Now we are only copying the partitions we want, by adding the count= switch. It is much faster to copy 1.4 GB instead of 37 GB.
dd if=/Users/Engadget/AppleTV.img count=1335 of=/dev/disk2 bs=1024k
(If you connected both drives at the same time this step is not necessary.)
Again you will see the output confirming completion.

**Update**
We removed the iPartition steps, they are no longer necessary, now we do it manually and free.
First we eject the disk, we have to do this every time we run gpt or you will get an error.
diskutil eject disk2
Just in case lets try to recover the partition table.
gpt recover disk2
diskutil eject disk2
Then we remove the old Media Partition. (don't remove the wrong one!)
gpt remove -i 4 disk2
diskutil eject disk2
Then find our new start and size.
gpt show disk2
This will return this.
It we look just above the Sec GPT table we will see that the empty space starts at 3141672 and is 74998455 in size so we will use those in our next command.Eject the disk again.
diskutil eject disk2
Then create the new partition, using the info from the last step.
gpt add -b 3141672 -i 4 -t hfs /dev/disk2
Last, we format the drive.
diskutil eraseVolume "Journaled HFS+" Media /dev/disk2s4
Now before we dismount the drive, verify that there are no .Spotlight folders on the partitions by typing this command in the Terminal:
ls -a /Volumes/Media
and
ls -a /Volumes/OSBoot
If there are, then use this command to remove them, but be very careful, this command can delete everything.
sudo rm -rf /Volumes/OSBoot/.Spotlight-V100
or
sudo rm -rf /Volumes/Media/.Spotlight-V100
Now dismount and disconnect the drive and then install it back into your Apple TV.
diskutil eject disk2
It will boot like the first time again and now you should now be able to go into the Apple TV menu and see the size as well as in iTunes.

Stayed tuned as we learn more about what we can make this thing do.






















Your partition table looks perfect, let me know how the format turns out.
Added the recovery step which should help if anything.
Fixed the time I referenced disk1 instead of disk2.
Tested it from the PPC Mac Mini and it works fine.
Not sure why Paul and JNErd are having troubles.
JNerd,
Glad you got it working, thanks for sharing your solution.
I'm still worried about connecting my AppleTV drive to my G5 PowerMac. While some people report that they didn't have a problem, some say that hooking up their drive to a PPC Mac left the drive unbootable:
http://wiki.awkwardtv.org/wiki/Connecting_drive_to_PowerPC_Mac
Would anybody like to venture a guess as to what the PowerMac does to an attached drive that might screw it up? And what one could do to fix it in case that happens?
BTW, I tried to erase and rename the partition using the actual Disk Utility GUI and it hung also. Had to force-quit it. Now I've gotten to the point where I have three partitions, with one of them 110GB of free space. I'm willing to try the next suggestion! (PS... I don't get paid til Friday, so I can't do anything that will cost money til then!)
John,
What version of OS X are you using?
Try deleting the partition and then rebooting your computer before adding it back.
Can't think of anything else other than using iPartition to create the Media partition.
You might try to image the entire disk and skip gpt commands all together. I haven't tested it myself, but others claim that if you image the entire drive, then do a system restore that the Apple TV will expand the partition automatically.
This takes longer, but should still work.
Roger,
I am not sure what they are referring too, but I just tested it again on my PPC Mac Mini running the latest version of 10.4 and didn't have any problems.
OK,
So i finally got it to work.
I followed everything you have written. (although i notice you have changed a few things since i tried it last night) but stopped after:
gpt add -b 3141672 -i 4 -t hfs /dev/disk2
then i unmounted the drive, put it into the AppleTV and it asked if i wanted to do a restore. After the restore it rebooted and i'm now showing 80G in the about screen.
Paul, glad to hear you got it working! So I'd say that if anyone has problems formatting the new partition try letting AppleTV do it (stop after the create partition step in the instructions, eject and plug the HD in to AppleTV).
I'm using 10.4.9 on my MacPro 2.66. The first thing I tried was to image the drive directly and let the AppleTV restore it, but the restore doesn't change the size of the partition.
How long should the eraseVolume command take. (120gb drive). Seems to be taking forever !
It should not take that long.
I don't have a 120GB drive to test with, but you can try to kill it. Then reboot, call the gpt restore command again.
Delete the partition again and recreate it, then try to format it again.
Thanks for the reply. Its been about 30 minutes. Too long ?
Yes, it took less than 5 mins on my 80G drive.
I too had the problem of Freezing when using diskutil erase Volume, so I skipped it. I did all the steps upto and including the add partion, "gpt add -b 3141672 -i 4 -t hfs /dev/disk2", checked for spotlight files on the OS volume. Reinstalled the drive. after boot-up check drive capcity, still read 32G, then did factory restore and when it came back up, 149G
There is a typo in the partition statement (which is why eraseVolume never finishes). In the example given by Engadget, this line:
gpt add -b 3141672 -i 4 -t hfs /dev/disk2
should rather be:
gpt add -b 3141672 -i 4 -s 3141672 -t hfs /dev/disk2
(Notice how they mention the 2 numbers are important, but never seem to use the second number ;-)
Obviously the numbers will vary when you use them, but this solves the problem immediately.
Cheers
A&O
If you don't specify the second number it will simply fill all the free space which is the same as the second number.
Originally I had the second number there, but removed it intentionally to simplify the command.
Are there equivalents to diskutil and gpt in linux? QtPartED ain't cutting it :(
Thanks,
Mike
Just leave out the count= switch and copy the entire disk.
It will take longer, but then you can do a "factory reset" from the Setting menu of the Apple TV and it will automatically expand the space for you.
I really appreciate this forum's help. With your help I've been able to copy my original AppleTV hard drive on to a new 120 GB hard drive. Unfortunately the factory reset option has NOT worked. I'm running Windows and Linux. QTParted hasn't worked for me (has it worked for anyone else?). Any recommendations from the crew on how to capture the free space on the new drive? Linux command lines?
Many thanks,
Mike
It works for me too. (Finally!)
Here is the step:
dd if=/dev/disk1 of=/Volumes/MacBook/AppleTV.img bs=1024k
dd if=/Volumes/MacBook/AppleTV.img of=/dev/disk1 bs=1024k
diskutil list
diskutil eject disk1
gpt recover disk1
diskutil eject disk1
gpt remove -i 4 disk1
diskutil eject disk1
gpt show disk1
diskutil eject disk1
gpt add -b 2732016 -i 4 -t hfs /dev/disk1
diskutil eject disk1
Disconnect HD, connect to AppleTV, and strat it
Starts AppleTV, go "Reset Setting", do "Factory Restore"
Done!
when i use the "gpt show disk2" command it only generates one line where the start is 0 and the size is 78140160. I cannot get it to generate the multiple lines that you have, can you help me with this??
thank you.
Hi Jon,
Your line looks like you have only one partition in your HD. You have to make sure clone your old AppleTV HD to image or directly to new HD (which use the dd command).
Help! Just copying over the drive. If I use count=1335 if finishes in a few seconds and appletv.img is only 1.3mb
How do I copy just the first 1.3 gig without the media partition?
duh! 1024k not 1024
sorry been a long day
Ken,
Thank you for your reply. I did do that. I plugged both drives into my laptop and used the "dd if=/dev/disk2 count=1335 of=/dev/disk3 bs=1024k" command. Any thoughts?
How long should it take for the following command to finish on a 120G drive?
diskutil eraseVolume "Journaled HFS+" Media /dev/disk2s4
Also is diskutil the same as the Disk Utility gui app?
Thanks
ara
Followed the instructions - at the point of "Last, we format the drive":
diskutil eraseVolume "Journaled HFS+" Media /dev/disk1s4
diskutil hangs (and makes the disk unreadable) - nohard disk action - even after several hours. Same results on two different drives, using a 2.33gHz core 2 Duo MacBook Pro, and a 2.0gHz Core Duo iMac.
Disk Utility shows 73.2GB and 147.7GB - confirmed by gpt show disk1 - as size for Media partition.
Disk utility verify results in:
Volume header needs minor repair
The volume Media needs to be repaired
Error: The underlying task reported failure on exit
When repair is executed, Media reverts to 35.8GB
Media size remains 35.8GB rather frustrating - has anyone else encountered this?
Does iPartition fix the problem?
Found the solution at:
http://wiki.awkwardtv.org/wiki/Prepare_a_Hard_Drive
160GB disk now working fine! Next is OSX (with all possible trimmings)
Those are basically the same directions.
What did you do differently when formating the partition that made it work?
Wiped the disk, as directed, then formatted the OSBoot and Media partitions first. Simple - I should have thought of that; instead I tried every other combination imaginable, without success. Needless to say I learned a little about gpt and the terminal on the way, so the time wasn't wasted. I'm sure glad that I didn't give up and purchase iPartition; the command line works just fine.
Although a few others with larger HDD have experienced the same problems, I don't have a drive over 80GB to test with and can't duplicate the issue on the one I have.
Based on others, it appears the issue is due to a problem with the partition table. The wiki recreates the entire GPT table and thus resolves the issue, but in more steps. The only difference when using iPartition is that it can create the GPT partition entry and format the partition, some have used the trial version of iPartition to discover a good size and then manually created it with gpt.
Either way I am glad you figured it out.
Ben
As I posted earlier, I had the same problem with an 80GB and a 160GB drive. I have just verified that the 80GB drive works just as well as the 160. From your comment, it now seems logical to me that when effectively cloning from the OEM drive, that one would of necessity have to recreate the GPT so as to recognize the expanded Media partition; luckily, all the tools required to do so come with the Mac. Thanks for your comments; happy hacking!
Hey, I have the same freeze problem during formatting on my 160GB disk.
Unfortunately I'm still preparing my Apple TV for the new TV which wasn't delivered yet. Therefore I would be very grateful if someone could lead me through the menu, i.e. tell me what exactly I have to press on the remote to get Apple TV go back to factory preset (including language setup, etc. that might come up at the first time).
Thanks in advance, pretzelmonster.
Has anyone had any success doing this from a Windows box?
Thanks in advance!
I'm a novice Terminal user, but am not afraid to dive right in. I performed all the steps to create the disk image and transfer it to the new drive, but when I tried to delete the Media partition it failed, because there was no secondary gpt header. When I execute the gpt show command I get everything listed but the last two items - the secondary gpt table and header. Do I need to reduplicate the original drive? Or is there some other way to get the partition deleted using the terminal?
Try to run the gpt restore command again.
gpt recover disk2
If all else fails re-image the new drive from the image you created, but this time leave out the count=1335
Thanks Ben! The recover worked perfectly. However, I had already begun reimaging the original drive, so I had to wait all day to recover the gpt secondary table and header. At least I didn't have to spend another 8 hours uploading the new image to the new disk.
Hey guys,
Just wanted to post a success story. I bought a 120GB IDE drive off Amazon together with a 2,5" to USB 2.0 converter. I am an OS X rookie and followed the instructions to the letter - worked like a charm first time around!!!
Only setback was that my puny iBook G4 didn't have enough juice on the USB port to drive the new HD - had to run out and buy a USB hub with external power ($19.99 at Target)
Cheers for putting together this, i can now finally sync all my music and photos to the Apple TV unit!!!!
Oh - i might as well add that the whole procedure took less than two hours. I figured i could just keep the old HD as a backup instead of saving the whole original image (which wouldn't fit on my laptop HD anyway - it's only 40GB) so i only copied the first 1.4 gigs to get the OSBOOT partition.
In case anyone wonder, i bought a Western Digital WD 1200VE drive.
What is the purpose of this command:
gpt recover disk#
I have been trying all the steps above but I keep hitting a wall at
diskutil eraseVolume "Journaled HFS+" Media /dev/disk2s4
Every time I try to execute the eraseVolume nothing happens. Hours pass by and the hard drive has no activiy.
I noticed on a previous step that the screen grab and the instructions are different. The following instruction
gpt add -b 3141672 -i 4 -t hfs /dev/disk2
has an additional aparamet of -s 74998455
I tried running the job with the second paramter and it still freezes at the eraseVolume
Any ideas?
Try to do the recover command again.
You can try to put the drive back in and do a restore with the Apple TV.
You can also copy the image back to the drive again, this time leaving out the count= statement which will take longer, but eliminates the need to recreate the partition manually.
Ben thanks for your help.
I will see what I can do with the recover command. But I am able to image back on to the new drive. Even but up to that drive on the apple tv. I just can't make the Media partition larger.
Once I expand that partition to the new spaace and format it - it kills my drive. I can no longer see waht's on the drive. I get the following error:
gpt show: error: bogus map
gpt show: unable to open device '/dev/disk1': No such file or directory.
If you re-image the entire drive and put the drive back in the Apple TV then do a factory restore from within the ATV menu it will expand the drive automatically.
The only reason I don't do it this way in the directions is cause it takes longer to copy 40GB than 1.4GB.
hi
after taking the apple tv apart and hooking up its hard drive to my usb adapter i am unable to access it. the hard drive does not show as an item on ´my computer´.
can anybody explain how i take it from here. i want to make a copy my photo and music on the drive (my desktop has crashed).
thanks,
jan
anyone know where you can get the disk image for the Apple TV?
I want to do the usb boot
Yay, it worked. I put in a Seagate 160GB drive. I'm totally ignorant of UNIX/Linux command line syntax, but I'm still comfortable building machines, messing with BIOS, etc, so I wasn't too worried. I was just super careful on the sudo stuff, lest I destory my entire system! The stupid spotlight exclude list is pretty useless, since by the time you drag the 2 volumes, the invisible spotlight files have already been created, and you can't add them to the list BEFORE they're mounted, soooo...blah. That's ok though, as my last step I deleted the offending files (.Spotlight-V100) on both OSBoot and Media, unmounted and ejected and shut the new drive off. It's booted up and happy, and syncing about 70GB of stuff as I type.
- JonYo
Glad you got it working, thanks for sharing your success story.
I've made it through the instructions on how to copy the factory drive. I'm now ready to prepare the new 160gb drive, but any time I type a command, I get the message "Resource busy" What is happening?