[Q] mmcblk0 Partiton table type (sgh-i927) - Samsung Captivate Glide

Does anybody know, which partition table type is used on the /dev/block/mmcblk0 (sgh-i927) ?
I thought there is GPT, but
Code:
~ # dmesg | grep -B1 -e mmcblk0
...
<4>[ 7.293135] Primary GPT is invalid, using alternate GPT.
<6>[ 7.293252] mmcblk0: p1 (䙅S) p2 (偁P) p3 (䅃C) p4 (䵉S) p5 (卍C) p6 (䑕A) p7 (䑍M) p8 (体S) p9 (乌X) p10 (呏A) p11 (䥈D)
...
fdisk does not recognize the partition table
Code:
~ # fdisk -l /dev/block/mmcblk0
Disk /dev/block/mmcblk0: 7733 MB, 7733248000 bytes
4 heads, 16 sectors/track, 236000 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Disk /dev/block/mmcblk0 doesn't contain a valid partition table
~ # fdisk -l /edevblommcb1
fdisk: can't open '/edevblommcb1': No such file or directory
~ # fdisk -l /dev/block/mmcblk1
Disk /dev/block/mmcblk1: 8166 MB, 8166309888 bytes
255 heads, 63 sectors/track, 992 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk1p1 1 992 7968208+ b Win95 FAT32
ok, no msdos table - no problem, I dumped mmcblk0 to my pc and checked it with parted:
Code:
[[email protected]][~/work/android-work/sgh-i927/device]> parted mmcblk0 print
WARNING: You are not superuser. Watch out for permissions.
Warning: Unable to open /home/roma/work/android-work/sgh-i927/device/mmcblk0 read-write (Permission denied).
/home/roma/work/android-work/sgh-i927/device/mmcblk0 has been opened read-only.
Warning: Unable to open /home/roma/work/android-work/sgh-i927/device/mmcblk0 read-write (Permission denied).
/home/roma/work/android-work/sgh-i927/device/mmcblk0 has been opened read-only.
Error: /home/roma/work/android-work/sgh-i927/device/mmcblk0: unrecognised disk label
disassembled:
Code:
[[email protected]][~/work/android-work/sgh-i927/device]> ../../../android-sdk-linux_86/tools/adb pull /sbin/recovery ./mmcblk0.elf
2823 KB/s (793872 bytes in 0.274s)
[[email protected]][~/work/android-work/sgh-i927/device]> dd if=mmcblk0 of=mmcblk0.mbr count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 5.8074e-05 s, 8.8 MB/s
[[email protected]][~/work/android-work/sgh-i927/device]> arm-eabi-objcopy --add-section mmcblk0=mmcblk0.mbr mmcblk0.elf
BFD: st4OsaEp: warning: sh_link not set for section `.ARM.exidx'
[[email protected]][~/work/android-work/sgh-i927/device]> arm-eabi-objdump -d -j mmcblk0 mmcblk0.elf
BFD: mmcblk0.elf: warning: sh_link not set for section `.ARM.exidx'
mmcblk0.elf: file format elf32-littlearm
Disassembly of section mmcblk0:
00000000 <mmcblk0>:
0: 3d5463d0 ldclcc 3, cr6, [r4, #-832]
4: 7c021fb1 stcvc 15, cr1, [r2], {177}
8: 9d1cfe9b ldcls 14, cr15, [ip, #-620]
c: bd8ba89c stclt 8, cr10, [fp, #624]
10: a2bfdf46 adcsge sp, pc, #280 ; 0x118
14: fa289616 blx 0xa25874
18: ffd97eab undefined instruction 0xffd97eab
1c: 6b1737f5 blvs 0x5cdff8
20: 14ea3ae2 strbtne r3, [sl], #2786
24: 545ad41f ldrbpl sp, [sl], #-1055
28: 720e0d51 andvc r0, lr, #5184 ; 0x1440
2c: 5cbb5c11 ldcpl 12, cr5, [fp], #68
30: 406ec5b9 strhtmi ip, [lr], #-89
34: 4514c01f ldrmi ip, [r4, #-31]
38: 52aac445 adcpl ip, sl, #1157627904 ; 0x45000000
3c: f83a0f38 undefined instruction 0xf83a0f38
...
seems garbage to me.
Has anybody else the same "broken" partition table?

fdisk -l /dev/block/mmcblk0
Everybody!
Please, help me in the research.
Post please here your terminal output for these commands:
Code:
$ su
# fdisk -l /dev/block/mmcblk0
Thank you!

romanr said:
Everybody!
Please, help me in the research.
Post please here your terminal output for these commands:
Code:
$ su
# fdisk -l /dev/block/mmcblk0
Thank you!
Click to expand...
Click to collapse
my result:
sorry for late response.....I am quite stuck with job hunting

romanr said:
Everybody!
Please, help me in the research.
Post please here your terminal output for these commands:
Code:
$ su
# fdisk -l /dev/block/mmcblk0
Thank you!
Click to expand...
Click to collapse
And my results
Code:
$ su
su
# fdisk -l /dev/block/mmcblk0
fdisk -l /dev/block/mmcblk0
Disk /dev/block/mmcblk0: 7733 MB, 7733248000 bytes
4 heads, 16 sectors/track, 236000 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Disk /dev/block/mmcblk0 doesn't contain a valid partition table

romanr said:
Everybody!
Please, help me in the research.
Post please here your terminal output for these commands:
Code:
$ su
# fdisk -l /dev/block/mmcblk0
Thank you!
Click to expand...
Click to collapse
<-- doesnt have a linux box available, sorry

Thanks everybody!
seems there is no standard msdos partition table on SGH-i927, but how does it work then... will dig it more

repartition
How can I re partition my Glide?
I think my NAND is corrupted, It does not boot. I can't get into the recovery (vol down + power).
I can get into the Download Mode.
Thanks

Litatus said:
How can I re partition my Glide?
I think my NAND is corrupted, It does not boot. I can't get into the recovery (vol down + power).
I can get into the Download Mode.
Thanks
Click to expand...
Click to collapse
You shouldn't have to do anything crazy. Put it into download mode and get one of the official releases for ICS -- and then run it against your phone -- it should get everything setup for you perfectly. I believe the download is about 660MB, though, just as a heads-up!

terinfire said:
You shouldn't have to do anything crazy. Put it into download mode and get one of the official releases for ICS -- and then run it against your phone -- it should get everything setup for you perfectly. I believe the download is about 660MB, though, just as a heads-up!
Click to expand...
Click to collapse
Well, i did that. I used the GB and the ICS roms, but nothing. No boot and no recovery, just the samsung logo or the download mode. I was thinking that my NAND could be corrupted, and since I didn't find the .pit file, I started to try other pits files. I've found one that finish the whole process with odin (the others gave me error). But the pit was for 16GB, and now when i flash the GB rom I get an error at the end of the flashing process, when the modem.bin is been transfered, and with the ICS rom at the beggining of the flashing process, when the fs is transfered. In the first case i get the following error message in the glide's screen: "partition size too small". In the second case i get: "data too large". So if i didn't have partitions problems before, now i got it.

http://forum.xda-developers.com/showthread.php?t=1831561
Try using that -- that's an all-in-one tool, which should hopefully repartition your tables and the like. Make sure you put your phone into download mode. If not, sounds like you're going to have a lot of pain moving forward.

not working.. proof...
ok. here are the snapshots. The first two are when I try to flash the stock GB rom. The other two are when I try to flash the stock ICS. The last one is when I try to flash the all-in-one tool...
Nothing... I need to Re-partition my NAND. (I think is the last thing to do before to say it is a hardware issue).
Maybe I could do a JTAG. My friend has the riff box, but he doesn't know the pinout to do the jtag. Does anyone knows?

gdisk
Seems there is GPT, but only the backup copy is used
Code:
GPT fdisk (gdisk) version 0.8.4
Unsupported GPT version in backup header; read 0x00000000, should be
0x00010000
Partition table scan:
MBR: not present
BSD: not present
APM: not present
GPT: not present
Creating new GPT entries.
Command (? for help): p
Disk /dev/block/mmcblk0: 15104000 sectors, 7.2 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 95328BF5-FDA5-45A2-BD5F-CE18C3F102AD
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 15103966
Partitions will be aligned on 2048-sector boundaries
Total free space is 15103933 sectors (7.2 GiB)
Number Start (sector) End (sector) Size Code Name
Command (? for help): r
Recovery/transformation command (? for help): c
Warning! This will probably do weird things if you've converted an MBR to
GPT form and haven't yet saved the GPT! Proceed? (Y/N): y
Caution! After loading partitions, the CRC doesn't check out!
Recovery/transformation command (? for help): p
Disk /dev/block/mmcblk0: 15104000 sectors, 7.2 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 95328BF5-FDA5-45A2-BD5F-CE18C3F102AD
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 15103966
Partitions will be aligned on 2048-sector boundaries
Total free space is 23485 sectors (11.5 MiB)
Number Start (sector) End (sector) Size Code Name
1 21504 46079 12.0 MiB 0700 ES
2 46080 1274879 600.0 MiB 0700 AP
3 1274880 1913855 312.0 MiB 0700 CC
4 1913856 9779199 3.8 GiB 0700 IS
5 9779200 9783295 2.0 MiB 0700 MC
6 9783296 13977599 2.0 GiB 0700 UA
7 13977600 14010367 16.0 MiB 0700 MM
8 14010368 14020607 5.0 MiB 0700 SS
9 14020608 14036991 8.0 MiB 0700 LX
10 14036992 14053375 8.0 MiB 0700 OA
11 14053376 15101951 512.0 MiB 0700 HD
Recovery/transformation command (? for help): q
Despite checksum error the table seems sane.
I thought if there is GPT, then probably there should be an EFI, but I don't see an EFI system partition, also the first partition is not FAT32 (seems it is even zero-filled) so it does not contain EFI boot loader. Probably the bootloader is written in the first 21503 sectors that are marked as free.
Until we know how the bootloader works changing the partition table is rather dangerous.

partition data
Code:
AP:
total 84
-rw-r--r-- 1 root root 2037 Aug 1 2008 CSCFiles.txt
-rw-r--r-- 1 root root 16 Aug 1 2008 CSCVersion.txt
-rw-r--r-- 1 root root 374 Aug 1 2008 SW_Configuration.xml
drwxr-xr-x 2 root root 4096 Feb 19 2012 T9DB
drwxr-xr-x 2 root root 4096 Aug 14 23:19 app
drwxr-xr-x 2 root 2000 4096 Feb 28 2012 bin
-rw-rw-rw- 1 root root 2936 Feb 19 2012 build.prop
drwxr-xr-x 2 root root 4096 Feb 19 2012 cameradata
drwxr-xr-x 2 root root 4096 Feb 19 2012 csc
drwxr-xr-x 16 root root 4096 Apr 19 2012 etc
drwxr-xr-x 2 root root 4096 Feb 19 2012 fonts
drwxr-xr-x 2 root root 4096 Feb 19 2012 framework
drwxr-xr-x 6 root root 8192 Aug 14 23:19 lib
drwx------ 2 root root 4096 Jan 1 1970 lost+found
drwxr-xr-x 4 root root 4096 Feb 19 2012 media
drwxr-xr-x 4 root root 4096 Feb 19 2012 tts
drwxr-xr-x 7 root root 4096 Feb 19 2012 usr
drwxr-xr-x 4 root root 4096 Feb 19 2012 vsc
drwxr-xr-x 2 root 2000 8192 Feb 23 2012 xbin
CC:
total 384
-rw-r--r-- 1 10029 10029 380994 Dec 7 21:57 downloadfile.bin
drwxrwx--- 2 root root 4096 Jan 1 1970 lost+found
drwxrwxr-x 2 roma 2001 4096 Dec 11 22:51 recovery
ES:
total 2140
-rw-r--r-- 1 roma roma 2 Dec 11 02:38 cryptprop_FailedAttempts
-rw-r--r-- 1 roma roma 9 Jan 1 2011 cryptprop_applied_result
-rw-r--r-- 1 roma roma 5 Feb 19 2012 cryptprop_lock_pattern_autolock
-rw-r--r-- 1 roma roma 6 Feb 19 2012 cryptprop_lock_pattern_tactile_feedback_enabled
-rw-r--r-- 1 roma roma 6 Feb 19 2012 cryptprop_lock_pattern_visible_pattern
-rw-r--r-- 1 roma roma 9 Aug 27 15:08 cryptprop_lockscreen.lockoutattemptdeadline
-rw-r--r-- 1 roma roma 6 Feb 19 2012 cryptprop_lockscreen.password_type
-rw-r--r-- 1 roma roma 5 Feb 19 2012 cryptprop_lockscreen.patterneverchosen
-rw-r--r-- 1 root root 5 Dec 3 11:07 cryptprop_onetimeboot
-rw-r--r-- 1 roma roma 3 Feb 19 2012 cryptprop_persist.sys.language
-rw-r--r-- 1 roma roma 14 Nov 14 20:01 cryptprop_persist.sys.timezone
-rw-r--r-- 1 root root 1 Jan 1 2011 cryptprop_rebootMode
-rw-r--r-- 1 root root 5 Jan 1 2007 cryptprop_sdcard
-rw-r--r-- 1 root root 3 Dec 3 11:07 cryptprop_securewipedata
drwx------ 3 roma roma 4096 Jan 1 2011 dmp
-rw------- 1 roma roma 112 Feb 19 2012 edk_p
-rw------- 1 root root 1 Jan 1 2007 essiv
drwxrwxr-x 2 1001 1001 4096 Nov 22 2011 imei
-rwx------ 1 1001 1001 4533 Mar 13 2012 nv.log
-rwx------ 1 1001 1001 2097152 Dec 11 22:51 nv_data.bin
-rwx------ 1 1001 1001 32 Dec 11 22:51 nv_data.bin.md5
-rwxrw-r-- 1 1001 1001 880 Jan 1 2011 redata.bin
-rw-rw-r-- 1 roma roma 3 Dec 11 22:37 slideCount
IS:
total 629124
drwxr-xr-x 3 root root 4096 Feb 20 2012 Android
drwxr-xr-x 3 root root 4096 Mar 26 2012 DCIM
drwxr-xr-x 2 root root 4096 Mar 17 2012 LOST.DIR
-rwxr-xr-x 1 root root 2344960 Feb 21 2012 app-add-system.tar
drwxr-xr-x 3 root root 4096 Feb 26 2012 clockworkmod
drwxr-xr-x 3 root root 4096 Feb 23 2012 data
-rwxr-xr-x 1 root root 285217010 Feb 1 2012 i927_OsiMood_v0_Origins.zip
-rwxr-xr-x 1 root root 186525834 Feb 16 2012 i927_OsiMood_v2.02.14.zip
-rwxr-xr-x 1 root root 2378 Nov 8 2009 qwerty.html
-rwxr-xr-x 1 root root 10240 Feb 21 2012 resolv-system.tar
-rwxr-xr-x 1 root root 10240 Feb 20 2012 sd-ext-swap-system.tar
-rwxr-xr-x 1 root root 133328 Oct 30 2011 timezone2011i.zip
-rwxr-xr-x 1 root root 58388913 Dec 7 2010 update-cm-6.1.0-DS-signed.zip
-rwxr-xr-x 1 root root 104298840 Feb 20 2012 update-cm-7.1.0-GalaxyS2-signed.zip
-rwxr-xr-x 1 root root 7249920 Feb 21 2012 xbin-add-system.tar
MC:
total 0
MM:
total 0
SS:
total 0
UA:
total 220
-rw-rw-rw- 1 roma roma 4096 Dec 3 11:08 NVM0
-rw-rw-rw- 1 roma roma 16384 Nov 19 16:54 NVM1
-rw-rw-rw- 1 roma roma 2832 Dec 3 11:08 NVM13
-rw-rw-rw- 1 roma roma 0 Feb 19 2012 NVM2
-rw-rw-rw- 1 roma roma 83724 Nov 19 16:54 NVM3
-rw-rw-rw- 1 roma roma 112 Nov 19 16:55 NVM5
-rw-rw-rw- 1 roma roma 0 Feb 19 2012 NVM6
drwxrwxr-x 2 roma roma 4096 Dec 7 20:45 anr
drwxrwx--x 2 roma roma 8192 Dec 11 22:31 app
drwxrwx--x 2 roma roma 4096 Apr 19 2012 app-private
drwx------ 5 roma roma 4096 Dec 7 20:24 backup
-rw-rw-rw- 1 roma roma 2777 Dec 11 14:51 cal.bin
drwxrwxr-x 25 roma roma 4096 Dec 11 02:22 clipboard
drwxrwx--x 2 roma roma 16384 Dec 11 22:31 dalvik-cache
drwxrwx--x 245 roma roma 12288 Dec 7 22:06 data
drwxr-x--- 2 root 1007 4096 Feb 19 2012 dontpanic
lrwxrwxrwx 1 root root 16 Dec 11 22:19 dropbear -> /sd-ext/dropbear
drwxrwxrwt 2 root root 4096 Feb 19 2012 fota
drwxrwx--x 2 roma roma 4096 Feb 19 2012 gps
srwxrwxrwx 1 1002 1002 0 Dec 7 18:03 inc_data_path
drwxrwx--x 3 2000 2000 4096 Sep 8 21:57 local
drwxrwxrwx 2 roma roma 4096 Dec 7 20:45 log
drwxrwx--- 2 root root 4096 Jan 1 1970 lost+found
drwxrwx--t 10 roma 9998 4096 Feb 23 2012 misc
drwxr--r-- 3 root root 4096 Feb 19 2012 mrd
drwx------ 2 root root 4096 Nov 14 20:01 property
drwx------ 3 roma roma 4096 Feb 19 2012 secure
drwxrwxr-x 8 roma roma 4096 Dec 11 22:51 system
drwxr-xr-x 2 roma roma 4096 Feb 21 2012 tombstones
drwxrwx--- 2 1010 1010 4096 Feb 19 2012 wifi
HD:
total 8
drwxr-xr-x 2 root root 4096 Sep 23 2011 app
drwxr-xr-x 2 root root 4096 Sep 23 2011 sdcard
HD/app:
total 1828
-rw-r--r-- 1 root root 30241 Sep 23 2011 ATTFamilyMapLauncher.apk
-rw-r--r-- 1 root root 644618 Sep 23 2011 Kindle-OEM-0.9.6-STUB.apk
-rw-r--r-- 1 root root 19096 Sep 23 2011 YPMAndroid_VPL-release_3.apk
-rw-r--r-- 1 root root 19390 Sep 23 2011 com.mobitv.client.tv.apk
-rw-r--r-- 1 root root 18476 Sep 23 2011 myATTVPL_SA_v4_aligned.apk
-rw-r--r-- 1 root root 1128479 Sep 23 2011 qik-preload-1.18-release-lite.apk
HD/sdcard:
total 98556
-rw-r--r-- 1 root root 94468591 Sep 23 2011 ASPHALT6_11-002_ONv2_480_H264_GOOD.wmv
-rw-r--r-- 1 root root 1270663 Sep 23 2011 Asphalt_6_Screen_Shot_1280x768_1.png
-rw-r--r-- 1 root root 1314442 Sep 23 2011 Asphalt_6_Screen_Shot_1280x768_2.png
-rw-r--r-- 1 root root 1269021 Sep 23 2011 Asphalt_6_Screen_Shot_1280x768_3.png
-rw-r--r-- 1 root root 1370346 Sep 23 2011 Asphalt_6_Screen_Shot_1280x768_4.png
-rw-r--r-- 1 root root 1217762 Sep 23 2011 Asphalt_6_Screen_Shot_1280x768_5.png
LX:
total 0
OA:
total 0
AP - seems like /system
CC - something to do with recovery
ES - /efs
IS - /sdcard (I have internal and external storage swapped)
UA - /data
HD - seems like bloatware bootstrap installation depot, 500Mb, perhaps it may be used as additional storage!
MC, MM, SS, LX, OA - was not mounted, unknown filesystem type

partition data
MC - seems like recovery bootloader, or something related (solely out off "boot-recovery" keyword
Code:
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000800 62 6f 6f 74 2d 72 65 63 6f 76 65 72 79 00 00 00 |boot-recovery...|
00000810 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000820 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000830 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00100000 ff ff ff ff 01 02 ff ff ff ff ff ff ff ff ff ff |................|
00100010 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
00100800 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
001ff000 3b 86 7c 39 74 01 00 00 00 00 00 00 ff 00 00 00 |;.|9t...........|
001ff010 04 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
001ff020 00 00 00 00 00 00 00 00 44 4c 4f 57 00 00 00 00 |........DLOW....|
001ff030 01 00 00 00 d4 fa fb ee 17 f2 c0 e7 e1 8f 8d 6e |...............n|
001ff040 b3 9a 72 08 ab c6 b9 17 26 89 ae 99 57 85 2d 57 |..r.....&...W.-W|
001ff050 74 7f 71 79 9a 9f 49 12 6a 9b 68 0e 22 da 07 13 |t.qy..I.j.h."...|
001ff060 c1 e5 e8 60 73 f5 61 4d 0f 05 b2 11 53 f4 46 8c |...`s.aM....S.F.|
001ff070 02 19 19 3b 71 c1 6f 4d bd ad cb e2 7e 48 c4 28 |...;q.oM....~H.(|
001ff080 d5 a9 4f 7e 85 99 5c c1 a3 2f a1 43 90 bf 1f 30 |..O~..\../.C...0|
001ff090 39 9a 2f a0 61 df e4 41 e0 c8 9c ab d1 f2 ca a9 |9./.a..A........|
001ff0a0 d3 0f 6c 46 02 51 8c 13 89 18 18 4d 04 e9 a3 94 |..lF.Q.....M....|
001ff0b0 55 79 ea 0d fe f7 35 6c 93 e6 d5 2a 7c 1e f6 9f |Uy....5l...*|...|
001ff0c0 b9 53 c6 ab 8a 60 2d 77 81 f6 cd e4 86 18 f2 57 |.S...`-w.......W|
001ff0d0 20 00 9b 61 33 1c 35 3b 64 3a 11 0b cf cb 84 6e | ..a3.5;d:.....n|
001ff0e0 70 7f 6a 20 72 03 63 f0 0c d1 05 79 cd 87 53 d0 |p.j r.c....y..S.|
001ff0f0 e4 78 da 3e 71 95 5a b0 1f 8b 9a 76 69 4f 68 d9 |.x.>q.Z....viOh.|
001ff100 56 cb 56 48 64 2b b2 15 e4 24 29 00 b2 57 9c b0 |V.VHd+...$)..W..|
001ff110 e3 b8 e0 b1 89 b3 c8 a8 d1 9b f9 54 3d c2 e8 57 |...........T=..W|
001ff120 94 ab aa 6d 37 5e 2e b3 98 7b 98 29 af 01 b8 9a |...m7^...{.)....|
001ff130 de 7d 6f 9f cb af 0d 71 cb ce 73 94 f8 46 d0 bf |.}o....q..s..F..|
001ff140 66 12 83 95 b6 3a d4 40 08 25 f3 c2 1e 8e b4 42 |f....:[email protected]%.....B|
001ff150 bc c8 82 f5 27 e3 40 c2 5a eb 3d 6b 14 19 2d 5f |....'[email protected]=k..-_|
001ff160 d5 9e 0a a9 19 f0 3d 91 26 34 51 bb 66 a9 97 be |......=.&4Q.f...|
001ff170 ab 06 74 b7 ff ff ff ff ff ff ff ff ff ff ff ff |..t.............|
001ff180 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
001ff800 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00200000
SS - is the system kernel (figured out by initramfs dismantling)
LX - is the recovery kernel
OA - empty partition, zeroed out
MM - really don't know what is it

no way to change the partition table (for now)
Actually there is GPT-like partition table, but it's impossible to modify it because there is a data (or a code) that overlaps with primary GPT header, so modifying the table with bare GPT tools like parted or gdisk will definitelly break something.

my PIT file
Litatus said:
I need to Re-partition my NAND. (I think is the last thing to do before to say it is a hardware issue).
Click to expand...
Click to collapse
Here is my pit file attached. Try to flash recovery, than if it works - try the factoryfs image.

thanks, but...
romanr said:
Here is my pit file attached. Try to flash recovery, than if it works - try the factoryfs image.
Click to expand...
Click to collapse
wow... thanks!... finally i got a pit file... unfortunately does not work either...
I get an error...

Litatus said:
wow... thanks!... finally i got a pit file... unfortunately does not work either...
I get an error...
Click to expand...
Click to collapse
Try heimdall, perhaps console one. I think you did put the recovery into the wrong slot.

GB images
Litatus said:
wow... thanks!... finally i got a pit file... unfortunately does not work either...
Click to expand...
Click to collapse
Here are my GB images: http://romanr.info/android/sgh-i927-GB-img.zip
These images do not contain EFS and factoryfs, so normal boot will not work.
Use heimdall 1.4, 1.3 may not work.
You may start with repartitioning and flashing only GPT and SOS images.
Code:
heimdall flash --repartition --pit sgh-i927-GB.pit --GPT GPT.img --SOS SOS.img
Than reboot and try to enter the recovery (hold volume down key). If the recovery works - you'r fine.
If recovery does not work, then try to flash more images.
Code:
heimdall flash --MSC MSC.img
heimdall flash --EBT EBT.img --EB2 EB2.img
Than try to reboot into recovery again.
Flash other images only at last resort.
Flash PT.img at very last resort.

Litatus said:
I need to Re-partition my NAND. (I think is the last thing to do before to say it is a hardware issue).
Maybe I could do a JTAG. My friend has the riff box, but he doesn't know the pinout to do the jtag. Does anyone knows?
Click to expand...
Click to collapse
sgh-i927 does not have NAND/emmc, it has bare MMC card internally mounted, all partitions lie on that internal card. Curious, that odin for now does not allow to read/dump the partition, but it is possible to dump all the internal mmc drive and get access to bootloader and other things. The first 2 blocks (block size = 512KiB) are hidden though.
I belive that samsung devices are truly unbreakable. Seems that samsung odin-download mode is booted out of some hidden storage, so repartition or even full wipe of internal SD card does not break the download mode.
Also I noticed that nvflash mode works too (holding volume up + volume down), but it requires some additional files. You may dig into it, it is JTAG-equivalent low-level mode.

Related

[Universal] Changing bootsplash easy way!

Hi all,
here's how to create and prepare correct bootsplash image:
http://buzzdev.net
Here's how to flash it to your device very easy way (a little tool):
http://buzzdev.net
Version 1.1 uploaded
DOWNLOAD
Fixed the error below:
pdocwrite %1 -> %NEWSPLASH%
Added default splash, which will be flashed if no splash file found or wrong/nonexisting filename specified on comandline.
Added autoreboot.
Added some comments.
Your comments are welcome.
buzz
buzz_lightyear said:
Hi all,
here's how to create and prepare correct bootsplash image:
http://buzzdev.net
Here's how to flash it to your device very easy way (a little tool):
http://buzzdev.net
Your comments are welcome.
buzz
Click to expand...
Click to collapse
wow wow wow , buzz you done great job again , thanks will try tonight
Excellent Work
Hey Buzz..Thanks..
Excellent work..u always make us proud of our devices..
Well i have a problem here..i did try everything mentioned on your website i.e created a new image new_splash.rsb and saved it in c:/ but when i ran UNI_splash it said the outcome was new file installed but when i restarted my device, i saw a white screen for 2 seconds or so and then the default imate splash image came up..am i doing something wrong. Here are the notes from splash file.
3 partitions, 1 binary partitions
customerid=00000000 uniqueid= 00 00 00 00 8b 08 01 02 1b 21 10 66 03 05 05 71
CopyTFFSToFile(0x3f00000, 0x96000, original_splash.bin)
bin\rsb_header.bin
original_splash.bin
1 file(s) copied.
3 partitions, 1 binary partitions
customerid=00000000 uniqueid= 00 00 00 00 8b 08 01 02 1b 21 10 66 03 05 05 71
ERROR: Unable to open file 0x3efffe4 - The system cannot find the file specified.
CopyFileToTFFS(0x3efffe4:0, 9601c, 00000000)
ERROR: Unable to open host/destination file - The system cannot find the file specified.
Click to expand...
Click to collapse
Please help!
Re: Excellent Work
Nishant said:
Hey Buzz..Thanks..
Excellent work..u always make us proud of our devices..
Well i have a problem here..i did try everything mentioned on your website i.e created a new image new_splash.rsb and saved it in c:/ but when i ran UNI_splash it said the outcome was new file installed but when i restarted my device, i saw a white screen for 2 seconds or so and then the default imate splash image came up..am i doing something wrong. Here are the notes from splash file.
3 partitions, 1 binary partitions
customerid=00000000 uniqueid= 00 00 00 00 8b 08 01 02 1b 21 10 66 03 05 05 71
CopyTFFSToFile(0x3f00000, 0x96000, original_splash.bin)
bin\rsb_header.bin
original_splash.bin
1 file(s) copied.
3 partitions, 1 binary partitions
customerid=00000000 uniqueid= 00 00 00 00 8b 08 01 02 1b 21 10 66 03 05 05 71
ERROR: Unable to open file 0x3efffe4 - The system cannot find the file specified.
CopyFileToTFFS(0x3efffe4:0, 9601c, 00000000)
ERROR: Unable to open host/destination file - The system cannot find the file specified.
Click to expand...
Click to collapse
Please help!
Click to expand...
Click to collapse
Buzz , I got the same problem too.
Re: Excellent Work
mwang said:
Nishant said:
Hey Buzz..Thanks..
Excellent work..u always make us proud of our devices..
Well i have a problem here..i did try everything mentioned on your website i.e created a new image new_splash.rsb and saved it in c:/ but when i ran UNI_splash it said the outcome was new file installed but when i restarted my device, i saw a white screen for 2 seconds or so and then the default imate splash image came up..am i doing something wrong. Here are the notes from splash file.
3 partitions, 1 binary partitions
customerid=00000000 uniqueid= 00 00 00 00 8b 08 01 02 1b 21 10 66 03 05 05 71
CopyTFFSToFile(0x3f00000, 0x96000, original_splash.bin)
bin\rsb_header.bin
original_splash.bin
1 file(s) copied.
3 partitions, 1 binary partitions
customerid=00000000 uniqueid= 00 00 00 00 8b 08 01 02 1b 21 10 66 03 05 05 71
ERROR: Unable to open file 0x3efffe4 - The system cannot find the file specified.
CopyFileToTFFS(0x3efffe4:0, 9601c, 00000000)
ERROR: Unable to open host/destination file - The system cannot find the file specified.
Click to expand...
Click to collapse
Please help!
Click to expand...
Click to collapse
Buzz , I got the same problem too.
Click to expand...
Click to collapse
you should modfiy the UNI_splash.bat
"bin\pdocwrite.exe %1 0x3efffe4 0x9601c >> Splash.log"
to
"bin\pdocwrite.exe c:\new_splash.rsb 0x3efffe4 0x9601c >> Splash.log"
it's my splash.log
3 partitions, 1 binary partitions
customerid=00000000 uniqueid= 00 00 00 00 c8 2e 02 04 08 32 0e bb 18 04 05 17
CopyTFFSToFile(0x3f00000, 0x96000, original_splash.bin)
bin\rsb_header.bin
original_splash.bin
已复制 1 个文件。
3 partitions, 1 binary partitions
customerid=00000000 uniqueid= 00 00 00 00 c8 2e 02 04 08 32 0e bb 18 04 05 17
CopyFileToTFFS(c:\new_splash.rsb:0, 3efffe4, 0009601c)
Hurray
Thanks wlinsong
Hurray! I did it..Thanks buzz for excellent peice of sofware...I just love it..
Nish
This is real nice it worked for me as well...
Here is the one I am using now:
And this could also be nice:
Re: Excellent Work
wlinsong said:
you should modfiy the UNI_splash.bat
"bin\pdocwrite.exe %1 0x3efffe4 0x9601c >> Splash.log"
to
"bin\pdocwrite.exe c:\new_splash.rsb 0x3efffe4 0x9601c >> Splash.log"
it's my splash.log
3 partitions, 1 binary partitions
customerid=00000000 uniqueid= 00 00 00 00 c8 2e 02 04 08 32 0e bb 18 04 05 17
CopyTFFSToFile(0x3f00000, 0x96000, original_splash.bin)
bin\rsb_header.bin
original_splash.bin
已复制 1 个文件。
3 partitions, 1 binary partitions
customerid=00000000 uniqueid= 00 00 00 00 c8 2e 02 04 08 32 0e bb 18 04 05 17
CopyFileToTFFS(c:\new_splash.rsb:0, 3efffe4, 0009601c)
Click to expand...
Click to collapse
Thanks Wlinsong , now I had O2 Exec with Dopod CHT ROM and my gf picture in my bootscreen , its cool.
Wlinsong do you dump Dopod HK rom yet ?
Thanks and Thanks
Two advantages...
1) as obvious....new splash
2) original splash images are also saved...
Very Good tool Indeed
This sounds like a great tool. Thanks buzz!
I have a question though: is it necessary to do a hard reset, or should a soft reset work? Only I have run the program and it said it worked and yet I still have the old O2 splash screen...
These are great news!! :lol:
I've been searching for such a tool maaany weeks!
Will try it soon. Thank you in advance!
GOT IT WORKING!
Sorry about that. I forgot to put the ".rsb" on the filename so it couldn't find the new ROM image. Now I have fixed it and it works beautifully!
hi guys,
i'm glad, that you like it )))
however, I cannot get the problem, why it was necessary to modify the batch.
you should supply two parameters.
first %1 is the new splash.
second %2 is backup filename.
no spaces, no special characters.
if you don't give it parameters, it is looking for
c:\new_splash.rsb
and saving old splash as
c:\backup_splash.rsb
please can anyone clear it for me?
It was really too late yesterday, maybe I did some mistake in that script )
i'm about to write a proper app in c++ later...
thanx
buzz
I fixed the .bat file by changing the %1 variable used in the pdocwrite statement to %NEWSPLASH% - it worked fine then. I presume this is because %1 and %2 are command line variables that get cleared at the next command (pdocread).
I have done the above and it works, except I get for a very brief period a white blank screen before the new splash image loads. I do not recall this behavious with the prior original splash image.
Does everybody else have the same behaviour?
here is my log file:
3 partitions, 1 binary partitions
customerid=00000000 uniqueid= 00 00 00 00 2d 1a 01 02 22 32 0a c6 18 09 05 00
CopyTFFSToFile(0x3f00000, 0x96000, original_splash.bin)
bin\rsb_header.bin
original_splash.bin
1 file(s) copied.
3 partitions, 1 binary partitions
customerid=00000000 uniqueid= 00 00 00 00 2d 1a 01 02 22 32 0a c6 18 09 05 00
CopyFileToTFFS(c:\new_splash.rsb:0, 3efffe4, 0009601c)
Yes, I get this, but its so brief I'm not worried about it personally. Not even sure whether it didn't do it before either!
Version 1.1 uploaded
DOWNLOAD
Fixed the error below:
pdocwrite %1 -> %NEWSPLASH%
Added default splash, which will be flashed if no splash file found or wrong/nonexisting filename specified on comandline.
Added autoreboot.
Added some comments.
THANX for comments
buzz
alfazulu said:
I have done the above and it works, except I get for a very brief period a white blank screen before the new splash image loads. I do not recall this behavious with the prior original splash image.
Does everybody else have the same behaviour?
Click to expand...
Click to collapse
It is normal. You probably didn't notice that behaviour.
buzz
Works Great!
Another Great Work Buzz!
Thanks

Need Help how to use OSNBTool at cooking CiPhone C6 ROM

Hi,
I’m Hellmuth from Germany and try to cook my own Rom for my new CiPhone C6 (3.5 Inch )
I used Weisuns OSNB-tool to split the Rom and later to Build it again
At the first step I try to split and rebuild the Rom. Without any changes.
But something seems to be wrong.
1. IMGFS in dump is different to Original IMGFS.
All files are there but when I compare them in TotalComander there are some differences in this files:
initflashfiles.dat, packages.sof, default.hv and user.hv and all *.DSM files
Is that a Problem ?​
2. The new IMGFS is smaler than the old one
110.624.768 imgfs_old.bin
99.944.448 imgfs_new.bin
But Again when I extract IMGFS_new the dump folder is the same size and all files are there​
3.when I try to extract my cooked rom with OSNBtool my kitchen stops and it don't look the same way I bolded some differences I found
Extracting from the original Rom looks like this:
OS ROM Partition Tool V1.56 By Weisun :> PDAclan.com
Sector size : 0x00000800
Extra data bytes : 0x00000008
OS IMAGE found.
Partitions infomation:
**************************************
Part-0 type: BOOT SECTION image
Part-1 type: XIP RAM Image
Part-2 type: IMGFS file system
Part-3 type: legit DOS partition
**************************************
CiPhone.bin.PRE written.
-------------------------------------------------
Sector counters (extra-data) found in source file.
Partition 0 true offset:00000002 true size:0000027E Len:0000027E
Partition 1 true offset:00000280 true size:00000740 Len:000006C0
Partition 2 true offset:000009C0 true size:0000D380 Len:0000D300
Partition 3 true offset:0000DD40 true size:000005CF Len:000117C0
CiPhone.bin.OS.NB written.​
Extracting from the new Build Rom looks like this:
OS ROM Partition Tool V1.56 By Weisun :> PDAclan.com
Sector size : 0x00000800
Extra data bytes : 0x00000008
OS IMAGE found.
Partitions infomation:
**************************************
Part-0 type: BOOT SECTION image
Part-1 type: XIP RAM Image
Part-2 type: IMGFS file system
Part-3 type: legit DOS partition
**************************************
Found 'B000FF' header at offset: 0x00000000
BIN_START: 0x00000000 BIN_LENGTH: 0x067E7800
Records: 0x00000338 RecordsSize: 0x067696AC
BinFileSize: 0x067696BB
StartAddr: 0x00000000
CiPhone.bin.BIN.NB0 written.​
I hope you can help me
Thank you for your affords in prediction
Hellmuth
Here are my batchfiles
Extrcat.cmd
@ECHO OFF
PATH %~dp0\Tools;%PATH%
Title CiPhone ROM Kitchen BY Hellmuth
CD /D "%~dp0"
cd Source
osnbtool -sp CiPhone.bin
Rem osnbtool -d CiPhone.bin.OS.NB 0 boot.bin
osnbtool -d CiPhone.bin.OS.NB 1 xip.bin
osnbtool -d CiPhone.bin.OS.NB 2 imgfs.bin
Rem osnbtool -d CiPhone.bin.OS.NB 3 DosPartition.bin
cd..
copy Source\xip.bin XIP_old.bin
xidump -build XIP_old.bin
md ROM
move xip. rom.
move romhdr.bin rom\
cd rom
attrib xip\*.* -h -s -r /s
cd XIP
move MSXIPKernel\boot_ms.rgu boot_ms.rgu
move OEMXIPKERNEL\boot.hv boot.hv
move OEMXIPKERNEL\boot.rgu boot.rgu
cd..
cd..
copy Source\imgfs.bin imgfs_old.bin
ImgfsToDump.exe imgfs_old.bin
packagebuilder.exe dump
move dump\SYS SYS
attrib dump\*.* -h -s -r /s
attrib sys\metadata\*.hv -h -s -r
move sys\metadata\*.hv dump
move dump\OEM OEM
ECHO.
ECHO Fertig
ECHO.
pause​
BuiltOS.cmd
@ECHO OFF
PATH %~dp0\Tools;%PATH%
Title CiPhone ROM Kitchen BY Hellmuth - Rom wird gebacken
CD /D "%~dp0"
BuildOS.exe
move dump\*.dsm temp\dump\
pause
move imgfs_old.bin Temp\imgfs_old.bin
CD Temp
WMReloc -gdump -lGLB_WMReloclog.txt
ImgfsFromDump imgfs_old.bin imgfs.bin
cd ..
move temp\imgfs.bin Source\imgfs_new.bin
cd Source
snbtool -c CiPhone.bin.OS.NB 2 imgfs_new.bin
osnbtool -extra CiPhone.bin.OS.NB.NEW
osnbtool -2bin CiPhone.bin.OS.NB.NEW.EXA (OS.nb.NEW.EXA.bin=NewROM.bin)
ren CiPhone.bin.OS.NB.NEW.EXA.BIN Ciphone.new.bin
osnbtool -fixbinheader Ciphone.new.bin
ECHO.
ECHO Fertig
ECHO.​
Does anyone has a Suggestion ??
Grüße Hellmuth
No suggestion at all ??
Happy New Year I've been following you all these days for ciphone customization.. any good news my friend?
Hellmuth said:
No suggestion at all ??
Click to expand...
Click to collapse
try to split twice.i mean like this
osnbtool -sp xxx.bin
osnbtool -sp xxx.bin.nb0.os.nb
then use -d command
while splitting .bin, u take a note of bin structure, its start address, u will need it when u rebuild using -2bin.
also use 1.59 version.It is available
hdubli said:
try to split twice.i mean like this
osnbtool -sp xxx.bin
osnbtool -sp xxx.bin.nb0.os.nb
then use -d command
Click to expand...
Click to collapse
When I Used -SP xxx.bin there wasn't build a nb0 file only an nb file is build
And it is no problem to get the imgfs.bin or the XIP.bin out of the nb file, so I think that part is correct
hdubli said:
while splitting .bin, u take a note of bin structure, its start address, u will need it when u rebuild using -2bin.
also use 1.59 version.It is available
Click to expand...
Click to collapse
Can you tell me witch address i have to to use in witch way?
This happens when I Extract from original Rom
OS ROM Partition Tool V1.56 By Weisun :> PDAclan.com
Sector size : 0x00000800
Extra data bytes : 0x00000008
OS IMAGE found.
Partitions infomation:
**************************************
Part-0 type: BOOT SECTION image
Part-1 type: XIP RAM Image
Part-2 type: IMGFS file system
Part-3 type: legit DOS partition
**************************************
CiPhone.bin.PRE written.
-------------------------------------------------
Sector counters (extra-data) found in source file.
Partition 0 true offset:00000002 true size:0000027E Len:0000027E
Partition 1 true offset:00000280 true size:00000740 Len:000006C0
Partition 2 true offset:000009C0 true size:0000D380 Len:0000D300
Partition 3 true offset:0000DD40 true size:000005CF Len:000117C0
CiPhone.bin.OS.NB written.
osnbtool is used after you extract all partitions inside the rom image file.. be careful
hdubli said:
try to split twice.i mean like this
osnbtool -sp xxx.bin
osnbtool -sp xxx.bin.nb0.os.nb
then use -d command
while splitting .bin, u take a note of bin structure, its start address, u will need it when u rebuild using -2bin.
also use 1.59 version.It is available
Click to expand...
Click to collapse
ciphone image does not has bin structure at all it has their own structure..
Hallo NeuronNetwork
So I tried what you and hdubli suggested to me
When I first use the parameter -SP there is not a .nb0. but a .nb. File created.
For the second time -SP the result is "Source file does not need to split!"
Take a look what happens on the screen
1. osnbtool -sp CiPhone.bin
OS ROM Partition Tool V1.59 By Weisun :> PDAclan.com
Sector size : 0x00000800
Extra data bytes : 0x00000008
OS IMAGE found.
Partitions infomation:
**************************************
Part-0 type: BOOT SECTION image
Part-1 type: XIP RAM Image
Part-2 type: IMGFS file system
Part-3 type: legit DOS partition
**************************************
CiPhone.bin.PRE written.
-------------------------------------------------
Sector counters (extra-data) found in source file.
Partition 0 true offset:00000002 true size:0000027E Len:0000027E
Partition 1 true offset:00000280 true size:00000740 Len:000006C0
Partition 2 true offset:000009C0 true size:0000D380 Len:0000D300
Partition 3 true offset:0000DD40 true size:000005CF Len:000117C0
CiPhone.bin.OS.NB written.
2. osnbtool -sp CiPhone.bin.OS.NB
OS ROM Partition Tool V1.59 By Weisun :> PDAclan.com
Sector size : 0x00000800
Extra data bytes : 0x00000000
OS IMAGE found.
Partitions infomation:
**************************************
Part-0 type: BOOT SECTION image
Part-1 type: XIP RAM Image
Part-2 type: IMGFS file system
Part-3 type: legit DOS partition
**************************************
It does not include .PRE section in source file.
Source file does not need to split!
Be honest do you really solved the problem ???
Grüße Hellmuth
Be honest do you really solved the problem ???
Click to expand...
Click to collapse
yes i do.. do you really look at the attachment post #7 do i have to say wm6.5 28005 runs very smooth?
there are several important partitions inside the CiPhoneImage and one of them is FLASH partition. osnbtool should be use with this FLASH partition, and not the CiPhoneImage.. ..and why it's not ending in BIN extension, because it's not a BIN file structure..
Sorry I think it is an miss understanding
I do not want to annoy you
But you can see what I tried. What is wrong ??
And it seems to me you are using an other program called fhpkg
I don't have it where can I get it
So please help me.
osnbtool is used after you extract all partitions inside the rom image file.. be careful
Click to expand...
Click to collapse
Sorry I think this is the misunderstanding I only tried OSNBTool I have no other tool.
How can I Extract it before ??
Grüße Hellmuth
Hellmuth said:
Sorry I think this is the misunderstanding I only tried OSNBTool I have no other tool.
How can I Extract it before ??
Grüße Hellmuth
Click to expand...
Click to collapse
i create it my own.. it can extract and combine all the partitions.. modification were also made to OEM, XIP, and ROM.. rebuilt the modification back to the FLASH partition.. it pass ciphone flashing tool and boot wm6.5 successfully.. but some portion of the partition is still being analyze so i cant release it in the time being.. but if you need info, make sure you know how to use hex editor.. if you do know how to use, then post the first 512 bytes hex value of the ciphone image..
It seems you make me hot
NeuronNetwork said:
do i have to say wm6.5 28005 runs very smooth?
Click to expand...
Click to collapse
Her comes the first 512 Bytes
It's in the attachment too named test.txt
8c 77 07 01 00 00 00 01 00 06 00 00 00 31 31 2f
31 31 2f 32 30 30 39 00 00 00 00 00 00 00 00 00
00 00 00 00 01 16 34 7c 1c 03 00 00 00 00 00 04
c4 00 00 00 02 00 00 00 0c b1 00 00 00 00 08 a0
e0 03 00 00 03 f1 12 00 00 00 02 00 00 00 00 00
ec b4 00 00 04 16 34 7c 1c d1 01 00 00 00 02 00
ec b4 02 00 05 00 00 00 00 14 1b 07 00 00 20 00
08 86 04 00 07 f1 12 00 80 14 00 00 00 00 00 00
08 9a 1f 07 08 a4 16 7c 8c 8a 24 00 00 00 00 00
88 ae 1f 07 d0 f1 12 00 00 00 00 00 64 f1 12 00
ed a4 16 7c 21 00 00 00 c8 f3 f0 83 d0 f1 12 00
64 f1 12 00 34 a5 16 7c 18 47 d8 00 41 a5 16 7c
21 00 00 00 ff 01 2d e9 38 22 9f e5 00 10 92 e5
10 10 81 e3 00 10 82 e5 2c 22 9f e5 00 10 92 e5
10 10 81 e3 00 10 82 e5 20 22 9f e5 20 12 9f e5
00 10 82 e5 1c 22 9f e5 1c 12 9f e5 00 10 82 e5
18 22 9f e5 18 12 9f e5 00 10 82 e5 0b 1a a0 e3
01 10 51 e2 fd ff ff 1a 08 22 9f e5 35 10 a0 e3
00 10 82 e5 00 22 9f e5 35 10 a0 e3 00 10 82 e5
f8 21 9f e5 30 10 a0 e3 00 10 82 e5 f0 21 9f e5
30 10 a0 e3 00 10 82 e5 e8 21 9f e5 35 10 a0 e3
00 10 82 e5 e0 21 9f e5 34 10 a0 e3 00 10 82 e5
d8 21 9f e5 00 10 a0 e3 00 10 82 e5 0b 1a a0 e3
01 10 51 e2 fd ff ff 1a c4 21 9f e5 32 10 a0 e3
00 10 82 e5 bc 21 9f e5 bc 11 9f e5 00 10 82 e5
b8 21 9f e5 b8 11 9f e5 00 10 82 e5 b4 21 9f e5
b4 11 9f e5 00 10 82 e5 b0 21 9f e5 0c 10 a0 e3
00 10 82 e5 a8 21 9f e5 a8 11 9f e5 00 10 82 e5
a4 21 9f e5 a4 11 9f e5 00 10 82 e5 a0 21 9f e5
00 10 a0 e3 00 10 82 e5 98 21 9f e5 84 11 9f e5
00 10 82 e5 90 21 9f e5 80 11 9f e5 00 10 82 e5
88 21 9f e5 00 10 a0 e3 00 10 82 e5 80 21 9f
copy block starting from 48608 to 71F9A08 and write it to a file.. this is your FLASH file.. you may start extract it using osnbtool with this FLASH file..
Sorry but the same happens as before
The old ciphone.bin has 121.511.560
the new reduced Flashfile has 119.911.572 it that correct?
OSNBtool only builds a nb not an nb0 file
and second time -SP is also not needed
Hellmuth said:
the new reduced Flashfile has 119.911.572 it that correct?
Click to expand...
Click to collapse
of course it's correct, the flash file you have just extract is part of the ciphone image file, that's why it reduced in size..
O.k but it makes no difference in using OSNBtool I only can extract it once with the -sp parameter no nb0 file is build only a nb file
By the way I am able to extract imgfs.bin and xip.bin
Thats no problem so I can not understand why I have to delete parts of the Rom. (It seems to make no difference)
I especially need help in rebuilding it how do you do that ??
Thats no problem so I can not understand why I have to delete parts of the Rom.
Click to expand...
Click to collapse
i didnt said you have to delete part of the rom.. i just said you have to extract part of the rom to get the FLASH file..
this is how i rebuild it.. you pass the modified dump directory to buildos.. wmreloc the new dump directory.. imgfsfromdump the dump directory.. osnbtool combine imgfs partition type 2 file.. osnbtool extra the new imgfs file.. merge pre header with the new imgfs file.. the new merge file is the new FLASH file.. this is the reason why you dont have to use osnbtool 2bin because it's not a BIN structure file..
you have to merge this FLASH file with other partitions to get back the ciphoneimage rom file.. in order to get this other partitions, you have to extract it..
[CiPhoneImage] = [Header] + [Partition..N] + [Partition..N+1] + [Partition..N+2] and etc..
you only extract part of it, not all.. you need all partitions to build ciphoneimage rom file back.. it does make a difference..
Sorry I think misunderstanding goes on
I always used OSNBtool or IMFGSTODUMP to extract something.
I hope I get you right now:
In your opinion extracting means to save only a parts of the Original Ciphone.Bin. in this case from 48608 to 71F9A08 in a File named FLASH.Bin
If I'm right how can I extract IMFGS.Bin and XIP.bin from Flash.bin which Program do you use for this?
I tried OSNBTool -SP again it is the same as before no nb0 File is created only an .nb File and i can't split this a second time with -SP option.
Do you have a Batchfiles for building and rebuilding the Files?
May be you can give it to me so I can analyse it and understand more.
Sorry until now I meant I Know a lot about this. But now I know that's not the truth.
Grüße Hellmuth

Is msm_nand.c broken?

I think msm_nand.c is broken because i got 56 bytes garbage from MEMREADOOB ioctl.
example code snippet:
memset(oobbuf, 0x55, 64);
oob.start = offs;
oob.length = 64;
oob.ptr = oobbuf;
if (ioctl(fd1, MEMREADOOB, &oob) != 0) {
perror("ioctl: ");
return -1;
}
page 0:
00000007E0: FF FF FF FF FF FF FF FF │ FF FF FF FF FF FF FF FF ˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙
00000007F0: FF FF FF FF FF FF FF FF │ FF FF FF FF FF FF FF FF ˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙
oob:
0000000800: 13 FD 23 69 75 23 8B 70 │ 52 8A A8 CF 56 CF FA 43 ‼ý#iu#<pRŠ¨ĎVĎúC
0000000810: 09 9F 79 FF A8 CF 56 CF │ FA 43 09 9F 79 FF 01 10 ○źy˙¨ĎVĎúC○źy˙☺►
0000000820: 00 00 01 00 00 30 00 00 │ 00 80 00 00 00 00 88 49 ☺ 0 _ _I
0000000830: 10 E2 F0 4E 39 B0 20 59 │ 55 55 55 55 55 55 55 55 ►âđN9° YUUUUUUUU
page 1:
0000000840: 03 00 00 00 01 00 00 00 │ FF FF 61 70 70 00 00 00 ♥ ☺ ˙˙app
Is it a driver bug? Anyone could fix it please?
htc wildfire buzz - Linux version 2.6.35.13-nFinity ([email protected]) (gcc version 4.4.3 (GCC)
Could it be caused by bad blocks on the nand? Can you provide a binary so I can test?
The blocks are good on this area. Thank you for testing.
You could download the source and binary at:
http://gnet.hu/memreadoob/memreadoob.c
http://gnet.hu/memreadoob/memreadoob
Other problem, I think we can't switch to MTD_MODE_RAW
i got this message in kernel log: msm_nand_read_oob: unsupported ops->len, 2112
but it doesn't contains MTD_OOB_RAW so we are not in raw mode.
cm-kernel/drivers/mtd/devices/msm_nand.c:
if (ops->datbuf != NULL &&
(ops->len % (mtd->writesize + mtd->oobsize)) != 0) {
pr_err("%s: unsupported ops->len,"
" %d for MTD_OOB_RAW\n", __func__, ops->len);
return -EINVAL;
}
}
if (ops->mode != MTD_OOB_RAW && ops->ooblen != 0 && ops->ooboffs != 0) {
pr_err("%s: unsupported ops->ooboffs, %d\n",
__func__, ops->ooboffs);
return -EINVAL;
}
phr3ak128 said:
Other problem, I think we can't switch to MTD_MODE_RAW
i got this message in kernel log: msm_nand_read_oob: unsupported ops->len, 2112
Click to expand...
Click to collapse
I have no such message in my kernel log.
I also ran memreadoob on my phone, and this is the output I got.
memreadoob
size: 262144000
erase size: 131072
write size: 2048
oob size: 64
2048 bytes readed
oob.start: 56
oob.length: 64
2048 bytes readed
oob.start: 56
oob.length: 64
Hi arco68,
Can we access the radio NAND after HBOOT has started AMSS (the radio OS?) I guess it is blocked by the radio? But I've read elsewhere that CWM 2.x can flash a radio.img, so it seems it does have access?
yes because in this test you read 2048 byte not 2112. it's other bug.
so if you see your /sdcard/test.img you will see the 56 bytes garbage on 0x800 instead of 64 bytes correct oob data.
xdbg said:
Hi arco68,
Can we access the radio NAND after HBOOT has started AMSS (the radio OS?) I guess it is blocked by the radio? But I've read elsewhere that CWM 2.x can flash a radio.img, so it seems it does have access?
Click to expand...
Click to collapse
CWM2 can flash radio yes, CWM3 can not. I don't think you want to mess with the radio part though.
phr3ak128 said:
yes because in this test you read 2048 byte not 2112. it's other bug.
so if you see your /sdcard/test.img you will see the 56 bytes garbage on 0x800 instead of 64 bytes correct oob data.
Click to expand...
Click to collapse
Well I have no idea what's correct or not to be honest. I'm sure if it was a major bug that it would have been fixed upstream a long time ago.
Have you tested with kernel 2.6.32, if it's the same?
Which kernel branch used from git for current nightly?
It's based on original HTC sources released on http://developer.htc.com/
My patched version, if you want to download and compile it yourself, is here:
https://github.com/arco/buzz-kernel-2.6.35
So, Are these bad for buzz? git://github.com/CyanogenMod/cm-kernel.git
What do you think who is the maintainer of msm_nand.c ?
When will be available 2.6.37 for buzz?
So, Are these bad for buzz? git://github.com/CyanogenMod/cm-kernel.git
Click to expand...
Click to collapse
Yes, it's for snapdragon devices.
phr3ak128 said:
What do you think who is the maintainer of msm_nand.c ?
When will be available 2.6.37 for buzz?
Click to expand...
Click to collapse
Google/Code Aurora, and probably some code done by HTC.
2.6.37 won't be available for the Tattoo. Anything higher than 2.6.35 I don't think will happen, unless some new phone with similar specs as the wildfire comes out with a newer kernel. And even then it could be impossible.
I see the msm-2.6.35 mtd driver is newer than yours. How possible this? I tried to complie that with msm_defconfig without success.
It's not compatible with our phone.
What is the problem with that, Is that not support MSM7225?
Think of it like this, you can't use the drivers for a Nvidia GeForce 9 card on an old GeForce 2 card, can you? If you understand what I mean?
phr3ak128 said:
What do you think who is the maintainer of msm_nand.c ?
When will be available 2.6.37 for buzz?
Click to expand...
Click to collapse
It's possible, but a huge amount of work. Porting all the hardware and making sure it works fine is really not trivial. It's time consuming, and the benefit right now of using 2.6.37 instead of 2.6.35 is unclear to me.

