Talk:Harddrive: Difference between revisions

From PS3 Developer wiki
Jump to navigation Jump to search
(→‎HDD partitions: added encryption notes, thx flatz and 3141card for the talks :)
Line 94: Line 94:


*Encryption Notes:
*Encryption Notes:
**Encryption is made "by sector" (every sector is encrypted/decrypted individually, data is accessed in chunks of 512 bytes), and "by device" (real and virtual devices). In the practise this means for PS3 NAND models all the HDD sectors are under 1 single encryption layer, but for PS3 NOR models (with a "virtual flash device" embedded inside "real hdd device") there is a "top" encryption layer over the whole HDD, and a "bottom" encryption layer over VFLASH (or in other words... in NOR models the sectors inside VFLASH are encrypted 2 times, and the others out of VFLASH are encrypted 1 time)
**Encryption is made "by sector" (data is accessed in chunks of 512 bytes and encrypted/decrypted individually), applyed "at write time" (only used sectors are encrypted), and "by device" (real and virtual devices). In the practise this means for PS3 NAND models all the HDD sectors are under 1 single encryption layer, but for PS3 NOR models (with a "virtual flash device" embedded inside "real hdd device") there is a "top" encryption layer over the whole HDD, and a "bottom" encryption layer over VFLASH (or in other words... in NOR models the sectors inside VFLASH are encrypted 2 times, and the others out of VFLASH are encrypted 1 time)
**Top encryption layer affects the whole hdd, is based in the '''ata-key''', and there are 3 posible types:
**Top encryption layer affects the whole hdd, is based in the '''ata-key''', and there are 3 posible types:
***FAT-NAND (no vflash). The whole hdd is encrypted with aes-cbc (ata-key and zero iv)
***FAT-NAND (no vflash). The whole hdd is encrypted with aes-cbc (ata-key and zero iv)

Revision as of 10:32, 9 April 2014

Todo

Need help getting data for the different SKU models and the default harddrive they are equiped with.

There is still some conflicting data to be sorted out, e.g.:

maximum size internal drive

The maximum size of the internal harddrive that the PS3 supports is 1TB (TeraBytes) 

note: this seems untrue as there are several people posting pictures of their external to internal drive mod with a size of 2TB

Personal experience

Using Normal Mode and Recovery - when trying to install a 1.5TB 3.5" drive as internal (using an eSATA cradle)
  • Using Recovery it is possible to finish the format of the harddrive until 100%. The system however fails to reboot automaticly after that and halts. When enforced to reboot, it errors out with "Wrong Harddrive".
  • When trying all the other Recovery Menu options it errors out with "Harddrive Error 0x8002F281".
  • When trying to boot to XMB it also errors out with "Harddrive Error 0x8002F281".
  • When replacing the drive for the previous tested 1TB harddrive, it boots without errors to XMB and reports : 827GB free/931GB total
Conclusion
>1TB didn't not work.
Using Factory Service Mode - when trying to install a 1.5TB 3.5" drive as internal (using an eSATA cradle) FSM
  • Second try, using Service Mode
  • first replacing drive for original 120GB 2.5" and using Factory Service Mode to downgrade to lowest firmware the system can handle (2K slim -> FW 2.70)
  • Replaced for 1.5TB 3.5" drive and do exactly the same 2.70 again
  • Boot to XMB with Service Mode still activated
    • No problems to get into XMB, but checking System Settings > System Information shows size detection issues:
System Software  Version 2.70
IP Address       xxx.xxx.x.xxx
MAX Address      xx:xx:xx:xx:xx:xx
Free Space       30 G
  • Exit Factory Service Mode
    • Blank screen freeze when trying to boot to XMB in normal mode
  • Power off and try again gives "system software was not installed correct" error
  • inserted USB with 2.70 on normal location and START+SELECT button to let it reinstall
    • Preparing Update counts to 100% and then halts (does not reboot), just like in first trial.
  • Manual poweroff and reboot just results in blank screen with no harddrive activity
