Hard Disk Backup HOWTO

From Xbox-Linux

by Michael Steil (Original Version: 8 May 2002)

With the Xbox hard disk conntected to your Linux computer, or with Linux running on your Xbox, you can easily make backups of the hard disk. Note that you have to replace "hdc" with "hda", if you use these commands on the Xbox - and of course, the directory you are in should be a network volume.

You can just make a complete image by running the following line as root:

dd if=/dev/hdc of=xbox-image.raw bs=1M

Note that you need kernel 2.4 or above and a file system that supports files bigger than 2 GB (e.g. notext2 or FAT), because the image size will be about 10 GB. It is possible to split the image into 1 GB files:

dd if=/dev/hdc bs=1M | split -b 1024m

If you want to experiment with the image contents, it might make sense to read the partitions into single files, as described in the table below. (It might be a good idea to compress the files and backup them to a CD-R. A bzip2-compressed backup of an Xbox hard disk that has never seen a game or audio CD will only be about 250 MB.)

No split, filesystem without 2 GB limit Split, filesystem with 2 GB limit
Backup
dd if=/dev/hdc of=00head.raw         count=1    bs=512k
dd if=/dev/hdc of=0.raw    skip=1    count=1500 bs=512k
dd if=/dev/hdc of=1.raw    skip=1501 count=1500 bs=512k
dd if=/dev/hdc of=2.raw    skip=3001 count=1500 bs=512k
dd if=/dev/hdc of=3.raw    skip=4501 count=1000 bs=512k
dd if=/dev/hdc of=4.raw    skip=5501 count=9790 bs=512k
dd if=/dev/hdc of=5.raw    skip=15291           bs=512k
dd if=/dev/hdc of=00head.raw         count=1    bs=512k
dd if=/dev/hdc of=0.raw    skip=1    count=1500 bs=512k
dd if=/dev/hdc of=1.raw    skip=1501 count=1500 bs=512k
dd if=/dev/hdc of=2.raw    skip=3001 count=1500 bs=512k
dd if=/dev/hdc of=3.raw    skip=4501 count=1000 bs=512k
dd if=/dev/hdc             skip=5501 count=9790 bs=512k | split -b 1024m - 4
dd if=/dev/hdc             skip=15291           bs=512k | split -b 1024m - 5
Compress
bzip2 -9 *.raw
bzip2 -9 *.raw 4* 5*
Restore all
cat *.raw > /dev/hdc
cat *.raw 4* 5* > /dev/hdc
Restore all (compressed)
bzip2 -cd *.bz2 > /dev/hdc
bzip2 -cd *.bz2 > /dev/hdc
Restore single partition/s
dd if=00head.raw of=/dev/hdc            bs=512k
dd if=0.raw      of=/dev/hdc seek=1     bs=512k
dd if=1.raw      of=/dev/hdc seek=1501  bs=512k
dd if=2.raw      of=/dev/hdc seek=3001  bs=512k
dd if=3.raw      of=/dev/hdc seek=4501  bs=512k
dd if=4.raw      of=/dev/hdc seek=5501  bs=512k
dd if=5.raw      of=/dev/hdc seek=15291 bs=512k
dd if=00head.raw of=/dev/hdc            bs=512k
dd if=0.raw      of=/dev/hdc seek=1     bs=512k
dd if=1.raw      of=/dev/hdc seek=1501  bs=512k
dd if=2.raw      of=/dev/hdc seek=3001  bs=512k
dd if=3.raw      of=/dev/hdc seek=4501  bs=512k
cat 4* | dd of=/dev/hdc seek=5501  bs=512k
cat 5* | dd of=/dev/hdc seek=15291 bs=512k
Restore single partition/s (compressed)
bzip2 -cd 00head.raw.bz2 | dd of=/dev/hdc            bs=512k
bzip2 -cd 0.raw.bz2      | dd of=/dev/hdc seek=1     bs=512k
bzip2 -cd 1.raw.bz2      | dd of=/dev/hdc seek=1501  bs=512k
bzip2 -cd 2.raw.bz2      | dd of=/dev/hdc seek=3001  bs=512k
bzip2 -cd 3.raw.bz2      | dd of=/dev/hdc seek=4501  bs=512k
bzip2 -cd 4.raw.bz2      | dd of=/dev/hdc seek=5501  bs=512k
bzip2 -cd 5.raw.bz2      | dd of=/dev/hdc seek=15291 bs=512k
bzip2 -cd 00head.raw.bz2 | dd of=/dev/hdc            bs=512k
bzip2 -cd 0.raw.bz2      | dd of=/dev/hdc seek=1     bs=512k
bzip2 -cd 1.raw.bz2      | dd of=/dev/hdc seek=1501  bs=512k
bzip2 -cd 2.raw.bz2      | dd of=/dev/hdc seek=3001  bs=512k
bzip2 -cd 3.raw.bz2      | dd of=/dev/hdc seek=4501  bs=512k
bzip2 -cd 4*             | dd of=/dev/hdc seek=5501  bs=512k
bzip2 -cd 5*             | dd of=/dev/hdc seek=15291 bs=512k

This will result in the following files:

File Name Size Description
00head.raw 0.5 MB Disk Config Area
0.raw 750 MB Game Cache A (FATX), X:
1.raw 750 MB Game Cache B (FATX), Y:
2.raw 750 MB Game Cache C (FATX), Z:
3.raw 500 MB System Files (FATX), C:
4.raw


or
4aa,4ab,4ac,4ad,4ae

4895 MB Music, Saved Games (FATX), E:
5.raw


or
5aa,5ab

1896 MB unused/empty, F:

If you want to extract data from the FATX partitions stored in single files using the program xboxdumper , you will have to modify the array partitionAddresses[] at the beginning of the file main.c as follows:

u_int64_t partitionAddresses[] = { 0, 0, 0, 0, 0 };

Now always pass the corresponding image file to xboxdumper as a parameter, for instance:

./xboxdumper list 3 3.raw