XBox One – Fun with GPT Disk (Larger Drive)

Written by on July 14, 2014 in Linux, Technology, Tutorials
photo
Original XBox One drive
seagate_box

Last December the kids got an XBox One and over the course of 6 months the drive has reached it’s capacity. Recently Microsoft has added the ability to add an external USB3 drive to expand on the core storage of 500Gb, however; I figured it would be fun to disassemble the device and attempt to install a larger hard drive. Based on information I have read online Microsoft was shipping the XBox One with Samsung hard drives, however my device contained a Western Digial Blue WD500LPVX. The market for 2Tb laptop hard drives is pretty slim but I managed to buy a 2Tb Seagate Momentus (ST2000LM003) on Amazon for $109 by purchasing an external Seagate Backup Plus Slim. The USB3 drive enclosure is held together by double stick tape and is pretty easy to disassemble. As you can see from the picture of the enclosure it is plastic with an aluminum lid and a USB to SATA circuit board. I would advise anyone who is planning on disassembling their XBox One to buy some panel tools so you don’t damage your case and be aware that you are voiding your warranty by opening the system. Using a Linux with gdisk installed will allow you to view the GPT information such as Disk GUIDs, Partition GUIDs, and MBR information. Based on what I have seen every XBox One hard drive uses the same exact partition layout and GUIDs. The following text, is a dump of information about my original XBox hard drive. I created a short bash script to get this output during my testing, it can be downloaded here.

GUID                                  Device       Name
A2344BDB-D6DE-4766-9EB5-4109A12228E5  /dev/sdc 
B3727DA5-A3AC-4B3D-9FD6-2EA54441011B  /dev/sdc1   'Temp Content'
869BB5E0-3356-4BE6-85F7-29323A675CC7  /dev/sdc2   'User Content'
C90D7A47-CCB9-4CBA-8C66-0459F6B85724  /dev/sdc3   'System Support'
9A056AD7-32ED-4141-AEB1-AFB9BD5565DC  /dev/sdc4   'System Update'
24B2197C-9D01-45F9-A8E1-DBBCFA161EB2  /dev/sdc5   'System Update 2'
Code language: JavaScript (javascript)

Let’s have a look at the other information we can pull from the gdisk command. The details presented in the next image show the options available after launching gdisk /dev/sdX and GUID information is available in “experts only” menu. The gdisk tool should seem very familiar to anyone who has used fdisk in Linux.

It’s pretty obvious from the partition naming and size (365Gib) as to which partition is used for storing games and content.

drive_info

The expert menu provides ways modify the disk GUID, partition GUIDs, and MBR information.

Since partitioning new drives with gdisk is a bit cumbersome I created a bash script which uses the sgdisk tool to help streamline the process. The script is broken into two stages; Stage 1 creates the initial disk partitions and Stage 2 updates the disk GUIDs and MBR. Since the script is essentially cloning the disk GUID information it was best to copy the GUID data after the original XBox One disk contents have been transferred and original disk was unmounted. This prevents any GUID collisions from occurring with the original disk. The MBR change is needed since the XBox MBR is different from a typical GPT partitioned disk. Normally the two byte identifier at offset 0x1FE is 55AA (0xAA55), however; an XBox has 99CC (0xCC99). This allows the XBox to identify the disk and for the disk to not be readable on a Windows host. The script uses DD to modify the two bytes of the MBR as shown below:

# Patching MBR from 55AA to 99CC
echo -en '\x99\xCC' | dd conv=notrunc bs=1 of=${DEV} seek=510
Code language: PHP (php)

After Stage 1 is complete, copy the files from each of the original XBox One partitions to the newly partitioned disk by volume name (eg. Temp Content to Temp Content).

stage1

Once the file copy from the old disk is complete, unmount the disk and the run script again with the –stage 2 option.

stage2

After Stage 2 is complete, place the drive back in the case and boot the system. My system booted without delay and actually seems to load games quicker than the old Western Digital Blue, however I don’t have precise time metrics. The last script I wrote was was just fun and it uses dd to parse the entire GPT partition table without gdisk. Wikipedia has some really good data regarding the data GPT data structures. Below is the output from the bash script that manually parses the partition information.

disk_info

UPDATE

500G XBox Drive Replacement Scenario

I was recently contacted by someone online regarding restoring an XBox where the drive had died. I updated the create_xbox_drive.sh adding the option –mirror which allows the user to buy a replacement 500G drive and it partitions identical to the original Xbox One.

500+G XBox Drive Scenario

If you add a drive larger than the stock 500G drive to your XBox (DO NOT) reset it to factory defaults after you have installed it or you will brick your system. The XBox factory reset option will delete your System Update folders causing an E102 and E101 error. The on board NAND memory most likely stores state and system information which it uses during the factory reset process. Additionally, once a failed factory reset occurs and the original drive is reinstalled, it will be reset to factory defaults. This means the system boots from stateful storage and performs the factory reset on the SATA disk during subsequent boot. The completion flag is not set until a successful restore occurs. The rule here is keep your original disk or you are going to have to jump through some hoops with OSUDT1 and OSUDT2 to fix your system.

Tags:

Top