Jump to content


Photo

Build A Working Xbox Hd From Scratch


  • Please log in to reply
151 replies to this topic

#1 ldots

ldots

    X-S Freak

  • Members
  • PipPipPipPipPip
  • 1,496 posts

Posted 02 April 2004 - 08:04 PM

This will explain how to make a clean HD work with your xbox

Why did I do this?
Mostly for fun biggrin.gif
I wanted to learn about the layout of the xbox HD and fatx format, but realized that this could be usefull for making a working HD :
- for people who's HD stops working.
- for people who want to have second HD to put in their xbox. Yes, cloning the old one is most likely easier, but maybe people dont like hotswapping and are not comfortable with opening their xbox until they have build their new HD.
- for people who have messed it up so bad doing unsuccesfull exploits that rebuilding it is needed. Often people can restore their HD back to normal by using HDD Driver and removing their soft exploit, but lets face. HDD Driver is buggy. Some people don't even get it running. Others have reported that HDD Driver corrupted their files. Xlinux is another option for uninstalling exploits but sometimes the fatx-filesystem is simply corrupt.
- for people who "forgot" to make an image of their original drive before disaster struck.

Finally I simply find it cool that it is possible to make your xbox work even if the HD should stop working or gets corrupted one day. At least I know of a few people on this forum that will benefit from this...

Things needed :
1) Your xbox eeprom, or the passwd for your current drive if you just want to rebuild this. Without a modchip the xbox HD need to be locked with a unique passwd when the xbox boots. If you build a new drive this passwd can be calculated using your xbox eeprom and a little proggy called liveinfo. You can get your eeprom from the backup option in Evox. The first thing any softmodder should do when they run their very first game save hack is backup system files (C-drive), eeprom and hdd passwd
2) A bootable fatx enabled linux with the mkfs.fatx utility - I recommend Xebian
3) Access to xbox system-files. Either from an old backup or from Slayers Evox CD.
4) Unlockx if you are building a new drive.

The xbox HD structure
The xbox HD doesn't have an actual partition table. The partition table is hardcoded in the xbox kernel. The linux driver for xbox fatx harddrives is build in a similar way assigning a given series of sectors to a given partition.
The xbox HD header is one block long and doesn't really contain much of interrest except the magic word 'BRFR' at offset 0x600. The linux kernel identifies a xbox HD by this magic word as well as the occurance of the string FATX in the beginning of the following blocks :
CODE

block     partition
1         Game Cache X:
1501      Game Cache Y:
3001      Game Cache Z:
4501      System     C:
5501      System     E:


Connect your non-working xbox drive or blank HD
to the secondary master channel on your PC (i will assume this in the following). This should make the xbox drive /dev/hdc. You can verify when in linux by typing :
CODE
dmesg | grep hd


"Building" the partitions
We will "trick" the linux kernel into thinking we have an xbox drive. This is possible since we don't have to write an actual partition table. Create the header. First make a file 1 block long containing all zeros :
CODE
dd if=/dev/zero of=header count=1 bs=512k

Now open this file in a hexedit :
hexedit head
and go to offset 0x600. Write BRFR if in ASCII mode or 42 52 46 52 if in hex mode (you toggle modes with TAB). Save the file : CTRL+x
Now write this to the xbox drive. Note! Be sure by now that the xbox is /dev/hdc. If you write the header to another drive you will distroy this drives partition table.
CODE
dd if=header of=/dev/hdc bs=512k


Now we "build" the fatx partitions knowing where they are located on the drive :
CODE

echo "FATX" | dd of=/dev/hdc seek=1     bs=512k
echo "FATX" | dd of=/dev/hdc seek=1501  bs=512k
echo "FATX" | dd of=/dev/hdc seek=3001  bs=512k
echo "FATX" | dd of=/dev/hdc seek=4501  bs=512k
echo "FATX" | dd of=/dev/hdc seek=5501  bs=512k


Edit : It has been brought to my attention that Xebian sometimes has a screwed up keymapping. The "|" character is sometimes not available. As a quick fix you can remap "Shift+Space" to this character by doing :
CODE

xmodmap -e "keycode 65 = space bar"


Now you must reboot to let linux recognize the drive as fatx.

Formatting the drive
Once rebooted verify that linux has recognized the drive as fatx. The command : ls /dev/hdc* should produce :
/dev/hdc /dev/hdc50 /dev/hdc51 /dev/hdc52 /dev/hdc53 /dev/hdc54

Now format the fatx partitions :
CODE

mkfs.fatx /dev/hdc50
mkfs.fatx /dev/hdc51
mkfs.fatx /dev/hdc52
mkfs.fatx /dev/hdc53
mkfs.fatx /dev/hdc54


Copying files on the drive
Here you have a choice.
1) You could have your xbox system files on another harddrive attached to a different IDE channel in which case you can mount that drive (if first partition on primary master and if NTFS filesystem) :
CODE

mkdir /backupdrive
mount -t ntfs /dev/hda1 /backupdrive


