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

Search This thread

Doc_cheilvenerdi.org

Senior Member
Oct 11, 2011
127
349
Ferrara - Ravenna
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:
[b][url=https://docs.google.com/folder/d/0B3qe_9NlA1D_QVlKXy01bjZPbVE/edit]Memory Hack Google Drive Archive[/url][/b]

[b][size=3]Galaxy MINI/NEXT/POP[/size][/b]
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

[b][size=3]Galaxy MINI/NEXT/POP[/size][/b]
[b]Froyo[/b]
S5570DXKB1        S5570XIKFI        S5570XWKC1

[b][size=3]Galaxy GIO[/size][/b]
S5660AIKT4        S5660DXKT8        S5660JPKT7
S5660XXKPA        S5660XXKTF        S5660XXKTI
S5660XXKTK        S5660XXKTO
-----------
S5660MUGKG3

[b][size=3]Galaxy FIT[/size][/b]
S5670DDKB1        S5670DDKT3        S5670DXKPB
S5670DXKT4        S5670JPKQ7        S5670XWKQA
S5670XWKTI        S5670XXKPQ        S5670XXKPU
-----------
S5670LUBKP6       S5670LUBKPI

[b][size=3]Galaxy ACE[/size][/b]
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:

Odin1.png



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

gestione_english.png



- - -​


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
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
From post n. 52 I explain exactly What I do deep Inside and Step by Step...
ADDED PHONE MODELS
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
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
In post n. 148 you find modded images with OC Kernel inside

P.S. Only for rooted phones with CWM or Custom Recovery!
 
Last edited:

Doc_cheilvenerdi.org

Senior Member
Oct 11, 2011
127
349
Ferrara - Ravenna
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 [b]ext4.ko[/b]
-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 [b]jbd2.ko[/b]
-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
    [color=red]insmod /lib/modules/jbd2.ko[/color]
    [color=red]insmod /lib/modules/ext4.ko[/color]


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
-rw[color=red][b]s[/b][/color]r-xr-x 1 root root 2016700 11 dic 08.21 [b]busybox[/b]
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
        [color=red][b]mount rfs /dev/stl13 /data nosuid nodev check=no[/b][/color]
    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
        [color=red][b]exec /sbin/busybox sh /init.data.sh[/b][/color]
    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!
 

Midomad

Recognized Contributor
May 7, 2011
4,154
3,234
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?
 
Last edited:
  • Like
Reactions: kzutov

Doc_cheilvenerdi.org

Senior Member
Oct 11, 2011
127
349
Ferrara - Ravenna
Increase Performance? Oh Yes!


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"...




i have s5570jpks1 in pda...

I'll take a look. Please Hold on...
 

distan7

Senior Member
Mar 12, 2011
365
146
Jakarta-Indonesia
...

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
 

distan7

Senior Member
Mar 12, 2011
365
146
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
 

Doc_cheilvenerdi.org

Senior Member
Oct 11, 2011
127
349
Ferrara - Ravenna
Read Ahead...

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 "[b]8192[/b]" > /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..



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



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



distan7 said:
...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...



...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...)
 

Midomad

Recognized Contributor
May 7, 2011
4,154
3,234
Salé
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 "[b]8192[/b]" > /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 :D
 

Doc_cheilvenerdi.org

Senior Member
Oct 11, 2011
127
349
Ferrara - Ravenna
Upgrade Complete!

Upgrade completed and new boot images uploaded.

Also added S5570JPKS1 to the list!


init.data.sh changed to
Code:
#!/sbin/busybox sh
if /sbin/busybox [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]
then
  /sbin/busybox echo "[b]3072[/b]" > /sys/devices/virtual/bdi/179:0/read_ahead_kb
fi;
/sbin/busybox mount -o [b]noauto_da_alloc,data=ordered,commit=15,barrier=1,nouser_xattr,errors=continue,noatime,nodiratime[/b],nosuid,nodev -t ext4 /dev/block/mmcblk0p2 /data || /sbin/busybox mount -o nosuid,nodev -t rfs /dev/stl13 /data


Enjoy again!

P.S. +10% Performance!
 

Midomad

Recognized Contributor
May 7, 2011
4,154
3,234
Salé
Upgrade completed and new boot images uploaded.

