Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,732,619 Members 52,216 Now Online
XDA Developers Android and Mobile Development Forum

[HACK] Increase Internal Memory Size to Whatever You Want!

Tip us?
 
Doc_cheilvenerdi.org
Old
(Last edited by Doc_cheilvenerdi.org; 13th October 2012 at 07:42 AM.) Reason: Changed Images Storage links
#1  
Doc_cheilvenerdi.org's Avatar
Senior Member - OP
Thanks Meter 344
Posts: 123
Join Date: Oct 2011
Location: Ferrara - Ravenna
Talking [HACK] Increase Internal Memory Size to Whatever You Want!

Free Memory to > 1Gb!

How to Increase your Internal Memory Size with very low effort!

NOTICE: This method works both on Rooted and NOT Rooted Phones!

You simply need to meet three easy requirements:
  • Stock Firmware installed on the Phone (custom ROMS not supported ...They don't need to!)
  • A microSD with two primary formatted partitions inside (the former 'to FAT32' and the latter 'to EXT4' filesystems)
  • Ready to Flash to your Galaxy Next via Odin


NOTICE: The following Black Box Howto is explained deep inside in the next post of this Thread (short explanation) and in This Thread from outside: Internal Memory to +1Gb! and related ones (long explanation / Italian Language)




HOW TO

1) Download Tass.ops file for Odin!


2) Type this number on your phone keyboard:

*#1234#

and keep note of the PDA code of the Firmware installed.



3) Download boot image ready for Odin and suitable for your firmware:

All modded images are inside my Google Drive; actually we find:
Code:
Memory Hack Google Drive Archive

Galaxy MINI/NEXT/POP
S5570AIKQ3        S5570BGKS3        S5570BGKT2
S5570BVKQ4        S5570BVKT1        S5570DDKA7
S5570DDKQ7        S5570DXKPD        S5570DXKT6
S5570JPKQ8        S5570JPKS1        S5570JPKT2
S5570JVKQ3        S5570JVKT1        S5570MJKS2
S5570XIKQC        S5570XWKE3        S5570XWKQG
S5570XWKS2        S5570XWKS7        S5570XWKT7
S5570XWKTH        S5570XWKTN        S5570XWKTS
S5570XWKTU        S5570XXKPF        S5570XXKPI
S5570XXKPK        S5570XXKS1        S5570XXKS4
S5570ZSKPC
-----------
S5570bVJKPB
-----------
S5570LWMKP9       S5570LWMKPJ       S5570LWMKPO

Galaxy MINI/NEXT/POP
Froyo
S5570DXKB1        S5570XIKFI        S5570XWKC1

Galaxy GIO
S5660AIKT4        S5660DXKT8        S5660JPKT7
S5660XXKPA        S5660XXKTF        S5660XXKTI
S5660XXKTK        S5660XXKTO
-----------
S5660MUGKG3

Galaxy FIT
S5670DDKB1        S5670DDKT3        S5670DXKPB
S5670DXKT4        S5670JPKQ7        S5670XWKQA
S5670XWKTI        S5670XXKPQ        S5670XXKPU
-----------
S5670LUBKP6       S5670LUBKPI

Galaxy ACE
S5830BOKS3        S5830DDKQ5        S5830DDKQ8
S5830DXKPB        S5830DXKPD        S5830DXKT5
S5830XWKPY        S5830XWKS2        S5830XWKS9
S5830XWKT7        S5830XWKTM        S5830XWKTQ
S5830XXKPH        S5830XXKPP
your firmware not listed? ...take a look into Google Drive first, then let me know if you don't find anything!


4) Flash the downloaded archive with Odin

Example image follows:




5) THAT'S ALL FOLKS!


- - -


How does it Work:


Scenario 1:
I switch on the Phone, without a MicroSD slotted in or with a microSD with a single FAT32 partition (broken or damaged microSD also suite this scenario...); GingerBread boots as usual!
No Difference!