Conclusion
>1TB didn't not work in normal or recovery mode only with FSM enabled.
Going back to the 1TB and crosschecking
  • Replacing drive back to the working 1TB (has 3.55 on it) gives prompt to reinstall 2.70, doing so errors out with "Harddrive Error 0x8002F281".
  • Entering Factory Service Mode with 1TB and let it reinstall via lv2diag results fine without errors: UPDATER_LOG.TXT
  • Boot to XMB with Service Mode still activated
    • No problems to get into XMB, but checking System Settings > System Information shows size detection issues (the '30 G' seems to be FSM related):
System Software  Version 2.70
IP Address       xxx.xxx.x.xxx
MAX Address      xx:xx:xx:xx:xx:xx
Free Space       30 G
  • Exit Factory Service Mode
  • No problems to get into XMB, and checking System Settings > System Information shows no size detection issues:
System Software  Version 2.70
IP Address       xxx.xxx.x.xxx
MAX Address      xx:xx:xx:xx:xx:xx
Free Space       827GB / 931GB
Conclusion
<=1TB works fine in all modi.

maximum size external drive

External HDD : You can format it to any size up to 8TB

note: this seems untrue, because when >2TB drives have hit the market, no screenshots of >2TB external storage are known


Footnote: maximum supported drive space correlates to support of 512sector (either native, or emulated), see: http://en.wikipedia.org/wiki/Advanced_Format


AES-256-CBC versus AES-256-XTS

There is conflicting mention of sources for the algo/mode used for GameOS encryption.

Fact:

  • Sony/IBM loves AES
  • 256bit based
  • sectorsize 512 bytes (4096 bits)
  • blockcipher
  • recurring patterns are seen

Reference:




Experimental Tables

HDD partitions

  • Padding Notes:
    • The thin horizontal grey lines without text are areas betwen regions with a size of 0 bytes (doesnt exists), are used in the table as a note to remember there is no padding out of the regions in this position
    • 7th region of vflash (ps3vflashg) ends at sector 0x77E00. vflash is 0x80000 sectors size, so the "not used area" after ps3vflashg has a size of: 0x80000 - 0x77E00 = 0x8200 sectors = 17039360 bytes (16,25 MB)
    • The padding between regions defined in "HDD Partition Table" seems to be 0x8 sectors size (see graf notes) but the padding can be different when using unnofficial rebuild methods (create_hdd_region.sh adds a padding of 0x8 before and another 0x8 after the new region, concatenating new regions with this script generates double padding). Or when modifying the "HDD Partition Table" manually is posible to remove all padding then let the system generate the new region by himself
  • Encryption Notes:
    • Encryption is made "by sector" (data is accessed in chunks of 512 bytes and encrypted/decrypted individually), applyed "at write time" (only used sectors are encrypted), and "by device" (real and virtual devices). In the practise this means for PS3 NAND models all the HDD sectors are under 1 single encryption layer, but for PS3 NOR models (with a "virtual flash device" embedded inside "real hdd device") there is a "top" encryption layer over the whole HDD, and a "bottom" encryption layer over VFLASH (or in other words... in NOR models the sectors inside VFLASH are encrypted 2 times, and the others out of VFLASH are encrypted 1 time)
    • Top encryption layer affects the whole hdd, is based in the ata-key, and there are 3 posible types:
      • FAT-NAND (no vflash). The whole hdd is encrypted with aes-cbc (ata-key and zero iv)
      • FAT-NOR (with vflash). The whole hdd is encrypted with aes-cbc (ata-key and zero iv)
      • SLIM-NOR (with vflash). The whole hdd is encrypted with aes-xts (ata-key and tweaking)
    • Bottom encryption layer affects the whole vflash, is based in the encdec_key, and there are 2 posible types:
      • FAT-NOR (with vflash). The whole vflash is encrypted with aes-cbc (encdec-key and zero iv)
      • SLIM-NOR (with vflash). The whole vflash is encrypted with aes-xts (encdec-key and tweaking)

