Restoring my "corrupted" HDD

@3141card Ok, so I'm attached everything which I have. Thanks in name of the community.

And BTW: As I remember I was just point to You to start versioning publishing hdd readers and also tell You about some bugs. I did this in quite polite way so I cannot understand of Your reaction in those times. So anyway, I'm quite friendly type of guy and I'm sure it's time to virtually shake hands. ;p

- - -

@DrexploidHax You have no idea what about are You talking about...

dev_flash partitions are HDD partitions since NOR models appearing. On NAND type consoles, they are on NAND and this is why they mount points are still dev_flash.

It is not a matter of believe or not, because it's facts... All PS3 firmwares are installed on flash non volatile memory. In case of NOR, some resources are stored on HDD to spare cell life.
 

Attachments

Last edited:
That may be, that I'm not 100% sure about the subject, but are you telling me it really does fit the entire firmware on 16Mb of flash memory, which is also used for allot of other stuff? Because I'm nearly 100% sure that's why nand consoles swap HDDs no problem and nor models don't.
 
Meanwhile I have edited above post.
Crucial part of the fw is on NOR, the rest on HDD including dev_flash2. ;)
 
Well then I assumed dev flash was flash memory, and you know what they say about assuming, so yea I guess I didn't know what I was talking wabiut.
 
Sorry for the late reply!
It won't solve all my problems, but I managed to get my IDPS number from PSNPatch!
Why do You need xRegistry.sys in the first place? If You have CFW You can just go there and copy it to USB or via FTP. If You need to know lost NP Account ID, it's written in plain text in all saves in PARAM.SFO.
I thought the xRegistry.sys file was related to my user accounts, and that if I didn't have it, if I were to copy the users over from my old HDD to a new HDD, it wouldn't work. Maybe I am mistaken.
If I were to copy the xRegistry.sys file that's on the HDD I used to install CFW, it would be different to the file that's on my old HDD that I can't boot with.
If I don't need the xRegistry.sys file, that's good! :)
I have all my data from dev_hdd0 from my old HDD. Now I just need a way to be able to restore that on a new HDD, and then install OFW, and be safe to log onto PSN. I read the link you sent on post #15, so is the only way for me to copy my data over through Linux? (I'm really sorry for all my questions)
Even if I restore the data I got off my old HDD and my trophies aren't restored, trophies should be able to sync as usual when I log into PSN, right?

@123ducky123
Sry, this stuff is to long ago. Iam old, forgot all about this ps3 hdd partition and decrypt thing, so I can't help you.
That's okay. Your tools have been very useful, anyway! I also found your Arch Linux Virtual Box image you posted on another forum, and tried to use that, but for some reason, when I ran the mount_fat_nor.sh, at every line it said "command not found" so clearly I did something wrong. I have the hdd_key.bin and vflash_key.bin in the right place.
I opened up the sh in a text editor, and tried to enter the terminal commands manually, which worked until line 6, which was "cryptsetup create -c aes-cbc-null -d /home/picard/ps3hdd/vflash_key.bin -s 192 -p 8 vflash_dec /dev/mapper/ps3hdd_dec1"
 
Last edited:
Sorry for the late reply!
It won't solve all my problems, but I managed to get my IDPS number from PSNPatch!

I thought the xRegistry.sys file was related to my user accounts, and that if I didn't have it, if I were to copy the users over from my old HDD to a new HDD, it wouldn't work. Maybe I am mistaken.
If I were to copy the xRegistry.sys file that's on the HDD I used to install CFW, it would be different to the file that's on my old HDD that I can't boot with.
If I don't need the xRegistry.sys file, that's good! :)
I have all my data from dev_hdd0 from my old HDD. Now I just need a way to be able to restore that on a new HDD, and then install OFW, and be safe to log onto PSN. I read the link you sent on post #15, so is the only way for me to copy my data over through Linux? (I'm really sorry for all my questions)
Even if I restore the data I got off my old HDD and my trophies aren't restored, trophies should be able to sync as usual when I log into PSN, right?