Scenario 2:
I switch on The Phone with a microSD slotted in (with the second partition formatted as EXT4 filesystem but still EMPTY); Ginger boots acting as if

/data

is completely moved outside to microSD but just WIPED (not true obviously, and the original /data is safe inside the phone), so it resettle it from beginning...

NOTICE:
...If your second partition is 1Gb wide...
...your new Internal Memory will be 1Gb wide...


Scenario 3:
I switch on the Phone with the second partition of the microsd (EXT4) up and running (already resettled up for use and with my userdata on it); Ginger simply boots with

/data

moved outside to microSD with your userdata there and tons of apps just installed from the market...

Example Image of my New Internal Memory Size follows




- - -


NOTICES & ADVICES:
  • If I want to remove the microSD from the slot, FIRST I NEED TO SWITCH OFF THE PHONE!
  • When I install apps from the Market, Ginger Misunderstands the actual new Internal Memory SIZE and puts the apk files to External Storage anyway! I simply need to move them "to the phone" via "Settings menu" immediately after!
  • When I switch on the Phone without the microSD, I boot using the original /data inside the phone, actually loosing all the apps installed onto the external one untill next boot with SDcard; and, of course, loosing my sms stored there and others personal userdata too.
  • Unfortunately this boot image heavy conflicts with Link2SD (great app anyway!), so you must choose one: This Boot image or Link2SD... not both... sorry!


Don't You Like the boot image just installed and You want to revert without flashing the full firmware to the Phone?
The original images, ready for Odin, are stored into my Google Drive too, inside BASE subfolders!



- - - - - - - - - - - - - - - - -


THREAD ADDONS

CHECK FILESYSTEM FOR ERRORS
Quote:
On post n. 43 you can find an Android Application useful to check the 2nd partition filesystem for errors once a month...

EXT4 Checkup Tool 1.0 RC3

P.S. Only for rooted phones!
HOW TO
Quote:
From post n. 52 I explain exactly What I do deep Inside and Step by Step...
ADDED PHONE MODELS
Quote:
In post n. 56 I added boot images modded for Galaxy FIT (S5670), Galaxy ACE (S5830) and Galaxy GIO (S5660)!
ALL IN ONE WONDER AUTOSCRIPT
Quote:
In post n. 78 I added a Linux Script "All in one" to mod your boot Image on your own simply with a double-click!
MEMORY AND OVERCLOCK KERNEL
Quote:
In post n. 148 you find modded images with OC Kernel inside

P.S. Only for rooted phones with CWM or Custom Recovery!
The Following 79 Users Say Thank You to Doc_cheilvenerdi.org For This Useful Post: [ Click to Expand ]
 
Doc_cheilvenerdi.org
Old
#2  
Doc_cheilvenerdi.org's Avatar
Senior Member - OP
Thanks Meter 344
Posts: 123
Join Date: Oct 2011
Location: Ferrara - Ravenna
Default Patched Boot Image "Deep Inside"

As I stated in the previous Post, I skip the Long Explanation of this How to (Italian Threads online anyway) and briefly describe What I did!


1) Split Boot.img

I splitted boot.img into it's two main parts: The Kernel and the Ramdisk.


2) Edit ramdisk


2.1) Strip Samsung Kernel Modules
I figured out that Samsung modules used for rfs filesystem are compiled with all the debug symbols inside, so I stripped them saving more than 3Mb into the ramdisk!

NOTICE: The boot.img must not exceed 8Mb Size or I cannot flash it! BEWARE!


2.2) Add Ext4 kernel Modules
I compiled the jbd2.ko and ext4.ko modules for the attached Kernel and put them into /lib/modules inside the ramdisk:
Code:
gandalf $ ls -l ./ramdisk/lib/modules/
totale 1304
-rw-r--r-- 1 root root 236116 11 dic 08.24 ext4.ko
-rw-r--r-- 1 root root 363932 11 dic 08.24 fsr.ko
-rw-r--r-- 1 root root 211200 11 dic 08.24 fsr_stl.ko
-rw-r--r-- 1 root root  58176 11 dic 08.24 jbd2.ko
-rw-r--r-- 1 root root 260568 11 dic 08.24 rfs_fat.ko
-rw-r--r-- 1 root root  90968 11 dic 08.24 rfs_glue.ko
-rw-r--r-- 1 root root  99532 11 dic 08.24 sec_param.ko
gandalf $