PS3 Hard Disk Drive, partitions and storage regions
Storage Region File System Size Usage Notes




OtherOS GameOS Access Control List Official Unnofficial Official Unnofficial



Official



Unnofficial



ACL's unk? Encryption Type Type Decimal Hexadecimal
Bytes Sectors Bytes Sectors
(3) ps3d No ? No All available Physical Device Internall hard drive
(3.0) ps3da No ? No Any Physical partition Entire HDD
4 KB (4.096) 8 0x1000 0x8 Same HDD Partition Table
(3.1) ps3vflash No ? No All available Virtual Device Only in PS3's with NOR flash
(3.1(1.0)) ps3vflasha No ? 1070000001000001
1070000002000001
0B
03
No 256 MB (268.435.456) 524.288 0x10000000 0x80000 Any Physical partition Entire VFLASH
4 KB (4.096) 8 0x1000 0x8 Same VFLASH Partition Table
(3.1(1.1)) ps3vflashb ? 1070000001000001 03 ? Raw access ? 14,75 MB (15.462.400) 30.200 0xEBF000 0x75F8 Same "mirror" of real NOR second region: "ps3nflashb" ?
256 KB (262.144) 512 0x40000 0x200 Same ?
(3.1(1.2)) ps3vflashc dev_flash 1070000002000001
1070000001000001
1020000003000001
03
03
01
Yes FAT16 199,75 MB (209.453.056) 409.088 0xC7C0000 0x63E00 Same Firmware files
(3.1(1.3)) ps3vflashd dev_flash2 1070000002000001
1070000001000001
03
03
? FAT16 16 MB (16.777.216) 32.768 0x1000000 0x8000 Same XRegistry (Console/User settings)
(3.1(1.4)) ps3vflashe dev_flash3 1070000002000001
1070000001000001
03
03
? FAT12 512 KB (524.288) 1.024 0x80000 0x400 Same CRL/DRL (Bluray revocation lists)
(3.1(1.5)) ps3vflashf ? 1070000002000001
1070000001000001
1080000004000001
03
03
03
No ? Raw access 4 MB (4.194.304) 8.192 0x400000 0x2000 Any OtherOS bootloader
(compressed: otheros.bld)
OtherOS++ bootloader
(uncompressed: dtbImage.ps3.bin)
cell_ext_os_area + bootloader
(usually petitboot or kboot)
4,25 MB (4.456.448) 8.704 0x440000 0x2200 Same ?
(3.1(1.6)) ps3vflashg ? 1070000001000001 03 ? Raw access ? 256 KB (262.144) 512 0x40000 0x200 Same ?
16,25 MB (17.039.360) 33.280 0x1040000 0x8200 No ? Padding
(3.1(1.7)) ps3vflashh ? ???????????????? ?? No Not
used
All supported
by linux kernel
Any Not used Linux/FreeBSD for NOR PS3's
Based on graf drivers (deprecated)
Firmware installers doesnt
creates this region
8 KB (8.192) 16 0x2000 0x10 Same ? Double Padding ?
4 KB (4.096) 8 0x1000 0x8 Same ? Only NAND: Padding ?
(3.2) ps3db dev_hdd0 1070000001000001
1070000002000001
1020000003000001
03
03
03
NAND:aes-cbc-192
NOR:aes-xts-128
UFS2 Any GameOS NAND: region starts at sector 0x20 ?
NOR: region starts at sector 0x80018
4 KB (4.096)) 8 0x1000 0x8 Same ? Padding
(3.3) ps3dc dev_hdd1 1070000001000001
1070000002000001
03
03
? FAT16 2 GB (2.147.479.552) 4.194.296 0x7FFFF000 0x3FFFF8 Same GameOS Cache
4 KB (4.096) 8 0x1000 0x8 Same ? Padding
(3.4) ps3dd dev_hdd2 ? ???????????????? ?? No All supported
by linux kernel
10GB (0x13FFFF8 sectors)
All available except 10GB (All - 0x13FFFF8 sectors)
Any OtherOS
(disabled in firmware 3.21)
Linux/FreeBSD for NAND/NOR PS3's
Based on glevand drivers
4 KB (4.096) 8 0x1000 0x8 Same ? Padding
  • This table (pretends to) show all the posible partition layouts in all PS3 models, even when there are 2 big differences that changes partition positions (and consequently region names in Otheros/linux)
    • Flash type
      • NAND flash 256mb - All firmware is stored in real NAND flash
      • NOR flash 16mb - A small part of the firmware is stored in real NOR flash, and most of the firmware is stored in the first "virtual flash" (ps3vflash) partition in HDD (his position makes the other partitions to be displaced)
    • OtherOS bootloader installation (petitboot)
      • OtherOS bootloader official - petitboot is installed in region (1.5), his size is smaller than the region so no need to resize
      • OtherOS++ bootloader unofficial - petitboot is installed in region (1.5), his size is bigger than the region so the region is resized conveniently (usually up to 8MB = 16384 sectors)
    • OtherOS installation
      • OtherOS official for NAND models - Linux/FreeBSD installed at region (3.4), last region of the HDD
      • OtherOS++ unofficial for NOR models - Linux/FreeBSD installed at region (1.7), last region of vflash is created and resized conveniently
      • OtherOS/OtherOS++ unofficial for NOR/NAND models - Linux/FreeBSD installed at region (3.4), last region of the HDD
  • Devices contains a single physical partition
  • Physical partitions contains one or more logicall partitions

