Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

paduck

macrumors 6502
Original poster
Jul 5, 2007
426
0
UPDATE 8/23/09 - The cloning of an ATV hard drive can also be accomplished via Dynaflash's ATV Cloner program. It can be found here:

http://dynaflashtech.net/

Original Article Follows:

A few months ago, I got a 40GB Apple TV from eBay for $60 to put the kids' videos on. It worked great, but the hard drive was too small to store all the videos I wanted on it. I wasn't keen on streaming and don't have my iMac on all the time. Since my Apple TV isn't under warranty, there was no obstacle to doing the upgrade. I took the plunge this weekend and upgraded the hard drive on my Apple TV to 250GB since Microcenter was running a special on the WD Scorpio drive for $90. I did a hybrid installation using suggestions from several web pages. The upgrade went very well, I rebooted, did a factory restore, upgraded to Apple TV v2.2 of the software and resynced everything. Works great!

For those of you who care about the details, here they are:

References:

Engadget "How to Upgrade the Drive in your Apple TV"
http://img.engadget.com/2007/03/23/how-to-upgrade-the-drive-in-your-apple-tv/

Awkwardtv.org "Hard Drive Upgrade Tutorial"
http://wiki.awkwardtv.org/wiki/Prepare_a_Hard_Drive#Preparing_the_partition_table

Waroth.K in the AppleTVHack's Forums
http://appletvhacks.net/forums/viewtopic.php?f=5&t=66#p188

My goal was to reliably do the upgrade without having to wait forever to copy blank data from the 40GB hard drive I had in the Apple TV. It seemed unnecessary to waste time or disk space on that. A review of the available references above seemed to indicate that just copying the EFI and Apple_Recovery partitions from the Apple TV would be sufficient. To be on the safe side, I wanted to make disk images of those two partitions as well. I also had some reservations because there seemed to be an indication in forums and web pages that doing the upgrade using a PowerPC instead of an Intel Mac might be problematic. It turned out not to be.

Equipment:

Apple TV 40GB; Western Digital 250GB 2.5 inch IDE hard drive (WD2500BEVE); i-Connect 3-in-1 USB drive adaptor, 8GB USB keydrive, TORX-8 and TORX-10 screwdrivers, and a G5 iMac.

The plan:

1. Pull the Apple TV original hard drive
2. Copy the EFI and RECOVERY partitions to DMG files on the USB keydrive
3. Properly format and install appropriate partitions onto the new 250GB drive
4. Install the 250GB into the Apple TV
5. Connect and update Apple TV software
6. Sync everything in iTunes onto the Apple TV (approximately 60GB)
7. Store original 40GB Apple TV drive

The Engadget instructions for taking apart the Apple TV are very good and they have nice pictures. So, I had no trouble pulling the drive.

Once I had the drive, I wanted to connect it with minimal chance of corruption to the iMac, so I booted into single-user mode. Unfortunately, the diskutil command wasn't available there, so I rebooted. The had the unfortunate effect of putting copies of Spotlight indexes in my OSBoot partition and Media partitions on my original drive. I deleted them (the Engadget instructions were helpful there), but I'll note it here for everyone's benefit - everything didn't go 100% according to plan, but it all worked out. I probably should have put a utility on my Mac that turned off Spotlight. Still, no harm seems to have been done, although I was very concerned for awhile.

Once I rebooted my Mac from single-user mode, I went straight into the Terminal and got a listing of all the disks. Note that my Apple TV ended up being /dev/disk1 and the USB drive where I wanted to store my disk images was /dev/disk2. The USB disk is called "paul".

Below, Courier font for everything in the Terminal. Bold for what I actually typed in.