Also added S5570JPKS1 to the list!


init.data.sh changed to
Code:
#!/sbin/busybox sh
if /sbin/busybox [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]
then
  /sbin/busybox echo "[b]3072[/b]" > /sys/devices/virtual/bdi/179:0/read_ahead_kb
fi;
/sbin/busybox mount -o [b]noauto_da_alloc,data=ordered,commit=15,barrier=1,nouser_xattr,errors=continue,noatime,nodiratime[/b],nosuid,nodev -t ext4 /dev/block/mmcblk0p2 /data || /sbin/busybox mount -o nosuid,nodev -t rfs /dev/stl13 /data


Enjoy again!

P.S. +10% Performance!

it's a little slowly but working like a charm
you're a life saver :)
 

van8x10

Member
Oct 11, 2007
12
2
Some apps run very slowly, especially import contacts from SD (file .vcf)!
(My Rom is the GingerBread Europe 2.3.6 PDA=S5570JVKT1)
 
Last edited:

parasmi

Senior Member
Jan 4, 2011
344
1,125
Dasmariñas
Nice. Some interesting stuffs are really coming out from our forum :) I will give these mount option a shot.

I will try to convert /system and /cache to ext2 and leave /data as ext4 as system is mounted as r/o as default and cache can be formatted anytime.
 

van8x10

Member
Oct 11, 2007
12
2
Why? You must explain reasons ...

Simply for me, some apps run very slowly:
- It took me ~1 hour to import contacts from vcf file on SD card
- When I was testing the Expense Manager App, My Phone Shutdown for unknown reason (not reboot), luckily not yet bricked :confused:
- I think It is not safe for me, then wait for a new version from Doc!
 
Last edited:

Doc_cheilvenerdi.org

Senior Member
Oct 11, 2011
127
349
Ferrara - Ravenna
Beta Testing...

Some apps run very slowly, especially import contacts from SD (file .vcf)!
(My Rom is the GingerBread Europe 2.3.6 PDA=S5570JVKT1)


How I Test all the boot images before sharing them

When I power on the phone the hardware bootstrap passing soon after the control to the (using PC terminology) BIOS (Basic Input OutPut System)... a sort of mini system used to poweron all the peripherals inside and related to the phone... (In my Galaxy Next - briefly - I find something similar in the code sequence mibib-qcsbl-oemsbl-amss-arm11boot)...
...Immediately after, the BIOS loads into memory the Kernel in a fixed position and an initial ramdisk (in a fixed position too) and leave control to the kernel...
...the kernel setup the ramdisk and use the second mini system inside to complete the boot stage...
...Finally the kernel - using commands in the ramdisk - give control to the real system - GingerBread.

Actually the Bios releases control to the kernel calling a routine starting always from a fixed point hardcoded in itself and the Kernel launch the system (wherever it is) looking in the init files inside the ramdsik...

While slightly upgrading GingerBread from 2.3.0 to 2.3.* the mid part of the full boot sequence (kernel + ramdisk) need only two things to work properly:
  • Kernel compiled with the first assembly code starting from the fixed position hardcoded in the Bios
  • init files in the ramdisk showing where the filesystem and its data are...

Finally: All boot.img of GingerBread flavours meet these prerequisites... so I can easily use anyone of them with my system (or any other minor version of Ginger) while my BIOS call the kernel and it is in the right place and the init files exit to the filesystem where it really is...


I simply flash one of the shared boot images and test it three times:
  • power on with micorSD outside (system boot as usual)
  • power on with microSD inside and /data empty (the system fill it with all what is needed)
  • power on with microSD already full of apps, userdata and cache

I check mount points, SD read ahead, browse something on Internet, Market...
...and Finally I feel comfortable with the image cooked...
...I can share It!


Why didn't I said that you can use any of the shared boot images
If I simply call the boot image (for example)

CODE_S5570DOC01_boot.tar.md5

probably several end users (not heavy skilled with Linux, boot, Android, etc...) could be scared to use it...

... so I decided to provide an image for any of the "most wanted versions" now on the network using the attached kernel (anyway slightly different each other) with the same name of the Stock Version...


How I handle Errors reported from end users