Partition formatting in a service mode firmware installation for NOR flash. Google it: http://lmgtfy.com/?q=site%3Ahttp%3A%2F%2Fpastebin.com%2F+%22vflash+is+enabled...%22

manufacturing updating start
PackageName = /dev_usb000/PS3UPDAT.PUP
settle polling interval success
vflash is enabled...
creating system regions...
create storage region: (region id = 1)
create storage region: (region id = 2)
format partition: (region_id = 2, CELL_FS_UTILITY:HDD0, CELL_FS_UFS)
create storage region: (region id = 3)
format partition: (region_id = 3, CELL_FS_UTILITY:HDD1, CELL_FS_FAT)
creating system regions done.
boot from nor flash...
creating nor flash regions...
create storage region: (region id = 2)
create storage region: (region id = 3)
creating flash regions...
create storage region: (region id = 1)
create storage region: (region id = 2)
format partition: (region_id = 2, CELL_FS_IOS:BUILTIN_FLSH1, CELL_FS_FAT)
create storage region: (region id = 3)
format partition: (region_id = 3, CELL_FS_IOS:BUILTIN_FLSH2, CELL_FS_FAT)
create storage region: (region id = 4)
format partition: (region_id = 4, CELL_FS_IOS:BUILTIN_FLSH3, CELL_FS_FAT)
create storage region: (region id = 5)
create storage region: (region id = 6)

Partition formatting in a service mode firmware installation for NAND flash. Google it: http://lmgtfy.com/?q=site%3Ahttp%3A%2F%2Fpastebin.com%2F+%22vflash+is+disabled...%22

manufacturing updating start
PackageName = /dev_usb000/PS3UPDAT.PUP
settle polling interval success
vflash is disabled...
boot from nand flash...
creating flash regions...
create storage region: (region id = 2)
format partition: (region_id = 2, CELL_FS_IOS:BUILTIN_FLSH1, CELL_FS_FAT)
create storage region: (region id = 3)
format partition: (region_id = 3, CELL_FS_IOS:BUILTIN_FLSH2, CELL_FS_FAT)
create storage region: (region id = 4)
format partition: (region_id = 4, CELL_FS_IOS:BUILTIN_FLSH3, CELL_FS_FAT)
create storage region: (region id = 5)
create storage region: (region id = 6)