Last login: Sat Oct 25 20:40:28 on console
[iMacG5:~] paul% diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: Apple_partition_scheme *232.9 Gi disk0
1: Apple_partition_map 31.5 Ki disk0s1
2: Apple_HFS Macintosh HD 232.8 Gi disk0s3
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *37.3 Gi disk1
1: EFI 34.0 Mi disk1s1
2: Apple_Recovery 400.0 Mi disk1s2
3: Apple_HFS OSBoot 900.0 Mi disk1s3
4: Apple_HFS Media 35.8 Gi disk1s4
/dev/disk2
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *7.5 Gi disk2
1: Apple_HFS paul 7.5 Gi disk2s1

after identifying all the disks, I plotted out my commands on paper first. I started out using the AwkwardTV instructions to make copies of the EFI and Apple_Recovery partitions. AwkwardTV used the "sudo" command to preface every other command. It is unclear to me if this is necessary, but I used it and it worked. Someone who understands Unix a little better can explain whether or not it is redundant. Note that I use the full disk name for my USB keydrive "/Volumes/paul/". According to AwkwardTV, my Apple_Recovery partition should be 419430400 bytes. Mine was actually 419405824. This had be concerned as well, but again, all seems to work in the end.

[iMacG5:~] paul% sudo diskutil unmountDisk /dev/disk1
Unmount of all volumes on disk1 was successful
[iMacG5:~] paul% sudo dd if=/dev/disk1s1 of=/Volumes/paul/efi.dmg bs=1m
34+0 records in
34+0 records out
35651584 bytes transferred in 14.665292 secs (2431018 bytes/sec)
[iMacG5:~] paul% sudo dd if=/dev/disk1s2 of=/Volumes/paul/recovery.dmg bs=1m
399+1 records in
399+1 records out
419405824 bytes transferred in 175.350872 secs (2391809 bytes/sec)

At this point, I ejected the original Apple TV 40GB drive.

[iMacG5:~] paul% diskutil eject disk1
Disk disk1 ejected

Then I added the new, blank, 250GB Western Digital drive. Continuing on with the AwkwardTV instructions, I found that the command "gpt destroy /dev/disk1" didn't take as the drive appears unformatted. Again a little concerning, but I just moved on to the next command which was basically to initialize the disk.

[iMacG5:~] paul% diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: Apple_partition_scheme *232.9 Gi disk0
1: Apple_partition_map 31.5 Ki disk0s1
2: Apple_HFS Macintosh HD 232.8 Gi disk0s3
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: *232.9 Gi disk1
/dev/disk2
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *7.5 Gi disk2
1: Apple_HFS paul 7.5 Gi disk2s1
[iMacG5:~] paul% diskutil unmountDisk /dev/disk1
Unmount of all volumes on disk1 was successful
[iMacG5:~] paul% sudo gpt create /dev/disk1

With a successfully created disk, now was the time to add the partitions. I used AwkwardTV's MacOS 10.5 instructions:

Adding the EFI partition (note, AwkwardTV recommended unmounting the disk before almost every command).

[iMacG5:~] paul% diskutil unmountDisk /dev/disk1
Unmount of all volumes on disk1 was successful
[iMacG5:~] paul% sudo gpt add -b 40 -i 1 -s 69632 -t efi /dev/disk1
/dev/disk1s1 added

Adding the Apple_Recovery partition (I do not know why it has the strange name beginning with "5265636F-")

[iMacG5:~] paul% diskutil unmountDisk /dev/disk1
Unmount of all volumes on disk1 was successful
[iMacG5:~] paul% sudo gpt add -b 69672 -i 2 -s 819200 -t 5265636F-7665-11AA-AA11-00306543ECAC /dev/disk1
/dev/disk1s2 added

Create the OSBoot Partition:

[iMacG5:~] paul% diskutil unmountDisk /dev/disk1
Unmount of all volumes on disk1 was successful
[iMacG5:~] paul% sudo gpt add -b 888872 -i 3 -s 1843200 -t hfs /dev/disk1
/dev/disk1s3 added

