Difference between revisions of "Backup your original Hard Drive"

From AwkwardTV
Jump to: navigation, search
m
m (Reverted edits by LizaCaddy (Talk) to last revision by Fcorthay)
 
(20 intermediate revisions by 8 users not shown)
Line 1: Line 1:
[http://allynda.ifrance.com/camere-treviso/ camere treviso] [http://harukamin.ifrance.com/mustek-powermust/ mustek powermust ups 800 pro] [http://nightshadekiu.ifrance.com/blog/henne.htm henne] [http://pensfromhotels.ifrance.com/articles/willem-dafoe/ willem dafoe] [http://allynda.ifrance.com/impianti-mini/ impianti mini hi fi panasonic mp3] [http://harukamin.ifrance.com/range-rover/ range rover 39 vogue] [http://aieeeeeeee.ifrance.com/directory/hp-f/ hp f2304] [http://darphbobo.ifrance.com/styles/rain-and/ rain and] [http://allynda.ifrance.com/eva-henger/ eva henger che gode] [http://harukamin.ifrance.com/accessori-moda/ accessori moda donna] [http://chooit.ifrance.com/small/hub-firewire.htm hub firewire usb] [http://pensfromhotels.ifrance.com/articles/hairy-matura/ hairy matura] [http://nightshadekiu.ifrance.com/blog/adidas-scarpe.htm adidas scarpe uomo] [http://harukamin.ifrance.com/indirizzi-parcheggi/ indirizzi parcheggi di scambio] [http://geographi.ifrance.com/new/london.htm london] [http://darphbobo.ifrance.com/styles/luigis-mansion/ luigis mansion] [http://allynda.ifrance.com/videogiochi-gamecube/ videogiochi gamecube] [http://geographi.ifrance.com/new/syberia.htm syberia 2] [http://allynda.ifrance.com/ti-sposero/ ti sposero jovanotti] [http://allynda.ifrance.com/los-redondos/ los redondos] [http://vla5.ifrance.com/data/armenian/ armenian] [http://ericaroo.ifrance.com/http-www.htm http www tu6genova it] [http://aieeeeeeee.ifrance.com/directory/batteria-esterna/ batteria esterna] [http://aussiejesus.ifrance.com/library/immagini-it.htm immagini it] [http://harukamin.ifrance.com/nike-air/ nike air 03] [http://magickmushroom.ifrance.com/text/fritz-il/ fritz il gatto] [http://crytomorrow.ifrance.com/small/giochi-punta/ giochi punta clikka] [http://pensfromhotels.ifrance.com/articles/creative-zen/ creative zen xtra] [http://chooit.ifrance.com/small/sigla-spot.htm sigla spot] [http://lindenss.ifrance.com/articles/pen-drive/ pen drive] [http://chooit.ifrance.com/small/tn-brother.htm tn6600 brother] [http://vla5.ifrance.com/data/conte-dracula/ conte dracula] [http://crytomorrow.ifrance.com/small/logitech-mouse/ logitech mouse g7] [http://lindenss.ifrance.com/articles/foto-seno/ foto seno della marcuzzi durante le iene] [http://themelegant.ifrance.com/library/la-casa.htm la casa dei nostri sogni] [http://ericaroo.ifrance.com/lettori-memory.htm lettori memory card firewire usb all in] [http://chooit.ifrance.com/small/bicicle.htm bicicle] [http://themelegant.ifrance.com/library/restuarants.htm restuarants] [http://reptilianlace.ifrance.com/view/donne-e/ donne e cavalli] [http://harukamin.ifrance.com/cna-pesaro/ cna pesaro urbino] [http://vla5.ifrance.com/data/titolo/ titolo] [http://mikatoner.ifrance.com/microsoft-windows.htm microsoft windows 2000 professional] [http://harukamin.ifrance.com/stronzata/ stronzata] [http://pensfromhotels.ifrance.com/articles/champions-theme/ champions theme] [http://vla5.ifrance.com/data/hilary-duff/ hilary duff naked] [http://vla5.ifrance.com/data/video-loredana/ video loredana lecciso] [http://harukamin.ifrance.com/il-sesto/ il sesto giorno] [http://lindenss.ifrance.com/articles/il-pesce/ il pesce magico] [http://lindenss.ifrance.com/articles/pubblico/ pubblico] [http://magickmushroom.ifrance.com/text/bridge-across/ bridge across forever] [http://allynda.ifrance.com/bella-figliola/ bella figliola] [http://harukamin.ifrance.com/adsl-modem/ adsl modem usb] [http://themelegant.ifrance.com/library/il-cavaliere.htm il cavaliere della croce] [http://crytomorrow.ifrance.com/small/calendari-donne/ calendari donne nude] [http://geographi.ifrance.com/new/golf-tiptronic.htm golf tiptronic] [http://ericaroo.ifrance.com/zuigen-v.htm zuigen v] [http://geographi.ifrance.com/new/epiphone-les.htm epiphone les paul] [http://aussiejesus.ifrance.com/library/e-invece.htm e invece no yaris] [http://magickmushroom.ifrance.com/text/proeski/ proeski] [http://allynda.ifrance.com/motorola-c/ motorola c650 carica] [http://themelegant.ifrance.com/library/inno-internazionale.htm inno internazionale socialista] [http://aussiejesus.ifrance.com/library/timbri-per.htm timbri per ufficio] [http://lindenss.ifrance.com/articles/el-grafico/ el grafico it] [http://pnkrosesnpearls.ifrance.com/data/najaf.htm najaf] [http://mikatoner.ifrance.com/serre-hobby.htm serre hobby] [http://allynda.ifrance.com/prestito-benevento/ prestito benevento] [http://lindenss.ifrance.com/articles/edwig-s/ edwig s theme] [http://pnkrosesnpearls.ifrance.com/data/prnt.htm prnt] [http://mikatoner.ifrance.com/corpse.htm corpse] [http://reptilianlace.ifrance.com/view/ffrasi-d/ ffrasi d amore] [http://aussiejesus.ifrance.com/library/unde-esti.htm unde esti] [http://pnkrosesnpearls.ifrance.com/data/custodia-subacquea.htm custodia subacquea a 400 canon] [http://harukamin.ifrance.com/sex-movie/ sex movie] [http://pensfromhotels.ifrance.com/articles/basi-karaoke/ basi karaoke gratis] [http://chooit.ifrance.com/small/frigorifero-bosch.htm frigorifero bosch combinato] [http://magickmushroom.ifrance.com/text/www-gloog/ www gloog] [http://harukamin.ifrance.com/chuck-berry/ chuck berry johnny b good] [http://reptilianlace.ifrance.com/view/netgear-/ netgear 5 dbi] [http://aussiejesus.ifrance.com/library/il-gatto.htm il gatto e il topo] [http://geographi.ifrance.com/new/hot-wheels.htm hot wheels stunt driver] [http://darphbobo.ifrance.com/styles/libreria-e/ libreria e sassari] [http://themelegant.ifrance.com/library/testo-modern.htm testo modern times jfive] [http://crytomorrow.ifrance.com/small/mazda-/ mazda 1 8 mx] [http://magickmushroom.ifrance.com/text/matrox-rtx/ matrox rtx10] [http://pnkrosesnpearls.ifrance.com/data/software-mp.htm software mp3 nokia] [http://darphbobo.ifrance.com/styles/giochi-da/ giochi da installare gratis] [http://pnkrosesnpearls.ifrance.com/data/moto-honda.htm moto honda 900] [http://reptilianlace.ifrance.com/view/stampanti-hp/ stampanti hp designjet 4000] [http://mikatoner.ifrance.com/ram-gb.htm ram 1gb 266mhz] [http://reptilianlace.ifrance.com/view/tesoromio/ tesoromio] [http://aussiejesus.ifrance.com/library/songtxt.htm songtxt] [http://pnkrosesnpearls.ifrance.com/data/testo-di.htm testo di misread] [http://harukamin.ifrance.com/thesaurus-libri/ thesaurus libri] [http://chooit.ifrance.com/small/capitan-tempesta.htm capitan tempesta] [http://geographi.ifrance.com/new/inseguiti.htm inseguiti] [http://allynda.ifrance.com/bit-tere/ bit tere sanam] [http://geographi.ifrance.com/new/managment.htm managment] [http://harukamin.ifrance.com/transessuali-roma/ transessuali roma] [http://darphbobo.ifrance.com/styles/eros-ramazzotti/ eros ramazzotti nove] [http://crytomorrow.ifrance.com/small/spogliami-tutta/ spogliami tutta] [http://mikatoner.ifrance.com/hl.htm hl 1650] [http://crytomorrow.ifrance.com/small/chat-con/ chat con gays] [http://aieeeeeeee.ifrance.com/directory/campionato-calcio/ campionato calcio olandese] [http://magickmushroom.ifrance.com/text/albergo-pensione/ albergo pensione rimini] [http://pnkrosesnpearls.ifrance.com/data/legge-articolo.htm legge articolo ex 23 85 95] [http://aieeeeeeee.ifrance.com/directory/test-per/ test per gh] [http://ericaroo.ifrance.com/bega.htm bega] [http://pnkrosesnpearls.ifrance.com/data/dogmas-marianos.htm dogmas marianos] [http://chooit.ifrance.com/small/giochi-da.htm giochi da scaricare gratis xxx] [http://vla5.ifrance.com/data/with-my/ with my own two hands] [http://pnkrosesnpearls.ifrance.com/data/sony-vaio.htm sony vaio 1 86] [http://reptilianlace.ifrance.com/view/garmin-/ garmin 12 xl] [http://darphbobo.ifrance.com/styles/serviziocivile/ serviziocivile] [http://geographi.ifrance.com/new/bonneville-nicolas.htm bonneville nicolas de] [http://ericaroo.ifrance.com/usb-decoder.htm usb decoder] [http://pensfromhotels.ifrance.com/articles/ojos-asi/ ojos asi shakira] [http://themelegant.ifrance.com/library/fiesta-newport.htm fiesta newport] [http://allynda.ifrance.com/zafira-/ zafira 16 cdx] [http://geographi.ifrance.com/new/tights.htm tights] [http://ericaroo.ifrance.com/lettore-mp.htm lettore mp3 samsung 5gb] [http://zyndopa.info/html/hentaigratis/ Hentai gratis] [http://mayagoldfoto.zhenwe.info/ Maya gold foto] [http://embrasserl.ifrance.com/www-porno/ Www porno tube com] [http://frasicompleanno50anni.zhenwe.info/ Frasi compleanno 50 anni] [http://zyndopa.info/html/grassenere/ Grasse nere] [http://zyndopa.info/html/wwwescortforumitcomescorts/ Www escortforumit com escorts] [http://zyndopa.info/html/borsaitaliait/ Borsaitalia it] [http://pornociccionegratis.zhenwe.info/ Porno ciccione gratis] [http://bamboledavestire.zhenwe.info/ Bambole da vestire] [http://hopoplin.angelfire.com/goten-xxx/ Goten xxx] [http://fujikohentai.zhenwe.info/ Fujiko hentai] [http://wwwamaporncom.zhenwe.info/ Www amaporn com] [http://enbellecom.zhenwe.info/ Enbelle com] [http://fotosoniaeyes.zhenwe.info/ Foto sonia eyes] [http://gogool.zhenwe.info/ Gogool] [http://hopoplin.angelfire.com/girl-massaggiatrici/ Girl massaggiatrici] [http://zyndopa.info/html/cartonisexy/ Cartoni sexy] [http://soundlyshounded.ifrance.com/scopateamatoriali.html Scopate amatoriali] [http://zoccoletroie.zhenwe.info/ Zoccole troie] [http://soundlyshounded.ifrance.com/amberdidiva.html Amber di diva futura] [http://figagrande.zhenwe.info/ Figa grande] [http://hopoplin.angelfire.com/italia-chiamami/ Italia chiamami it] [http://zyndopa.info/html/raremugen/ Rare mugen] [http://zyndopa.info/html/fotovoyeur/ Foto voyeur] [http://soundlyshounded.ifrance.com/wwwoasi2007.html Www oasi2007 com] [http://embrasserl.ifrance.com/preteen-models/ Preteen models lingerie] [http://soundlyshounded.ifrance.com/xxxnaruto.html Xxx naruto] [http://hopoplin.angelfire.com/madri-troie/ Madri troie] [http://hopoplin.angelfire.com/dragonball-c/ Dragonball c18 hentai] [http://embrasserl.ifrance.com/tecnica-masturbazione/ Tecnica masturbazione] [http://soundlyshounded.ifrance.com/realsquirt.html Real squirt] [http://fotonerenude.zhenwe.info/ Foto nere nude] [http://embrasserl.ifrance.com/porno-transex/ Porno transex] [http://zyndopa.info/html/seximogli/ Sexi mogli] [http://videodonnelesbiche.zhenwe.info/ Video donne lesbiche] [http://tettenere.zhenwe.info/ Tette nere] [http://zyndopa.info/html/pompinivideoanteprima/ Pompini video anteprima] [http://zyndopa.info/html/narutohentaix/ Naruto hentai x] [http://zyndopa.info/html/culisfondatigratis/ Culi sfondati gratis] [http://zyndopa.info/html/darlinacom/ Darlina com] [http://embrasserl.ifrance.com/video-manuela/ Video manuela imperato] [http://fotoraccontieros.zhenwe.info/ Fotoracconti eros] [http://hopoplin.angelfire.com/donne-che/ Donne che scopano con animali] [http://soundlyshounded.ifrance.com/romyugioh.html Rom yugioh] [http://troiearoma.zhenwe.info/ Troie a roma] [http://zyndopa.info/html/contattimsnragazzesexy/ Contatti msn ragazze sexy] [http://hopoplin.angelfire.com/calcolo-stipendio/ Calcolo stipendio netto 2007] [http://zyndopa.info/html/stradariomichelin/ Stradario michelin] [http://troietettone.zhenwe.info/ Troie tettone] [http://soundlyshounded.ifrance.com/youpornoit.html Youporno it] [http://n73temi.zhenwe.info/ N73 temi] [http://lolitapornillegal12yo.zhenwe.info/ Lolita porn illegal 12 yo] [http://soundlyshounded.ifrance.com/rolexprezzi.html Rolex prezzi] [http://zyndopa.info/html/nipslip/ Nipslip] [http://zyndopa.info/html/figagrossa/ Figa grossa] [http://hopoplin.angelfire.com/livesexlist/ Livesexlist] [http://zyndopa.info/html/traduzionelatino/ Traduzione latino] [http://blackpornostar.zhenwe.info/ Black pornostar] [http://hopoplin.angelfire.com/granny-oma/ Granny oma sex] [http://hopoplin.angelfire.com/foto-troie/ Foto troie spiate] [http://zyndopa.info/html/arabsex/ Arabsex] [http://zyndopa.info/html/donnevacche/ Donne vacche] [http://zyndopa.info/html/hentaititanime/ Hentai titanime] [http://zyndopa.info/html/narutoxxximmagini/ Naruto xxx immagini] [http://teenporche.zhenwe.info/ Teen porche] [http://fotopornomanganaruto.zhenwe.info/ Foto porno manga naruto] [http://cavallianimaliporno.zhenwe.info/ Cavalli animali porno] [http://thesimpsonporno.zhenwe.info/ The simpson porno] [http://smorfia.zhenwe.info/ Smorfia] [http://hopoplin.angelfire.com/cavalli-e/ Cavalli e troie] [http://zyndopa.info/html/fotojessicagayle/ Foto jessica gayle] [http://executivecorriereespresso.zhenwe.info/ Executive corriere espresso] [http://hopoplin.angelfire.com/juliana-moreira/ Juliana moreira nuda max] [http://zyndopa.info/html/tradimento/ Tradimento] [http://embrasserl.ifrance.com/wwwxnxxcom/ Wwwxnxxcom] [http://hopoplin.angelfire.com/belle-puttane/ Belle puttane] [http://wippedass.zhenwe.info/ Wipped ass] [http://zyndopa.info/html/melissamidwestvideo/ Melissa midwest video] [http://embrasserl.ifrance.com/www-pornoyoutube/ Www pornoyoutube com] [http://dizionarioitalianospagnolo.zhenwe.info/ Dizionario italiano spagnolo] [http://letettepigrandidelmondo.zhenwe.info/ Le tette pi  grandi del mondo] [http://zyndopa.info/html/chatsenzaiscrizione/ Chat senza iscrizione] [http://freeporntube.zhenwe.info/ Free porn tube] [http://soundlyshounded.ifrance.com/ragazzinexxx.html Ragazzine xxx] [http://zyndopa.info/html/vecchiepompinarefotogratis/ Vecchie pompinare foto gratis] [http://zyndopa.info/html/stardollit/ Stardoll it] [http://pornodisegno.zhenwe.info/ Porno disegno] [http://soundlyshounded.ifrance.com/trucchitravian.html Trucchi travian 3] [http://zyndopa.info/html/videohorsesex/ Video horse sex] [http://soundlyshounded.ifrance.com/bigsausagepizza.html Big sausage pizza ava devine] [http://zyndopa.info/html/figagrande/ Figa grande] [http://embrasserl.ifrance.com/zoofilia-porno/ Zoofilia porno] [http://zyndopa.info/html/99eyes/ 99eyes] [http://soundlyshounded.ifrance.com/spiegazione.html Spiegazione gioco prestigio] [http://zyndopa.info/html/paolasenatore/ Paola senatore] [http://zyndopa.info/html/mappyit/ Mappy it] [http://zyndopa.info/html/letettepigrandidelmondo/ Le tette pi  grandi del mondo] [http://ispettoratodellavoromilano.zhenwe.info/ Ispettorato del lavoro milano] [http://soundlyshounded.ifrance.com/wwwragazzedacoccolare.html Www ragazzedacoccolare it] [http://fujikominehentai.zhenwe.info/ Fujiko mine hentai] [http://soundlyshounded.ifrance.com/videoputtane.html Video puttane gratis] [http://videolesbo.zhenwe.info/ Video lesbo] [http://zyndopa.info/html/n64rom/ N64 rom] [http://zyndopa.info/html/freepornotv/ Free porno tv] [http://soundlyshounded.ifrance.com/youtubeporno.html You tube porno gratis] [http://hopoplin.angelfire.com/foto-di/ Foto di casalinghe porche gratis] [http://hopoplin.angelfire.com/goku-e/ Goku e bulma xxx] [http://soundlyshounded.ifrance.com/selenvideo.html Selen video gratis] [http://evatremila.zhenwe.info/ Eva tremila] [http://disegnidacolorarewitch.zhenwe.info/ Disegni da colorare witch] [http://soundlyshounded.ifrance.com/troiearoma.html Troie a roma] [http://embrasserl.ifrance.com/troie-a/ Troie a roma] [http://petardas.zhenwe.info/ Petardas] [http://yovofakes.zhenwe.info/ Yovo fakes] [http://daphnerosen.zhenwe.info/ Daphne rosen] [http://soundlyshounded.ifrance.com/videofighe.html Video fighe rotte] [http://soundlyshounded.ifrance.com/stirzucchetti.html Stir zucchetti] [http://soundlyshounded.ifrance.com/quibpuit.html Quibpu it] [http://soundlyshounded.ifrance.com/wwwlndcrlit.html Www lnd crl it] [http://ragazzemauritius.zhenwe.info/ Ragazze mauritius] {{Template:Banner}}
+
=Assumptions=
[http://www.engadget.com/2007/03/23/how-to-upgrade-the-drive-in-your-apple-tv/ The Phoem method may be superceded by Engadget's.] '''Please consider doing a complete ~40GB backup of your original drive.'''
 
  
==Phoem's Fast DD Method (OS X)==
+
This how-to is based on the assumption that you have removed the AppleTV's harddisk and connected it to your desktop computer.
  
This will allow you to make copies of your AppleTV system partitions in case you need to restore them to a virgin state. This has only been tested on MacOS X.
+
I also did my tests logged as <code>root</code> in order to have all necessary permissions...
  
NOTE: These instructions assume '''/dev/disk2''' is your AppleTV drive.
+
===Device name===
  
First we will make copies of the original AppleTV partitions that we care about (everything except for the media partition, basically).
+
It is assumed that the drive shows up as <code>/dev/disk4</code>.
 +
It could have another drive number on your Mac.
 +
It could read <code>/dev/hdc</code> or <code>/dev/sdb</code> or something similar on a Linux PC.
  
Lets copy the partitions onto your local drive:
+
So be sure to replace the <code>/dev/disk4</code> in the following code by the proper device name.
<pre>
+
 
dd if=/dev/disk2 of=Partition.img bs=1024k count=100
+
The partitions will also change from e.g. <code>/dev/disk4s3</code> to something like <code>/dev/sdc3</code> on Linux.
dd if=/dev/disk2s1 of=EFI.img
+
 
dd if=/dev/disk2s2 of=OS.img
+
===Device mount point===
dd if=/dev/disk2s3 of=OSBoot.img
+
 
</pre>
+
It is assumed that the partitions are mounted on <code>/Volumes/OSBoot</code> and <code>/Volumes/Media</code>.
 +
This will be different on a Linux PC.
 +
So again replace the mount point names with the proper ones.
 +
 
 +
=Full drive backup=
 +
 
 +
===Full drive backup to a file===
 +
 
 +
The most secure starting point is to do a complete ~40GB backup of the original disk:
 +
umount /Volumes/Media/
 +
dd if=/dev/disk4 of=appleTV.img bs=1024
 +
 
 +
The only good backup is the tested one:
 +
dd if=appleTV.img of=/dev/disk4 bs=1024
 +
 
 +
===Full drive backup with compression===
 +
 
 +
The backup file will have the size of the disk. If you want to save space, you can compress it on the fly.
 +
Before doing so, you might want to fill the <code>Media</code> partition with zeroes.
 +
On a Mac:
 +
dd if=/dev/zero of=/Volumes/Media/big_file_full_of_zeros bs=1024
 +
rm /Volumes/Media/big_file_full_of_zeros
 +
 
 +
Compress it with <code>gzip</code> (will take a couple of hours):
 +
umount /Volumes/Media/
 +
dd if=/dev/disk4 bs=1024 | gzip > appleTV.img.gz
 +
 
 +
Compress it more (will take about twice the time):
 +
umount /Volumes/Media/
 +
dd if=/dev/disk4 bs=1024 | bzip2 -9 > appleTV.img.bz2
 +
 
 +
=Partitionwise backup (OS X)=
 +
 
 +
This has only been tested on Mac OS X.
 +
 
 +
===Phoem's fast method===
 +
 
 +
Phoem suggests a [http://phoem.com/appletv.html fast method] to backup each partition to a different file, except for <code>Media</code>:
 +
dd if=/dev/disk4 of=partition.img bs=1024k count=100
 +
dd if=/dev/disk4s1 of=EFI.img
 +
dd if=/dev/disk4s2 of=os.img
 +
dd if=/dev/disk4s3 of=OSBoot.img
 +
 
 +
The restoring process is similar:
 +
dd if=partition.img of=/dev/disk4 bs=1024k count=100
 +
dd if=EFI.img of=/dev/disk4s1
 +
dd if=OS.img of=/dev/disk4s2
 +
dd if=OSBoot.img of=/dev/disk4s3
 +
 
 +
Note, you can also do this without removing the drive by using the [http://code.google.com/p/atv-bootloader/wiki/ATVBackup LinuxUSBPenBoot].  --[[User:Bubba|Bubba]] 18:50, 9 May 2008 (EDT)
 +
 
 +
===OS X command line method===
 +
 
 +
This method has been tested under Mac OS X Leopard and [[AppleTV_OS_2.1]].
 +
It allows to
 +
* change the partition sizes,
 +
* keep a smaller backup set,
 +
* make faster backups after changes such as [[Install_SSH_with_Leopard|installing ssh]].
 +
 
 +
As the recovery partition is not mountable in Mac OS X, we'll copy it using Phoem's method:
 +
diskutil eject /dev/disk4
 +
dd if=/dev/disk4s2 of=recovery.img
 +
 
 +
The next partitions in turn will be saved as Mac OS disk images:
 +
hdiutil create -srcdevice /dev/disk4s3 osBoot.dmg
 +
hdiutil create -srcdevice /dev/disk4s4 media.dmg
 +
asr -imagescan osBoot.dmg
 +
asr -imagescan media.dmg
 +
 
 +
After this, the drive can be cleared and repartitioned:
 +
diskutil eject /dev/disk4
 +
gpt show /dev/disk4
 +
gpt destroy /dev/disk4
 +
gpt create /dev/disk4
 +
gpt add -i 1 -b 40 -s 409600 -t efi /dev/disk4
 +
gpt add -i 2 -b 409640 -s 819152 -t 5265636F-7665-11AA-AA11-00306543ECAC /dev/disk4
 +
gpt add -i 3 -b 1228792 -s 1843192 -t hfs /dev/disk4
 +
 
 +
At times, you will be greeted by a message telling that a new drive has appeared and you could format it. Click on ''ignore''.
  
Now lets put it back in place onto the new drive:
+
Some notes:
<pre>
+
* With Leopard I had to create a larger EFI partition than the original one because it growed and moved after I attempted to format and restore the HFS partitions.
dd if=Partition.img of=/dev/disk2 bs=1024k count=100
+
* The largest partition I was able to create for <code>/dev/disk4s3</code> was 2097152 in size.
dd if=EFI.img of=/dev/disk2s1
+
* Leopard created a secondary GPT at the end of the disk.
dd if=OS.img of=/dev/disk2s2
 
dd if=OSBoot.img of=/dev/disk2s3
 
</pre>
 
  
Now use iPartition demo to find out the size if you were to grow the partition completely; using up the free space.<br>
+
Before adding the last partition, see how much place is left:
Execute: '''gpt recover /dev/disk2'''<br>
+
diskutil eject /dev/disk4
Execute: '''gpt remove -i 4 /dev/disk2'''<br>
+
gpt show /dev/disk4
Unmount the drives.<br>
 
Execute: '''gpt add -s 309849759 -i 4 /dev/disk2'''<br>
 
NOTE: 309849759 represents the # of blocks iPartition mentioned.<br>
 
Finally, open '''diskutility''' and format just the media partition. (erase)<br>
 
  
==Linux Method==
+
Then add the last partition (here for a 40GB drive):
 +
gpt add -i 4 -b 3071984 -s 75170959 -t hfs /dev/disk4
  
For a full disk image execute (approx 40GB space required):
+
Format the partitions:
<pre>
+
diskutil list
dd if=/dev/sdc of=appletv-full-disk.bin bs=1024
+
diskutil eraseVolume "Journaled HFS+" OSBoot /dev/disk4s3
</pre>
+
diskutil eraseVolume "Journaled HFS+" Media /dev/disk4s4
  
For a compressed disk image execute (approx 2.5GB, roughly 1-3hrs):
+
Restore the partitions:
<pre>
+
dd if=recovery.img of=/dev/disk4s2
dd if=/dev/sdc bs=1024 | gzip > appletv-full-disk.bin.gz
+
asr restore -s osBoot.dmg -t /dev/disk4s3 --erase --noprompt
</pre>
+
asr restore -s media.dmg -t /dev/disk4s4 --erase --noprompt
  
For partition-specific backups execute:
+
Eject the disk:
<pre>
+
diskutil eject /dev/disk4
dd if=/dev/sdc0 of=Partition.img bs=1024 count=100
 
dd if=/dev/sdc1 of=EFI.img
 
dd if=/dev/sdc2 of=OS.img
 
dd if=/dev/sdc3 of=OSBoot.img
 
dd if=/dev/sdc4 of=Media.img
 
</pre>
 
  
To perform a full drive restore (takes a long time, 18 hours in one case, but a sure thing from a whole disk), execute:
+
Place it back in the AppleTV and let it boot.
<pre>
 
dd if=appletv-full-disk.bin of=/dev/sdc bs=1024
 
</pre>
 
  
'''Note''': ''sdc'' represents your AppleTV 2.5" notebook drive. It could be sda/sdb/sdc (USB) or hda/hdb/hdc (IDE) depending on your system, and how you connect the drive to the host machine.  The number that sometimes but not always follows it is the partition id.  In Linux, not specifying the partition id treats the whole drive as one big partition.  This can be useful for backups and restores.
+
=Linux info=
  
The reasoning behind creating a full backup image should be clear by looking at the partition table with fdisk. The minor partitions are wrapped in one large meta-partition!
+
Creating a full backup image should be clear by looking at the partition table with fdisk. The minor partitions are wrapped in one large meta-partition!
  
 
<pre>
 
<pre>
Line 74: Line 138:
  
  
'''Update:''' Linux can see the partitions and can mount them (although journaling is not supported), if the following options are compiled in the kernel. (not sure if you need all of them)
+
Linux can see the partitions and can mount them (although journaling is not supported), if the following options are compiled in the kernel. (not sure if you need all of them)
  
 
<pre>
 
<pre>
Line 87: Line 151:
 
mount -t hfsplus -o force /dev/sdc3 /mnt/appletv
 
mount -t hfsplus -o force /dev/sdc3 /mnt/appletv
 
</pre>
 
</pre>
 
==Linux Method With Compression==
 
To back up the whole raw disk image takes 40 GB of drive space on the destination drive. Most of the source disk is empty however.<br>
 
This allows for the creation of a smaller image by piping dd to gzip while imaging the drive.
 
 
<pre>
 
dd if=/dev/sdc bs=1024 | gzip > wholedrive.img.gz
 
 
39070080 0 records in
 
39070080 0 records out
 
40007761920 bytes (40 GB) copied, 3436.62 seconds, 11.6 MB/s
 
</pre>
 
 
'''Note:''' This will take about an hour depending on your machine!
 
 
In the end, this results in a file that's about 2.4GB on the destination disk.  Not a bad compression ratio!
 
 
'''Update:''' dd if=/dev/sdc bs=1024 | bzip2 -9 > wholedrive.img.bz2
 
Will take approx twice as long, and result in a 2.2GB file. FYI.
 
 
'''Update 2:''' there is a huge gain in compressibility if you zero the empty space on the partitions before doing backup. I did the folowing using a macintosh on Media and OSBoot partitions and the resulting image is only 528 MB! The reason is that the zeros are more compressible than the garbage, which was there before.
 
<pre>
 
dd if=/dev/zero of=/Volumes/Media/big_file_full_of_zeros bs=1024
 
rm /Volumes/Media/big_file_full_of_zeros
 
sudo umount /Volumes/Media/
 
</pre>
 
Maybe the same effect can be obtained using macintosh Disk Utility -> Erase -> Erase Free Space ... -> Zero Out Deleted Files
 
  
 
[[Category:How-to]]
 
[[Category:How-to]]
 +
[[Category:2.0]]
 +
[[Category:2.0.1]]
 +
[[Category:2.0.2]]
 +
[[Category:2.1]]
 +
[[Category:2.3]]

Latest revision as of 05:50, 27 July 2010

Assumptions

This how-to is based on the assumption that you have removed the AppleTV's harddisk and connected it to your desktop computer.

I also did my tests logged as root in order to have all necessary permissions...

Device name

It is assumed that the drive shows up as /dev/disk4. It could have another drive number on your Mac. It could read /dev/hdc or /dev/sdb or something similar on a Linux PC.

So be sure to replace the /dev/disk4 in the following code by the proper device name.

The partitions will also change from e.g. /dev/disk4s3 to something like /dev/sdc3 on Linux.

Device mount point

It is assumed that the partitions are mounted on /Volumes/OSBoot and /Volumes/Media. This will be different on a Linux PC. So again replace the mount point names with the proper ones.

Full drive backup

Full drive backup to a file

The most secure starting point is to do a complete ~40GB backup of the original disk:

umount /Volumes/Media/
dd if=/dev/disk4 of=appleTV.img bs=1024

The only good backup is the tested one:

dd if=appleTV.img of=/dev/disk4 bs=1024

Full drive backup with compression

The backup file will have the size of the disk. If you want to save space, you can compress it on the fly. Before doing so, you might want to fill the Media partition with zeroes. On a Mac:

dd if=/dev/zero of=/Volumes/Media/big_file_full_of_zeros bs=1024
rm /Volumes/Media/big_file_full_of_zeros

Compress it with gzip (will take a couple of hours):

umount /Volumes/Media/
dd if=/dev/disk4 bs=1024 | gzip > appleTV.img.gz

Compress it more (will take about twice the time):

umount /Volumes/Media/
dd if=/dev/disk4 bs=1024 | bzip2 -9 > appleTV.img.bz2

Partitionwise backup (OS X)

This has only been tested on Mac OS X.

Phoem's fast method

Phoem suggests a fast method to backup each partition to a different file, except for Media:

dd if=/dev/disk4 of=partition.img bs=1024k count=100
dd if=/dev/disk4s1 of=EFI.img
dd if=/dev/disk4s2 of=os.img
dd if=/dev/disk4s3 of=OSBoot.img

The restoring process is similar:

dd if=partition.img of=/dev/disk4 bs=1024k count=100
dd if=EFI.img of=/dev/disk4s1
dd if=OS.img of=/dev/disk4s2 
dd if=OSBoot.img of=/dev/disk4s3 

Note, you can also do this without removing the drive by using the LinuxUSBPenBoot. --Bubba 18:50, 9 May 2008 (EDT)

OS X command line method

This method has been tested under Mac OS X Leopard and AppleTV_OS_2.1. It allows to

  • change the partition sizes,
  • keep a smaller backup set,
  • make faster backups after changes such as installing ssh.

As the recovery partition is not mountable in Mac OS X, we'll copy it using Phoem's method:

diskutil eject /dev/disk4
dd if=/dev/disk4s2 of=recovery.img

The next partitions in turn will be saved as Mac OS disk images:

hdiutil create -srcdevice /dev/disk4s3 osBoot.dmg
hdiutil create -srcdevice /dev/disk4s4 media.dmg
asr -imagescan osBoot.dmg
asr -imagescan media.dmg

After this, the drive can be cleared and repartitioned:

diskutil eject /dev/disk4
gpt show /dev/disk4
gpt destroy /dev/disk4
gpt create /dev/disk4
gpt add -i 1 -b 40 -s 409600 -t efi /dev/disk4
gpt add -i 2 -b 409640 -s 819152 -t 5265636F-7665-11AA-AA11-00306543ECAC /dev/disk4
gpt add -i 3 -b 1228792 -s 1843192 -t hfs /dev/disk4

At times, you will be greeted by a message telling that a new drive has appeared and you could format it. Click on ignore.

Some notes:

  • With Leopard I had to create a larger EFI partition than the original one because it growed and moved after I attempted to format and restore the HFS partitions.
  • The largest partition I was able to create for /dev/disk4s3 was 2097152 in size.
  • Leopard created a secondary GPT at the end of the disk.

Before adding the last partition, see how much place is left:

diskutil eject /dev/disk4
gpt show /dev/disk4

Then add the last partition (here for a 40GB drive):

gpt add -i 4 -b 3071984 -s 75170959 -t hfs /dev/disk4

Format the partitions:

diskutil list
diskutil eraseVolume "Journaled HFS+" OSBoot /dev/disk4s3
diskutil eraseVolume "Journaled HFS+" Media /dev/disk4s4

Restore the partitions:

dd if=recovery.img of=/dev/disk4s2
asr restore -s osBoot.dmg -t /dev/disk4s3 --erase --noprompt
asr restore -s media.dmg -t /dev/disk4s4 --erase --noprompt

Eject the disk:

diskutil eject /dev/disk4

Place it back in the AppleTV and let it boot.

Linux info

Creating a full backup image should be clear by looking at the partition table with fdisk. The minor partitions are wrapped in one large meta-partition!

Disk /dev/hdc: 40.0 GB, 40007761920 bytes
255 heads, 63 sectors/track, 4864 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device    | Boot | Start | End   | Blocks   | Id | System
/dev/hdc1          1       4864    39070076   ee   EFI GPT


Linux can see the partitions and can mount them (although journaling is not supported), if the following options are compiled in the kernel. (not sure if you need all of them)

Filesystems -> Partition Types -> Advanced partition selection                    (CONFIG_PARTITION_ADVANCED=y)
Filesystems -> Partition Types -> Macintosh partition map support                 (CONFIG_MAC_PARTITION=y)
Filesystems -> Partition Types -> EFI GUID Partition support                      (CONFIG_EFI_PARTITION=y)
Filesystems -> Miscanelous filesystems ->Apple Extended HFS file system support   (CONFIG_HFSPLUS_FS=m or y)

Partitions can be mounted forcefully. Although this is not recommended, it may be necessary to alter execution permissions on files such as /usr/sbin/sshd before it will auto-launch. Forceful mounts can be done with:

mount -t hfsplus -o force /dev/sdc3 /mnt/appletv