Other flash/hdd regions. Google it: http://lmgtfy.com/?q=site%3Ahttp%3A%2F%2Fpastebin.com%2F+%22CELL_FS_UTILITY%3AHDD2%22 and Mountpoints

CELL_FS_IOS:BUILTIN_FLSH1
CELL_FS_IOS:BUILTIN_FLSH2
CELL_FS_IOS:BUILTIN_FLSH3
CELL_FS_IOS:BUILTIN_FLSH4
CELL_FS_UTILITY:HDD0
CELL_FS_UTILITY:HDD1
CELL_FS_UTILITY:HDD2

Speed tests running in PS3 nativelly

Speed Tests (PS3)
Brand Series Model Linux GameOs
[hdparm -Tt] N/A
Cache read
(MB/s)
Disk read
(MB/s)
Link
Fujitsu MHW MHW2040BH N/A
MHZ MHZ2080BH N/A
MHZ2160BH N/A
Hitachi Travelstar 5K160 HTS541640J9SA00 N/A
Travelstar 5K250 HTS542580K9SA00 N/A
Travelstar 5K500 HTS545012B9SA00 N/A
Travelstar Z5K500 HTS545050A7E380 N/A
Seagate Momentus 5400.2 ST96812AS N/A
Momentus 5400.3 ST980811AS N/A
LD25 SATA ST920217AS N/A
ST9402115AS N/A
LD25 5400.2 ST940210AS N/A
Toshiba MKxx52GSX MK8052GSX N/A
MK1652GSX N/A
MKxx55GSX MK1255GSX N/A
MK2555GSX N/A
MKxx65GSX MK1665GSX N/A
MK3265GSX N/A
MKxx76GSX MK1676GSX N/A
MK3276GSX N/A

Phat NAND HDD Entropy Table (After zerofill,no vflash)

Start Offset End Offset Size Description
0x0000 0x1000 0x1000 Header
0x4000 0x16000 0x12000 unknown
0x18000 0x28000 0x10000 unknown

file

Slim NOR HDD Data Table (After zerofill,vflash)

Start Offset End Offset Size Description
0x0 0x2000 0x2000 Header
0x4400 0x8118240 please fill unk
0x8119000 0x8149960 please fill unk
0x814B000 0x8152CB0 please fill unk
0x8153000 0x81530C0 please fill unk
0x8155000 0x8159B10 please fill unk
0x815B000 0x815E3D0 please fill unk
0x815F000 0x8166190 please fill unk
0x8167000 0x817B750 please fill unk
0x817D000 0x817D5C0 please fill unk
0x817F000 0x818A500 please fill unk
0x818B000 0x818CDC0 please fill unk
0x818D000 0x81C9F10 please fill unk
0x81CB000 0x81D1FD0 please fill unk
0x81D3000 0x81D9E20 please fill unk
0x81DB000 0x81DB1B0 please fill unk
0x81DD000 0x81DD0A0 please fill unk
0x81DF000 0x81DF090 please fill unk
0x81E1000 0x81E1080 please fill unk
0x81E3000 0x81E3090 please fill unk
0x81E5000 0x81E50A0 please fill unk
0x81E7000 0x81E70A0 please fill unk
0x81E9000 0x81E9090 please fill unk
0x81EB000 0x81F4CD0 please fill unk


  • There is actual readable data near the end of the disk, so this has been renamed to Data Table instead of Entropy Table
  • The table is incomplete, please help filling it.
  • the dump and key

GameOS fsck

code uses memory container ( there is also fsck without ) - does fsck on hdd0:

LOAD:0000000000030270 .set var_3C, -0x3C
LOAD:0000000000030270 .set var_38, -0x38
LOAD:0000000000030270 .set var_34, -0x34
LOAD:0000000000030270 .set var_30, -0x30
LOAD:0000000000030270 .set var_20, -0x20
LOAD:0000000000030270 .set var_18, -0x18
LOAD:0000000000030270 .set arg_10,  0x10
LOAD:0000000000030270
LOAD:0000000000030270                 lis       r9, aFsck_cfs@h # "fsck_cfs"
LOAD:0000000000030274                 mflr      r0
LOAD:0000000000030278                 lis       r11, aY@h     # "-y"
LOAD:000000000003027C                 lis       r10, aHdd0@h  # "hdd0"
LOAD:0000000000030280                 stdu      r1, -0xB0(r1)
LOAD:0000000000030284                 addi      r9, r9, aFsck_cfs@l # "fsck_cfs"
LOAD:0000000000030288                 addi      r11, r11, aY@l # "-y"
LOAD:000000000003028C                 addi      r10, r10, aHdd0@l # "hdd0"
LOAD:0000000000030290                 std       r28, 0xB0+var_20(r1)
LOAD:0000000000030294                 li        r3, 1 = "App" 
LOAD:0000000000030298                 li        r28, 0
LOAD:000000000003029C                 stw       r11, 0xB0+var_38(r1)
LOAD:00000000000302A0                 std       r0, 0xB0+arg_10(r1)
LOAD:00000000000302A4                 stw       r9, 0xB0+var_3C(r1)
LOAD:00000000000302A8                 stw       r10, 0xB0+var_34(r1)
LOAD:00000000000302AC                 std       r29, 0xB0+var_18(r1)
LOAD:00000000000302B0                 stw       r28, 0xB0+var_30(r1)
LOAD:00000000000302B4                 bl        _vsh_E7C34044_getMemoryContainerId
LOAD:00000000000302B8                 clrldi    r4, r3, 32
LOAD:00000000000302BC                 addi      r6, r1, 0xB0+var_40
LOAD:00000000000302C0                 li        r5, 0x200
LOAD:00000000000302C4                 lis       r3, 0x200
LOAD:00000000000302C8                 stw       r28, 0xB0+var_40(r1)
LOAD:00000000000302CC                 bl        sys_memory_allocate_from_container
LOAD:00000000000302D0                 lis       r7, stru_1429E8@h
LOAD:00000000000302D4                 lwz       r5, 0xB0+var_40(r1)
LOAD:00000000000302D8                 addi      r4, r1, 0xB0+var_3C
LOAD:00000000000302DC                 addi      r7, r7, stru_1429E8@l
LOAD:00000000000302E0                 lis       r6, 0x200
LOAD:00000000000302E4                 li        r8, 0
LOAD:00000000000302E8                 li        r3, 3
LOAD:00000000000302EC                 bl        _fs_utility_init_1F3CD9F1
LOAD:00000000000302F0                 li        r11, 0x15D    # sys_memory_free
LOAD:00000000000302F4                 mr        r29, r3
LOAD:00000000000302F8                 lwz       r3, 0xB0+var_40(r1)
LOAD:00000000000302FC                 sc
LOAD:0000000000030300                 clrldi    r3, r29, 32
LOAD:0000000000030304                 bl        _sysPrxForUser_sys_ppu_thread_exit
LOAD:0000000000030308                 lis       r9, dword_146D74@h
LOAD:000000000003030C                 ld        r0, 0xB0+arg_10(r1)
LOAD:0000000000030310                 ld        r29, 0xB0+var_18(r1)
LOAD:0000000000030314                 mtlr      r0
LOAD:0000000000030318                 stw       r28, dword_146D74@l(r9)
LOAD:000000000003031C                 ld        r28, 0xB0+var_20(r1)
LOAD:0000000000030320                 addi      r1, r1, 0xB0
LOAD:0000000000030324                 blr
LOAD:0000000000030324 # End of function fsck_cfs_main