[ASK] Link2SD for galaxy W

I wanna ask,
is galaxy w need link2sd installed?
what setting that would be good if installing link2sd?
Actually it depends on how much applications you want being installed on your phone but yes it worths installing it for at least 5 reasons:
Being able to mount to your computer your SD cards using the debug mode without stopping the applications that you should have moved to the SD card using the native App2SD.
Not being limited by the size of the /data partition because of the *.dex files generated for the dalvik cache.
You can move any kind of applications even those that are not movable to SD!
Link2SD includes free utilities like conversion of system application to user application (and vice versa) that you'll have to pay for with other solutions like Titanium Backup.
Avoiding slow downs because of the loop mounts created (Just run the "mount" command from an adb shell or terminal and you'll see).
Indeed I noticed a global slow down of my phone after I've started getting more and more applications being installed and beside I'm using some other tool to avoid push services and other unwanted background processes to be started by some applications, I've come to the conclusion that too many loop mounts because of the native App2SD is not good either (I suspect it takes over the RAM).
Actually the Link2SD FAQ will give you all the good reasons why to use it:
http://www.link2sd.info/faq
Recommendations:
I'd like to also share share my experience (I may move the following to another thread):
Recommend microSD cards:
Regarding the microSD card you can use even a 32 GB class 10.
The ones I recommend (32 GB class 10) are Samsung, SanDisk, Transcend (Those Transcend ones made in Korea are logically made by Samsung, the ones made in China are made by SanDisk).
Partitionning and formatting:
The tough part is the partitioning and formatting.
Out of the box, all the microSD cards are partitioned and formatted so that they are aligned with their erase block size (it can be 8 MiB, 12 MiB...)
Thus you'll have to consult so you'll know the erase block size:
the Linaro flash card survey:
https://wiki.linaro.org/WorkingGroups/Kernel/Projects/FlashCardSurvey
the corresponding flashbench mailing list
http://lists.linaro.org/mailman/listinfo/flashbench-results
You can also use the flashbench tool to figure it out.
The problem is that you cannot create or resize the FAT32 partition using Windows (even with minitool partition or paragon partition manager), nor with Linux by using gparted or other because you won't get your partitions aligned with the erase blocks and thus you'll get bad performances and faster wearing of your card.
Backup:
Before formatting do a raw backup of the first 16 MiB (for the partitions table and the FAT32 description) using busybox dd on the phone itself or dd on Linux.
For example on the phone:
dd if=/dev/block/mmcblk1 of=/sdcard/mmcblk1-orig-1st-16MiB.img bs=4M count=4
Also you must keep using the default cluster size of 32 kiB because of optimization done at the level of Android and because smaller cluster size will mean more memory taken from the RAM - Actually the FAT is loaded in the RAM, so you must keep it not too big.
Formulas:
Then decide how much you need for the Link2SD partition - You can start with 1 GiB or so, personally I use about 2 GiB. You can check how much space is taken by the asec images to decide...
Now here comes some math (The formulas are to be used in LibreOffice Calc):
Partitioning:
We need to define the new size for the FAT32 partition at the beginning so it is aligned with the erase block size and so that the File Allocation Tables are located between the special offsets (especially true with SanDisk - for example the FAT must be located between the offsets at 4 MiB and 12 MiB, that's why most SD card have 4 MiB unpartitioned free space at the beginning).
Code:
new_fat32_partition_size = MROUND(whole_microsd_size - wanted_link2sd_partition_size + fat32_start_offset ; erase_block_size) - fat32_start_offset
With:
whole_microsd_size: The actual total size of the card - You can get it using fdisk.
wanted_link2sd_partition_size: The size you'd like for the Link2SD partition.
fat32_start_offset: The offset where the 1st FAT32 partition starts.
erase_block_size: The erase block size.
So for example for a SanDisk microSDHC 32 GB Class 10, we have an erase block size of 12 MiB (actually 3 times 4 MiB) and a FAT description that has to start at the offset at 4 MiB and then next erase block that starts at the offset at 12 MiB.
Therefore you'll have:
Code:
new_fat32_partition_size = MROUND(30,101,504 kiB - 1,061,376 kiB + 4,194,304 kiB ; erase_block_size) - 12 582 912 kiB = 30,101,504 kiB
Therefore using fdisk you should get something like the following when printing the partitions (p) - Don't forget to disable the DOS compatibility flag and use the sector as the unit:
Code:
Disk /dev/mmcblk0: 31.9 GB, 31914983424 bytes
4 heads, 16 sectors/track, 973968 cylinders, total 62333952 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x9a064f9d
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 8192 60211199 30101504 c W95 FAT32 (LBA)
/dev/mmcblk0p2 60211200 62333951 1061376 83 Linux
FAT32 formatting:
In order to use mkdosfs 3.0.9 or later with the right amount of reserved sectors so the root directory and data will start exactly at the next erase block offset.
The idea is to make so that the FATs ends exactly before that offset, but for that we need to know the size of one FAT.
Here is the formula based on mkdosfs source code, to calculate that needed number of reserved sectors:
Code:
total_number_of_sectors = total_number_of_blocks * block_size / sector_size
number_of_sectors_for_fats_and_data = total_number_of_sectors - MROUND(default_number_of_reserved_sectors ; cluster_size)
number_of_clusters = (number_of_sectors_for_fats_and_data * sector_size + number_of_fats * 8) / (cluster_size * sector_size + number_of_fats * 4)
fat_size = MROUND(CEILING((number_of_clusters + 2) * 4 / sector_size ; 1) ; cluster_size)
root_directory_offset = default_number_of_reserved_sectors + number_of_fats * fat_size
aligned_root_directory_offset = MROUND(root_directory_offset ; erase_block_size * 1024^2 / sector_size)
number_of_reserved_sectors = aligned_root_directory_offset - root_directory_offset + default_number_of_reserved_sectors
With:
sector_size: 512 bytes (Standard value)
block_size: 1,024 bytes (Standard value)
total_number_of_blocks: new_fat32_partition_size in kiB
default_number_of_reserved_sectors: 64 (can be 32)
cluster_size: 64 sectors (i.e. 32 kiB)
number_of_fats: 2 (Standard value)
So for example for that same card you'll get:
Code:
total_number_of_sectors = 60,203,008
number_of_reserved_sectors = 1,664
Therefore here is the command to format the FAT32 partition:
Code:
$> sudo mkdosfs -F 32 -s 64 -R 1664 -n EXTERNAL_SD -v /dev/mmcblk0p1
mkdosfs 3.0.9 (31 Jan 2010)
/dev/mmcblk0p1 has 4 heads and 16 sectors per track,
logical sector size is 512,
using 0xf8 media descriptor, with 60203008 sectors;
file system has 2 32-bit FATs and 64 sectors per cluster.
FAT size is 7360 sectors, and provides 940416 clusters.
There are 1664 reserved sectors.
Volume ID is 8aa89e36, volume label EXTERNAL_SD.
You can see that each FAT takes less than 3.6 MiB, so with 2 FATs and the reserved sector the FAT description takes less than 8 MiB.
You can then check using hexdump if indeed the root directory starts at the the 12 MiB offset (knowing that the partition begin at the 4 MiB offset - indeed 12 = 4 + 8).
For that let's read the first 13 MiB of the card:
Code:
$> sudo hd -n $[13*1024*1024] /dev/mmcblk0
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 82 |................|
000001c0 03 00 0c f8 95 a3 00 20 00 00 00 a0 96 03 00 f8 |....... ........|
000001d0 96 a3 83 1b f3 28 00 c0 96 03 00 64 20 00 00 00 |.....(.....d ...|
000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00400000 eb 58 90 6d 6b 64 6f 73 66 73 00 00 02 40 80 06 |[email protected]|
00400010 02 00 00 00 00 f8 00 00 10 00 04 00 00 00 00 00 |................|
00400020 00 a0 96 03 c0 1c 00 00 00 00 00 00 02 00 00 00 |................|
00400030 01 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00400040 00 00 29 e5 a5 dc 46 45 58 54 45 52 4e 41 4c 5f |..)...FEXTERNAL_|
00400050 53 44 46 41 54 33 32 20 20 20 0e 1f be 77 7c ac |SDFAT32 ...w|.|
00400060 22 c0 74 0b 56 b4 0e bb 07 00 cd 10 5e eb f0 32 |".t.V.......^..2|
00400070 e4 cd 16 cd 19 eb fe 54 68 69 73 20 69 73 20 6e |.......This is n|
00400080 6f 74 20 61 20 62 6f 6f 74 61 62 6c 65 20 64 69 |ot a bootable di|
00400090 73 6b 2e 20 20 50 6c 65 61 73 65 20 69 6e 73 65 |sk. Please inse|
004000a0 72 74 20 61 20 62 6f 6f 74 61 62 6c 65 20 66 6c |rt a bootable fl|
004000b0 6f 70 70 79 20 61 6e 64 0d 0a 70 72 65 73 73 20 |oppy and..press |
004000c0 61 6e 79 20 6b 65 79 20 74 6f 20 74 72 79 20 61 |any key to try a|
004000d0 67 61 69 6e 20 2e 2e 2e 20 0d 0a 00 00 00 00 00 |gain ... .......|
004000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
004001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
00400200 52 52 61 41 00 00 00 00 00 00 00 00 00 00 00 00 |RRaA............|
00400210 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
004003e0 00 00 00 00 72 72 41 61 7e 59 0e 00 03 00 00 00 |....rrAa~Y......|
004003f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
00400400 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00400c00 eb 58 90 6d 6b 64 6f 73 66 73 00 00 02 40 80 06 |[email protected]|
00400c10 02 00 00 00 00 f8 00 00 10 00 04 00 00 00 00 00 |................|
00400c20 00 a0 96 03 c0 1c 00 00 00 00 00 00 02 00 00 00 |................|
00400c30 01 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00400c40 00 00 29 e5 a5 dc 46 45 58 54 45 52 4e 41 4c 5f |..)...FEXTERNAL_|
00400c50 53 44 46 41 54 33 32 20 20 20 0e 1f be 77 7c ac |SDFAT32 ...w|.|
00400c60 22 c0 74 0b 56 b4 0e bb 07 00 cd 10 5e eb f0 32 |".t.V.......^..2|
00400c70 e4 cd 16 cd 19 eb fe 54 68 69 73 20 69 73 20 6e |.......This is n|
00400c80 6f 74 20 61 20 62 6f 6f 74 61 62 6c 65 20 64 69 |ot a bootable di|
00400c90 73 6b 2e 20 20 50 6c 65 61 73 65 20 69 6e 73 65 |sk. Please inse|
00400ca0 72 74 20 61 20 62 6f 6f 74 61 62 6c 65 20 66 6c |rt a bootable fl|
00400cb0 6f 70 70 79 20 61 6e 64 0d 0a 70 72 65 73 73 20 |oppy and..press |
00400cc0 61 6e 79 20 6b 65 79 20 74 6f 20 74 72 79 20 61 |any key to try a|
00400cd0 67 61 69 6e 20 2e 2e 2e 20 0d 0a 00 00 00 00 00 |gain ... .......|
00400ce0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00400df0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
00400e00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
004d0000 f8 ff ff 0f ff ff ff 0f f8 ff ff 0f ff ff ff 0f |................|
004d0010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00868000 f8 ff ff 0f ff ff ff 0f f8 ff ff 0f ff ff ff 0f |................|
00868010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00c00000 45 58 54 45 52 4e 41 4c 5f 53 44 08 00 00 52 b3 |EXTERNAL_SD...R.|
We can see that indeed the root partition starts at the offset 0x00c00000 which is 12 MiB!
Also note that 0x00400000 is the 4 MiB offset, the beginning of the FAT32 partition...
You can try the hexdump against the backup you did and you'll see that the factory formatting is also with a number of reserved sector so that the root directory is aligned. For example I've found the root directory at the 12 MiB offset (of course) and for that they use 1,170 reserved sector (I've decoded the hexdump to get that value) which matches the formula. They also set 8,192 hidden sectors - that's more for compatibility with some cameras, we don't care here...
Link2SD formatting:
I use ext4 for that partition, I've got inspiration from http://blogofterje.wordpress.com/2012/01/14/optimizing-fs-on-sd-card/, however I'm not sure if indeed using the stride and the stripe-width options is really needed:
Code:
[FONT=Courier New]$ sudo mkfs.ext4 -O ^has_journal -E stride=4,stripe-width=512 -b 4096 -L Link2SD /dev/mmcblk0p2
mke2fs 1.41.14 (22-Dec-2010)
Filesystem label=Link2SD
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=4 blocks, Stripe width=512 blocks
66384 inodes, 265344 blocks
13267 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=272629760
9 block groups
32768 blocks per group, 32768 fragments per group
7376 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 30 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.[/FONT]
Anyway I consider the Link2SD partition is going to be used much more for read than write and we need the same file system that is used on the other partitions of the phone (i.e. ext4).
I hope it's not too complicated and that will help
Some other references:
http://android.bytearrays.com/android/align-your-sdcard-fat-and-ext-partition/
http://www.bradfordembedded.com/2011/12/format-an-sd-card-with-8-mib-aligned-partitions/
http://www.olpcnews.com/forum/index.php?topic=4993.0
http://www.patriotmemory.com/forums...ite-speed-by-aligning-FAT32&p=41521#post41521
http://forum.xda-developers.com/showthread.php?t=1224408
What a long and completed answer
I'll read and try to understand the way one-by-one. Thanks for sharing your knowledge!
Sent from my GT-I8150 using Tapatalk 2
v0rt3x said:
Actually it depends on how much applications you want being installed on your phone but yes it worths installing it for at least 5 reasons:
Being able to mount to your computer your SD cards using the debug mode without stopping the applications that you should have moved to the SD card using the native App2SD.
Not being limited by the size of the /data partition because of the *.dex files generated for the dalvik cache.
You can move any kind of applications even those that are not movable to SD!
Link2SD includes free utilities like conversion of system application to user application (and vice versa) that you'll have to pay for with other solutions like Titanium Backup.
Avoiding slow downs because of the loop mounts created (Just run the "mount" command from an adb shell or terminal and you'll see).
Indeed I noticed a global slow down of my phone after I've started getting more and more applications being installed and beside I'm using some other tool to avoid push services and other unwanted background processes to be started by some applications, I've come to the conclusion that too many loop mounts because of the native App2SD is not good either (I suspect it takes over the RAM).
Actually the Link2SD FAQ will give you all the good reasons why to use it:
http://www.link2sd.info/faq
Recommendations:
I'd like to also share share my experience (I may move the following to another thread):
Recommend microSD cards:
Regarding the microSD card you can use even a 32 GB class 10.
The ones I recommend (32 GB class 10) are Samsung, SanDisk, Transcend (Those Transcend ones made in Korea are logically made by Samsung, the ones made in China are made by SanDisk).
Partitionning and formatting:
The tough part is the partitioning and formatting.
Out of the box, all the microSD cards are partitioned and formatted so that they are aligned with their erase block size (it can be 8 MiB, 12 MiB...)
Thus you'll have to consult so you'll know the erase block size:
the Linaro flash card survey:
https://wiki.linaro.org/WorkingGroups/Kernel/Projects/FlashCardSurvey
the corresponding flashbench mailing list
http://lists.linaro.org/mailman/listinfo/flashbench-results
You can also use the flashbench tool to figure it out.
The problem is that you cannot create or resize the FAT32 partition using Windows (even with minitool partition or paragon partition manager), nor with Linux by using gparted or other because you won't get your partitions aligned with the erase blocks and thus you'll get bad performances and faster wearing of your card.
Backup:
Before formatting do a raw backup of the first 16 MiB (for the partitions table and the FAT32 description) using busybox dd on the phone itself or dd on Linux.
For example on the phone:
dd if=/dev/block/mmcblk1 of=/sdcard/mmcblk1-orig-1st-16MiB.img bs=4M count=4
Also you must keep using the default cluster size of 32 kiB because of optimization done at the level of Android and because smaller cluster size will mean more memory taken from the RAM - Actually the FAT is loaded in the RAM, so you must keep it not too big.
Formulas:
Then decide how much you need for the Link2SD partition - You can start with 1 GiB or so, personally I use about 2 GiB. You can check how much space is taken by the asec images to decide...
Now here comes some math (The formulas are to be used in LibreOffice Calc):
Partitioning:
We need to define the new size for the FAT32 partition at the beginning so it is aligned with the erase block size and so that the File Allocation Tables are located between the special offsets (especially true with SanDisk - for example the FAT must be located between the offsets at 4 MiB and 12 MiB, that's why most SD card have 4 MiB unpartitioned free space at the beginning).
Code:
new_fat32_partition_size = MROUND(whole_microsd_size - wanted_link2sd_partition_size + fat32_start_offset ; erase_block_size) - fat32_start_offset
With:
whole_microsd_size: The actual total size of the card - You can get it using fdisk.
wanted_link2sd_partition_size: The size you'd like for the Link2SD partition.
fat32_start_offset: The offset where the 1st FAT32 partition starts.
erase_block_size: The erase block size.
So for example for a SanDisk microSDHC 32 GB Class 10, we have an erase block size of 12 MiB (actually 3 times 4 MiB) and a FAT description that has to start at the offset at 4 MiB and then next erase block that starts at the offset at 12 MiB.
Therefore you'll have:
Code:
new_fat32_partition_size = MROUND(30,101,504 kiB - 1,061,376 kiB + 4,194,304 kiB ; erase_block_size) - 12 582 912 kiB = 30,101,504 kiB
Therefore using fdisk you should get something like the following when printing the partitions (p) - Don't forget to disable the DOS compatibility flag and use the sector as the unit:
Code:
Disk /dev/mmcblk0: 31.9 GB, 31914983424 bytes
4 heads, 16 sectors/track, 973968 cylinders, total 62333952 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x9a064f9d
Device Boot Start End Blocks Id System
/dev/mmcblk0p1 8192 60211199 30101504 c W95 FAT32 (LBA)
/dev/mmcblk0p2 60211200 62333951 1061376 83 Linux
FAT32 formatting:
In order to use mkdosfs 3.0.9 or later with the right amount of reserved sectors so the root directory and data will start exactly at the next erase block offset.
The idea is to make so that the FATs ends exactly before that offset, but for that we need to know the size of one FAT.
Here is the formula based on mkdosfs source code, to calculate that needed number of reserved sectors:
Code:
total_number_of_sectors = total_number_of_blocks * block_size / sector_size
number_of_sectors_for_fats_and_data = total_number_of_sectors - MROUND(default_number_of_reserved_sectors ; cluster_size)
number_of_clusters = (number_of_sectors_for_fats_and_data * sector_size + number_of_fats * 8) / (cluster_size * sector_size + number_of_fats * 4)
fat_size = MROUND(CEILING((number_of_clusters + 2) * 4 / sector_size ; 1) ; cluster_size)
root_directory_offset = default_number_of_reserved_sectors + number_of_fats * fat_size
aligned_root_directory_offset = MROUND(root_directory_offset ; erase_block_size * 1024^2 / sector_size)
number_of_reserved_sectors = aligned_root_directory_offset - root_directory_offset + default_number_of_reserved_sectors
With:
sector_size: 512 bytes (Standard value)
block_size: 1,024 bytes (Standard value)
total_number_of_blocks: new_fat32_partition_size in kiB
default_number_of_reserved_sectors: 64 (can be 32)
cluster_size: 64 sectors (i.e. 32 kiB)
number_of_fats: 2 (Standard value)
So for example for that same card you'll get:
Code:
total_number_of_sectors = 60,203,008
number_of_reserved_sectors = 1,664
Therefore here is the command to format the FAT32 partition:
Code:
$> sudo mkdosfs -F 32 -s 64 -R 1664 -n EXTERNAL_SD -v /dev/mmcblk0p1
mkdosfs 3.0.9 (31 Jan 2010)
/dev/mmcblk0p1 has 4 heads and 16 sectors per track,
logical sector size is 512,
using 0xf8 media descriptor, with 60203008 sectors;
file system has 2 32-bit FATs and 64 sectors per cluster.
FAT size is 7360 sectors, and provides 940416 clusters.
There are 1664 reserved sectors.
Volume ID is 8aa89e36, volume label EXTERNAL_SD.
You can see that each FAT takes less than 3.6 MiB, so with 2 FATs and the reserved sector the FAT description takes less than 8 MiB.
You can then check using hexdump if indeed the root directory starts at the the 12 MiB offset (knowing that the partition begin at the 4 MiB offset - indeed 12 = 4 + 8).
For that let's read the first 13 MiB of the card:
Code:
$> sudo hd -n $[13*1024*1024] /dev/mmcblk0
00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 82 |................|
000001c0 03 00 0c f8 95 a3 00 20 00 00 00 a0 96 03 00 f8 |....... ........|
000001d0 96 a3 83 1b f3 28 00 c0 96 03 00 64 20 00 00 00 |.....(.....d ...|
000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00400000 eb 58 90 6d 6b 64 6f 73 66 73 00 00 02 40 80 06 |[email protected]|
00400010 02 00 00 00 00 f8 00 00 10 00 04 00 00 00 00 00 |................|
00400020 00 a0 96 03 c0 1c 00 00 00 00 00 00 02 00 00 00 |................|
00400030 01 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00400040 00 00 29 e5 a5 dc 46 45 58 54 45 52 4e 41 4c 5f |..)...FEXTERNAL_|
00400050 53 44 46 41 54 33 32 20 20 20 0e 1f be 77 7c ac |SDFAT32 ...w|.|
00400060 22 c0 74 0b 56 b4 0e bb 07 00 cd 10 5e eb f0 32 |".t.V.......^..2|
00400070 e4 cd 16 cd 19 eb fe 54 68 69 73 20 69 73 20 6e |.......This is n|
00400080 6f 74 20 61 20 62 6f 6f 74 61 62 6c 65 20 64 69 |ot a bootable di|
00400090 73 6b 2e 20 20 50 6c 65 61 73 65 20 69 6e 73 65 |sk. Please inse|
004000a0 72 74 20 61 20 62 6f 6f 74 61 62 6c 65 20 66 6c |rt a bootable fl|
004000b0 6f 70 70 79 20 61 6e 64 0d 0a 70 72 65 73 73 20 |oppy and..press |
004000c0 61 6e 79 20 6b 65 79 20 74 6f 20 74 72 79 20 61 |any key to try a|
004000d0 67 61 69 6e 20 2e 2e 2e 20 0d 0a 00 00 00 00 00 |gain ... .......|
004000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
004001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
00400200 52 52 61 41 00 00 00 00 00 00 00 00 00 00 00 00 |RRaA............|
00400210 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
004003e0 00 00 00 00 72 72 41 61 7e 59 0e 00 03 00 00 00 |....rrAa~Y......|
004003f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
00400400 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00400c00 eb 58 90 6d 6b 64 6f 73 66 73 00 00 02 40 80 06 |[email protected]|
00400c10 02 00 00 00 00 f8 00 00 10 00 04 00 00 00 00 00 |................|
00400c20 00 a0 96 03 c0 1c 00 00 00 00 00 00 02 00 00 00 |................|
00400c30 01 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00400c40 00 00 29 e5 a5 dc 46 45 58 54 45 52 4e 41 4c 5f |..)...FEXTERNAL_|
00400c50 53 44 46 41 54 33 32 20 20 20 0e 1f be 77 7c ac |SDFAT32 ...w|.|
00400c60 22 c0 74 0b 56 b4 0e bb 07 00 cd 10 5e eb f0 32 |".t.V.......^..2|
00400c70 e4 cd 16 cd 19 eb fe 54 68 69 73 20 69 73 20 6e |.......This is n|
00400c80 6f 74 20 61 20 62 6f 6f 74 61 62 6c 65 20 64 69 |ot a bootable di|
00400c90 73 6b 2e 20 20 50 6c 65 61 73 65 20 69 6e 73 65 |sk. Please inse|
00400ca0 72 74 20 61 20 62 6f 6f 74 61 62 6c 65 20 66 6c |rt a bootable fl|
00400cb0 6f 70 70 79 20 61 6e 64 0d 0a 70 72 65 73 73 20 |oppy and..press |
00400cc0 61 6e 79 20 6b 65 79 20 74 6f 20 74 72 79 20 61 |any key to try a|
00400cd0 67 61 69 6e 20 2e 2e 2e 20 0d 0a 00 00 00 00 00 |gain ... .......|
00400ce0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00400df0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
00400e00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
004d0000 f8 ff ff 0f ff ff ff 0f f8 ff ff 0f ff ff ff 0f |................|
004d0010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00868000 f8 ff ff 0f ff ff ff 0f f8 ff ff 0f ff ff ff 0f |................|
00868010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00c00000 45 58 54 45 52 4e 41 4c 5f 53 44 08 00 00 52 b3 |EXTERNAL_SD...R.|
We can see that indeed the root partition starts at the offset 0x00c00000 which is 12 MiB!
Also note that 0x00400000 is the 4 MiB offset, the beginning of the FAT32 partition...
You can try the hexdump against the backup you did and you'll see that the factory formatting is also with a number of reserved sector so that the root directory is aligned. For example I've found the root directory at the 12 MiB offset (of course) and for that they use 1,170 reserved sector (I've decoded the hexdump to get that value) which matches the formula. They also set 8,192 hidden sectors - that's more for compatibility with some cameras, we don't care here...
Link2SD formatting:
I use ext4 for that partition, I've got inspiration from http://blogofterje.wordpress.com/2012/01/14/optimizing-fs-on-sd-card/, however I'm not sure if indeed using the stride and the stripe-width options is really needed:
Code:
[FONT=Courier New]$ sudo mkfs.ext4 -O ^has_journal -E stride=4,stripe-width=512 -b 4096 -L Link2SD /dev/mmcblk0p2
mke2fs 1.41.14 (22-Dec-2010)
Filesystem label=Link2SD
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=4 blocks, Stripe width=512 blocks
66384 inodes, 265344 blocks
13267 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=272629760
9 block groups
32768 blocks per group, 32768 fragments per group
7376 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 30 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.[/FONT]
Anyway I consider the Link2SD partition is going to be used much more for read than write and we need the same file system that is used on the other partitions of the phone (i.e. ext4).
I hope it's not too complicated and that will help
Some other references:
http://android.bytearrays.com/android/align-your-sdcard-fat-and-ext-partition/
http://www.bradfordembedded.com/2011/12/format-an-sd-card-with-8-mib-aligned-partitions/
http://www.olpcnews.com/forum/index.php?topic=4993.0
http://www.patriotmemory.com/forums...ite-speed-by-aligning-FAT32&p=41521#post41521
http://forum.xda-developers.com/showthread.php?t=1224408
Click to expand...
Click to collapse
what a nice answer... It's too complicated, but I think I can understand overall of that.. thanks mate
USB storage
Galaxy W has an internal USB Storage. Link2sd failed to move apps that have big database or library (like sygic) to the external memory but instead it was moved to the internal USB storage. How do I make Link2sd to move all the large apps to the external memory? Thanks in advance
Scootster said:
Galaxy W has an internal USB Storage. Link2sd failed to move apps that have big database or library (like sygic) to the external memory but instead it was moved to the internal USB storage. How do I make Link2sd to move all the large apps to the external memory? Thanks in advance
Click to expand...
Click to collapse
Swap the storage so that your external_sd will change place with the internal storage
Pressing "Thanks" button will be much appreciated if user's posts useful for you
swapped memory
reddvilzz said:
Swap the storage so that your external_sd will change place with the internal storage
Pressing "Thanks" button will be much appreciated if user's posts useful for you
Click to expand...
Click to collapse
I swapped memory before this but the phone perform not very good. It lagged very much in switching from one task to another.
If memory was to swapped, then there is no use for Link2sd isn't it? because all apps were installed directly to. external memory. Does memory card needs to be in 2 partition?
No, swapped ish juz useless trick and could break ur sd card.
Dwama said:
No, swapped ish juz useless trick and could break ur sd card.
Click to expand...
Click to collapse
What are you talking about?
There are 2 meanings of the word 'swap' for the W:
The 1st meaning is creating a swapfile and/or swap partition.
The 2nd meaning is to change the mount points of the internal SD and the external SD so that Android thought the external SD is the internal one (mounted at /sdcard) and the internal SD gets mounted to the external point ( /sdcard/external_sd)
The 1st meaning is the dangerous one. The 2nd meaning is instead very useful.
-- xda app / CM9b3 / DXKL1 / Galaxy W --

[WEC7][DL]Download System Image Flash.Store.bin[PB]

Structure flash.store.bin:
Flash.Store.Bin - the wm7 image in a new format (D000FF, containing several sections)
Code:
00000000: "D000FF\n"
00000007: 00000000
0000000b: 00000800 -- sectorsize
0000000f: 0000f79d -- total nr of sectors
00000013: 00000009 -- nr of sections
00000017: 00000000
0000001b: 00000004
0000001f: 00000000
type offset idlen id
00000023: 00000002 00000040 00000008 54 53 55 4e 41 47 49 00 ; MODEM
00000037: 00000002 00000180 00000008 4c 4f 47 4f 00 ff ff ff ; LOGO
0000004b: 00000002 00000240 00000008 42 4c 44 52 00 ff ff ff ; BLDR
0000005f: 00000002 00000080 00000008 42 53 50 00 ff ff ff ff ; BSP
00000073: 00000003 00000400 00000002 1b 00
00000081: 00000003 00001600 00000002 20 00
0000008f: 00000003 00000740 00000002 23 00
0000009d: 00000003 0000fc7f 00000002 25 00
000000ab: 00000003 0002453f 00000002 04 00
Code:
2048 Oct 22 23:24 section-0.bin "MODEM" "META!7.27.1!DFP-SDCAOWZM-221001-1! "
81920 Oct 22 23:24 section-1.bin "LOGO" bitmaps
636928 Oct 22 23:24 section-2.bin "BLDR" bootloader
2048 Oct 22 23:24 section-3.bin "BSP"
86016 Oct 22 23:24 section-4.bin type 1b 'exfat'
4624384 Oct 22 23:24 section-5.bin type 20 compressed xip
3500032 Oct 22 23:24 section-6.bin type 23 xip
119576576 Oct 22 23:24 section-7.bin type 25 imgfs
1310720 Oct 22 23:24 section-8.bin type 04 'exfat'
Big thank's for Itsme
Use Format Image flash.store.bin in Platform Builder
Only this format image We use in PB. All OS image (FLPart etc, we not download in PB)
How flash this file in PB?
...copy this file format in general directory PB (replace/rename to nk.bin)
How to get Download Image in Device?
...in bootloader menu, select "USBFn Serial " or in my device, this possible - Press and Hold - Volume Key down + Power Key.
Then see:
--BLDR/MODEM/BOOTME Info version
--Bootloader comm. info/process.
--And at the bottom of the screen - inscription "Downloading Image..."
How to run Download process?
Connect Device via USB, Click "Attach Device", and wait 3-4 min...
More Method/Info
Comming Soon...
Nokser

Categories

Resources