2.3) Patch init.rc file
I patched the init.rc file into the ramdisk to load these modules into the kernel immediately after the first boot stage of the firmware:
Code:
# insmod fsr/rfs modules
    insmod /lib/modules/fsr.ko
    insmod /lib/modules/fsr_stl.ko
    insmod /lib/modules/rfs_glue.ko
    insmod /lib/modules/rfs_fat.ko
    insmod /lib/modules/sec_param.ko
    insmod /lib/modules/jbd2.ko
    insmod /lib/modules/ext4.ko

2.4) Add busybox
I added a copy of busybox into /sbin.
I'll need it to mount ext4 filesystems on microSD later on.
Code:
gandalf $ ls -l ./ramdisk/sbin/
totale 2088
-rwxr-x--- 1 root root  117948 11 dic 08.18 adbd
-rwsr-xr-x 1 root root 2016700 11 dic 08.21 busybox
lrwxrwxrwx 1 root root       7 11 dic 08.18 ueventd -> ../init
(i686) gandalf ~ (i686) $

2.5) Patch init.rc again
I changed the mount command for /data!

Original code:
Code:
    # Mounting of system/userdata is moved to 'on emmc' and 'on nand' sections
    # We chown/chmod /data again so because mount is run as root + defaults
        mount rfs /dev/stl13 /data nosuid nodev check=no
    chown system system /data
    chmod 0771 /data
Patched code:
Code:
    # Mounting of system/userdata is moved to 'on emmc' and 'on nand' sections
    # We chown/chmod /data again so because mount is run as root + defaults
        exec /sbin/busybox sh /init.data.sh
    chown system system /data
    chmod 0771 /data

2.6) add init.data.sh file
I added an external shell file, used to mount microsd /data avoiding the Android Init Language used by init.rc.
Code:
gandalf $ cat ./ramdisk/init.data.sh 
#!/sbin/busybox sh
/sbin/busybox mount -o nosuid,nodev -t ext4 /dev/block/mmcblk0p2 /data || /sbin/busybox mount -o nosuid,nodev -t rfs /dev/stl13 /data
gandalf $

3) Repack ramdisk and kernel into boot.img
I used the AOSP mkbootimg tool to repack alltoghether.


4) Prepare Odin Archive ready for flash
I created a PDA Archive with only boot.img inside.
A command sequence could be, for example:
Code:
tar -H ustar -c boot.img > CODE_S5570XWKS7_boot.tar
md5sum CODE_S5570XWKS7_boot.tar >> CODE_S5570XWKS7_boot.tar 
mv CODE_S5570XWKS7_boot.tar CODE_S5570XWKS7_boot.tar.md5

That's All!

Enjoy!
The Following 27 Users Say Thank You to Doc_cheilvenerdi.org For This Useful Post: [ Click to Expand ]
 
denzel09
Old
#3  
denzel09's Avatar
Senior Member
Thanks Meter 666
Posts: 3,201
Join Date: Jun 2009
Location: Venezia
Wonderful

now i am using this: http://forum.xda-developers.com/show...php?p=18561098

 
Midomad
Old
(Last edited by Midomad; 18th December 2011 at 06:19 PM.)
#4  
Midomad's Avatar
Senior Member
Thanks Meter 386
Posts: 975
Join Date: May 2011
Location: Salé
i have s5570jpks1 in pda
phone:s5570xwks2
csc:s5570ojpks1
it's arabic firmware with 2.3.5

help me please
what pda i should use?
The Following User Says Thank You to Midomad For This Useful Post: [ Click to Expand ]
 