Now a little more tricky, create the Media partition. To find out the right numbers to plug in for the appropriate size, you have to take a look at the disk. Note that the two key numbers in the final "gpt" command are in the start and size columns (2732072 and 485665063). Depending on the size of your hard drive, these numbers may be different.

[iMacG5:~] paul% diskutil unmountDisk /dev/disk1
Unmount of all volumes on disk1 was successful
[iMacG5:~] paul% sudo gpt show /dev/disk1
start size index contents
0 1 PMBR
1 1 Pri GPT header
2 32 Pri GPT table
34 6
40 69632 1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
69672 819200 2 GPT part - 5265636F-7665-11AA-AA11-00306543ECAC
888872 1843200 3 GPT part - 48465300-0000-11AA-AA11-00306543ECAC
2732072 485665063
488397135 32 Sec GPT table
488397167 1 Sec GPT header
[iMacG5:~] paul% diskutil unmountDisk /dev/disk1
Unmount of all volumes on disk1 was successful
[iMacG5:~] paul% gpt add -b 2732072 -i 4 -s 485665063 -t hfs /dev/disk1
/dev/disk1s4 added

Now it's time to copy my disk images for the EFI and Apple_Recovery partitions onto the new Apple TV drive. Note that I am putting in the full name of the disk drive they reside on "/Volumes/paul/".

[iMacG5:~] paul% sudo dd if=/Volumes/paul/efi.dmg of=/dev/disk1s1 bs=1m
34+0 records in
34+0 records out
35651584 bytes transferred in 7.474555 secs (4769727 bytes/sec)
[iMacG5:~] paul% sudo dd if=/Volumes/paul/recovery.dmg of=/dev/disk1s2 bs=1m
399+1 records in
399+1 records out
419405824 bytes transferred in 75.162186 secs (5580011 bytes/sec)
[iMacG5:~] paul% diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: Apple_partition_scheme *232.9 Gi disk0
1: Apple_partition_map 31.5 Ki disk0s1
2: Apple_HFS Macintosh HD 232.8 Gi disk0s3
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *232.9 Gi disk1
1: EFI 34.0 Mi disk1s1
2: Apple_Recovery 400.0 Mi disk1s2
3: Apple_HFS 900.0 Mi disk1s3
4: Apple_HFS 231.6 Gi disk1s4
/dev/disk2
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *7.5 Gi disk2
1: Apple_HFS paul 7.5 Gi disk2s1

Now at this point, AwkwardTV says that you are done. I know that I have blank OSBoot and Media partitions, because I just created them from scratch. However, I went ahead and followed Waroth.K's instructions to remove the partitions and put them back on. I'm thinking that this might be redundant. Perhaps the configuration statements below can be simply replace AwkwardTV's partition creation statements? I'm unclear. Doing it twice didn't harm anything though. I'd be interested in other people's thoughts about this.

[iMacG5:~] paul% diskutil eject disk1
Disk disk1 ejected
[iMacG5:~] paul% gpt remove -i 4 disk1
disk1s4 removed
[iMacG5:~] paul% diskutil eject disk1
Disk disk1 ejected
[iMacG5:~] paul% gpt show disk1
start size index contents
0 1 PMBR
1 1 Pri GPT header
2 32 Pri GPT table
34 6
40 69632 1 GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
69672 819200 2 GPT part - 5265636F-7665-11AA-AA11-00306543ECAC
888872 1843200 3 GPT part - 48465300-0000-11AA-AA11-00306543ECAC
2732072 485665063
488397135 32 Sec GPT table
488397167 1 Sec GPT header
[iMacG5:~] paul% diskutil eject disk1
Disk disk1 ejected
[iMacG5:~] paul% gpt add -b 2732072 -i 4 -t hfs /dev/disk1
/dev/disk1s4 added
[iMacG5:~] paul% diskutil eject disk1
Disk disk1 ejected
[iMacG5:~] paul% newfs_hfs -J -v Media /dev/disk1s4
Initialized /dev/rdisk1s4 as a 232 GB HFS Plus volume with a 24576k journal
[iMacG5:~] paul% diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: Apple_partition_scheme *232.9 Gi disk0
1: Apple_partition_map 31.5 Ki disk0s1
2: Apple_HFS Macintosh HD 232.8 Gi disk0s3
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *232.9 Gi disk1
1: EFI 34.0 Mi disk1s1
2: Apple_Recovery 400.0 Mi disk1s2
3: Apple_HFS 900.0 Mi disk1s3
4: Apple_HFS 231.6 Gi disk1s4
/dev/disk2
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *7.5 Gi disk2
1: Apple_HFS paul 7.5 Gi disk2s1
[iMacG5:~] paul% diskutil eject disk1
Disk disk1 ejected
[iMacG5:~] paul%

