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)
 
(43 intermediate revisions by 11 users not shown)
Line 1: Line 1:
[http://kewheatl.125mb.com/library/adidas-street.htm adidas street] [http://dragonzgrace.ifrance.com/description/brigette-bulgara/ brigette bulgara] [http://vanopo.ifrance.com/library/chatt-italiani/ chatt italiani it] [http://madavidan.125mb.com/text/soccer-slam.htm soccer slam] [http://mike12305.ifrance.com/lib/foto-serenella/ foto serenella] [http://earthlygnome.ifrance.com/dvd-recorder/ dvd recorder lg dr7500] [http://sylverrain.ifrance.com/data/nino-d/ nino d angelo senza giacca e cravata mp3] [http://mcgoley.125mb.com/articles/dancan-dei.htm dancan dei blue] [http://raneely.125mb.com/text/la-petite.htm la petite sirene] [http://doloeb.125mb.com/worm-somefool.htm worm somefool p] [http://kamedcal.125mb.com/bittorent.htm bittorent] [http://kewheatl.125mb.com/library/la-ballata.htm la ballata dei fantasmi] [http://bemedad.125mb.com/blog/www-snals.htm www snals it na] [http://bakedsmurf.ifrance.com/description/pianetabari/ pianetabari] [http://bemedad.125mb.com/blog/firma-costituzione.htm firma costituzione europea] [http://dragonzgrace.ifrance.com/description/citroen-nuove/ citroen nuove] [http://mcgoley.125mb.com/articles/www-quest.htm www quest net] [http://madavidan.125mb.com/text/traduzione-canzone.htm traduzione canzone di aemon] [http://sylverrain.ifrance.com/data/las-celulas/ las celulas] [http://bakedsmurf.ifrance.com/description/canali-porno/ canali porno satellite] [http://stbrocke.125mb.com/content/ristorazione-scolastica.htm ristorazione scolastica del comune di ve] [http://kuzelka111.ifrance.com/lib/xpm-amd/ xpm amd] [http://stbrocke.125mb.com/content/google-si.htm google si] [http://kamedcal.125mb.com/hotels-.htm hotels  regno unito] [http://mamerium.125mb.com/tesine-maturita.htm tesine maturita tesina] [http://prkinardan.125mb.com/styles/trust-optical.htm trust optical usb mouse] [http://madavidan.125mb.com/text/stampante-codici.htm stampante codici barra] [http://kamedcal.125mb.com/se-l.htm se l amore ha scelto noi] [http://superspounge.ifrance.com/nada-valgo/ nada valgo sin tu amo] [http://bakedsmurf.ifrance.com/description/toyota-prius/ toyota prius problemi] [http://vanopo.ifrance.com/library/sinead-o/ sinead o connor] [http://doloeb.125mb.com/drivers-modem.htm drivers modem siemens c60] [http://mcgoley.125mb.com/articles/giorgio-alfieri.htm giorgio alfieri] [http://mike12305.ifrance.com/lib/beby-siter/ beby siter] [http://mamerium.125mb.com/www-krausz.htm www krausz com] [http://bemedad.125mb.com/blog/grafield.htm grafield] [http://kamedcal.125mb.com/in-the.htm in the shadow the rasmus] [http://bemedad.125mb.com/blog/dlink.htm dlink 514] [http://vanopo.ifrance.com/library/aladino-telefono/ aladino telefono] [http://mamerium.125mb.com/alcor-ferrara.htm alcor ferrara] [http://stbrocke.125mb.com/content/peugeot.htm peugeot 306 1995] [http://superspounge.ifrance.com/radio-dj/ radio dj rmx] [http://prkinardan.125mb.com/styles/batterie-litio.htm batterie litio nokia 3330] [http://todkonda.ifrance.com/content/eros-emozione/ eros emozione] [http://bemedad.125mb.com/blog/sexy-ebonies.htm sexy ebonies] [http://kuzelka111.ifrance.com/lib/verica-serifovic/ verica serifovic] [http://superspounge.ifrance.com/marketing-vino/ marketing vino] [http://mcgoley.125mb.com/articles/blue-bossa.htm blue bossa] [http://vanopo.ifrance.com/library/hd/ hd 32] [http://kamedcal.125mb.com/florette.htm florette] [http://kamedcal.125mb.com/holli-marie.htm holli marie combs] [http://kuzelka111.ifrance.com/lib/venezia-bed/ venezia bed and breakfast] [http://earthlygnome.ifrance.com/brava-/ brava 105 jtd] [http://madavidan.125mb.com/text/schiller-mit.htm schiller mit heppner leben i feel you] [http://vanopo.ifrance.com/library/auricolare-blue/ auricolare blue tooth qtek] [http://doloeb.125mb.com/sexmon.htm sexmon] [http://madavidan.125mb.com/text/festa-damore.htm festa damore] [http://dragonzgrace.ifrance.com/description/it-s/ it s a hard day] [http://mamerium.125mb.com/silver-jewelry.htm silver jewelry] [http://madavidan.125mb.com/text/the-revision.htm the revision of the acquis] [http://earthlygnome.ifrance.com/rex-rd/ rex rd 185 dx] [http://kuzelka111.ifrance.com/lib/paliurus/ paliurus] [http://mike12305.ifrance.com/lib/cpu-amd/ cpu amd64 socket 940] [http://vanopo.ifrance.com/library/lettore-mp/ lettore mp3 boghe vip quadro] [http://vanopo.ifrance.com/library/back-street/ back street boys i still] [http://vanopo.ifrance.com/library/splitter-video/ splitter video] [http://bemedad.125mb.com/blog/palestra-milano.htm palestra milano angelo caroli club] [http://raneely.125mb.com/text/barzelletta-carabiniere.htm barzelletta carabiniere] [http://raneely.125mb.com/text/nomadi-copertine.htm nomadi copertine cd] [http://vanopo.ifrance.com/library/lavatrici-rex/ lavatrici rex] [http://raneely.125mb.com/text/il-re.htm il re in anteprima] [http://kuzelka111.ifrance.com/lib/network-attached/ network attached] [http://vanopo.ifrance.com/library/bmx-bicicletta/ bmx bicicletta] [http://madavidan.125mb.com/text/lcd-samsung.htm lcd samsung 40] [http://vanopo.ifrance.com/library/fuori-dal/ fuori dal tunnel caparezza] [http://stbrocke.125mb.com/content/superior.htm superior] [http://kewheatl.125mb.com/library/isole-di.htm isole di capoverde] [http://doloeb.125mb.com/irradio-.htm irradio  micro] [http://kuzelka111.ifrance.com/lib/hi-fi/ hi fi] [http://mamerium.125mb.com/incontri-pordenone.htm incontri pordenone] [http://madavidan.125mb.com/text/wake-up.htm wake up] [http://mcgoley.125mb.com/articles/che-spasso.htm che spasso] [http://bakedsmurf.ifrance.com/description/pubblicita/ pubblicita] [http://bakedsmurf.ifrance.com/description/batterie-samsung/ batterie samsung z300] [http://superspounge.ifrance.com/giochi-di/ giochi di alloween in cui bisogna entrare nelle case e trovare oggetti] [http://kuzelka111.ifrance.com/lib/chicas-speed/ chicas speed] [http://kuzelka111.ifrance.com/lib/ef-mm/ ef 55200mm f 4 55 6 ii usm] [http://madavidan.125mb.com/text/lidi-ravennati.htm lidi ravennati] [http://bakedsmurf.ifrance.com/description/igiene-degli/ igiene degli alimenti] [http://kamedcal.125mb.com/frangiosa.htm frangiosa] [http://kamedcal.125mb.com/il-figlio.htm il figlio di spartacus] [http://kewheatl.125mb.com/library/sybian.htm sybian] [http://todkonda.ifrance.com/content/ristorante-pizzeria/ ristorante pizzeria europa] [http://doloeb.125mb.com/lazio-vola.htm lazio vola] [http://bakedsmurf.ifrance.com/description/green-mountains/ green mountains] [http://prkinardan.125mb.com/styles/canon-a.htm canon a 300] [http://kuzelka111.ifrance.com/lib/sex-bestial/ sex bestial] [http://bemedad.125mb.com/blog/testo-my.htm testo my heart will go on] [http://kamedcal.125mb.com/belami.htm belami] [http://todkonda.ifrance.com/content/my-emotion/ my emotion] [http://kamedcal.125mb.com/stampante-a.htm stampante a3 deskjet colori ethernet] [http://todkonda.ifrance.com/content/dragostea-cover/ dragostea cover] [http://mcgoley.125mb.com/articles/online.htm online] [http://todkonda.ifrance.com/content/il-video/ il video degli ostaggi bulgari] [http://kewheatl.125mb.com/library/farmaci.htm farmaci] [http://bakedsmurf.ifrance.com/description/la-spia/ la spia dal dente doro] [http://bemedad.125mb.com/blog/nikon-ehb.htm nikon eh62b] [http://todkonda.ifrance.com/content/grenn/ grenn] [http://mcgoley.125mb.com/articles/royal-canin.htm royal canin latte cuccioli] [http://doloeb.125mb.com/straight-shooting.htm straight shooting] [http://doloeb.125mb.com/philips-pf.htm philips 50pf7320 10] [http://earthlygnome.ifrance.com/la-montagna/ la montagna di luce] [http://madavidan.125mb.com/text/citta-brugherio.htm citta brugherio milano] [http://superspounge.ifrance.com/leatherman-squirt/ leatherman squirt p4] [http://dragonzgrace.ifrance.com/description/dediche-dolci/ dediche dolci] [http://kamedcal.125mb.com/belgio-hotel.htm belgio hotel] [http://sylverrain.ifrance.com/data/aggiornamento-veloce/ aggiornamento veloce sulle tecnologie degli attual] [http://mcgoley.125mb.com/articles/volvo-t.htm volvo t5] [http://doloeb.125mb.com/austin-mary.htm austin mary hunter] [http://sylverrain.ifrance.com/data/corse-di/ corse di slitte] [http://sylverrain.ifrance.com/data/you-spin/ you spin me right round baby] [http://bemedad.125mb.com/blog/winmix-download.htm winmix download] [http://prkinardan.125mb.com/styles/banco-di.htm banco di sicilia] [http://superspounge.ifrance.com/scusami-midi/ scusami midi file dei pooh] [http://stbrocke.125mb.com/content/the-mythical.htm the mythical detective loki ragnarok vol 01] [http://bemedad.125mb.com/blog/telefoni-cordless.htm telefoni cordless motorola] [http://dragonzgrace.ifrance.com/description/visitare-loret/ visitare loret de mar] [http://kewheatl.125mb.com/library/depp-it.htm depp it low] [http://mike12305.ifrance.com/lib/supporto-cellulare/ supporto cellulare per auto] [http://dragonzgrace.ifrance.com/description/cd-slim/ cd slim usb] [http://raneely.125mb.com/text/united-artt.htm united artt] [http://doloeb.125mb.com/centro-commenrciale.htm centro commenrciale] [http://bakedsmurf.ifrance.com/description/sesso-animale/ sesso animale it] [http://todkonda.ifrance.com/content/pacha/ pacha] [http://kuzelka111.ifrance.com/lib/ravazzi-cristina/ ravazzi cristina] [http://kuzelka111.ifrance.com/lib/rs-mmc/ rs mmc mobile memory card 512 mb] [http://mamerium.125mb.com/panca-legno.htm panca legno] [http://mamerium.125mb.com/visual-c.htm visual c net 2003] [http://dragonzgrace.ifrance.com/description/fax-samsung/ fax samsung sf330] [http://bakedsmurf.ifrance.com/description/impuntura/ impuntura] [http://raneely.125mb.com/text/stampanti-inkjet.htm stampanti inkjet multifunzione] [http://todkonda.ifrance.com/content/eliza-dushku/ eliza dushku] [http://kuzelka111.ifrance.com/lib/archilochus/ archilochus] [http://earthlygnome.ifrance.com/da-gennaro/ da gennaro] [http://prkinardan.125mb.com/styles/scaldabiberon-casa.htm scaldabiberon casa auto] [http://madavidan.125mb.com/text/dolore.htm dolore] [http://earthlygnome.ifrance.com/kloj/ kloj] [http://vanopo.ifrance.com/library/mas-que/ mas que nada] [http://mamerium.125mb.com/igor-milanovic.htm igor milanovic] [http://mamerium.125mb.com/castrocaro.htm castrocaro] [http://doloeb.125mb.com/panca-per.htm panca per inversione apollo] [http://mike12305.ifrance.com/lib/nec/ nec 228] [http://raneely.125mb.com/text/commercio-equo.htm commercio equo solidale] [http://vanopo.ifrance.com/library/cous-cous/ cous cous] [http://vanopo.ifrance.com/library/silga-settimo/ silga settimo cielo] [http://raneely.125mb.com/text/testo-tekkaman.htm testo tekkaman] [http://bemedad.125mb.com/blog/panasonic-minidv.htm panasonic minidv nvgs17] [http://mamerium.125mb.com/il-treno.htm il treno ha fischiato di pirandello] [http://earthlygnome.ifrance.com/il-marchio/ il marchio del bruto] [http://superspounge.ifrance.com/cardiopatia/ cardiopatia] [http://bemedad.125mb.com/blog/deborah-secco.htm deborah secco nua] [http://superspounge.ifrance.com/nokia-/ nokia 2650 usb] [http://todkonda.ifrance.com/content/singola-genova/ singola genova] [http://kewheatl.125mb.com/library/webcam-com.htm webcam com] [http://mike12305.ifrance.com/lib/thin-lizzy/ thin lizzy at rockpalast] [http://earthlygnome.ifrance.com/parfait/ parfait] [http://todkonda.ifrance.com/content/sauna-svizzera/ sauna svizzera] [http://prkinardan.125mb.com/styles/mario-piu.htm mario piu communication] [http://sylverrain.ifrance.com/data/ospedali-emilia/ ospedali emilia romagna] [http://prkinardan.125mb.com/styles/jvc-ths.htm jvc ths1] [http://dragonzgrace.ifrance.com/description/sinceramente-tua/ sinceramente tua] [http://dragonzgrace.ifrance.com/description/buyer-senior/ buyer senior (regione veneto)] [http://mcgoley.125mb.com/articles/ray-ban.htm ray ban 3132] [http://mcgoley.125mb.com/articles/singola-over.htm singola over 50] [http://mcgoley.125mb.com/articles/scene-sulla.htm scene sulla mafia] [http://mcgoley.125mb.com/articles/piede-nudo.htm piede nudo] [http://sylverrain.ifrance.com/data/www-poltronesofa/ www poltronesofa it] [http://madavidan.125mb.com/text/pronuncia-inglese.htm pronuncia inglese] [http://mike12305.ifrance.com/lib/frou-frou/ frou frou good to be in love] [http://mcgoley.125mb.com/articles/soltanto-canzone.htm soltanto canzone] [http://todkonda.ifrance.com/content/marjorie-sempre/ marjorie sempre] [http://kuzelka111.ifrance.com/lib/fotos-rita/ fotos rita cadillac] [http://raneely.125mb.com/text/wwww-google.htm wwww google] [http://kuzelka111.ifrance.com/lib/grp/ grp] [http://kamedcal.125mb.com/motorola-.htm motorola  hs810] [http://todkonda.ifrance.com/content/hotels-/ hotels  belgio] [http://earthlygnome.ifrance.com/www-lycos/ www lycos] [http://mcgoley.125mb.com/articles/lebt-denn.htm lebt denn dr alte holzmichl no] [http://raneely.125mb.com/text/carboni-luca.htm carboni luca] [http://mcgoley.125mb.com/articles/patricia.htm patricia] [http://todkonda.ifrance.com/content/kl-bogel/ kl bogel] [http://madavidan.125mb.com/text/lg-rh.htm lg rh7800 160 gb] [http://kuzelka111.ifrance.com/lib/scegli-me/ scegli me di raiz] [http://vanopo.ifrance.com/library/www-pley/ www pley boi it] [http://sylverrain.ifrance.com/data/intimo-dolce/ intimo dolce e gabbana uomo] [http://vanopo.ifrance.com/library/in-fuga/ in fuga col cretino] [http://kamedcal.125mb.com/zapomnij-o.htm zapomnij o tym trzeci wymiar] [http://madavidan.125mb.com/text/toyota-yaris.htm toyota yaris 1 4 tdi] [http://dragonzgrace.ifrance.com/description/centrifuga-a/ centrifuga a] [http://todkonda.ifrance.com/content/il-cerchio/ il cerchio della vita] {{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 12: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