The problem I had was some bad sectors on the disk. A bad sector is a sector on a computer's disk drive or flash memory that cannot be used due to permanent damage (or an OS inability to successfully access it), such as physical damage to the disk surface.
If any file uses a sector which is marked as 'bad' by a disk utility then the bad sector of the file is remapped to a free sector and any unreadable data is lost.
Unfortunately the PS3 doesn't seem to mark the bad sectors as 'bad'. During the file system restore process when it attempts to repair the data in the bad sector it tries to write it back to the same bad sector. This will not work and it gets stuck in a corrupt file system loop.
Depending on the nature of the fault it is sometimes possible to recover most of the data on a failing hard disk.
To solve the corrupted file system loop we need to make the sector good again by cloning the damaged disk to a new disk and then run the recovery on the new disk. This will work because the sector is no longer damaged on the new disk and the recovery process can complete without any issues.
Before we get started with process of cloning the PS3's hard disk you will need the following.
- A Linux system with ddrescue installed
- A new hard disk that is compatible with a PS3 and is at least the same size as the corrupt disk.
- A way to connect the corrupted PS3 disk to a PC. I used an external enclosure for a 2.5 inch SATA hard disks.
- Enough disk space to store a complete image of the PS3 hard disk
- A Philips screw driver to remove the hard disk from the PS3
A word of warning, ddrescue is a very powerful tool but can also be a very destructive tool if you make a mistake. Only try this is you fully understand what you are doing.
First step is take the PS3 hard disk out and connect it to your computer.
The next step is to identify the PS3 hard disk on your computer. Use the following command to list all attached block devices.
sudo parted -l
Here is an example of the output of the command on my computer.
We are looking for a disk's size and description that matches the hard disk from the PS3. From the screenshot above for my system it is "/dev/sdi".
With the information we have obtained from above we can now clone the PS3's hard disk to a file on the computer. Here is an example of how the command looks like on my computer. You will have to change the source and destination paths to match your setup. Please note that this can take a couple of hours to complete.
sudo ddrescue -r 1 /dev/sdi /home/firefly/ps3.hdd ps3-rescue.log
Now that we have an image of our PS3's hard disk it is time to write the data back to the new hard disk. Swap the corrupted hard disk for the new one. Now use the method mentioned earlier in the article to find your new hard disk. Like above here is an example of what the command looks like on my computer. Please make the necessary changes for your system.
sudo ddrescue /home/firefly/ps3.hdd /dev/sdi
Once the command completes disconnect the new disk from the computer and put it in to your PS3. When you switch your PS3 on you will get the "The hard disk's file system is corrupted and will be restored." message but this time it will complete successfully and it will run much faster as well. After the system restarts your PS3 will boot up as per normal.
Note that even if booting succeeds, it's possible that some data has been lost or is still corrupt, so bear this in mind if you find that particular saves/files are not working properly.
If it was not for Linux and ddrescue I would have lost all my save files and would have to re-download all of my games again. This tutorial was centered around the PS3 but the tutorial will work for any case where a drive needs to be cloned.