That's okay. Your tools have been very useful, anyway! I also found your Arch Linux Virtual Box image you posted on another forum, and tried to use that, but for some reason, when I ran the mount_fat_nor.sh, at every line it said "command not found" so clearly I did something wrong. I have the hdd_key.bin and vflash_key.bin in the right place.
I opened up the sh in a text editor, and tried to enter the terminal commands manually, which worked until line 6, which was "cryptsetup create -c aes-cbc-null -d /home/picard/ps3hdd/vflash_key.bin -s 192 -p 8 vflash_dec /dev/mapper/ps3hdd_dec1"
I believe the xRegistry file is a HDD file with a (part)UUID so that only ONE Internal HDD can be formatted to a single PS3 at a time, and I don't believe this file helps you decrypt it, although I have no clue or experience.
You should also be able to sign back in on your current CFW or OFW, but it's safer via OFW. But you can only log back in if your not banned.
 
I thought the xRegistry.sys file was related to my user accounts, and that if I didn't have it, if I were to copy the users over from my old HDD to a new HDD, it wouldn't work.

In this file, CellOS storing all settings, including such things like UN and AID. Those data are necessary to recognize restored content but file itself is not so important as You can edit it and just write to it them. Having xRegistry.sys with all needed IDs, just simplified the process. ;] As UN and AID are in every PARAM.SFO in plain text (so it is sufficient to copy non protected save from PS3 to USB and view by hex editor this file).

Maybe I am mistaken.

In almost every post, but this is normal learning process. ^^

If I were to copy the xRegistry.sys file that's on the HDD I used to install CFW, it would be different to the file that's on my old HDD that I can't boot with.

It doesn't really matter, as PS3 accepting xRegistry.sys from even different console. If some data doesn't match, it ignoring it and replacing by valid (with errors blah blah, nagging to reformat but it is sufficient to just ignore it, resetting the console and then next boot will be clean). I have CECHL04 and CECH-2504, and did this in the past to keep IDs (it is much quicker than resigning all saves and trophies, especially with missing Disc Hash Keys which no one care...).

I have all my data from dev_hdd0 from my old HDD. Now I just need a way to be able to restore that on a new HDD, and then install OFW, and be safe to log onto PSN. I read the link you sent on post #15, so is the only way for me to copy my data over through Linux? (I'm really sorry for all my questions)

Only Linux with kernel patches allowing to experimental ;) write on UFS2 + proper generated HDD Key + kernel module compiled, fitted to this specific kernel, allow You to restore files on PS3 HDD via PC.

I never did it myself as I don't know how to create "fat HDD Key" from ERK and unable to compile bswap16 (as I heard, impossible on current kernel lines without changes). I lost interest in that way as involve to much of my time to solve it.

Even if I restore the data I got off my old HDD and my trophies aren't restored, trophies should be able to sync as usual when I log into PSN, right?

You created total chaos in this thread and I lost track across all those days what You have, and what You want achieve. And based on Your comments, probably You too. ;p

In short:
  1. If You want copy data from one HDD to another on the same console (formatted on the same console), with CFW, just use any file manager and USB or FTP.
  2. If You want copy data from one HDD to another on different console and both have CFW, just use any file manager and USB or FTP.
  3. If You want copy data from one HDD to another on the same console (formatted on the same console), with OFW, You need cross the Linux way or do this on CFW before installing OFW.