This is the point where I put the drive back into the Apple TV and rebooted. It asked for a factory restore, which I approved. Then I configured it, downloaded v2.2 of the software (my Apple TV has 1.0 native), and synced everything over ethernet.

I apologize for the long post. I hope there are people out there who find it helpful. I know that I had a lot of reservations about doing this upgrade (mainly worried about bricking my original hard drive), but it turned out to be pretty simple, even if I had a few bumps along the way. The end result, after about four hours of work (mostly syncing) is a 231GB Apple TV with about 60GB of content installed. Total cost was $125 if you include the SATA/IDE adapter ($20) and a set of screwdrivers from Radio Shack ($15). I used a USB keydrive to store the disk images on, but I have subsequently copied them off to my hard drive for safe keeping. With the initial investment of $60 for the Apple TV, I am one very happy customer.
 

spencers

macrumors 68020
Sep 20, 2004
2,381
232
Very nice writeup. Thanks for the time you made to write it!
I plan on doing this soon.
 

paduck

macrumors 6502
Original poster
Jul 5, 2007
426
0
Can you not just take out the drive and Carbon Copy Clone it to the new bigger drive?

It isn't that easy, I don't think. Specifically, the EFI and Restore partitions aren't standard and ATV is extremely tempermental about how it's drive is supposed to look. But I'm not a Unix guru, so I just went with the directions I found on the web. The above instructions are simply the combined instructions from others with appropriate references. The fact that it is tried and proven to work is important - I wasn't trying to break new ground.
 

TheSpaz

macrumors 604
Jun 20, 2005
7,032
1
I just bought my pre-setup 250GB Apple TV Hard Drive from Ebay... the only thing I had to do was put it in. The software was already on it. Hehe.
 

Attachments

  • Picture 2.png
    Picture 2.png
    236.6 KB · Views: 2,348

mavis

macrumors 601
Jul 30, 2007
4,734
1,452
Tokyo, Japan
Hi paduck,

I just wanted to thank you PROFUSELY for this great tutorial - after spending hours following three or four other tuts, I ran across this one and voila! I've got a 250GB Apple TV now. And in a fraction of the time the other methods took.

So, THANK YOU. I appreciate the fact that you took your time to post this. :)
 

tom1971

macrumors 6502a
May 15, 2007
670
0
would this work with any size HDD?

Are you able to add an external drive to the back and view content off of it?

If you refer to an external USB drive - yes. You have to patch your ATV first and you can even sync directly to the external drive with a few commands.
 

mavis

macrumors 601
Jul 30, 2007
4,734
1,452
Tokyo, Japan
If you refer to an external USB drive - yes. You have to patch your ATV first and you can even sync directly to the external drive with a few commands.
Really? I've read that iTunes will still only sync to the Media partition, and that the external drive is only used by Boxee/XBMC etc ...

Anyway, this great tutorial is simple enough (you basically just copy & paste the terminal commands!), fast enough (twenty minutes, tops), and cheap enough (I picked up my 250GB WD Scorpio WD2500BEVE for less than $90) that it makes sense to just do it. :)
 

karlnorling

macrumors newbie
Nov 15, 2008
2
0
Hi Paul and thanks for the awesome guide.