Doc_cheilvenerdi.org
Old
#5  
Doc_cheilvenerdi.org's Avatar
Senior Member - OP
Thanks Meter 344
Posts: 123
Join Date: Oct 2011
Location: Ferrara - Ravenna
Thumbs up Increase Performance? Oh Yes!

Quote:
Originally Posted by denzel09 View Post
Great Script! Really Interesting!

Good Idea to mix /data outside with some programs still onboard, looking to performance...

At a first glance I like a lot this command:
Code:
busybox mount -t ext4 -o noauto_da_alloc,data=ordered,commit=15,barrier=1,nouser_xattr,errors=continue,noatime,nodiratime,nosuid,nodev /dev/block/mmcblk0p2 /data;
I achieve the same safe result while data=ordered and barrier=1 are defaults for ext4 mount command and because I compiled ext4 kernel modules with the extended attributes disabled (nouser_xattr).

I surely agree with noatime and nodiratime due to microsd lifecycle troubleshootings, but never set noauto_da_alloc...
...after some readings I figured out that it should be a MUST Option for SSD...

While working of this bunch of code
Code:
#-- SDCard Speed Fix
if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]
then
  /system/xbin/echo "8192" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
fi;
I surely upgrade AS SOON AS POSSIBLE the attached boot images to gain performance without loosing stability..

Thanks a Lot!


P.S. Great Idea Again; thanks to Amarullz too.
Actually, anyway, I moved the whole GingerBread outside... I have /data, /system and /cache alltoghether into my microSD...
...that is: "free to experiment! No need to halt and reflash on errors"...




Quote:
Originally Posted by midomad View Post
i have s5570jpks1 in pda...
I'll take a look. Please Hold on...
The Following 7 Users Say Thank You to Doc_cheilvenerdi.org For This Useful Post: [ Click to Expand ]
 
van8x10
Old
#6  
Junior Member
Thanks Meter 2
Posts: 12
Join Date: Oct 2007
Quote:
Originally Posted by Doc_cheilvenerdi.org View Post
I surely upgrade AS SOON AS POSSIBLE the attached boot images to gain performance without loosing stability..
Please do it ASAP, thanks
 
distan7
Old
#7  
distan7's Avatar
Senior Member
Thanks Meter 140
Posts: 397
Join Date: Mar 2011
Location: Jakarta-Indonesia
Quote:
Originally Posted by Doc_cheilvenerdi.org View Post

...

I surely agree with noatime and nodiratime due to microsd lifecycle troubleshootings, but never set noauto_da_alloc...
...after some readings I figured out that it should be a MUST Option for SSD...

While working of this bunch of code
Code:
#-- SDCard Speed Fix
if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]
then
  /system/xbin/echo "8192" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
fi;
....

P.S. Great Idea Again; thanks to Amarullz too.
Actually, anyway, I moved the whole GingerBread outside... I have /data, /system and /cache alltoghether into my microSD...
...that is: "free to experiment! No need to halt and reflash on errors"...
Wow, 8 MB ? Is that really useful ? I read somewhere that 3 MB is optimum, 4 MB is slightly waste. 8MB ? Then again I might be wrong, never tried 8MB myself.

It's a good thing you come up with this doc. I read at stepph's thread how you MOVED /system to MicroSD but somehow I forgot to ask. Now you mentioned it here. Is it safe ? No i/o bottleneck / noticeable lag ? I know we'll need a really fast and reliable MicroSD card. What's yours doc ?

---------------------------------
Sent from my Samsung Galaxy Mini GT-S5570 via xda-dev app
CyanogenMod 7.2.0-RC4-KANG by squadzone
Galaxy Mini S5570 (Retired) - Galaxy Tab 2 7" P3100 - Lenovo P780 (MIUI v5) - Oppo R819 (ColorOS)
 
distan7
Old
#8  
distan7's Avatar
Senior Member
Thanks Meter 140
Posts: 397
Join Date: Mar 2011
Location: Jakarta-Indonesia
Doc,