And as I tell You already, in case of third way, the easiest way is just restoring everything on normal CFW, then write CFW for "dual boot" (CFW with only patches allowing You qa flag, downgrade and launching unsigned apps), cleaning unneeded data, then sync trophies, disconnection to SEN and going back to normal CFW. It is easy, and consider it as almost safe. ;) If You need 100% sure be safe, You need do all this Linux stuff and You are alone as none of us (let's say, scene enthusiasts), did this.

I have the hdd_key.bin and vflash_key.bin in the right place.

How did You generate it from ERK?

I opened up the sh in a text editor, and tried to enter the terminal commands manually, which worked until line 6, which was "cryptsetup create -c aes-cbc-null -d /home/picard/ps3hdd/vflash_key.bin -s 192 -p 8 vflash_dec /dev/mapper/ps3hdd_dec1"

I don't have this on my eyes and cannot help You as I don't know how did You tell Vbox to read physical PS3 HDD and how did You mount it as loop device.

- - -

BTW: Restoring content, didn't mean that You will be owner of them. User Number and NP Account ID must match or trophy and save data systems will be locked. Also remember that CellOS doesn't read data for showing them on XMB in real time, it's based on databases which are filling by various of actions. So after restoring them, You must rebuild db from recovery or they will no showing up in the menu.
 
I believe the xRegistry file is a HDD file with a (part)UUID

In xRegistry.sys HDD is recognized only by model number, serial number and it's firmware version (HDD fw, not PS3 fw ;]). However, yet HDD can only be one attached to the system, but registry info is not important. These info is somewhere else which stored somewhere on real flash (at least on NOR models). User can using any xRegistry.sys from any PS3 and any version.

and I don't believe this file helps you decrypt it, although I have no clue or experience

He don't want use it to decrypt anything but only for getting user IDs.
 
You created total chaos in this thread and I lost track across all those days what You have, and what You want achieve. And based on Your comments, probably You too. ;p
Yeah, I'm really sorry my posts are so confusing! Thank you for being patient with me, and always taking the time to reply! My wording may have been unclear, but what I want to achieve has always been option 3. Basically any way in which to get my old data from my old HDD to a new HDD and in the end be on OFW so I can safely access PSN.
3. If You want copy data from one HDD to another on the same console (formatted on the same console), with OFW, You need cross the Linux way or do this on CFW before installing OFW.

And as I tell You already, in case of third way, the easiest way is just restoring everything on normal CFW, then write CFW for "dual boot" (CFW with only patches allowing You qa flag, downgrade and launching unsigned apps), cleaning unneeded data, then sync trophies, disconnection to SEN and going back to normal CFW. It is easy, and consider it as almost safe. ;) If You need 100% sure be safe, You need do all this Linux stuff and You are alone as none of us (let's say, scene enthusiasts), did this.
I read about this method in your link on post #15, but you said it was risky. I could stick with dual boot CFW, but I would prefer to be on OFW so I don't have to worry about clearing it every time before signing into PSN.
I think you're right that my best option is to copy everything over via CFW and reinstall OFW over it. I just need to delete everything CFW related before I install OFW. I want to do this, but I'm not sure how. I know everybody says that the safest way to clear all traces of CFW is to just format the HDD, but I can't do that because I want to keep my data...
Though if I was able to copy everything over with CFW, install dual boot CFW, clear all the unnecessary data, and install OFW over it, then that would be perfect!
In this file, CellOS storing all settings, including such things like UN and AID. Those data are necessary to recognize restored content but file itself is not so important as You can edit it and just write to it them. Having xRegistry.sys with all needed IDs, just simplified the process. ;] As UN and AID are in every PARAM.SFO in plain text (so it is sufficient to copy non protected save from PS3 to USB and view by hex editor this file).
Oh, I see! Again, I'm really sorry for my misunderstanding. I thought having xRegistry with all the IDs on it was essential. I'm glad to hear I can just edit it with my UN and AID!
BTW: Restoring content, didn't mean that You will be owner of them. User Number and NP Account ID must match or trophy and save data systems will be locked. Also remember that CellOS doesn't read data for showing them on XMB in real time, it's based on databases which are filling by various of actions. So after restoring them, You must rebuild db from recovery or they will no showing up in the menu.
Ahh, I think my misunderstanding about the xRegistry.sys file was that it was the only way to get my User Number and NP Account IDs to match.
So I can get my NP Account ID from my PARAM.SFO, that's good! Can I get the User Number from what I backed up from dev_hdd0? Where do I need to edit these to match?