Simply for me, some apps run very slowly:
- It took me ~1 hour to import contacts from vcf file on SD card
- When I was testing the Expense Manager App, My Phone Shutdown for unknown reason (not reboot), luckily not yet bricked :confused:
- I think It is not safe for me, then wait for a new version from Doc!

With my Wind boot.image first, and then with the JVTK1 one, I did what follows:


First Test
I exported my contacts to SD twice (about 2 minutes every time)
I imported it four times from SD without overwriting existing ones (about 1 minute to 2 minute at last) growing it to 400 entries
I exported and Imported them again (2 +2 minutes)

Test made with both the boot images - same result


Second Test
I own Titanium Backup PRO so I performed a backup of 98 apps (about 200Mb mixed from /system and from outside /data) to SD (4-5 minutes)
I repeated 3 times forcing the full operation (always about 5 minutes)
I Verified the backups towards original apps (3-4 minutes) (Found 2 errors related to WiFi in both boot images)
I restored 25 apps (this time only the ones stored on the outside /data - left untouched /system); I needed 10-12 minutes to reinstall them while dr web light antivirus was underneath scanning them. (Market crashed once in JKVT1 boot image)


Third Test
Called friends by Phone,
Sent some SMS to them,
Whatsapped them too,
Browsed xda-developers forum with Opera Mobile and Tapatalk.


Fourth Test
Don't do it!
I started "via emulator terminal" to dump a 100Mb wide file copying from /dev/zero...
while writing to SD I removed it crashing the system...
All fine after reboot... but (I'll soon post about what I'm saying) I suggest to use tools like fsck for errors out of journals...


Last Test
I own a Very old SD (1Gb) at the end of its lifecycle...
Every time I use it, bad blocks appear... timing readouts... freezing PC ports where connected...
...so I consider it a very bad hardware...
...but very useful for extreme tests of hardware/software endurance...

I made this test only with JVKT1 anyway...

I prepared the 2 partitions in it on my Linux PC (system froze twice then I was able to write partion table and format them)...
...Power On the phone with SD inside...
...adb shell and ddms connected to follow the de-wipe operation from PC..
...needed 40 minutes to complete it...
...frustrating...
...the System ended up and running anyway...


Conclusions
I think that the problem noticed should be investigated outside the boot stage of Ginger JVKT1 image...


How I cook the boot images
The images to deal with are growing up (just preparing XXKPI) so I prepared a Batch Farm used to do the dirty job avoiding human errors...
...Obviously I check pre and post by Hand...
...Test on My Next...
...Share...
Once the Script will be STANDALONE FUNCTIONALE I'll share it too!



...luckily not yet bricked :confused:...
No luck needed here...
Studying Brick deep inside, while the Flash operation doesn't touch the first BIOS code (mibib, ecc...), if I don't make mistakes with Tass.ops or images too big I cannot really Brick while flashing...

...obviously I can always kill definitely my system with a wrong root command...

...All situations that I can resolve at last using Odin again...




Nice. Some interesting stuffs are really coming out from our forum :) I will give these mount option a shot.

I will try to convert /system and /cache to ext2 and leave /data as ext4 as system is mounted as r/o as default and cache can be formatted anytime.

Good Hint! Why do I need to journal a filesystem read only... I think I can deal with it occasionaly while readwriting something to it anyway!
THANKS!
 
  • Like
Reactions: Evaldino

