Difference between revisions of "Prepare a Hard Drive"

From AwkwardTV
Jump to: navigation, search
m
Line 1: Line 1:
[http://littleangel1.h18.ru/html/whirlpool-mt.htm whirlpool mt 68 al] [http://krazykat1187.freehostia.com/description/www-saver/ www saver it] [http://www.kitten130999.pop3.ru/view/sound-blaster.htm sound blaster x fi] [http://chistovskaya.freehostia.com/topic/telesystem-ricevitore/ telesystem ricevitore satellitare] [http://moniqueleigh.freehostia.com/data/bilancia/ bilancia 97] [http://krazykat1187.freehostia.com/description/fiorello-marenostrum/ fiorello marenostrum] [http://kiwibttrflyt.h18.ru/directory/canzoni-di.htm canzoni di lucio rossi] [http://triniophoeni.h18.ru/calendario-samanta/ calendario samanta de grenet] [http://gealbrig.125mb.com/library/dumanoir.htm dumanoir] [http://timo-kiev.freehostia.com/beach-volley1.htm beach volley bibione] [http://www.terry-a-boot.pop3.ru/content/pescantina/ pescantina] [http://taedward.125mb.com/description/philips/ philips 630] [http://moniqueleigh.freehostia.com/data/configurazione-alcatel/ configurazione alcatel mms] [http://midnightbrave.freehostia.com/totaly-clips/ totaly clips of the heart] [http://hehayfor.125mb.com/styles/xxxcartoon/ xxxcartoon] [http://chistovskaya.freehostia.com/topic/rex-lavastoviglie3/ rex lavastoviglie 45 cm] [http://www.wylt.pop3.ru/seat-ibiza/ seat ibiza 14 signo] [http://cyclique.freehostia.com/content/lingua-latina/ lingua latina] [http://www.fuzps.pop3.ru/content/gioco-online/ gioco online sport invernale] [http://evbailly.125mb.com/cinque-corpi/ cinque corpi senza testa] [http://timo-kiev.freehostia.com/natale-poesie.htm natale poesie] [http://doublename.125mb.com/alex-castelli.htm alex castelli] [http://moniqueleigh.freehostia.com/data/robot-casa/ robot casa] [http://taedward.125mb.com/description/ricetta-cavoletti/ ricetta cavoletti] [http://ruwilhel.125mb.com/resources/nokia-.htm nokia 6600 vivavoce per cellulari] [http://keniff.125mb.com/topic/tanita-bf.htm tanita bf] [http://maross.125mb.com/library/stacchetti.htm stacchetti] [http://keniff.125mb.com/topic/lcd-v.htm lcd 12v dvd] [http://goer.freehostia.com/description/wwwho.htm wwwho] [http://moviemania0.h18.ru/km-golf/ km0 golf 1 9 tdi diesel] [http://keniff.125mb.com/topic/discografia-cristina.htm discografia cristina millian] [http://limepink.h18.ru/small/canon-eos.htm canon eos kit 350d 55 200] [http://goer.freehostia.com/description/gianni-brera.htm gianni brera] [http://www.lemonn-ka.pop3.ru/small/infermiere-puttane/ infermiere puttane] [http://biwittic.125mb.com/sacrifice-di/ sacrifice di elton jhon] [http://www.prairiesky.pop3.ru/view/negozi-sexy/ negozi sexy shop] [http://www.shadowthecatslj.pop3.ru/data/silvex-srl/ silvex srl] [http://reliles.125mb.com/library/logitech-pen.htm logitech pen io] [http://souya.freehostia.com/small/giannarelli.htm giannarelli] [http://evbailly.125mb.com/barcode/ barcode] [http://www.devochek.pop3.ru/directory/km-volkswagen.htm km0 volkswagen passat variant tdi diesel] [http://maross.125mb.com/library/la-societa.htm la societa per freud] [http://www.chaoticidealism.pop3.ru/blog/scuola-provveditorato.htm scuola provveditorato caserta] [http://bachenau.125mb.com/dfi-lanparty.htm dfi lanparty nf4 sli] [http://gor22011978.pop3.ru/articles/googlel/ googlel] [http://timo-kiev.freehostia.com/pajero-pinin.htm pajero pinin 18] [http://bulopipe.125mb.com/web/dietetique-du.htm dietetique du monde] [http://gimaynar.125mb.com/small/bimodale/ bimodale] [http://bulopipe.125mb.com/web/lene-marlin.htm lene marlin lost] [http://suhorne.125mb.com/bosch-/ bosch  kgp 36360] [http://moniqueleigh.freehostia.com/data/camera-montepulciano/ camera montepulciano] [http://krazykat1187.freehostia.com/description/marco-rossi1/ marco rossi picchia duro in video] [http://www.anafema-device.pop3.ru/view/adobe-creative/ adobe creative suite 2] [http://ruwilhel.125mb.com/resources/indesit-ta.htm indesit ta] [http://taedward.125mb.com/description/televisori-al/ televisori al plasma phocus] [http://ruwilhel.125mb.com/resources/witch-doctor.htm witch doctor] [http://souya.freehostia.com/small/canon-digital6.htm canon digital camera] [http://bachenau.125mb.com/finanziaria-.htm finanziaria 2003 mutuo] [http://www.chaoticidealism.pop3.ru/blog/tomi-torres.htm tomi torres] [http://midnightbrave.freehostia.com/spogliarellista-piacenza/ spogliarellista piacenza] [http://reliles.125mb.com/library/bes-beauty.htm bes beauty e science] [http://kalahiet.125mb.com/articles/m-p/ m p benevento] [http://www.tjmclean84.pop3.ru/web/lavatrici-classe/ lavatrici classe aaa] [http://triniophoeni.h18.ru/stampanti-laser/ stampanti laser colore a4 minolta] [http://krazykat1187.freehostia.com/description/www-cartoonnetwork2/ www cartoonnetwork] [http://www.aneta-spb.pop3.ru/blog/risin.htm risin] [http://www.terry-a-boot.pop3.ru/content/bear-shared/ bear shared] [http://www.kitten130999.pop3.ru/view/video-di.htm video di pamela anderson] [http://www.sunny-may.pop3.ru/resources/zurita-raul/ zurita raul] [http://evbailly.125mb.com/carrelli-da/ carrelli da cucina] [http://timo-kiev.freehostia.com/toyota-corolla3.htm toyota corolla benzina] [http://hehayfor.125mb.com/styles/nuove-prove/ nuove prove] [http://midnightbrave.freehostia.com/exalt-cycle/ exalt cycle] [http://moniqueleigh.freehostia.com/data/johnson-decapitacion/ johnson decapitacion] [http://goer.freehostia.com/description/giochi-flash2.htm giochi flash] [http://prihodnaja.pop3.ru/data/www-santafe/ www santafe gob ar] [http://krazykat1187.freehostia.com/description/livi-bacci/ livi bacci] [http://taedward.125mb.com/description/leggero-cellulari/ leggero cellulari samsung] [http://gealbrig.125mb.com/library/brother-mfc.htm brother mfc890] [http://evbailly.125mb.com/mia-hii/ mia hii] [http://timo-kiev.freehostia.com/hotel-desenzano.htm hotel desenzano] [http://www.kitten130999.pop3.ru/view/cape-d.htm cape d ages] [http://cyclique.freehostia.com/content/diosas-desnudas/ diosas desnudas] [http://gealbrig.125mb.com/library/video-acqua.htm video acqua] [http://krazykat1187.freehostia.com/description/amd-athlon41/ amd athlon 64 3200 sk939 tray] [http://cyclique.freehostia.com/content/antolini-luigi/ antolini luigi] [http://ramangel.125mb.com/topic/churg-syndrom.htm churg syndrom] [http://doublename.125mb.com/cordless-dect.htm cordless dect gap siemens] [http://www.teplohead.pop3.ru/description/ricerca-k.htm ricerca k keys astra tv html] [http://timo-kiev.freehostia.com/hombres.htm hombres] [http://limepink.h18.ru/small/toner-minolta.htm toner minolta pagepro 1300w] [http://keniff.125mb.com/topic/neotion-box.htm neotion box 3000] [http://www.rei794.pop3.ru/articles/truble-bubb.htm truble bubb] [http://www.wildhand.pop3.ru/topic/mercedes-provincia.htm mercedes (provincia di san luis)] [http://bachenau.125mb.com/fiat-punto.htm fiat punto turbo] [http://goer.freehostia.com/description/seggiolini-peg.htm seggiolini peg perego] [http://www.nadz0r.pop3.ru/new/festivalbar-/ festivalbar 2004 cagliari] [http://bachenau.125mb.com/nadja-farrag.htm nadja farrag] [http://www.teplohead.pop3.ru/description/socci.htm socci] [http://goer.freehostia.com/description/ateneo-bari.htm ateneo bari] [http://www.startonlineweb.com/help/new/xvjgim.html Cristallo autoveicolo] [http://www.ccrs.uzh.ch/user/root/dknsbd.html Scaricare mp3 gratis] [http://www.ccrs.uzh.ch/user/root/quhtxg.html Provini napoli] [http://www.worthwhilehosting.com/banners/auto/normlo.html Screensaver animati pc] [http://www.worthwhilehosting.com/banners/auto/hmqatk.html Liguria albergo] [http://www.startonlineweb.com/help/new/ajctbt.html Di francia ristorante] [http://www.worthwhilehosting.com/banners/auto/xmptxq.html Cartina stradali europa] [http://www.startonlineweb.com/help/new/xuvhgh.html Beach topless] [http://www.ccrs.uzh.ch/user/root/alvwvv.html Autonoleggio grosseto] [http://www.ccrs.uzh.ch/user/root/qmxfmm.html Guida acquisto portatile] [http://www.worthwhilehosting.com/banners/auto/amengr.html Oroscopo fox cancro] [http://www.ccrs.uzh.ch/user/root/pdimhg.html Piedi e solletico] [http://www.worthwhilehosting.com/banners/auto/tohatg.html Huge black shemale] [http://www.startonlineweb.com/help/new/dijgsw.html Immagine bomboniera cristallo] [http://www.startonlineweb.com/help/new/gxstrm.html Temi nokia n70 gratis] [http://www.worthwhilehosting.com/banners/auto/pxjwuq.html Prestito vibo valentia] [http://www.startonlineweb.com/help/new/scwksj.html Percorsi maturita] [http://www.worthwhilehosting.com/banners/auto/bhjcia.html Forex market] [http://www.ccrs.uzh.ch/user/root/tdnbaj.html Banca popolare intra] [http://www.hiidenkivenpaivakoti.fi/help/new/npfquk.html Manga sfondi] [http://www.hiidenkivenpaivakoti.fi/help/new/xjuewx.html Video divertente] [http://www.startonlineweb.com/help/new/wmqdci.html Napoli albergo] [http://www.ccrs.uzh.ch/user/root/kuujwm.html Stradario saronno] [http://www.hiidenkivenpaivakoti.fi/help/new/dcsuls.html Video gratis culi] [http://www.hiidenkivenpaivakoti.fi/help/new/pwmdkw.html Hotel volo tunisia] [http://www.startonlineweb.com/help/new/degtmf.html Ragazze nude in spiaggia] [http://www.startonlineweb.com/help/new/wqmldx.html Sesso cavallo] [http://www.startonlineweb.com/help/new/oxuhel.html Lavoretti per bambini] [http://www.ccrs.uzh.ch/user/root/dxjxsk.html Madonna di fatima] [http://www.startonlineweb.com/help/new/cujqgr.html Www mature it] [http://www.hiidenkivenpaivakoti.fi/help/new/tdnkrt.html Figa depilata] [http://www.startonlineweb.com/help/new/sxttwo.html Confessioni incestuose] [http://www.ccrs.uzh.ch/user/root/klpxpb.html Albergo austin] [http://www.ccrs.uzh.ch/user/root/xrljuj.html Albergo bali] [http://www.worthwhilehosting.com/banners/auto/wlrwhe.html Software gestionale] [http://www.worthwhilehosting.com/banners/auto/uinipl.html Damien rice] [http://www.ccrs.uzh.ch/user/root/bfbmdf.html Gay muscolosi] [http://www.ccrs.uzh.ch/user/root/delbpo.html Casalinghe tettone] [http://www.startonlineweb.com/help/new/tailal.html Foto troie vecchie] [http://www.startonlineweb.com/help/new/rfmueg.html Fotoracconti] [http://www.ccrs.uzh.ch/user/root/xmsncv.html Sesso trans] [http://www.startonlineweb.com/help/new/gecmqk.html Automobile insurance] [http://www.worthwhilehosting.com/banners/auto/tafhtr.html Creare sito web] [http://www.ccrs.uzh.ch/user/root/vvukui.html Scaffale acciaio inox napoli] [http://www.startonlineweb.com/help/new/dgkxma.html racconti perversi] [http://www.ccrs.uzh.ch/user/root/txdtqn.html Prestito agrigento personale] [http://www.worthwhilehosting.com/banners/auto/wsdohn.html Little pussy japan] [http://www.worthwhilehosting.com/banners/auto/aqcsrn.html Siracusa hotel] [http://www.ccrs.uzh.ch/user/root/lefmwb.html Fastwebnet e mail] [http://www.worthwhilehosting.com/banners/auto/ldqxhu.html Guns n roses] [http://www.hiidenkivenpaivakoti.fi/help/new/mxsous.html Gabbiano] [http://www.ccrs.uzh.ch/user/root/cjdmsa.html Diciottenne bella coscia gratis] [http://www.worthwhilehosting.com/banners/auto/wbnmhw.html Adolescenti porno] [http://www.worthwhilehosting.com/banners/auto/jenmvw.html Casalinghe mature] [http://www.hiidenkivenpaivakoti.fi/help/new/pvbgmt.html Testo spartito musicale] [http://www.ccrs.uzh.ch/user/root/nhongn.html Corsi universitari distanza] [http://www.startonlineweb.com/help/new/fvemdd.html Servizi di animazione turistica] [http://www.ccrs.uzh.ch/user/root/vqmjua.html Skiathos] [http://www.startonlineweb.com/help/new/bjwnnt.html Dalida 1996 perugia] [http://www.worthwhilehosting.com/banners/auto/vjftwt.html Lanterna] [http://www.worthwhilehosting.com/banners/auto/tpghlf.html Ristorante tizzano val parma] [http://www.startonlineweb.com/help/new/gedcrk.html Sydney shopping] [http://www.ccrs.uzh.ch/user/root/hxgvuv.html Hotel sacramento] [http://www.startonlineweb.com/help/new/cekerp.html Fotomontaggio] [http://www.hiidenkivenpaivakoti.fi/help/new/wixocn.html Giochi sexy online] [http://www.ccrs.uzh.ch/user/root/heitaa.html Nere bellissime] [http://www.startonlineweb.com/help/new/tioegh.html Tatuaggi scritte] [http://www.worthwhilehosting.com/banners/auto/hkxjus.html Calcolo imposte 2007] [http://www.hiidenkivenpaivakoti.fi/help/new/eiuqqx.html Sistema sicurezza internet software] [http://www.ccrs.uzh.ch/user/root/jrtuig.html Spam blocker free] [http://www.startonlineweb.com/help/new/urdckp.html Tushy doctor] [http://www.worthwhilehosting.com/banners/auto/rhawnv.html Fumetti sexi] [http://www.hiidenkivenpaivakoti.fi/help/new/uodeus.html Casa prefabbricata legno puglia] [http://www.ccrs.uzh.ch/user/root/ohanec.html Maria swan video] [http://www.ccrs.uzh.ch/user/root/olprhh.html Chichi] [http://www.startonlineweb.com/help/new/buceak.html Fidanzate nude] [http://www.worthwhilehosting.com/banners/auto/wpfrot.html Clipart gratis bambino] [http://www.worthwhilehosting.com/banners/auto/mgufbp.html Tweety bird] [http://www.worthwhilehosting.com/banners/auto/hoqrad.html Matita] [http://www.startonlineweb.com/help/new/fqjhwc.html Disegni angeli] [http://www.startonlineweb.com/help/new/idafoe.html Ospedale santo spirito] [http://www.ccrs.uzh.ch/user/root/lwtwbp.html Manuali telefonino samsung] [http://www.worthwhilehosting.com/banners/auto/gjnrlb.html Porco] [http://www.startonlineweb.com/help/new/vtagig.html Annuncio affitto toscana] [http://www.hiidenkivenpaivakoti.fi/help/new/areuaw.html Susanna torretta nuda] [http://www.startonlineweb.com/help/new/pniouf.html Comitato ligure fisi] [http://www.startonlineweb.com/help/new/iglhsh.html Autoreggenti] [http://www.startonlineweb.com/help/new/snrmru.html C18 porno] [http://www.startonlineweb.com/help/new/ubepnu.html Satellite spia] [http://www.worthwhilehosting.com/banners/auto/iqhjpd.html Casa decorazione] [http://www.startonlineweb.com/help/new/nphdkv.html Matura black ass] [http://www.startonlineweb.com/help/new/hhomnh.html Testi toro amos] [http://www.startonlineweb.com/help/new/agbjev.html Maglia calcetto] [http://www.startonlineweb.com/help/new/qsxmhv.html Lussino] [http://www.worthwhilehosting.com/banners/auto/gnfopt.html Edenviaggi it] [http://www.startonlineweb.com/help/new/sowekx.html Hotel milan] [http://www.startonlineweb.com/help/new/lthrkc.html Jessica rabbit midi] [http://www.hiidenkivenpaivakoti.fi/help/new/hagdjj.html Orologio tudor usato] [http://www.worthwhilehosting.com/banners/auto/udmlbm.html Www sborra in faccia it] [http://www.worthwhilehosting.com/banners/auto/awbqsq.html Www thehun com] == Overview==
+
== Overview==
  
These instructions will guide you through the preparation of a new hard di
+
These instructions will guide you through the preparation of a new hard disk to replace the factory disk in the Apple TV.  When complete, the newly prepared disk will be identical to a factory disk but with a larger Media partition.  Please refer to other articles for other hacks.
5A8
 
sk to replace the factory disk in the Apple TV.  When complete, the newly prepared disk will be identical to a factory disk but with a larger Media partition.  Please refer to other articles for other hacks.
 
  
 
'''''Remark:''''' There are several methods to add a new (larger) hard disk around. Some users found the method described here (doing a factory restore in the end) the only one of the command line based methods to work with large drives (larger than approx. 80 GB). You find out that you have a problem with other methods at the moment when formatting a partition takes longer than minutes ;-)
 
'''''Remark:''''' There are several methods to add a new (larger) hard disk around. Some users found the method described here (doing a factory restore in the end) the only one of the command line based methods to work with large drives (larger than approx. 80 GB). You find out that you have a problem with other methods at the moment when formatting a partition takes longer than minutes ;-)
Line 20: Line 18:
 
== Requirements ==
 
== Requirements ==
  
The instructions have only been tested on an Intel-based Macintosh under  
+
The instructions have only been tested on an Intel-based Macintosh under Mac OS X.  They could work on a PowerPC-based machine, with OS X 10.4.6 or higher where "gpt," the GUID Partition Table tools can be found. Other BSD-like operating systems might also be used, but the ingredients will have to be suitably modified.  This article assumes that you have successfully removed the factory disk from the Apple TV and that you have the necessary hardware, e.g. a 2.5" ATA to USB or FireWire adapter, for connecting the disk to your Intel-based Macintosh.
5A8
 
Mac OS X.  They could work on a PowerPC-based machine, with OS X 10.4.6 or higher where "gpt," the GUID Partition Table tools can be found. Other BSD-like operating systems might also be used, but the ingredients will have to be suitably modified.  This article assumes that you have successfully removed the factory disk from the Apple TV and that you have the necessary hardware, e.g. a 2.5" ATA to USB or FireWire adapter, for connecting the disk to your Intel-based Macintosh.
 
  
 