Now this just came across my mind. With /system and /data in MicroSD, does this mean we can MULTIBOOT ?

Let's say I partitioned my sdcard into 5 : 1st one is FAT32 and the other 5 is ext4. I modified boot.img from (let's say) CM7 and stock GB. On CM7's init.rc i put /system and /data into partition 2&3. On stock GB's init.rc i put them into partition 4&5. Partition 6 is used for /cache. I flashed stock with modded boot.img, play around first. Then I flashed CM7 with modded boot.img and played around. Now each time I want to switch ROM, all I have to do is flash the appropriate boot.img using CWM. This boot.img will determine which partition will be used for /system and /data.

Could it work doc ?

---------------------------------
Sent from my Samsung Galaxy Mini GT-S5570 via xda-dev app
CyanogenMod 7.2.0-RC4-KANG by squadzone
Galaxy Mini S5570 (Retired) - Galaxy Tab 2 7" P3100 - Lenovo P780 (MIUI v5) - Oppo R819 (ColorOS)
 
Doc_cheilvenerdi.org
Old
#9  
Doc_cheilvenerdi.org's Avatar
Senior Member - OP
Thanks Meter 344
Posts: 123
Join Date: Oct 2011
Location: Ferrara - Ravenna
Default Read Ahead...

Quote:
Originally Posted by distan7 View Post
Wow, 8 MB ? Is that really useful? I read somewhere that 3 MB is optimum, 4 MB is slightly waste. 8MB? Then again I might be wrong, never tried 8MB myself...

Antutu Benchmark Total Result on my Stock ROM with a 4Gb SD Class 4 said about 1650...


After moving (without tuning filesystems...) Antutu Said about 1450...


After Amarullz reading I remounted my filesystem from the shell this way:
Code:
# busybox mount -o remount,nosuid,nodev,noatime,nodiratime,errors=continue,nouser_xattr /cache (ext2 filesystem)
# busybox mount -o remount,ro,noatime,nodiratime,nouser_xattr,barrier=1,data=ordered,noauto_da_alloc /system (ext4)
# busybox mount -o remount,noatime,nodiratime,nouser_xattr,barrier=1,data=ordered,noauto_da_alloc /data (ext4)
#
Left commit=15 backwards, but I'll put it in the new init.rc of patched boot images... I also set barrier, data order and extended attributes, even if defaults...

and Antutu said about 1550...


Actually I'm trying on the fly this tweak
Code:
# busybox echo "8192" > /sys/devices/virtual/bdi/179:0/read_ahead_kb
#
While googling for optimum value...

And Antutu said about 1600

Now I'm trying to stress the system with heavy loads from/to SDCard...
...Anyway I cannot say anything yet about Battery charge..



Quote:
Originally Posted by van8x10 View Post
Please do it ASAP, thanks
...Boot images are ready to be shared with these patches on, but I need to test them one by one... I think to be Ready within tomorrow night...



Quote:
Originally Posted by midomad View Post
i have s5570jpks1 in pda...
Found and patched 2.3.5 fimware S5570JPKS1 with these tweaks too... scheduled to be tested within tomorrow night too...



Quote:
Originally Posted by distan7
...I read at stepph's thread how you MOVED /system to MicroSD but somehow I forgot to ask. Now you mentioned it here. Is it safe ? No i/o bottleneck / noticeable lag ? I know we'll need a really fast and reliable MicroSD card. What's yours doc?
It is safe... Up and running very heavy since last month...
Bottlenecks and lags occurr when I stress /data writing and /system reading while /cache is working... sometimes happens...


As I said somewhere else, if You like to play with your phone dont do it! but...
...if you like (for example) to test firmwares or play around deep inside the system without flashing anything and resuming from errors whenever you want... I call it "a Must Option"


I don't have a fast SD card (now on 4Gb class 4 and very old sailor...) so I cannot compare lags and performance for now with faster memories...