Top Liked Posts

  • There are no posts matching your filters.
  • 84
    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:
    [b][url=https://docs.google.com/folder/d/0B3qe_9NlA1D_QVlKXy01bjZPbVE/edit]Memory Hack Google Drive Archive[/url][/b]
    
    [b][size=3]Galaxy MINI/NEXT/POP[/size][/b]
    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
    
    [b][size=3]Galaxy MINI/NEXT/POP[/size][/b]
    [b]Froyo[/b]
    S5570DXKB1        S5570XIKFI        S5570XWKC1
    
    [b][size=3]Galaxy GIO[/size][/b]
    S5660AIKT4        S5660DXKT8        S5660JPKT7
    S5660XXKPA        S5660XXKTF        S5660XXKTI
    S5660XXKTK        S5660XXKTO
    -----------
    S5660MUGKG3
    
    [b][size=3]Galaxy FIT[/size][/b]
    S5670DDKB1        S5670DDKT3        S5670DXKPB
    S5670DXKT4        S5670JPKQ7        S5670XWKQA
    S5670XWKTI        S5670XXKPQ        S5670XXKPU
    -----------
    S5670LUBKP6       S5670LUBKPI
    
    [b][size=3]Galaxy ACE[/size][/b]
    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:

    Odin1.png



    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

    gestione_english.png



    - - -​


    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
    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
    From post n. 52 I explain exactly What I do deep Inside and Step by Step...
    ADDED PHONE MODELS
    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
    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
    In post n. 148 you find modded images with OC Kernel inside

    P.S. Only for rooted phones with CWM or Custom Recovery!
    27
    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 [b]ext4.ko[/b]
    -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 [b]jbd2.ko[/b]
    -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
        [color=red]insmod /lib/modules/jbd2.ko[/color]
        [color=red]insmod /lib/modules/ext4.ko[/color]


    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
    -rw[color=red][b]s[/b][/color]r-xr-x 1 root root 2016700 11 dic 08.21 [b]busybox[/b]
    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
            [color=red][b]mount rfs /dev/stl13 /data nosuid nodev check=no[/b][/color]
        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
            [color=red][b]exec /sbin/busybox sh /init.data.sh[/b][/color]
        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!
    7
    Increase Performance? Oh Yes!


    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"...




    i have s5570jpks1 in pda...

    I'll take a look. Please Hold on...
    6
    Read Ahead...

    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 "[b]8192[/b]" > /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..



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



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



    distan7 said:
    ...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...



    ...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...)
    6
    Challenging and...

    STOCK OVERCLOCK ! ! !

    i think its possible, but it depend to the dev want to make it or not

    ...let say "Challenging"...

    ...and after a short debrief of the Squadzone GitHub Kernel Source repository, I found these differences between Stock and Overclocok kernels:
    Code:
    .
    |-- [color=blue]arch[/color]
    |   `-- [color=blue]arm[/color]
    |       `-- [color=blue]mach-msm[/color]
    |           |-- acpuclock.c
    |           `-- cpufreq.c
    |-- [color=blue]drivers[/color]
    |   |-- [color=blue]cpufreq[/color]
    |   |   |-- Kconfig
    |   |   |-- Makefile
    |   |   |-- cpufreq.c
    |   |   |-- cpufreq_brazilianwax.c
    |   |   |-- cpufreq_interactive.c
    |   |   |-- cpufreq_interactivex.c
    |   |   |-- cpufreq_lagfree.c
    |   |   |-- cpufreq_minmax.c
    |   |   |-- cpufreq_savagedzen.c
    |   |   |-- cpufreq_scary.c
    |   |   |-- cpufreq_smartass.c
    |   |   |-- cpufreq_smartass2.c
    |   |   |-- cpufreq_smoothass.c
    |   |   `-- cpufreq_stats.c
    |   `-- [color=blue]cpuidle[/color]
    |       `-- [color=blue]governors[/color]
    |           `-- menu.c
    `-- [color=blue]include[/color]
        `-- [color=blue]linux[/color]
            `-- cpufreq.h
    Differences related to Cpu Clock and Cpufreq Governors...

    Now, discarding many others Squadzone patches (really interesting anyway - - - investigating on them later on), I simply replaced these files in Stock Kernel and recompiled it...

    NOTICE: I sticked the max boot cpu frequency to 600Mhz
    antutu-before.png

    ...so you have to install an application like "No Frills CPU" to upraise it after boot...

    Here my Galaxy Mini benchmarking at 729Mhz:
    antutu-after.png

    What's now?

    Modded Images (with Memory Hack and OverClock Stock Kernel) List:
    These are "update zip files" to be flashed using CWM or a custom recovery of your choice!
    Why don't I cook Odin Archives for these Images? My answer in post n. 152!


    Modded OC Images for Galaxy ACE and Galaxy FIT too:
    ...but I'm waiting feedback on them! I cannot test on my Mini...



    P.S. Like usually, here you find the patched files (from Squadzone GitHub repository) that I put into stock kernel tree: kernel_diffs.tar.gz
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone