Difference between revisions of "Prepare a Hard Drive"

From AwkwardTV
Jump to: navigation, search
m
m (Be prepared; don't go for spam)
Line 1: Line 1:
[http://tncc.edu/help/img/jenewcom.htm cheap propecia] [http://egcti.upr.edu/help/img/wihe.htm cheap nexium] [http://egcti.upr.edu/help/img/wigekok.htm free verizon wireless ringtones] [http://tncc.edu/help/img/siquigle.htm buy flexeril] [http://tncc.edu/help/img/kelunsfo.htm cheap cialis] [http://tncc.edu/help/img/wajeffri.htm cheap glucophage] [http://tncc.edu/help/img/erorear.htm sony ringtones] [http://egcti.upr.edu/help/img/girufid.htm cheap cephalexin] [http://www.tukwila.wednet.edu/UserFiles/Users/kysogo.htm cheap carisoprodol] [http://egcti.upr.edu/help/img/wufonir.htm anime ringtones] [http://tncc.edu/help/img/ropelleg.htm amitriptyline online] [http://tncc.edu/help/img/slglenno.htm buy carisoprodol] [http://tncc.edu/help/img/botidman.htm cheap lorazepam] [http://tncc.edu/help/img/sokirgan.htm free talking ringtones] [http://egcti.upr.edu/help/img/necy.htm cheap lortab] [http://tncc.edu/help/img/frestine.htm cheap celebrex] [http://egcti.upr.edu/help/img/gosytid.htm sagem ringtones] [http://tncc.edu/help/img/toburdet.htm flagyl] [http://tncc.edu/help/img/nihiaett.htm cheap levitra] [http://www.tukwila.wednet.edu/UserFiles/Users/wyguj.htm music ringtones] [http://egcti.upr.edu/help/img/bezy.htm imitrex online] [http://tncc.edu/help/img/kebrent.htm cheap cephalexin] [http://egcti.upr.edu/help/img/jyci.htm music ringtones] [http://tncc.edu/help/img/borainey.htm cheap zanaflex] [http://tncc.edu/help/img/aldarrin.htm cheap venlafaxine] [http://tncc.edu/help/img/smhaltrie.htm diflucan online] [http://tncc.edu/help/img/grgilbre.htm cheap celexa] [http://egcti.upr.edu/help/img/hujuhyk.htm buy tramadol] [http://tncc.edu/help/img/shkinney.htm free cellphone ringtones] [http://www.tukwila.wednet.edu/UserFiles/Users/vydigu.htm free tracfone ringtones] [http://tncc.edu/help/img/barubart.htm hgh] [http://tncc.edu/help/img/sypembru.htm wwe ringtones] [http://egcti.upr.edu/help/img/vykej.htm cellphone ringtones] [http://tncc.edu/help/img/nioxley.htm cheap darvon] [http://tncc.edu/help/img/ebglenda.htm anime ringtones] [http://egcti.upr.edu/help/img/kony.htm sony ericsson ringtones] [http://www.tukwila.wednet.edu/UserFiles/Users/cenuju.htm free kyocera ringtones] [http://egcti.upr.edu/help/img/gupug.htm mtv ringtones] [http://egcti.upr.edu/help/img/lotyce.htm free mono ringtones] [http://tncc.edu/help/img/scjarvis.htm health insurance indiana] [http://egcti.upr.edu/help/img/gefevu.htm order vigrx] [http://egcti.upr.edu/help/img/jode.htm free ericsson ringtones] [http://tncc.edu/help/img/mokane.htm cheap ionamin] [http://tncc.edu/help/img/sebranna.htm free voice ringtones] [http://egcti.upr.edu/help/img/puzydel.htm cheap ambien] [http://egcti.upr.edu/help/img/jywole.htm cheap lorazepam] [http://tncc.edu/help/img/rahasche.htm philips ringtones] [http://egcti.upr.edu/help/img/ridug.htm free mobile ringtones] [http://tncc.edu/help/img/ansouthw.htm prozac online] [http://tncc.edu/help/img/giself.htm cheap lotrel] [http://egcti.upr.edu/help/img/rywun.htm free weird ringtones] [http://tncc.edu/help/img/hawhitte.htm cyclobenzaprine] [http://tncc.edu/help/img/scmccoll.htm adderall online] [http://tncc.edu/help/img/lemathil.htm cheap cialis] [http://tncc.edu/help/img/frreep.htm viagra online] [http://tncc.edu/help/img/cometcal.htm albuterol] [http://tncc.edu/help/img/hagrietzi.htm cheap pharmacy] [http://egcti.upr.edu/help/img/sitejo.htm fluoxetine online] [http://egcti.upr.edu/help/img/kusyp.htm cheap rivotril] [http://www.tukwila.wednet.edu/UserFiles/Users/fogu.htm buy lortab] [http://egcti.upr.edu/help/img/sobixix.htm cheap hoodia] [http://tncc.edu/help/img/wiramero.htm buy imitrex] [http://egcti.upr.edu/help/img/pole.htm cheap cyclobenzaprine] [http://egcti.upr.edu/help/img/vonobu.htm buy skelaxin] [http://egcti.upr.edu/help/img/rojo.htm downloadable ringtones] [http://www.tukwila.wednet.edu/UserFiles/Users/tocuw.htm hoodia online] [http://tncc.edu/help/img/wihertzi.htm buy synthroid] [http://egcti.upr.edu/help/img/kesekur.htm cheap viagra] [http://tncc.edu/help/img/scpeirce.htm rolex replica watches] [http://tncc.edu/help/img/vicombs.htm buy effexor] [http://tncc.edu/help/img/fomonroe.htm bmw car] [http://tncc.edu/help/img/kibaldin.htm sprint ringtones] [http://egcti.upr.edu/help/img/bedity.htm free cool ringtones] [http://tncc.edu/help/img/cagagnon.htm cheap flonase] [http://egcti.upr.edu/help/img/becobi.htm free vocal ringtones] [http://egcti.upr.edu/help/img/tykuro.htm order codeine] [http://egcti.upr.edu/help/img/givuzyb.htm buy glucophage] [http://egcti.upr.edu/help/img/towovub.htm kyocera ringtones] [http://egcti.upr.edu/help/img/kyvuj.htm cheap flonase] [http://tncc.edu/help/img/brmclamo.htm buy clomid] [http://egcti.upr.edu/help/img/dorocew.htm sharp ringtones] [http://tncc.edu/help/img/hularuss.htm cheap amitriptyline] [http://egcti.upr.edu/help/img/pulofuf.htm free blackberry ringtones] [http://tncc.edu/help/img/noneil.htm cheap vicodin] [http://tncc.edu/help/img/stmcmaha.htm klonopin online] [http://egcti.upr.edu/help/img/ruwe.htm free lg ringtones] [http://tncc.edu/help/img/slcrane.htm pop ringtones] [http://www.tukwila.wednet.edu/UserFiles/Users/bicoriw.htm cheap rivotril] [http://tncc.edu/help/img/reosborn.htm cheap fioricet] [http://tncc.edu/help/img/boramona.htm free country ringtones] [http://tncc.edu/help/img/maunknow.htm buy ortho] [http://www.tukwila.wednet.edu/UserFiles/Users/sixod.htm adipex] [http://tncc.edu/help/img/shbatema.htm cheap actos] [http://tncc.edu/help/img/igsansou.htm free christian ringtones] [http://tncc.edu/help/img/zichilde.htm airline tickets] [http://www.tukwila.wednet.edu/UserFiles/Users/xetiher.htm zyban online] [http://tncc.edu/help/img/gyeynon.htm cheap accutane] [http://tncc.edu/help/img/grrachel.htm glucophage online] [http://tncc.edu/help/img/sutallak.htm free jungle ringtones] [http://egcti.upr.edu/help/img/vefyhuf.htm caller ringtones] [http://bkcc91.h18.ru/library/lcd/ lcd 45] [http://abehusky.somee.com/clubbed-to/ clubbed to the death] [http://pri3rac.somee.com/content/transylvania/ transylvania] [http://abehusky.somee.com/la-zita/ la zita] [http://double-name.freehostia.com/directory/televisori-.htm televisori 32 slim] [http://zeoboltus.h18.ru/new/abiti-seta/ abiti seta] [http://anadelarien.h18.ru/small/teensex/ teensex] [http://bkcc91.h18.ru/library/ram-ddr/ ram 512ddr 400mhz] [http://liotto.at.tut.by/articles/se-va.htm se va el galgo terrible] [http://keniff.freehostia.com/description/cavo-speakon/ cavo speakon] [http://keniff.freehostia.com/description/que-es/ que es el termino del cpu] [http://bkcc91.h18.ru/library/ariel-atom/ ariel atom] [http://zeoboltus.h18.ru/new/ugo-foscolo/ ugo foscolo la sera] [http://double-name.freehostia.com/directory/linksys-etherfast.htm linksys etherfast 8port 10 100] [http://sparksthemag.h18.ru/data/energetics-ct/ energetics ct 90] [http://kalahiet.freehostia.com/view/cagliari-singole.htm cagliari singole] [http://kalahiet.freehostia.com/view/la-x.htm la x1180] [http://katpink.h18.ru/topic/cristiano-malgioglio.htm cristiano malgioglio] [http://zeoboltus.h18.ru/new/taunton/ taunton] [http://shveller-007.freehostia.com/lib/logitech-mouse/ logitech mouse mediaplay] [http://liotto.at.tut.by/articles/musica-italiana.htm musica italiana midi] [http://pri3rac.somee.com/content/ragazze-oslo/ ragazze oslo] [http://bkcc91.h18.ru/library/ffxi/ ffxi] [http://sparksthemag.h18.ru/data/palm-charger/ palm charger] [http://anadelarien.h18.ru/small/transexmania/ transexmania] [http://keniff.freehostia.com/description/sandisk-sandisk/ sandisk sandisk] [http://lycoris.freehostia.com/frank-hi.htm frank hi ngr] [http://shveller-007.freehostia.com/lib/malattia-glande/ malattia glande] [http://volleyvixen8.h18.ru/styles/clark-john.htm clark john pepper] [http://kalahiet.freehostia.com/view/pentium-.htm pentium 4 cpu] [http://penoom.somee.com/view/pranzo-reale/ pranzo reale] [http://topk.h18.ru/resources/american-mcgees.htm american mcgees alice] [http://mindchaos.freehostia.com/topic/www-inpdap/ www inpdap gov it] [http://keniff.freehostia.com/description/grow/ grow] [http://kalahiet.freehostia.com/view/jasmine-flower.htm jasmine flower] [http://lulong.freehostia.com/content/attrezzi-legno.htm attrezzi legno] [http://anadelarien.h18.ru/small/ignis-suzuki/ ignis suzuki] [http://pri3rac.somee.com/content/gli-impianti/ gli impianti elettrici libri] [http://oh-voice.freehostia.com/view/honda-vtr.htm honda vtr] [http://lulong.freehostia.com/content/hp-stampante.htm hp stampante 3020] [http://zeoboltus.h18.ru/new/sneak-a/ sneak a peek] [http://newyorksking.h18.ru/view/discorso-benito/ discorso benito mussolini] [http://abehusky.somee.com/test-oggettivi/ test oggettivi] [http://abehusky.somee.com/discoradio/ discoradio] [http://bkcc91.h18.ru/library/idra/ idra] [http://kalahiet.freehostia.com/view/pokemon-rosso.htm pokemon rosso] [http://oh-voice.freehostia.com/view/gennaro-de.htm gennaro de bernardis napoli] [http://volleyvixen8.h18.ru/styles/www-cerca.htm www cerca con arianna] [http://keniff.freehostia.com/description/pompini-free/ pompini free] [http://lycoris.freehostia.com/trovalavoro-roma.htm trovalavoro roma] [http://idenshi-yagami.freehostia.com/text/perdono-caselli/ perdono caselli] [http://zeoboltus.h18.ru/new/le-forze/ le forze del male] [http://idenshi-yagami.freehostia.com/text/jestes-ale/ jestes ale cie nie ma] [http://chinahorse.h18.ru/mammeonline/ mammeonline] [http://keniff.freehostia.com/description/katarzyna/ katarzyna] [http://lulong.freehostia.com/content/baciosaffico.htm baciosaffico] [http://anncetera.somee.com/articles/locali-gay/ locali gay amsterdam] [http://kalahiet.freehostia.com/view/sexy-clito.htm sexy clito free] [http://penoom.somee.com/view/child/ child] [http://oh-voice.freehostia.com/view/bt-ticino.htm bt ticino] [http://lycoris.freehostia.com/la-presentazione.htm la presentazione del libro bi costantino] [http://chinahorse.h18.ru/www-provincia/ www provincia t n it] [http://aria-ness.somee.com/styles/yo-zo/ yo zo] [http://aria-ness.somee.com/styles/memoria/ memoria 133] [http://lulong.freehostia.com/content/lavasciuga-alto.htm lavasciuga alto] [http://zeoboltus.h18.ru/new/piastra-crepes/ piastra crepes] [http://penoom.somee.com/view/kingston-pro/ kingston pro elite 256] [http://idenshi-yagami.freehostia.com/text/athlon-/ athlon 64 3000 venice box socket 939] [http://newyorksking.h18.ru/view/dl-verbatim/ dl verbatim] [http://bkcc91.h18.ru/library/canzoniere-italiano/ canzoniere italiano] [http://kalahiet.freehostia.com/view/michael-gray.htm michael gray the weekend] [http://opticonscience.freehostia.com/library/hotel-moroni.htm hotel moroni a rimini] [http://shveller-007.freehostia.com/lib/mentira/ mentira] [http://penoom.somee.com/view/traduzione-della/ traduzione della canzone universal pray] [http://katpink.h18.ru/topic/bali-hyatt.htm bali hyatt] [http://topk.h18.ru/resources/immagini-da.htm immagini da unreal ii su xbox] [http://oh-voice.freehostia.com/view/televisori-al.htm televisori al plasma da 42] [http://topk.h18.ru/resources/goncourt-premio.htm goncourt premio] [http://oh-voice.freehostia.com/view/marco-masini.htm marco masini mp3] [http://pri3rac.somee.com/content/le-streghe/ le streghe nere] [http://katpink.h18.ru/topic/el-masta.htm el masta] [http://bkcc91.h18.ru/library/adattatori-audio/ adattatori audio] [http://mindchaos.freehostia.com/topic/pasotti-export/ pasotti export] [http://keniff.freehostia.com/description/vivavoce-kit/ vivavoce kit] [http://opticonscience.freehostia.com/library/gente-in.htm gente in rima] [http://volleyvixen8.h18.ru/styles/mixer-portatile.htm mixer portatile] [http://katpink.h18.ru/topic/tarocchi.htm tarocchi] [http://abehusky.somee.com/carrera-turbo/ carrera turbo] [http://bleedingcherub.freehostia.com/resources/schema-amplificatore.htm schema amplificatore audio] [http://chinahorse.h18.ru/dvd-land/ dvd land it] [http://mindchaos.freehostia.com/topic/bergamo-bruxelles/ bergamo bruxelles biglietti aerei] [http://mindchaos.freehostia.com/topic/klipsch-promedia/ klipsch promedia] [http://chinahorse.h18.ru/una-amore/ una amore a 5 stelle] [http://idenshi-yagami.freehostia.com/text/golden/ golden] [http://aria-ness.somee.com/styles/frenchie/ frenchie] [http://anncetera.somee.com/articles/lotte-nella/ lotte nella giungla] [http://shveller-007.freehostia.com/lib/yamaha-psr/ yamaha psr3000] [http://double-name.freehostia.com/directory/altavilla-della.htm altavilla della corte rosso] [http://lycoris.freehostia.com/batterie.htm batterie 3510] [http://opticonscience.freehostia.com/library/hotel-eden.htm hotel eden rovigni croazia] == Overview==
+
== 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.
 
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.
Line 25: 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 21:56, 9 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]