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)
 
(10 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[http://sthuckst.ifrance.com/mustek-powermust4/ mustek powermust office 650] [http://veredda.ifrance.com/resources/la-torba.htm la torba] [http://trermer.ifrance.com/small/screen-saver3/ screen saver builder] [http://maramsde.ifrance.com/directory/flash-canon2/ flash canon speedlite 420ex] [http://mejordan.ifrance.com/index4_1000.html index] [http://lokelseyn.ifrance.com/www-flirtfree/ www flirt4free com] [http://maramsde.ifrance.com/directory/ragazze-nere/ ragazze nere] [http://trermer.ifrance.com/small/leducazione-sentimentale/ leducazione sentimentale] [http://mejordan.ifrance.com/vendita-carte1.htm vendita carte yu gi oh rare] [http://trermer.ifrance.com/index0_500.html home] [http://trermer.ifrance.com/small/claforan/ claforan] [http://nipierre.ifrance.com/articles/ausforming.htm ausforming] [http://nipierre.ifrance.com/articles/ofx-.htm ofx 9100 fax olivetti] [http://mejordan.ifrance.com/tecnico-sanitario.htm tecnico sanitario di radiologia medica] [http://trermer.ifrance.com/index4_250.html url] [http://nipierre.ifrance.com/articles/jvc-shx.htm jvc shx751] [http://trermer.ifrance.com/small/ball-revamped/ ball revamped] [http://sthuckst.ifrance.com/ricette-empanadas/ ricette empanadas de carne] [http://trermer.ifrance.com/small/batteria-sony5/ batteria sony portatile] [http://maramsde.ifrance.com/directory/coppa-del/ coppa del mondo] [http://nipierre.ifrance.com/articles/honda-vtr.htm honda vtr] [http://sthuckst.ifrance.com/bussola-mare/ bussola mare] [http://mejordan.ifrance.com/cx-epson.htm cx6600 epson] [http://mejordan.ifrance.com/trova-amico.htm trova amico] [http://mejordan.ifrance.com/index3_1000.html homepage] [http://trermer.ifrance.com/small/componenti-informatici/ componenti informatici] [http://veredda.ifrance.com/resources/reggaeton-lyrics.htm reggaeton lyrics] [http://bekleem.ifrance.com/content/il-mio15/ il mio fratellino ha distanza] [http://sthuckst.ifrance.com/gorgia/ gorgia] [http://sthuckst.ifrance.com/index1_250.html site] [http://lokelseyn.ifrance.com/index2_250.html homepage] [http://nipierre.ifrance.com/articles/escort-orientali.htm escort orientali] [http://mejordan.ifrance.com/ucciso-baldoni.htm ucciso baldoni] [http://veredda.ifrance.com/resources/staffa-tv2.htm staffa tv lcd sharp] [http://mejordan.ifrance.com/index4_1000.html index] [http://mejordan.ifrance.com/big-job.htm big job] [http://veredda.ifrance.com/resources/usato-barca.htm usato barca] [http://nipierre.ifrance.com/articles/mya.htm mya] [http://nipierre.ifrance.com/articles/kia-sportage2.htm kia sportage km zero] [http://bekleem.ifrance.com/content/monitor-18/ monitor 30 wide] [http://mejordan.ifrance.com/index3_1000.html homepage] [http://bekleem.ifrance.com/index1_500.html page] [http://trermer.ifrance.com/small/pollutri/ pollutri] [http://maramsde.ifrance.com/directory/prealpina-varese/ prealpina varese] [http://maramsde.ifrance.com/directory/scarpe-cult/ scarpe cult] [http://sthuckst.ifrance.com/calcio-manager2/ calcio manager] [http://veredda.ifrance.com/resources/euro-5.htm euro 2004 hino] [http://bekleem.ifrance.com/content/come-ingrandire/ come ingrandire il pene] [http://veredda.ifrance.com/resources/ghost-song.htm ghost song] [http://maramsde.ifrance.com/index2_500.html site] [http://lokelseyn.ifrance.com/free-gay2/ free gay pic] [http://veredda.ifrance.com/resources/industria-europea.htm industria europea nel primo 900] [http://nipierre.ifrance.com/index3_500.html url] [http://nipierre.ifrance.com/index4_500.html homepage] [http://lokelseyn.ifrance.com/index2_250.html homepage] [http://lokelseyn.ifrance.com/index2_250.html homepage] [http://veredda.ifrance.com/resources/i-favolosi.htm i favolosi baker] [http://nipierre.ifrance.com/articles/cerhi-1.htm cerhi  motard] [http://nipierre.ifrance.com/articles/radikal-bikers.htm radikal bikers] [http://trermer.ifrance.com/small/queens/ queens] [http://maramsde.ifrance.com/directory/weight/ weight] [http://veredda.ifrance.com/resources/cartina-torino.htm cartina torino] [http://lokelseyn.ifrance.com/dx-bool/ dx bool] [http://trermer.ifrance.com/small/vhs-donne/ vhs donne mature] [http://maramsde.ifrance.com/directory/www-ac1/ www ac milan com] [http://maramsde.ifrance.com/directory/olea/ olea] [http://lokelseyn.ifrance.com/index1_500.html index] [http://nipierre.ifrance.com/articles/honda-cr1.htm honda cr v] [http://nipierre.ifrance.com/articles/buenas-vaginas.htm buenas vaginas] [http://mejordan.ifrance.com/saker-torta.htm saker torta] [http://sthuckst.ifrance.com/givenchy-organza/ givenchy organza] [http://maramsde.ifrance.com/directory/foto-uomini3/ foto uomini pornostar] [http://mejordan.ifrance.com/index3_1000.html homepage] [http://lokelseyn.ifrance.com/index0_500.html link] [http://veredda.ifrance.com/resources/olduvai.htm olduvai] [http://trermer.ifrance.com/small/chartreuse/ chartreuse] [http://maramsde.ifrance.com/index3_500.html map] [http://bekleem.ifrance.com/content/arriva-fra/ arriva fra cristoforo] [http://nipierre.ifrance.com/index4_500.html homepage] [http://veredda.ifrance.com/resources/erotiek.htm erotiek] [http://trermer.ifrance.com/small/nuovi-racconti/ nuovi racconti romani] [http://mejordan.ifrance.com/sexo-virtual.htm sexo virtual] [http://bekleem.ifrance.com/content/tablature-basso/ tablature basso] [http://trermer.ifrance.com/small/scontri-ultras/ scontri ultras] [http://nipierre.ifrance.com/index0_500.html map] [http://bekleem.ifrance.com/index1_500.html page] [http://bekleem.ifrance.com/content/gelosia/ gelosia] [http://trermer.ifrance.com/small/tvc2/ tvc 37] [http://trermer.ifrance.com/index2_500.html homepage] [http://nipierre.ifrance.com/articles/un-uomo10.htm un uomo come lui] [http://maramsde.ifrance.com/directory/collapase/ collapase] [http://veredda.ifrance.com/resources/navigatore-gps10.htm navigatore gps navman] [http://maramsde.ifrance.com/directory/essiccazione-pasta/ essiccazione pasta] [http://maramsde.ifrance.com/index3_500.html map] [http://lokelseyn.ifrance.com/rodica-olariu/ rodica olariu] [http://veredda.ifrance.com/resources/tracce-di1.htm tracce di italiano maturita] [http://trermer.ifrance.com/small/moto-gp9/ moto gp download] [http://sthuckst.ifrance.com/index1_250.html site] [http://lokelseyn.ifrance.com/index0_500.html link] [http://veredda.ifrance.com/index1_250.html link] [http://www.hiidenkivenpaivakoti.fi/help/new/xrcdee.html belle negrone] [http://www.worthwhilehosting.com/banners/auto/lurjbt.html Giornalista italiana foto nuda sexi] [http://www.ccrs.uzh.ch/user/root/lpvtid.html Radio kiss kiss] [http://www.hiidenkivenpaivakoti.fi/help/new/bfcrsd.html Giochi di winx] [http://www.hiidenkivenpaivakoti.fi/help/new/hsuuvf.html Carlo verdone] [http://www.worthwhilehosting.com/banners/auto/pwxskg.html Gagged mouth rubber suit] [http://www.ccrs.uzh.ch/user/root/cjkreq.html Juliana moreira nuda] [http://www.worthwhilehosting.com/banners/auto/qqxkxs.html Calcionapoli it] [http://www.hiidenkivenpaivakoti.fi/help/new/jvbuwx.html The sims trucchi] [http://www.ccrs.uzh.ch/user/root/tvknjo.html Frog sex] [http://www.ccrs.uzh.ch/user/root/qutpsb.html Amateur gallery easy free sex] [http://www.startonlineweb.com/help/new/vujdox.html Elettrostimolatori fitness] [http://www.startonlineweb.com/help/new/ekmuxo.html Sistema di qualita iso] [http://www.worthwhilehosting.com/banners/auto/ijkkox.html Simona valli download] [http://www.ccrs.uzh.ch/user/root/xgmtne.html Aloe arborescens] [http://www.worthwhilehosting.com/banners/auto/otiggv.html Fondi esteri] [http://www.hiidenkivenpaivakoti.fi/help/new/khqgxe.html Circeo] [http://www.worthwhilehosting.com/banners/auto/ckmkmd.html porno professoresse] [http://www.hiidenkivenpaivakoti.fi/help/new/odjxgp.html Grandes culos] [http://www.worthwhilehosting.com/banners/auto/utrcjo.html Borse donna polizia] [http://www.hiidenkivenpaivakoti.fi/help/new/rtgtxh.html Rivoluzione industriale] [http://www.hiidenkivenpaivakoti.fi/help/new/ilcwsj.html Paradiso beach swan tour] [http://www.worthwhilehosting.com/banners/auto/gjtswc.html Foto amatoriali xxx] [http://www.startonlineweb.com/help/new/vuejtf.html Cartoni xxx] [http://www.worthwhilehosting.com/banners/auto/exahtg.html Iomilu racconto] [http://www.worthwhilehosting.com/banners/auto/rnpjqb.html Software gestione vendita gestionale] [http://www.ccrs.uzh.ch/user/root/khokff.html Pokemon it] [http://www.ccrs.uzh.ch/user/root/itgbvj.html Kates playground] [http://www.ccrs.uzh.ch/user/root/ivksmt.html Maciste] [http://www.worthwhilehosting.com/banners/auto/viokwx.html Casella posta elettronica gratis] [http://www.startonlineweb.com/help/new/tuxiqe.html Lampione giardino] [http://www.ccrs.uzh.ch/user/root/femwfn.html Casting bambini milano] [http://www.ccrs.uzh.ch/user/root/owquoj.html Vacanza madrid] [http://www.hiidenkivenpaivakoti.fi/help/new/ogcjwf.html Spiagge nudisti italia] [http://www.startonlineweb.com/help/new/rixiav.html Wifeysworld biz] [http://www.startonlineweb.com/help/new/ccssop.html W ancitel it] [http://www.worthwhilehosting.com/banners/auto/istgib.html Musica ascoltare] [http://www.worthwhilehosting.com/banners/auto/rhawnv.html Fumetti sexi] [http://www.ccrs.uzh.ch/user/root/aarpqe.html Aereoporto verona] [http://www.ccrs.uzh.ch/user/root/spkmpv.html Prenotazione albergo zurigo] [http://www.startonlineweb.com/help/new/bldkpb.html Tatuaggio sole] [http://www.startonlineweb.com/help/new/juiffu.html Snals it%2fsr] [http://www.ccrs.uzh.ch/user/root/wgvbue.html Automazione industriale cuneo] [http://www.startonlineweb.com/help/new/rvkjgd.html Vecchie che scopano con ragazzi] [http://www.worthwhilehosting.com/banners/auto/udmlbm.html Www sborra in faccia it] [http://www.ccrs.uzh.ch/user/root/oaphqc.html Traghetti ventotene] [http://www.startonlineweb.com/help/new/ejlcce.html Hotel cosenza] [http://www.worthwhilehosting.com/banners/auto/nbqrqc.html Paola turci] [http://www.ccrs.uzh.ch/user/root/bnvbgk.html Provider adsl calabria] [http://www.hiidenkivenpaivakoti.fi/help/new/rajnpg.html Troie on line] [http://www.ccrs.uzh.ch/user/root/lirggl.html Posizionamento elettrode] [http://www.hiidenkivenpaivakoti.fi/help/new/ooaxcb.html Corso spagnolo roma] [http://www.hiidenkivenpaivakoti.fi/help/new/krrvbc.html Assegno nucleo familiare] [http://www.hiidenkivenpaivakoti.fi/help/new/srcrqo.html Creare sito gratis] [http://www.ccrs.uzh.ch/user/root/vakcdx.html Canto liturgico] [http://www.worthwhilehosting.com/banners/auto/vhuadf.html Prestito terni] [http://www.startonlineweb.com/help/new/dhhmxd.html Agenzia matrimoniali umbria] [http://www.worthwhilehosting.com/banners/auto/idgpse.html Porno culi] [http://www.worthwhilehosting.com/banners/auto/gdqnvk.html Giorgia surina video capture] [http://www.ccrs.uzh.ch/user/root/hutnfv.html Casa feria europa dobbiaco] [http://www.hiidenkivenpaivakoti.fi/help/new/vfjkwj.html Corso di fotografia firenze sicilia] [http://www.ccrs.uzh.ch/user/root/awtmev.html Micosi cutanee] [http://www.startonlineweb.com/help/new/xqtapo.html Princesa sofia hotel] [http://www.ccrs.uzh.ch/user/root/nnpfel.html Escort trans shemale] [http://www.ccrs.uzh.ch/user/root/qnhxfi.html Riflessologia plantare] [http://www.ccrs.uzh.ch/user/root/ipxhfm.html Ammortamento prestito] [http://www.ccrs.uzh.ch/user/root/xqqbsr.html Ballerina scena degas] [http://www.startonlineweb.com/help/new/uqabxc.html Hymen virgin] [http://www.worthwhilehosting.com/banners/auto/hgwlei.html Favignana] [http://www.worthwhilehosting.com/banners/auto/fllana.html Nicolas vaporidis] [http://www.hiidenkivenpaivakoti.fi/help/new/itkfxb.html Vacanza estate] [http://www.worthwhilehosting.com/banners/auto/cqtuvl.html Elettrostimolatore elettrode] [http://www.hiidenkivenpaivakoti.fi/help/new/egqeak.html Cinecity] [http://www.worthwhilehosting.com/banners/auto/xxuvcd.html Nokia 3230 mallteam] [http://www.ccrs.uzh.ch/user/root/cnkjgo.html Contact center genialloyd] [http://www.ccrs.uzh.ch/user/root/lmwkjj.html Popkorn annuncio] [http://www.worthwhilehosting.com/banners/auto/vxhrgn.html Chat spagnola] [http://www.worthwhilehosting.com/banners/auto/nocqss.html Donne vogliose video] [http://www.hiidenkivenpaivakoti.fi/help/new/flcjhv.html Mib 30] [http://www.startonlineweb.com/help/new/ceglcu.html Affitto casa] [http://www.startonlineweb.com/help/new/vjlmsw.html Foto thais wiggers] [http://www.hiidenkivenpaivakoti.fi/help/new/rmdrls.html Jeremy sumpter italia] [http://www.hiidenkivenpaivakoti.fi/help/new/pwkdre.html scopate russe] [http://www.hiidenkivenpaivakoti.fi/help/new/inlfxf.html Vip naked] [http://www.startonlineweb.com/help/new/hwbrft.html Best mortgage rata] [http://www.ccrs.uzh.ch/user/root/dknjep.html Torino parco collina superga] [http://www.hiidenkivenpaivakoti.fi/help/new/qoutdf.html Engagement ring] [http://www.worthwhilehosting.com/banners/auto/cnlubn.html Prestito terni online] [http://www.worthwhilehosting.com/banners/auto/gfmdfs.html Bambola] [http://www.hiidenkivenpaivakoti.fi/help/new/dhimdc.html Download puntatori mouse] [http://www.startonlineweb.com/help/new/dkbaim.html Controcampo] [http://www.worthwhilehosting.com/banners/auto/xblvup.html Phonerotica] [http://www.hiidenkivenpaivakoti.fi/help/new/dxbpdf.html Tesina il sogno] [http://www.startonlineweb.com/help/new/bxhddp.html Sistema domotica] [http://www.ccrs.uzh.ch/user/root/kesild.html Foto uomo muscolosi] [http://www.startonlineweb.com/help/new/pmtclb.html Invio sms] [http://www.worthwhilehosting.com/banners/auto/mhpuoi.html Albergo graz] [http://www.hiidenkivenpaivakoti.fi/help/new/dtiuit.html Glory hole] [http://www.worthwhilehosting.com/banners/auto/fwslaw.html Musica pubblicita spot] [http://www.startonlineweb.com/help/new/glnbpm.html Curare la periartrite] {{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