If I can edit my xRegistry.sys file, then perhaps I would be able to restore all my data with PS3xport... Then I wouldn't have to worry about having anything CFW-related remaining on my HDD. But if copying all my files over CFW and then installing OFW is easier/more reliable, then perhaps I should do that.
How did you generate it from ERK?

I don't have this on my eyes and cannot help You as I don't know how did You tell Vbox to read physical PS3 HDD and how did You mount it as loop device.
There was software included with the Arch Virtual box that would extract the hdd_key.bin and vflash_key.bin from my ERK. I wasn't able to add links before, but it seems I am able to now: https://playstationhax.xyz/forums/t...ubles-mounting-the-encrypted-ufs2-filesystem/
But if I can just edit another xRegistry.sys file, then I don't need to use this method, because I was only using it to try to access dev_flash2.

Thanks for being patient with all my confusing questions!
 
Last edited:
I read about this method in your link on post #15, but you said it was risky.

Indeed, a little risky.
I have synced debug PS3 trophies and even trophies from friends games on PSV. Still, no ban across PSV/PS3/PS4.

I just need to delete everything CFW related before I install OFW. I want to do this, but I'm not sure how. I know everybody says that the safest way to clear all traces of CFW is to just format the HDD, but I can't do that because I want to keep my data...
Though if I was able to copy everything over with CFW, install dual boot CFW, clear all the unnecessary data, and install OFW over it, then that would be perfect!

The best? No. Easiest? Yes.