Quote:
Originally Posted by distan7 View Post
...With /system and /data in MicroSD, does this mean we can MULTIBOOT ?

Let's say I partitioned my sdcard into 5 : 1st one is FAT32 and the other 5 is ext4. I modified boot.img from (let's say) CM7 and stock GB. On CM7's init.rc i put /system and /data into partition 2&3. On stock GB's init.rc i put them into partition 4&5. Partition 6 is used for /cache. I flashed stock with modded boot.img, play around first. Then I flashed CM7 with modded boot.img and played around. Now each time I want to switch ROM, all I have to do is flash the appropriate boot.img using CWM. This boot.img will determine which partition will be used for /system and /data...
I'm working on this in my spare time... Actually - without flashing anything - I cannot change kernel from one boot to another one, but via init.rc I could start following something written somewhere on /cache or /sdcard...I could - for example - shutdown CM7 saying that I want to boot (next time) to Stock GB and viceversa...

I'm not a True Developer (Long time ago I said "Hello World" to somebody but I don't know if I will be able to do it) but I'm trying to start the system asking to th euser what to do during the boot stage...(Hard Task for me, but why not...)
The Following 6 Users Say Thank You to Doc_cheilvenerdi.org For This Useful Post: [ Click to Expand ]
 
Midomad
Old
#10  
Midomad's Avatar
Senior Member
Thanks Meter 386
Posts: 975
Join Date: May 2011
Location: Salé
Quote:
Originally Posted by Doc_cheilvenerdi.org View Post
Antutu Benchmark Total Result on my Stock ROM with a 4Gb SD Class 4 said about 1650...


After moving (without tuning filesystems...) Antutu Said about 1450...


After Amarullz reading I remounted my filesystem from the shell this way:
Code:
# busybox mount -o remount,nosuid,nodev,noatime,nodiratime,errors=continue,nouser_xattr /cache (ext2 filesystem)
# busybox mount -o remount,ro,noatime,nodiratime,nouser_xattr,barrier=1,data=ordered,noauto_da_alloc /system (ext4)
# busybox mount -o remount,noatime,nodiratime,nouser_xattr,barrier=1,data=ordered,noauto_da_alloc /data (ext4)
#
Left commit=15 backwards, but I'll put it in the new init.rc of patched boot images... I also set barrier, data order and extended attributes, even if defaults...

and Antutu said about 1550...


Actually I'm trying on the fly this tweak
Code:
# busybox echo "8192" > /sys/devices/virtual/bdi/179:0/read_ahead_kb
#
While googling for optimum value...

And Antutu said about 1600

Now I'm trying to stress the system with heavy loads from/to SDCard...
...Anyway I cannot say anything yet about Battery charge..




...Boot images are ready to be shared with these patches on, but I need to test them one by one... I think to be Ready within tomorrow night...




Found and patched 2.3.5 fimware S5570JPKS1 with these tweaks too... scheduled to be tested within tomorrow night too...





It is safe... Up and running very heavy since last month...
Bottlenecks and lags occurr when I stress /data writing and /system reading while /cache is working... sometimes happens...


As I said somewhere else, if You like to play with your phone dont do it! but...
...if you like (for example) to test firmwares or play around deep inside the system without flashing anything and resuming from errors whenever you want... I call it "a Must Option"


I don't have a fast SD card (now on 4Gb class 4 and very old sailor...) so I cannot compare lags and performance for now with faster memories...





I'm working on this in my spare time... Actually - without flashing anything - I cannot change kernel from one boot to another one, but via init.rc I could start following something written somewhere on /cache or /sdcard...I could - for example - shutdown CM7 saying that I want to boot (next time) to Stock GB and viceversa...

I'm not a True Developer (Long time ago I said "Hello World" to somebody but I don't know if I will be able to do it) but I'm trying to start the system asking to th euser what to do during the boot stage...(Hard Task for me, but why not...)
thanks a lot bro i can't wait for you're boot img

The Following 2 Users Say Thank You to Midomad For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes