Question for anyone who understands Decoding ROMs and HEX Editing - JASJAR, XDA Exec, MDA Pro Software Upgrading

I do know to increase the Universal pagepool to look for: 64 B0 00 00 64 00 00 00 2E 2E 2E 2E 00 00 2E 00
I did also observed that the 12th set 2E (4th 2E) is always 90 in ALL ROMs I tried. Could this 90 be the value of MB for the Extended ROM? If yes, then theoretically if we decrease it to 00, we can use the space as added memory.
Can anyone confirm what that value 90 is?

You may have more luck in the upgrading tweaking section in the general forum... seems to get very technical there...
http://forum.xda-developers.com/forumdisplay.php?f=260

Related

mission impossible - editing nk.exe

can someone assist me in changing the nk.exe in a way that allows me to change the deviceid from PU10 to HERM100
i succeded in hexediting the hk.nba from PU10 to HERM with the confirmation that Getdevice data recognize it as HERM
http://wiki.xda-developers.com/index.php?pagename=GetDeviceData
there are 2 places in the nk.nba where the device type is found
00007074h: 48 00 45 00 52 00 4D ; H.E.R.M
00316c74h: 48 00 45 00 52 00 4D ; H.E.R.M
i need to get H.E.R.M.1.0.0 instead (6 bytes to insert)
00007050h: 2C 00 25 00 64 00 2C 00 20 00 4E 00 61 00 6D 00 ; ,.%.d.,. .N.a.m.
00007060h: 65 00 20 00 69 00 73 00 20 00 25 00 73 00 0D 00 ; e. .i.s. .%.s...
00007070h: 0A 00 00 00 48 00 45 00 52 00 4D 00 00 00 00 00 ; ....H.E.R.M.....
00007080h: 4F 45 4D 47 65 74 43 50 4C 44 5F 47 50 49 4F 28 ; OEMGetCPLD_GPIO(
after dumping the rom including the boot XIP i found that the nk.exe contains this data.
the reason to do it is to "help" bbconnect to recognize it as a hermes
anyone can assist me ?

[FIXED!] - BuildOS producing Windows error on opening

I'm really sorry to be starting a new thread, but I've been racking my brains over this problem and haven't got anywhere yet. I know it's not the application so it must be something I've done, just not sure what!
Until today I have been able to use the BuildOS.exe in both Pandora and Core's kitchens without problem. Haven't tried using it for a few weeks, but with the new OS build today tried Pandora. Unfortunately, when I try to open BuildOS, it reports it has encountered a problem and needs to close. It offers the choice of reporting to Microsoft or not (reporting produces no suggested fixes).
Have uninstalled .NET Framework 3, 2, 1.1 and 1 and then re-installed them from Microsoft Update but at each stage the error message has been the same. I've also tried Googling for problems with BuildOS, but each just suggests installing .NET Framework 2. Searching for the error message codes didn't producing anything either.
I'm attaching the first screen of the error message but cannot work out how to copy and paste the actual error (it's unselectable).
If anyone has any ideas at all, I'd really appreciate them as I'm out. Thanks for reading this post and please don't flame unless they're REALLY funny!
The attachment doesnt really give much information..
Try print-screening the error and paste it into paint then cut out just the error and post it.. though im guessing it just says something lke unhandled exception or something like that..
You can also try looking around the system error logs in Control Panel\Administrative Tools\Event Log where you might find some details of the error.
have you installed or uninstalled anything in those few weeks?
the only thing I get from that log file is the mscorelib - .NET Framework...
Maybe try MS .NET Compact FW? I have 1.0 SP3 and 2.0 SP1...
Step by step
Lets try to isolate the problem:
Step 1: Try to use an older version of pandora, if its working something is wrong with your download of the latest version.
Step 2: You said that you haven't use the kitchen for some weeks. What have you installed and/or deinstalled since the last use of the kitchen? Maybe another program on your desktop computer is in conflict with .net or the kitchen.
Problem located, just got to fix it now!
Thanks for the suggestions guys, should've thought of the event viewer myself! D'oh!
The report viewer shows the problem is in my .NET 2 installation, so at least I know where to concentrate now.
Time for the big stick with the nail in it, I think!
Thanks again Sam and matt. I know you're both very busy and really do appreciate you taking the time to help.
EDIT: Sorry Gerald, your post showed up while I was typing. Thank you very much for the suggestion and bringing me back to sanity! Will try an older version first, just in case, and then going to play around with my .NET installations.
mattk_r said:
Maybe try MS .NET Compact FW? I have 1.0 SP3 and 2.0 SP1...
Click to expand...
Click to collapse
Uhh, in my world .NET CF runs on a device.
The problem continues...
Bugger - tried a shortcut and it didn't work! Copied the Pandora setup files and installed them on my laptop, only for that to come up with the same error message!
The laptop has very little installed on it and has only been up and running from a fresh install for two weeks. I've got basic drivers, AVG Anti-virus, Spybot and MS Office 2003 installed and that's about it. It's also completely up to date on MS Updates (I'm anal like that) so has .NETs up to 3.0 installed.
I also tried downloading Core's kitchen onto the laptop but again the BuildOS in that reports the same error.
The error shows under Event Viewer > Application as:
Event Type: Error
Event Source: .NET Runtime 2.0 Error Reporting
Event Category: None
Event ID: 5000
Date: 14/08/2007
Time: 21:07:36
User: N/A
Computer: MINI-LAPTOP
Description:
EventType clr20r3, P1 buildos.exe, P2 0.0.0.0, P3 45fef3bf, P4 mscorlib, P5 2.0.0.0, P6 461eee3d, P7 331e, P8 119, P9 system.io.directorynotfound, P10 NIL.
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Data:
0000: 63 00 6c 00 72 00 32 00 c.l.r.2.
0008: 30 00 72 00 33 00 2c 00 0.r.3.,.
0010: 20 00 62 00 75 00 69 00 .b.u.i.
0018: 6c 00 64 00 6f 00 73 00 l.d.o.s.
0020: 2e 00 65 00 78 00 65 00 ..e.x.e.
0028: 2c 00 20 00 30 00 2e 00 ,. .0...
0030: 30 00 2e 00 30 00 2e 00 0...0...
0038: 30 00 2c 00 20 00 34 00 0.,. .4.
0040: 35 00 66 00 65 00 66 00 5.f.e.f.
0048: 33 00 62 00 66 00 2c 00 3.b.f.,.
0050: 20 00 6d 00 73 00 63 00 .m.s.c.
0058: 6f 00 72 00 6c 00 69 00 o.r.l.i.
0060: 62 00 2c 00 20 00 32 00 b.,. .2.
0068: 2e 00 30 00 2e 00 30 00 ..0...0.
0070: 2e 00 30 00 2c 00 20 00 ..0.,. .
0078: 34 00 36 00 31 00 65 00 4.6.1.e.
0080: 65 00 65 00 33 00 64 00 e.e.3.d.
0088: 2c 00 20 00 33 00 33 00 ,. .3.3.
0090: 31 00 65 00 2c 00 20 00 1.e.,. .
0098: 31 00 31 00 39 00 2c 00 1.1.9.,.
00a0: 20 00 73 00 79 00 73 00 .s.y.s.
00a8: 74 00 65 00 6d 00 2e 00 t.e.m...
00b0: 69 00 6f 00 2e 00 64 00 i.o...d.
00b8: 69 00 72 00 65 00 63 00 i.r.e.c.
00c0: 74 00 6f 00 72 00 79 00 t.o.r.y.
00c8: 6e 00 6f 00 74 00 66 00 n.o.t.f.
00d0: 6f 00 75 00 6e 00 64 00 o.u.n.d.
00d8: 20 00 4e 00 49 00 4c 00 .N.I.L.
00e0: 0d 00 0a 00 ....
I know this now definitely isn't a WM6 problem but I'm adding this info in case one of the great XDA Dev minds knows the solution, and in case another user like me experiences the same problem - you're not alone and I'll update the thread when I find the solution!
Here's a stab at it (albeit a simple one). When using Pandora, do you have everything in the proper folder structure? The following applies:
(in this example, everything is thrown into a main folder "Pandora")
- Pandora (parent folder)
- BuildOS.exe (file)
- CreateROM.bat (file)
- pkgcommon.dll (file)
- OEM (sub folder)
- ROM (sub folder)
- SYS (sub folder)
- TOOLS (sub folder)
If you don't follow this hierarchy, Windows will shoot an error out at you.
Good luck!
Thanks Taurus, good suggestion. I've also got an inconsequential Readme.txt file in there too, but other than that - all present and correct!
Again, thanks for all your suggestions guys and once I find the solution I'll be sure to post it up.
You run buildOS from the command line, make sure you cd to the folder containing OEM/SYS/ROM and TOOLS .... THEN run buildOS from wherever it is by typing the full path into cmd, or even better add buildOS to the PATH variable .
so you need to follow this kind of procedure:
Code:
cd c:\ROMFOLDER (ENTER)
then...
c:\ROMTOOLSFOLDER\BuildOS (ENTER)
remember ROMFOLDER and ROMTOOLSFOLDER should be replaced by the paths you use.....its a PITA but thats how it runs.
Confused Stu said:
Thanks Taurus, good suggestion. I've also got an inconsequential Readme.txt file in there too, but other than that - all present and correct!
Again, thanks for all your suggestions guys and once I find the solution I'll be sure to post it up.
Click to expand...
Click to collapse
No problem. I just wanted to clarify what I meant, as I don't know if I was that clear.
I've attached a shot of everything the way it should look. Anyhow, it sounds like you have it right already, but I thought I'd just float that your way.
vp3G said:
Uhh, in my world .NET CF runs on a device.
Click to expand...
Click to collapse
It gets installed with VS Team Suite 2k5, probably since it has the CE mobile device emulators included.
Confused Stu - if you're still having trouble with .NET, let me know. I supported this stuff for M$, and know a few tricks to getting it cleaned up and installed.
Only common factor - interface between keyboard and chair!
OK, I've spent this evening wiping and rebuilding my laptop. It's got XP SP2 on it, then added the laptop drivers, the Kitchen and ran all the Microsoft Updates until only the .NETs were left.
Tried running BuildOS with no .NETs installed, and it came up with a message telling me the application wasn't in the correct state and re-installing it might help.
Installed .NET 1 (same message on trying to open BuildOS), then installed the updates for .NET 1 - same message. Installed .NET 2 and immediately got the original error I was getting on my home PC and other laptop! Went on to install the updates for .NET 2 and finally .NET 3 - but the same error kept coming up.
I've now got this same error coming up my Home PC (self-built), my Dell laptop, and my newly rebuilt Medion one! I've got no common files besides the MS Updates and no common components. Beginning to think maybe it's just plain personal!
Matt - if you can help at all with my .NET problems, I'd be ridiculously grateful. Alternatively, if anyone can suggest another avenue I can try please post it up - I'm almost out of ideas!
I've got another fresh install going on at work (Dell desktop this time) so tomorrow I'm going to try installing only .NET 1 and .NET 2 - not even any other MS Updates. Then if i install the updates one at a time I might be able to work out the problem one. Still not sure why I'm the only person affected by this though?
First of all, you are not alone, have a look at:
http://www.google.at/search?hl=de&q...time+2.0+Error+Reporting+Event+ID:+5000&meta=
Now for the bad news: I checked the first ten posts or so, they recommend to debug the code. But as its running on other machines without any problems it must be something within your .net installion.
man, this is strange.
I had a similar problem with BuildOS but with me it happened anytime I tried to add a package to the OEM folder.
Have you made any changes to anything from the Kitchen?
Matt said that you can't just add a package because its signed ( or something).
FIXED!!!!
Allan1 - you're a star!!!!
I've just deleted out the OEM (and SYS) folders, unzipped the v6 kitchen again and it's worked perfectly! Looks like my problem was I was unzipping the v6.1 (beta) OEM over the top of the existing OEM and that was causing my problems.
Don't I feel like a complete doughnut!
Sorry for wasting everyone's time, and THANK YOU very, very, very much for everyone's help and suggestions on this. It's really touching that so many people were willing to try to help me out.
Now commence the "what an idiot" flaming if anyone wants to - it's justified!
No probs!!
allan1 said:
I had a similar problem with BuildOS but with me it happened anytime I tried to add a package to the OEM folder.
Have you made any changes to anything from the Kitchen?
Matt said that you can't just add a package because its signed ( or something).
Click to expand...
Click to collapse
good looking out...just encountered this problem in HYPERCORE....driving me insane why it wasn't working cuz I just built 3 .nb's in the last few hours.
thanks alot