I ran into some bumps as you did when figuring this out. The reason behind my post is that I have one bump left. The factory restore won't work for me, the progress bar goes halfway and then it says that the factory restore has failed.

As I said, I followed your steps. I even took the 250 drive out of the appletv and repeated the steps and plugged it in again, but still, the same thing kept happening.

Worth mentioning is that I bought a new AppleTV, could that have something to do with it? The Scorpio drive is brand new also.

[Edit]
I made a copy of the OSBoot disk1s3 also and put it on the Scorpio drive.
I will see if that helps.
RESULT: No good he.
[/Edit]

[Edit]
After a number of times erasing the drive / destroying the gpt. All I get now is just the Apple logo and when pressing any button on the remote a solid white light. I can hear that the HD is doing something. I can wait like 30 min, same Apple logo.

Should I maybe buy a new Scorpio drive?
[/Edit]

Thanks / Karl
 

paduck

macrumors 6502
Original poster
Jul 5, 2007
426
0
Guys - thanks for the feedback. I am glad someone else found the information useful.

Chris Rogers - This should work with any size hard drive. You just have to be careful at certain points to enter in the unique drive size numbers at the appropriate point. The only real difference will probably be the high-end (signifying the ending blocks), but that is where to watch for any hiccups.

External hard drives - not having done it, I don't want to claim to be an expert, but you can hook up an unpatched external SATA hard drive by using an IDE-SATA converter (which costs about $6). Then the AppleTV will run with the larger hard drive in an unpatched mode. With all external drives, you need to ensure that they spin up before the AppleTV is turned on.

karlnoring - my guess is that you either have Spotlight files copied into your directory or the file partitiions aren't quite the right size. It might help if you boot your Mac into "safe" mode before entering the terminal. Also, verify that you are using the right partition size numbers - there are steps in the above process that you should replace my numbers with the numbers you see on your installation. I doubt the problem is with your Scorpio drive, although that might be a place to start. When you install the original AppleTV drive, does it work? I would have recommended purchasing a used one off eBay if you were planning on modifying it - cheaper and no warranty to kill. Good luck! Let us know how it turns out.
 

Maxwell Smart

macrumors 6502a
Jan 29, 2006
525
0
Thank you SO very much for the clear concise directions. After trying a few different methods and having them bomb each time, this was the best, most straightforward and quickest guide I came across. It worked perfectly with a 160GB upgrade on an original 40GB Apple TV. I couldn't be happier, thanks again.
 

karlnorling

macrumors newbie
Nov 15, 2008
2
0
paduck - thanks for your response. I figured the apple.tv 2.4 would help me but no, I made another efi and recovery image from the org apple drive and yes it still works when I plug it in.

After I went through the process again with the new drive and plug it in, I get a slightly different experience, it keeps rebooting all the time, not going into a recovery mode again, I also tested by putting the OSboot partition from the org drive, it still would reboot it self.

so my conclusion is two things, either Spotlight files, or the apple tv is really cranky about the partitions, I would say the partitions aren't what they should be. I assume it's the efi that's the primary partition that's supposed to start it up.

I also read a interesting fact on AwkwardTV Guide about upgrading HD.

"There is a little bit of voodoo involved in recreating the partitions on the new disk, because of strange behavior of diskutil. The OSBoot and Media partitions must be created and formatted before the EFI and Recovery partitions are on the disk. Otherwise, diskutil gets confused and does some strange things to the partition table. This method should take less than 10 minutes to complete, because only the EFI and Recovery partition are duplicated from the factory disk. The OSBBoot partition and Media get initialized by the Apple TV Factory Restore procedure. "

[Edit]
Didn't work that either. I'm starting to thing that it's the efi.dmg that some what get's corrupted.
[/Edit]
 

funkyp56