1. stay on normal CFW (like i.e Rebug REX or Lite)
2. install multiMAN, be sure to have checked in the options clearing pushlists
3. restore all data what You need (saves, trophies etc.) and be sure they all are recognized by games as yours
4. delete every homebrew applications (except mM obviously ;])
5. by build in mM file manager, clear everything related to CFW like i.e:
- additional plugins and it's resources
- every homebrew external resources
- every temp/cache data (even 500MB swap file but on the end, because it force You on next boot to fs check and reb db)
- every unneeded data in $home/<user/> (leave only savedata/, trophy/, exdata/ (this one but only if all licenses are original included act.dat), and user name file)
6. delete everything related to homebrew in Game Data Tool in XMB
7. delete mM
8. on next boot system fill tell You fs is damaged (it is not, don't worry ;]) and You will face with mandatory fscheck and database rebuilding
9. install dual boot CFW (read carefully what kind of patches have, You must have QA active before install such CFW, it rise risk level but spare You a lot of hedache in case of any version problems in syscon)
10. log into SEN and sync trophies (do not make any other activities, especially playing online or visiting PSS)
11. logout, disconnect and return to normal CFW

I hope I didn't forgot about something. ;p
And it doesn't mean that You don't get ban. Just no one yet got it in that way.

So I can get my NP Account ID from my PARAM.SFO, that's good! Can I get the User Number from what I backed up from dev_hdd0? Where do I need to edit these to match?

In xRegistry.sys. ;p You can read them from SFO but You must edit registry to tell system You are You.

If I can edit my xRegistry.sys file, then perhaps I would be able to restore all my data with PS3xport... Then I wouldn't have to worry about having anything CFW-related remaining on my HDD. But if copying all my files over CFW and then installing OFW is easier/more reliable, then perhaps I should do that.

In theory, yes. But this application is very problematic, not finished, not tested enough and no one test if trophies are restorable from it (because in original sysbup they doesn't exist). You also must remember to keep proper files ownership (so forget doing this on Windows; probably 600 or 644 >> compare with original to be sure).
 
I see... Hmm, it seems like the best option is to do as you say and install dual boot CFW, but I don't want to lose access to playing online and accessing the Playstation Store.
I'm going to have to consider my options. Thank you very much for all your help, Berion!

For now, I did an experiment with PS3xport. After formatting my new HDD with OFW, I logged into PSN with my PS ID. Then I made a backup file on PS3. I added just my save data from my old HDD into the backup with PS3xport. Because the user number was 00000001 on both my old and new HDD, and the Account ID was the same, when I restored the backup and Rebuilt Database, all my saves appeared. As a test, I loaded up a save, and played until I unlocked a trophy... and it worked! :)

The most important thing for me was to keep my saves and to be able to stay on OFW, so I'm happy right now.
I'd still like to get my xRegistry.sys file so I can restore my other user profiles (I have PSN accounts for different regions), but for now I'm happy that I have my old save data back for my main account! Phew... I'm so grateful for all the people who made such clever software!
 
Last edited:
The problem with my old HDD is that my PS3 wants to format it when it boots up (likely because it was damaged in some way when it suddenly YLOD'd on me... however, when I plug the HDD into the PC, it's able to read all the files fine, so I'm confused!). If I were in a position to install CFW on my old HDD, then I wouldn't have any problems.
I installed CFW by plugging in a second HDD (in order to get the rootkey file to read my old HDD on PC), however that xRegistry.sys file is different to the one on my old HDD, so it's of no use to me, unfortunately. :(
 
The firmware complains about a partition on internal hdd that uses UFS2 filesystem

What we dont know is if the damaged data is the file itself... or the journal metadata associated with the files (used to index the files, keep a record of changes, timestamps, etc...)

In PC (after decryption by that driver you are using in the tool) doesnt seems to complain... but i guess is because is not making any verification of the journal
Or... incase is doing it.... then the tool is not "fixing" the problems automatically, because you know... the real data is fully encrypted
To "fix" it is needed to update the filesystem... and in the final step to encrypt the whole partition (this encryption is made "by block", so i guess not needed to update everything, but you got the concept)... then save changes
But the tool doesnt does that, and im not sure if there is some way to achieve this

I know... this is not helping you much, im explaining it because i think this is what happens
And because you need to keep in mind there is something damaged for sure (could be filedata, or filedata + journal assocated to that filedata, or only the journal), and that filesystems are very well designed to avoid data lost, is just the PS3 is a bit "dumb"
 
Last edited:
@3141card I'm confused. I'm sure that I read my data both from dev_hdd0 and dev_flash2 from my CECHL04 (which is fat and with NOR) on some of "middle builds" HDD Reader.

BTW: Could You help me fix my script for generating HDD Key for Fats? Or Am I misunderstood dev wiki and ATA Key is generating in the same way from ERK across all PS3 models and differences are only in HDD encryption algos?
http://www.psx-place.com/threads/hdd-keys-generating-scripts.10610/page-2#post-125197
 
Regarding keys I look tomorrow.
EDIT:
Yes, its the same for all. No differences for model.

Regarding HDD encryption:
Code:
Fat(NAND), 1. layer(ata)    -> aes-cbc-192, ata_key1 IV = 0
           2. layer(vflash) no vflash
        
Fat(NOR),  1. layer(ata)    -> aes-cbc-192, ata_key1 IV = 0
           2. layer(vflash) -> aes-xts-128 encdec_key1 and encdec_key2
        
Slim(NOR), 1. layer(ata)    -> aes-xts-128, ata_key1 and ata_key2
           2. layer(vflash) -> aes-xts-128 encdec_key1 and encdec_key2

Was more easy than I think, only two types of encryption. But I had really forgotten many about this all.
 
Last edited:
Yeah, thank you so much 3141card for taking the time to look into Fat NOR HDD support for hdd_reader! I know it must have been a while since you last looked at the code, but the fact that you were kind enough to help me out means so much to me!

Thanks to the support of 3141card, I was able to finally access my dev_flash2 partition, which was the last important file I needed to recover before I could restore my HDD to the way it was before my PS3 YLOD'd.

I am so happy now! Here I was, fearing I would have to format my HDD and start every single game from scratch. Countless hours would have gone down the drain...
It's all thanks to this community that I could do what Sony would never help me with and recover my files from my allegedly "corrupted" HDD. Thanks for nothing, Sony, and a tremendous thank you to all the people here at PSX-Place who helped me! You saved my PS3!
 

Similar threads

Back
Top