Key To Unlocking Bootloader Found!

This is excellent news!
Read here: Sholes Keyleak Explained
and here: Twitter Feed
It won't be long now!
Great news I hope Cyanogen is ported soon. And hello to Gingerbread.
Very nice!!!!!!:d
It's a shame Eugene_373's Defy bit the dust.
We could really use a Dev of his skills now.
How can I get the variable s and data?
k = s - sha1sum(data)
P.S.: His explanation: the vulnerability is that p is 0, which makes r=1, which makes s = sha1sum(data) - k
Did you get the keys posted on Twitter?
psicodelico said:
How can I get the variable s and data?
k = s - sha1sum(data)
P.S.: His explanation: the vulnerability is that p is 0, which makes r=1, which makes s = sha1sum(data) - k
Click to expand...
Click to collapse
Beach_Head said:
Did you get the keys posted on Twitter?
Click to expand...
Click to collapse
that is for milestone, we need the values from Defy to found the Key.
Have you tried?
There's no mention that the key is different for all phones using the Sholes platform...
psicodelico said:
that is for milestone, we need the values from Defy to found the Key.
Click to expand...
Click to collapse
No, I didn't try yet. I'm just waiting... . Let the things happen.
I'll be testing it when I get home.
I hope I don't brick my device in the process...
psicodelico said:
No, I didn't try yet. I'm just waiting... . Let the things happen.
Click to expand...
Click to collapse
Great news. Hope other devs jump into this right away. Will be looking forward.
Maybe is easier to post the keys here:
7e 21 a8 37 64 12 75 a3 47 13 54 42 12 48 58 12 71 a4 5e 41 a7 64 72 34 2a 6f e2 0a 97 8f <== sholes private key
97 6a 21 7a 67 41 37 9f 26 53 4a 61 7f 2a 86 ae ff 71 21 78 2e 61 4f 71 90 3e 00 27 fe 9b <== initialization vector
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 <== nonce (e)
Click to expand...
Click to collapse
Taken from William Pitcock twitter: http://twitter.com/nenolod
Hi, but what does it meen?
What can we do now?
And how?
Can we crack the bootloader?
Custom ROms?Kernel?Cyanogenmod 7 for defy??
Sweet maybe in the future there'll be a cool rom for my Droid 2 global
Sent from my DROID2 GLOBAL using XDA App
But what we have to do now?
What can we do with this information an keys?
So we gettin custom kernels soon?
Sent from my thumbs
Your recovery must update the signatures on the Codegroup Descriptor Table (CDT). If it does not, your recovery will brick the phone if you attempt to flash a custom ROM.
I understand nothing ))
Who can do this?
Where are the defy gurus!!!!
I can't belive it! It must to be an april fool! *_*
totally awesome *.*
can't wait to see the first custom kernels

Enter S8600 store with your Wave 1 or 2...

Any idea how Kies identify model? It seems not via AT Commands...
Or I am dumb...
AT+DEVCONINFO
I have used portmon to sniff communication...
Maybe it is the name, what Explorer shows?...
So the mass thingie USB driver...
How for instance S8600 answers in Explorer?
Best Regards
May be it?
http://forum.xda-developers.com/showpost.php?p=11286021&postcount=78
amss.bin I have checked... maybe not.
I have tried MANY combinations... maybe I have something not seen.
Maybe much easier.
Little example how bada Version is checked... Attention, high protection...
extreme hardcoded to prevent change...
2 parts needed...
Part 1:
SystemFS\User\OspSys\registry\buildnumber.ini
Part 2:
SystemFS/User/OspSys/registry/systeminfo.ini
Compare with latest Firmware and you know how to prepare your bada 1.x device for bada 3.0 Apps.
Anyway, I'm blind to manage Kies to work as S8600...
Best Regards
Okay, I've found Original Screenshot of S8600...
But I know where this Text String is stored...
But I can remember, I've tried this... and was not enough...
Maybe I'll try again.
Best Regards
It can be usb device description string in USB driver on phone or PC side (if it's PC side, description is paired with certain PID and VID), try to connect phone to linux in kies mode and use lsusb -a (aint sure if it's -a, anyway the thing is to get verbose info about device)
Hi, I think stune reads the same data that the kies when connected to the terminal.
I mean:
STUNE when you start telling us the firmware version terminal model of our product code, even our imei
Not fully correct
There is something in the PC driver that needs to be changed
You can see this in the driver details
Best Regards
Maybe Kies via Wi-Fi easier...
Not tested yet.
Best Regards
Bus reported device description is sent from device during USB enumeration. So model id is stored in Bada USB module. I'm nearly sure it's unicode string.
Maybe my fault...
AT+PROF="Device
Leads to file device.xml...
Will compare Wave 1, 2, 3 device.xml ...
Best Regards
Edit 1...
Code:
<ModelName value="GT-S8500"/>
<BaseModelName value="GT-S8500"/>
<ProjectName value="Lismore"/>
<FriendlyName value="Lismore"/>
<ProductLineup value="HHP"/>
Code:
<ModelName value="Wave 3"/>
<BaseModelName value="GT-S7250"/>
<ProjectName value="Wave3"/>
<FriendlyName value="Wave3"/>
<ProductLineup value="HHP"/>
Kies now shows other Error
Please, maybe someone can post from S8600 under Explorer...
Remember to remove IMEI...
I think this is MTP device... USB blabla portable Device Driver under Device Manager in Windows...
PS...
Text Samsung... in white Background is editable...
Edit 1.
Hmmm... Wave 2 can't edit ... grey colored...
Screenshot from S8600 would be nice.
Thanx in advance.
why do you think AT+DEVCONINFO is wrong? whole infos including imei in one packet
http://forum.xda-developers.com/showpost.php?p=20497198&postcount=15
Because I've found all files and positions to make 1:1 clone... including IMEI...
But this is not working for Kies.
Kies shows Error, that unsupported device is attached.
Best Regards
error it is kind of progress
what about these ones
Code:
Request: m-obex/connection_packet
82 00 23 CB 00 00 00 01 42 00 1B 6D 2D 6F 62 65 78 2F 63 6F 6E 6E 65 63 74 69 6F 6E 5F 70 61 63 6B 65 74
Answer:
A0 00 03
Request: m-obex/security/privacylock
83 00 27 CB 00 00 00 00 42 00 1F 6D 2D 6F 62 65 78 2F 73 65 63 75 72 69 74 79 2F 70 72 69 76 61 63 79 6C 6F 63 6B 00
Answer:
A0 00 12 C3 00 00 00 02 4C 00 05 00 00 49 00 05 00 00
Request: m-obex/fs/privacy_lock
83 00 22 CB 00 00 00 00 42 00 1A 6D 2D 6F 62 65 78 2F 66 73 2F 70 72 69 76 61 63 79 5F 6C 6F 63 6B 00
Answer:
A0 00 0D C3 00 00 00 02 49 00 05 4E 4F *
Request: m-obex/application/count
83 00 27 CB 00 00 00 00 42 00 1C 6D 2D 6F 62 65 78 2F 61 70 70 6C 69 63 61 74 69 6F 6E 2F 63 6F 75 6E 74 00 4C 00 03
Answer:
A0 00 14 C3 00 00 00 04 4C 00 05 00 00 49 00 07 2C 00 00 00
Request: m-obex/system/imsi
83 00 21 CB 00 00 00 00 42 00 16 6D 2D 6F 62 65 78 2F 73 79 73 74 65 6D 2F 69 6D 73 69 00 4C 00 03
Answer: IMSI ;)
A0 00 1F .....
Request: ƒm-obex/system/mnc
83 00 20 CB 00 00 00 00 42 00 15 6D 2D 6F 62 65 78 2F 73 79 73 74 65 6D 2F 6D 6E 63 00 4C 00 03
Answer: 02
A0 00 12 C3 00 00 00 02 4C 00 05 00 00 49 00 05 30 32
Request: ƒm-obex/system/csc
83 00 20 CB 00 00 00 00 42 00 15 6D 2D 6F 62 65 78 2F 73 79 73 74 65 6D 2F 63 73 63 00 4C 00 03
Answer: S8500OXAJID
A0 00 1B C3 00 00 00 0B 4C 00 05 00 00 49 00 0E 53 38 35 30 30 4F 58 41 4A 49 44
Request: m-obex/system/openapiversion
83 00 2B CB 00 00 00 00 42 00 20 6D 2D 6F 62 65 78 2F 73 79 73 74 65 6D 2F 6F 70 65 6E 61 70 69 76 65 72 73 69 6F 6E 00 4C 00 03
Answer: 1.2.0_1009152352_LIS_S8500XXJID_XEO
A0 00 33 C3 00 00 00 23 4C 00 05 00 00 49 00 26 31 2E 32 2E 30 5F 31 30 30 39 31 35 32 33 35 32 5F 4C 49 53 5F 53 38 35 30 30 58 58 4A 49 44 5F 58 45 4F
Request: m-obex/application/getinstallsetting
83 00 33 CB 00 00 00 00 42 00 28 6D 2D 6F 62 65 78 2F 61 70 70 6C 69 63 61 74 69 6F 6E 2F 67 65 74 69 6E 73 74 61 6C 6C 73 65 74 74 69 6E 67 00 4C 00 03
Answer:
A0 00 14 C3 00 00 00 04 4C 00 05 00 00 49 00 07 01 00 00 00
m-obex/system/csc and
m-obex/system/openapiversion ?
Thank you.
m-obex I have no success because also not enough knowledge.
See here:
http://forum.xda-developers.com/showpost.php?p=20954943&postcount=3
Best Regards
I've somewhere correct sequence to start obex on wave. I will post later
Good afternoon if it will not for anything in this case but I found this on apps_compressed:
x40BF86FF 'kDHd:! eNULL: @ STRENGTH'
0x40BF8765 'eNULL:! ANULL: @ STRENGTH'
0x40BF8784:'/../ cx / source / Xsupplicant / src / auth_methods / eapfast / eapfast.c '
0x40BF889C:'/../ cx / source / Xsupplicant / src / auth_methods / eapfast / eapfast_key.c '
0x40BFAE8C '/ www.openssl.org / support / faq.html'
0x40BFB506: '23456789ABCDEF '
0x40BFC610 '] VOHyrkd'
0x40BFD099: '56789.: AbcdefABCDEF '
ferrloz said:
Good afternoon if it will not for anything in this case but I found this on apps_compressed:
x40BF86FF 'kDHd:! eNULL: @ STRENGTH'
0x40BF8765 'eNULL:! ANULL: @ STRENGTH'
0x40BF8784:'/../ cx / source / Xsupplicant / src / auth_methods / eapfast / eapfast.c '
0x40BF889C:'/../ cx / source / Xsupplicant / src / auth_methods / eapfast / eapfast_key.c '
0x40BFAE8C '/ www.openssl.org / support / faq.html'
0x40BFB506: '23456789ABCDEF '
0x40BFC610 '] VOHyrkd'
0x40BFD099: '56789.: AbcdefABCDEF '
Click to expand...
Click to collapse
Umm, sorry, it's not helping anything in that case. FYI there are literally tenths of thousands such char strings in apps_compressed. Good you're looking tho. ;P
Maybe my goal is not clear enough...
Most of us have NO S8600...
But S8600 has few nice NEW Apps.
You can download without attached handset EVERY App you can find via Kies.
BUT not install if attached handset is not valid...
My goal is to make S8500 valid to install S8600 Apps via Kies.
Solution 1 is wait...
Maybe Samsung will offer these Apps like Tintin before Christmas 2012...
Really realistic...
I think minimum 2-3 months not available for S8500/S8530 to be exclusive for S8600...
Solution...
Move your bu ehm brain.
This mission is NOT impossible.
Best Regards
Sorry for them to lose the time, now I will focus more on the subject.
ferrloz thanks.

[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 --

Categories

Resources