macrumors member
Jun 27, 2007
92
33
I was gonna go this but just being able to access my home mac from apple tv is easier plus I only have an 80gb disk to upgrade to. does not seem worth it at this point. read the whole write up though. thanks for posting!
 

TheSpaz

macrumors 604
Jun 20, 2005
7,032
1
The 250GB drive I got from eBay was all set up and ready to go. However, my Apple TV moved very slowly after and often times my thumbnails wouldn't even load. I tried restoring multiple times and nothing seemed to work. I figured it was the drive itself, so I swapped it out with the original 40GB drive it came with and everything is fast and smooth again.
 

mavis

macrumors 601
Jul 30, 2007
4,734
1,452
Tokyo, Japan
Wirelessly posted (iPhone 3G (white): Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_2 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5G77 Safari/525.20)

TheSpaz said:
The 250GB drive I got from eBay was all set up and ready to go. However, my Apple TV moved very slowly after and often times my thumbnails wouldn't even load. I tried restoring multiple times and nothing seemed to work. I figured it was the drive itself, so I swapped it out with the original 40GB drive it came with and everything is fast and smooth again.

Odd. Mine is just fine. It actually should be faster than the default drive because the 250GB drive is 5400RPM, as opposed to the stock drive's 4200RPM. ;)
 

TheSpaz

macrumors 604
Jun 20, 2005
7,032
1
Wirelessly posted (iPhone 3G (white): Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_2 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5G77 Safari/525.20)



Odd. Mine is just fine. It actually should be faster than the default drive because the 250GB drive is 5400RPM, as opposed to the stock drive's 4200RPM. ;)

I think mine is damaged.
 

mavis

macrumors 601
Jul 30, 2007
4,734
1,452
Tokyo, Japan
Wirelessly posted (iPhone 3G (white): Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_2 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5G77 Safari/525.20)

TheSpaz said:
Wirelessly posted (iPhone 3G (white): Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_2 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5G77 Safari/525.20)



Odd. Mine is just fine. It actually should be faster than the default drive because the 250GB drive is 5400RPM, as opposed to the stock drive's 4200RPM. ;)

I think mine is damaged.

Well, this time save yourself some coin and just DIY - this is a great tutorial here, easy to follow and it works perfectly. And if your new drive fails, it'll be under warranty ...
 

chadamorrill

macrumors 6502
Sep 13, 2007
375
146
Orlando, FL
Perfect!

I agree, fantastic tutorial. I will comment on the "not sure this is needed/this sounds redundant" part though. In this section, it appears as if you are formatting the media partition HFS Journaled. This is key. I ejected and unplugged the drive, threw it into the AppleTV only to find that it would boot, but fail on a Factory Restore.

Not being sure why, I threw the drive back into the sled, followed Engadget's instructions to format the OSBoot and Media partitions, only to find that the partition map got screwed up (EFI had changed from disk1s1 to disk1s3, and OSBoot was disk1s2.) I did it twice to see if I had screwed up the commands, only to have the partition map screw up AGAIN, so I'm not sure I did anything wrong. But in the end, I had formatted both the OSBoot and Media partitions for the first time, and I think this is key.

I then deleted all partitions on the disk, and proceeded to rebuild them following these instructions. I then performed the secondary/redundant section as well, threw the drive back into the AppleTV, and factory restored with no problem.

I'm still syncing content, but the thing boots so much faster than when I had the USB hack installed. I'm a VERY happy camper so far. If that changes, I'll let you all know :)

Thanks for the great instructions!
 

jdmstar

macrumors member
Sep 4, 2008
94
0
I just bought my pre-setup 250GB Apple TV Hard Drive from Ebay... the only thing I had to do was put it in. The software was already on it. Hehe.

LOL thanks for the advice.

I priced out the same if i did it myself and it costs 111.00 for parts alone and this is with shipping, minus the time it takes for me to clone a HDD through linux then flash it to the new one.

Rather have a plug and play model for 114.00 on ebay, for extra 2 bucks i save time and headaches lol.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.