'''We will assume that when the disk is connected to your computer, it is associated with device node: /dev/disk2.  Remeber to replace /dev/disk2 with the appropariate device node!'''
 
'''We will assume that when the disk is connected to your computer, it is associated with device node: /dev/disk2.  Remeber to replace /dev/disk2 with the appropariate device node!'''
Line 29: Line 25:
  
 
=== Compatible Drives ===
 
=== Compatible Drives ===
The orginal Apple TV drive is a [http://www.fel.fujitsu.com/home/v3__product.asp?pid=531
+
The orginal Apple TV drive is a [http://www.fel.fujitsu.com/home/v3__product.asp?pid=531&inf=fsp&wg=13 FUJITSU MHW2040AT]
 +
, a parallel ATA (PATA) drive. The highest capacity PATA currently on the market is 160GB.
 +
 
 +
Your Options:
 +
{| class="wikitable"
 +
|-
 +
! Name !! Works
 +
|-
 +
||160 GB Samsung Harddrive (Samsung SpinPoint HM160JC)||Yes
 +
|-
 +
||Hitachi [[http://www.hitachigst.com/hdd/support/5k160/5k160.htm HTS541616J9AT00]]|| Yes
 +
|-
 +
||Hitachi Travelstar 4K120||??
 +
|-
 +
||Seagate ST9160821A||??
 +
|}
 +
 
 +
Note by mail-now for Samsung 160GB drive: You will need to create the partitions on the new drive and then use Mac OS 10.4.6 or later to resize the Media partition (shows up as only 70 GB) to maximum size and THEN dd the image files. The rest works perfectly. Finally, you will get 144GB of Media.
 +
 
 +
== Acquiring the necessary images ==
 +
The factory disk should be connected to your computer and located at device node <tt>/dev/disk2</tt>.  You will need a copy of the EFI image and the recovery partition from the factory disk.  They are located on partitions 1 and 2 of the factory disk, respectively.  You can copy them with <tt>dd</tt> by entering these commands into the command prompt:
 +
 
 +
<pre>
 +
diskutil unmountDisk /dev/disk2
 +
dd if=/dev/disk2s1 of=efi.dmg bs=1m
 +
dd if=/dev/disk2s2 of=recovery.dmg bs=1m
 +
</pre>
 +
 
 +
The unmount is there to make sure that the HFS+ partitions on the factory disk are not mounted.  These commands may take a few minutes to complete.  You can check on the status of <tt>dd</tt> while it is running by pressing Ctrl-T.  The <tt>bs=1m</tt> option is not strictly necessary, but it helps speed things up. 
 +
 
 +
When the commands have completed, the resulting files should be 35651584 bytes (about 34MB) and 419430400 bytes (about 400MB).  You may now disconnect the factory disk.
 +
 
 +
== Optional: Acquiring EFI and Recovery images without removing the hard drive ==
 +
 
 +
If you have the ability to <tt>ssh</tt> into the ATV, the EFI and Recovery images may be generated entirely within the ATV, then copied to your desktop computer.  This allows the new hard drive to be prepared in advance so that the hard drive upgrade process becomes a simple swap out.  To get started, first <tt>ssh</tt> into the ATV, then type <tt>diskutil list</tt>.  This is not strictly necessary but does help ensure a uniform starting point.  You should get the following results:
 +
 
 +
<pre>
 +
/dev/disk0
 +
  #:                  type name              size      identifier
 +
  0:  GUID_partition_scheme                    *37.3 GB  disk0
 +
  1:                    EFI                    34.0 MB  disk0s1
 +
  2:        Apple_Recovery                    400.0 MB  disk0s2
 +
  3:              Apple_HFS OSBoot            900.0 MB  disk0s3
 +
  4:              Apple_HFS Media              35.8 GB  disk0s4
 +
</pre>
 +
 
 +
Then type the following commands to generate the disk images in your <tt>/Users/frontrow/Documents</tt> directory.  It is not necessary to unmount the drive since the two partitions you are copying have never been mounted to begin with.
 +
 
 +
<pre>
 +
dd if=/dev/disk0s1 of=/Users/frontrow/Documents/efi.dmg bs=1m
 +
dd if=/dev/disk0s2 of=/Users/frontrow/Documents/recovery.dmg bs=1m
 +
</pre>
 +
 
 +
Finally, copy the two images to your desktop computer with the following commands and proceed as below.
 +
 
 +
<pre>
 +
scp /Users/frontrow/Documents/efi.dmg yourusername@youraddress:/efi.dmg
 +
scp /Users/frontrow/Documents/recovery.dmg yourusername@youraddress:/recovery.dmg
 +
</pre>
 +
 
 +
== Optional: Hacking the Recovery Image ==
 +
 
 +
The recovery.img file can be mounted like any other disk image.  Inside, you will find OS.dmg.  This is the factory image of the OSBoot partition.  Eventually, this image will be written to your new disk.  You can modify it at this point if you'd like.
 +
 
 +
== Preparing the partition table ==
 +
Connect the new disk.  Again, the instructions assume that it is associated with device node: <tt>/dev/disk2</tt>.  If this disk was previously non-empty, make sure that no volumes on the disk are mounted.
 +
 
 +
We will now erase any existing partition table on the disk and create a new GUID partition table using the command <tt>gpt</tt>.  The command will fail if any volumes on the disk are mounted, so make sure you unmount them.
 +
 
 +
<pre>
 +
gpt destroy /dev/disk2
 +
gpt create /dev/disk2
 +
</pre>
 +
 
 +
=== Adding the OSBoot and Media partitions ===
 +
The OSBoot and Media partitions have to be added and formatted first, otherwise diskutil gets confused by the EFI and Recovery partitions.
 +
 
 +
First add the OSBoot partition.
 +
<pre>
 +
gpt add -b 888872 -i 3 -s 1843200 -t hfs /dev/disk2
 +
</pre>
 +
 
 +
Now we can determine the size of the Media partition.
 +
<pre>
 +
gpt show /dev/disk2
 +
</pre>
 +
 
 +
The output of the command should look something like this:
 +
<pre>
 +
      start      size  index  contents
 +
          0          1        PMBR
 +
          1          1        Pri GPT header
 +
          2        32        Pri GPT table
 +
        34    888838       
 +
    888872    1843200      3  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
 +
    2732072  153569383       
 +
  156301455        32        Sec GPT table
 +
  156301487          1        Sec GPT header
 +
</pre>
 +
 
 +
The important part is the line above <tt>Sec GPT table</tt>:
 +
<pre>
 +
    2732072  153569383       
 +
</pre>
 +
This is where the Media partition will go.  Create the Media partition with the following command, replacing START and SIZE with the two numbers above:
 +
 
 +
<pre>
 +
gpt add -b START -i 4 -s SIZE -t hfs /dev/disk2
 +
</pre>
 +
Again, Finder will complain to you that the disk is unitialized.  Ignore the warning.
 +
 
 +
== Formatting the HFS+ partitions ==
 +
We will now format (erase) the HFS+ partitions and then unmount them:
 +
 
 +
<pre>
 +
diskutil eraseVolume "Journaled HFS+" OSBoot /dev/disk2s3
 +
diskutil eraseVolume "Journaled HFS+" Media /dev/disk2s4
 +
diskutil unmountDisk /dev/disk2
 +
</pre>
 +
 
 +
== Creating and writing the EFI and Recovery partitions ==
 +
Now we can add EFI and Recovery partitions.  First, add the EFI partition:
 +
<pre>
 +
gpt add -b 40 -i 1 -s 69632 -t efi /dev/disk2
 +
</pre>
 +
After the command completes, Finder will automount the OSBoot and Media partitions.  Unmount them.
 +
<pre>
 +
diskutil unmountDisk /dev/disk2
 +
</pre>
 +
 
 +
Now add the Recovery partition:
 +
<pre>
 +
gpt add -b 69672 -i 2 -s 819200 -t 5265636F-7665-11AA-AA11-00306543ECAC /dev/disk2
 +
</pre>
 +
Again, after Finder automounts the OSBoot and Media partitions, unmount them.
 +
<pre>
 +
diskutil unmountDisk /dev/disk2
 +
</pre>
 +
 
 +
The final step is to write the EFI and Recovery images that you copied from the factory disk to the new disk.
 +
<pre>
 +
dd if=efi.dmg of=/dev/disk2s1 bs=1m
 +
dd if=recovery.dmg of=/dev/disk2s2 bs=1m
 +
</pre>
 +
 
 +
You may now disconnect the disk (but make sure you have ejected/unmounted it first).
 +
 
 +
== Apple TV Factory Restore ==
 +
Connect the new disk to the Apple TV and power it up.  The Apple TV should now boot up from the new disk.  After a minute or so, you should be asked to choose a language and then presented with the "Apple TV Recovery" screen.  Go ahead and do the factory restore.  This will initialize the OSBoot partition with the original factory image.  Your Apple TV is now identical to the factory version, but with a larger Media partition.
 +
 
 +
== Simpler Alternative Method ==
 +
There is an alternative method where you duplicate the partitions you need with one command and then copy them to the new disk, then complete the preparation with the Apple TV Factory Restore. 
 +
To duplicate the factory disk, connect it to your computer and execute:
 +
<pre>
 +
dd if=/dev/disk2 of=appletv.dmg bs=1m
 +
</pre>
 +
This command may take several hours to complete, depending on the speed of the interface between your computer and the disk.  Now disconnect the factory disk and connect your new disk.  Write the image of the factory disk:
 +
<pre>
 +
dd if=appletv.dmg of=/dev/disk2 bs=1m
 +
</pre>
 +
This command may take several hours to complete, depending on the speed of the interface between your computer and the disk.  Once it completes, disconnect the disk and follow the instructions above under [[#Apple TV Factory Restore]].
 +
 
 +
== External Links ==
 +
GUID Partition Table (GPT) details at Wikipedia
 +
[http://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs]
 +
 
 +
[[Category:How-to]]

Revision as of 23:24, 21 September 2007

Overview

These instructions will guide you through the preparation of a new hard disk to replace the factory disk in the Apple TV. When complete, the newly prepared disk will be identical to a factory disk but with a larger Media partition. Please refer to other articles for other hacks.

Remark: There are several methods to add a new (larger) hard disk around. Some users found the method described here (doing a factory restore in the end) the only one of the command line based methods to work with large drives (larger than approx. 80 GB). You find out that you have a problem with other methods at the moment when formatting a partition takes longer than minutes ;-)

The Apple TV factory disk consists of four partitions:

  1. EFI
  2. Recovery
  3. OSBoot
  4. Media

There is a little bit of voodoo involved in recreating them 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.

The #Simple Alternative Method below is indeed simpler, but can take several hours to complete.

Requirements

The instructions have only been tested on an Intel-based Macintosh under Mac OS X. They could work on a PowerPC-based machine, with OS X 10.4.6 or higher where "gpt," the GUID Partition Table tools can be found. Other BSD-like operating systems might also be used, but the ingredients will have to be suitably modified. This article assumes that you have successfully removed the factory disk from the Apple TV and that you have the necessary hardware, e.g. a 2.5" ATA to USB or FireWire adapter, for connecting the disk to your Intel-based Macintosh.

We will assume that when the disk is connected to your computer, it is associated with device node: /dev/disk2. Remeber to replace /dev/disk2 with the appropariate device node!

While executing the gpt commands below, OS X may try to mount the volumes on the disk. You can safely click "Ignore" if Finder complains to you about an uninitialized disk. If it is able to mount the volume, make sure to eject it before continuing, otherwise gpt will not be able to access the disk.

Compatible Drives

The orginal Apple TV drive is a FUJITSU MHW2040AT , a parallel ATA (PATA) drive. The highest capacity PATA currently on the market is 160GB.

Your Options:

Name Works
160 GB Samsung Harddrive (Samsung SpinPoint HM160JC) Yes
Hitachi [HTS541616J9AT00] Yes
Hitachi Travelstar 4K120 ??
Seagate ST9160821A ??

Note by mail-now for Samsung 160GB drive: You will need to create the partitions on the new drive and then use Mac OS 10.4.6 or later to resize the Media partition (shows up as only 70 GB) to maximum size and THEN dd the image files. The rest works perfectly. Finally, you will get 144GB of Media.

Acquiring the necessary images

The factory disk should be connected to your computer and located at device node /dev/disk2. You will need a copy of the EFI image and the recovery partition from the factory disk. They are located on partitions 1 and 2 of the factory disk, respectively. You can copy them with dd by entering these commands into the command prompt:

diskutil unmountDisk /dev/disk2
dd if=/dev/disk2s1 of=efi.dmg bs=1m
dd if=/dev/disk2s2 of=recovery.dmg bs=1m

The unmount is there to make sure that the HFS+ partitions on the factory disk are not mounted. These commands may take a few minutes to complete. You can check on the status of dd while it is running by pressing Ctrl-T. The bs=1m option is not strictly necessary, but it helps speed things up.

When the commands have completed, the resulting files should be 35651584 bytes (about 34MB) and 419430400 bytes (about 400MB). You may now disconnect the factory disk.

Optional: Acquiring EFI and Recovery images without removing the hard drive

If you have the ability to ssh into the ATV, the EFI and Recovery images may be generated entirely within the ATV, then copied to your desktop computer. This allows the new hard drive to be prepared in advance so that the hard drive upgrade process becomes a simple swap out. To get started, first ssh into the ATV, then type diskutil list. This is not strictly necessary but does help ensure a uniform starting point. You should get the following results:

/dev/disk0
   #:                   type name               size      identifier
   0:  GUID_partition_scheme                    *37.3 GB  disk0
   1:                    EFI                    34.0 MB   disk0s1
   2:         Apple_Recovery                    400.0 MB  disk0s2
   3:              Apple_HFS OSBoot             900.0 MB  disk0s3
   4:              Apple_HFS Media              35.8 GB   disk0s4

Then type the following commands to generate the disk images in your /Users/frontrow/Documents directory. It is not necessary to unmount the drive since the two partitions you are copying have never been mounted to begin with.

dd if=/dev/disk0s1 of=/Users/frontrow/Documents/efi.dmg bs=1m
dd if=/dev/disk0s2 of=/Users/frontrow/Documents/recovery.dmg bs=1m 

Finally, copy the two images to your desktop computer with the following commands and proceed as below.

scp /Users/frontrow/Documents/efi.dmg yourusername@youraddress:/efi.dmg
scp /Users/frontrow/Documents/recovery.dmg yourusername@youraddress:/recovery.dmg

Optional: Hacking the Recovery Image

The recovery.img file can be mounted like any other disk image. Inside, you will find OS.dmg. This is the factory image of the OSBoot partition. Eventually, this image will be written to your new disk. You can modify it at this point if you'd like.

Preparing the partition table

Connect the new disk. Again, the instructions assume that it is associated with device node: /dev/disk2. If this disk was previously non-empty, make sure that no volumes on the disk are mounted.

We will now erase any existing partition table on the disk and create a new GUID partition table using the command gpt. The command will fail if any volumes on the disk are mounted, so make sure you unmount them.

gpt destroy /dev/disk2
gpt create /dev/disk2

Adding the OSBoot and Media partitions

The OSBoot and Media partitions have to be added and formatted first, otherwise diskutil gets confused by the EFI and Recovery partitions.

First add the OSBoot partition.

gpt add -b 888872 -i 3 -s 1843200 -t hfs /dev/disk2

Now we can determine the size of the Media partition.

gpt show /dev/disk2

The output of the command should look something like this:

      start       size  index  contents
          0          1         PMBR
          1          1         Pri GPT header
          2         32         Pri GPT table
         34     888838         
     888872    1843200      3  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
    2732072  153569383         
  156301455         32         Sec GPT table
  156301487          1         Sec GPT header

The important part is the line above Sec GPT table:

    2732072  153569383         

This is where the Media partition will go. Create the Media partition with the following command, replacing START and SIZE with the two numbers above:

gpt add -b START -i 4 -s SIZE -t hfs /dev/disk2

Again, Finder will complain to you that the disk is unitialized. Ignore the warning.

Formatting the HFS+ partitions

We will now format (erase) the HFS+ partitions and then unmount them:

diskutil eraseVolume "Journaled HFS+" OSBoot /dev/disk2s3
diskutil eraseVolume "Journaled HFS+" Media /dev/disk2s4
diskutil unmountDisk /dev/disk2

Creating and writing the EFI and Recovery partitions

Now we can add EFI and Recovery partitions. First, add the EFI partition:

gpt add -b 40 -i 1 -s 69632 -t efi /dev/disk2

After the command completes, Finder will automount the OSBoot and Media partitions. Unmount them.

diskutil unmountDisk /dev/disk2

Now add the Recovery partition:

gpt add -b 69672 -i 2 -s 819200 -t 5265636F-7665-11AA-AA11-00306543ECAC /dev/disk2

Again, after Finder automounts the OSBoot and Media partitions, unmount them.

diskutil unmountDisk /dev/disk2

The final step is to write the EFI and Recovery images that you copied from the factory disk to the new disk.

dd if=efi.dmg of=/dev/disk2s1 bs=1m
dd if=recovery.dmg of=/dev/disk2s2 bs=1m

You may now disconnect the disk (but make sure you have ejected/unmounted it first).

Apple TV Factory Restore

Connect the new disk to the Apple TV and power it up. The Apple TV should now boot up from the new disk. After a minute or so, you should be asked to choose a language and then presented with the "Apple TV Recovery" screen. Go ahead and do the factory restore. This will initialize the OSBoot partition with the original factory image. Your Apple TV is now identical to the factory version, but with a larger Media partition.

Simpler Alternative Method

There is an alternative method where you duplicate the partitions you need with one command and then copy them to the new disk, then complete the preparation with the Apple TV Factory Restore. To duplicate the factory disk, connect it to your computer and execute:

dd if=/dev/disk2 of=appletv.dmg bs=1m

This command may take several hours to complete, depending on the speed of the interface between your computer and the disk. Now disconnect the factory disk and connect your new disk. Write the image of the factory disk:

dd if=appletv.dmg of=/dev/disk2 bs=1m

This command may take several hours to complete, depending on the speed of the interface between your computer and the disk. Once it completes, disconnect the disk and follow the instructions above under #Apple TV Factory Restore.

External Links

GUID Partition Table (GPT) details at Wikipedia [1]