2) You could have the system files in a second CD-drive or you could have packed the systemfiles
in a folder together witht the xebian iso before burning it. Mount that :
CODE

mount -t iso9660 /dev/cdrom /backupdrive


Now you can mount the xbox E-drive and make the UDATA and TDATA folder. Don't know if that's needed?
CODE

mkdir /xbox
mount -t fatx /dev/hdc50 /xbox
mkdir /xbox/UDATA
mkdir /xbox/TDATA
umount /xbox


Now rebuild the xbox C-drive :
CODE

mount -t fatx /dev/hdc51 /xbox
cp -r /backupdrive/path_to_systemfiles/* /xbox
umount /xbox

Edit : Before unmounting the C-drive it might be needed give all files on the C-drive the correct permissions (these could be wrong depending on how they were stored/backed-up). Do the following before the unmount command :
CODE

chmod -R 755 /xbox/*


Finishing up
All done. The rest is basic knowledge. Boot your PC to windows and use liveinfo and your xbox eeprom to generate the correct passwd for the drive. Reboot with a DOS floppy with unlockx to lock the drive. Reassemble your xbox and be happy!

Saving a broken C-drive
A much simpler version of this can be used to save a broken C-drive. Boot Xebian with your xbox drive on secondary master. Reformat the C-drive:
mkfs.fatx /dev/hdc51
mount the C-drive and restore system files like above.

Comments :
8/4-2004 :
I have built a small (9Mb) linux distro that has all the needed features (plus some extra stuff) to do this HD making. It includes a small program that will automate the process of building a working HD drive. It's currently being tested.

Edited by ldots, 08 April 2004 - 09:21 AM.


#2 mkjones

mkjones

    X-S Freak

  • Members
  • PipPipPipPipPip
  • 1,427 posts

Posted 02 April 2004 - 08:55 PM

Cool man smile.gif always wonderd if this was possible!

#3 ldots

ldots

    X-S Freak

  • Members
  • PipPipPipPipPip
  • 1,496 posts

Posted 02 April 2004 - 09:05 PM

Thanks! And it's all tested. I just booted with a drive made this way. Now I feel even safer experimenting with my xbox. Having both an extra HD a safe place and knowing I can always rebuild a drive.
What would be really cool would be to pack a small distro like xlinux with the system-files (bzipped) and a script to automate the process. Then newbies could just attach a blank drive to their PC and execute this script once linux had booted to make a spare HD. But it would of course be a problem finding someone to host such a distro.

Edited by ldots, 02 April 2004 - 09:06 PM.


#4 ftothe3

ftothe3

    X-S X-perience

  • Members
  • PipPip
  • 455 posts

Posted 03 April 2004 - 03:21 AM

QUOTE (ldots @ Apr 2 2004, 10:05 PM)
But it would of course be a problem finding someone to host such a distro.

how bout xbins?

#5 ldots

ldots

    X-S Freak

  • Members
  • PipPipPipPipPip
  • 1,496 posts

Posted 03 April 2004 - 04:32 PM

Would they host a distro containing the xbox system-files (xboxdash etc.) ?
Secondly, would people be interrested in such an xbox HD installer ?

#6 kingroach

kingroach

    X-S Hacker

  • Dev/Contributor
  • PipPipPipPipPipPip
  • 2,741 posts
  • Xbox Version:v1.4
  • 360 version:v5.0 (360S - trinity)

Posted 03 April 2004 - 08:28 PM

u can also host it into linux hosting sites like linuxiso.org. I will be very good for ppl who upgrading Hd and has their boxsoftmodde or TSOP flashed. esp. Upgrading a Hd with softmod is a pain is ass and soetimes they dont work. so, if we can make a HD from scratch and keep first 4 partition exactly the same as xbox stock HD and transfer the rest of the Hd to E:\ partition or split them over E:\ and F:\ partition thet will be nice.

it will also help soem lazy ass ppl like me who doesnt like to play with commands. lol

Edited by kingroach, 03 April 2004 - 08:29 PM.


#7 ldots

ldots

    X-S Freak

  • Members
  • PipPipPipPipPip
  • 1,496 posts

Posted 03 April 2004 - 09:12 PM

It's no problem getting a bootable linux distro hosted, but if there are MS files on it? Slayers is not hosted on xbins wink.gif

Anyways, could be a nice little project. Cloning might still be easier if you allready have a working xbox drive - but this could be a really nice rescue option. I could image three options to present the user with :
1) Build HD from scratch
2) Clone existing xbox drive
3) Rebuild C-drive.

#8 G_David

G_David

    X-S Young Member

  • Members
  • Pip
  • 47 posts

Posted 05 April 2004 - 05:10 AM

having some trouble burning xebian.

When i boot up from xebian... it gives me an error

Call Trace:
Code: Bad EIR Value
<0> Kernal Panic: Attempted to kill unit!

its not the whole thing but its the last 3 stuff on it.

i burned the 1.0.1 iso image using nero on disc at once, cuz the site said so and it didnt work. (using cdr)

I burned xlinux on track at once and it works. (using cdrw)

im outta blanks rite now and my rw is to scratched up to burn any other stuff.

So i was wondering if this is just a computer errror or a burning error like using cdr or rw or burning at disc/track at once

#9 ldots

ldots

    X-S Freak

  • Members
  • PipPipPipPipPip
  • 1,496 posts

Posted 05 April 2004 - 01:50 PM

Could be a bad burn, but I doubt it. The CD does start to run, i.e linux starts to boot right ?
What kind of PC are you running it on?

Anyway - if you pop it in your PC when it's bootet to windows and you can browse the CD just fine, then it's not a bad burn.

Reason I asked about what PC you have was that maybe this particular kernel that Xebian has is not compatible with your architecture.

#10 BluhDeBluh

BluhDeBluh

    X-S Senior Member

  • Members
  • PipPip
  • 209 posts

Posted 05 April 2004 - 02:21 PM

Nice tut. You could post a ready made distro/script onto Usenet for anyone who wants them smile.gif

Is there any chance you could make a CD-bootable cut-down version of the Xebian distro? I'm happy to add my own backup files and EPROM to the CD...

This is a tidier solution to upgrading the HDD than Hotswapping in my opinion smile.gif

#11 tipsylenny

tipsylenny

    X-S Young Member

  • Members
  • Pip
  • 33 posts

Posted 05 April 2004 - 02:37 PM

Pleae help! I think i destroyed my xbox hd when I tried to do a hotswap,Now I just get error 7.

I was not able to make any backup of my xbox hdd, so now I don't have any access to it but I do have another stock hd from my friend's modchipped Xbox.

So here's my question:

Is there a way of using the other working original Xbox HD(with evox installed) on my new Xbox which has no modchip,doing a softmod maybe?

Sorry for my crappy explanation and thanx in advance!

#12 ldots

ldots

    X-S Freak

  • Members
  • PipPipPipPipPip
  • 1,496 posts

Posted 05 April 2004 - 05:16 PM

QUOTE (BluhDeBluh @ Apr 5 2004, 04:21 PM)
Is there any chance you could make a CD-bootable cut-down version of the Xebian distro?

Did something even better (in my opinion anyway biggrin.gif). I have build a linux kernel based on the vanilla sources with the latest fatx patches from xbox-linux. Also included is the mkfs.fatx utility and the most basic linux-tools (busybox). Pretty much just an extended/upgraded version of xlinux.
But I have also put on a script/program that performs the three tasks (menu-based) :
1) Builds a xbox HD from scratch
2) Rebuild an xbox C-partition (brings it back to a virgin state).
3) Clones existing xbox HD onto blank drive.

I'm currently debugging and testing on an old spare HD.

The distro itself is only 15Mb or so. I one should want to add the xbox system-files (meaning it would be an all in one solution), it would grow to 100Mb.

#13 ldots

ldots

    X-S Freak

  • Members
  • PipPipPipPipPip
  • 1,496 posts

Posted 05 April 2004 - 05:22 PM

QUOTE (tipsylenny @ Apr 5 2004, 04:37 PM)
Pleae help! I think i destroyed my xbox hd when I tried to do a hotswap,Now I just get error 7.

Do you have your eeprom or hd key?
Error 7 is a HD timeout, so I think this means that the HD is unlocked by the xbox but the systemfiles are corrupt producing the timeout. So most likely you will need a good amount of luck to perform the hotswap.
If hotswapping is not possible and you do not have neither the hdd key or the eeprom I think your only option is a modchip.

#14 BluhDeBluh

BluhDeBluh

    X-S Senior Member

  • Members
  • PipPip
  • 209 posts

Posted 05 April 2004 - 11:33 PM

QUOTE (ldots @ Apr 5 2004, 07:16 PM)
Did something even better (in my opinion anyway biggrin.gif). I have build a linux kernel based on the vanilla sources with the latest fatx patches from xbox-linux. Also included is the mkfs.fatx utility and the most basic linux-tools (busybox). Pretty much just an extended/upgraded version of xlinux.
But I have also put on a script/program that performs the three tasks (menu-based) :
1) Builds a xbox HD from scratch
2) Rebuild an xbox C-partition (brings it back to a virgin state).
3) Clones existing xbox HD onto blank drive.

I'm currently debugging and testing on an old spare HD.

The distro itself is only 15Mb or so. I one should want to add the xbox system-files (meaning it would be an all in one solution), it would grow to 100Mb.

This is rather excellent. I will backup my EEPROM (when creating my Feenix tutorial, I knew there was something I forgot... just as well I have enough sense not to fuck up) and upgrade my HDD next time I have chance.

IMO, this is a much more elegant solution to hotswapping which I don't trust. Good work smile.gif

#15 celinedrules

celinedrules

    X-S Hacker

  • Members
  • PipPipPipPipPipPip
  • 2,430 posts
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 06 April 2004 - 12:12 AM

Does this work w/ any xbox eeprom? If so, would I be able to format a hd w/ an unknown password?

Edited by celinedrules, 06 April 2004 - 12:12 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users