Moving dalvik-cache from /data to free up some space - Galaxy S Advance I9070 Original Android Developmen

Hi guys !
I wanted to share some thoughts on more efficient dalvik-cache placement.
There are two paths we can take here:
- move some or all of dalvik-cache to /cache partition,
- increase size of cache partition using other, unused parts of or flash.
I'll write all the stuff in order from the easiest to most complicated.
1A. Moving some dex files to /cache
Open your /system/build.prop and make sure that parameter dalvik.vm.dexopt-data-only is set to zero - either change it or explicitly set it, if is not there. This will cause dex files for all apks from /system partition to go to /cache - for Vanir it's about 65M. Good start
In theory you could move an apk from /data/app to /system/app and after reboot the dex file would move to /cache, but this creates two kinds of problems:
- after an update the app is on /data again and the dex file also,
- if you flash another rom, you'll most likely loose those apps, which isn't always desired, but this has a solution I'll give later.
1B. Moving entire dalvik-cache to /cache partition
If your dalvik-cache is smaller than /cache partition you might as well move it there entirely. There are few ways to do it, I'll show one of them.
Copy /fstab.samsungjanice somewhere (like /data/local/tmp/) and append (at the end!) the following line
Code:
/cache/dalvik-cache /data/dalvik-cache none bind defaults
Reboot into recovery and ensure that /data and /cache are mounted. Connect with adb and then run those:
Code:
mkdir -p /cache/dalvik-cache
chown system.system /cache/dalvik-cache
chmod 771 /cache/dalvik-cache
cp -a /data/dalvik-cache/* /cache/dalvik-cache
rm -f /data/dalvik-cache/*
Now move the modified fstab.samsungjanice to /efs/common/overlay/fstab.samsungjanice and reboot.
If everything went fine, you've just earned up to 300M more on /data
BEWARE that those two solutions are exclusive - either one, or the other. I don't know what happens if you use both - either nothing or it won't boot. You can of course switch between them - just don't enable both at the same time.
But... what if 300M is not enough? Then you can either stay with solution 1A or:
2. Enlarge /cache partition
Since preload, fota and kernel2 partitions aren't used (usually), we can extend /cache with them. This can be achieved either with repartitioning the flash or using lvm. I suggest the latter.
[MOD][EMMC][I9070/P][8/16GB] Internal Memory Repartition
Converting Cache and Preload to LVM
This way you can have over 600M of /cache, and if you throw in fota and kernel2, even around 670M.
Having done that you can use either 1A or 1B depending on what you want. If you don't intend to switch to ART, you can safely assume 600M is more than enough - use 1B. If however you want to give ART a try, I suggest trying 1A first - after switch to ART /cache usage increased from 65M to 195M and total dalvik-cache size went from 285M to 780M!!!
That's it for now - I'll extend this tut later.
Now the homework I gave you the ideas, now if someone could create recovery scripts that do this automatically, many more people could use them Any volunteers? It's not difficult - of course I'll help (as in check them and do minor corrections, not as in doing it all). If nobody does it, I'll probably do it... eventually... I'm kind of lazy ;P
I'm thinking about creating a repository of scripts/plugins for mk kernel on github - those will be a good addition.
Now tell me how many people are interested in using this - hit 'thanks' on this post since that's the easiest - by all means DON'T write posts "I'm interested" etc
@ChronoMonochrome, @ace2nutzer - it might be useful on codina as well.
P.S.
ART is awesome (using with my Vanir build which I'll make available soon)!!! Now Janice is even faster ;D

Just an add on/ info / guide if someone wants to use RE-PARTITION FLASH DRIVE by @AntaresOne
[MOD][EMMC][I9070/P][8/16GB] Internal Memory Repartition
And
@mkaluza
i really want to move devik from /data to another partition but i'm still using stock based rom so lvm method won't work for me and i still didn't thoroughly understand re-partition method from above.
but your opt 1B. seem to interesting to me so i'm goona try it now and let you know the results
btw is there any way to move delvik to /preload ? ( the stock base rom i'm using SamiOS more precisely don't use /preload partition so that 300MB is free so is there any way to use this instead of /cache ? )

jineshpatel30 said:
Just an add on/ info / guide if someone wants to use RE-PARTITION FLASH DRIVE by @AntaresOne
[MOD][EMMC][I9070/P][8/16GB] Internal Memory Repartition
Click to expand...
Click to collapse
Yes, thank you (did I say I'm lazy...?)
i really want to move devik from /data to another partition but i'm still using stock based rom so lvm method won't work for me and i still didn't thoroughly understand re-partition method from above.
Click to expand...
Click to collapse
Yes it will. The only real requirements are to have free /preload partition (so JB is ok, just don't use Samsung crap) and have a kernel that supports lvm. Using my kernel and overlay system it's only easier, but it is not required.
but your opt 1B. seem to interesting to me so i'm goona try it now and let you know the results
Click to expand...
Click to collapse
Ok, just remember that overlays work with my kernel only (this /efs/... stuff is overlay). (I'll soon make better stock ramdisk recovery zip)
btw is there any way to move delvik to /preload ? ( the stock base rom i'm using SamiOS more precisely don't use /preload partition so that 300MB is free so is there any way to use this instead of /cache ? )
Click to expand...
Click to collapse
Yes - just replace /cache with /preload in the fstab line there's no (straightforward) way to do it with 1A.

mkaluza said:
1B. Moving entire dalvik-cache to /cache partition
If your dalvik-cache is smaller than /cache partition you might as well move it there entirely. There are few ways to do it, I'll show one of them.
Copy /fstab.samsungjanice somewhere (like /data/local/tmp/) and append (at the end!) the following line
Code:
/cache/dalvik-cache /data/dalvik-cache none bind defaults
Reboot into recovery and ensure that /data and /cache are mounted. Connect with adb and then run those:
Code:
mkdir -p /cache/dalvik-cache
chown system.system /cache/dalvik-cache
chmod 771 /cache/dalvik-cache
cp -a /data/dalvik-cache/* /cache/dalvik-cache
rm -f /data/dalvik-cache/*
Now move the modified fstab.samsungjanice to /efs/common/overlay/fstab.samsungjanice and reboot.
If everything went fine, you've just earned up to 300M more on /data
Click to expand...
Click to collapse
well it's not working atleast for me
ROM : SamiOS 1.3.1
kernel CoCore 8.2
did everything as you said
put fstab.samsungjanice to /efs/common/overlay/fstab.samsungjanice ( with 777 and system as owner , PS : also tried with root as owner )
but every time i reboots after all this procedure it generates dakvik in /data/dalvik-cache again via optimizing apps 1 of xxx.
anyway as of know i removed common folder from /efs ( which was there before ) and wiped /cache & /dalvik-cache via recovery ...i'm hopping it these reverted all the changes i have may by those commands ...right ?
...................................................................................................................................................
Edit : @mkaluza
sorry i didn't know that 1B. works with your kernel only
i'm not using your kernel on stock ROMs bcz i get tearing on some apps while rotating screen and also it take much time to load some games like COC and stuck on loading screen with black screen.
also it's much brigher with auto brightness on stock roms.
some of these things were fixes by polishvodka in his version of your kernel for JB but he didn't posted any sources so we don't know what changes he made
so if there will be some fixes for these things in future i'll give it try again & check 1B. also
PS: you can contact me if you want to fix these things and make bug free kernel for stock roms..and need beta tester ...i'll be happy to help

I like that scripts/plugins repo idea.
And wow, ART takes a lot of space, I never knew that
Never try ART before, so I'm just gonna wait for your Vanir build so I can try it

mkaluza said:
Now tell me how many people are interested in using this - hit 'thanks' on this post since that's the easiest - by all means DON'T write posts "I'm interested" etc
@ChronoMonochrome, @ace2nutzer - it might be useful on codina as well.
Click to expand...
Click to collapse
Hmm, I read everything above wholly, and didn't understand, why we can't accomplish this goal just by repartition. Default partition where dalvik cache is stored is data, so why just don't decrease another partitions in order to increase /data ? That way we already can achieve upto ~3.1Gb space on data(furthermore, /system size can be increased as well). As for automatized scripts, take look at this thread http://forum.xda-developers.com/galaxy-ace/ace-2-develop/guide-cwm-reparted-t2895673 . Decreasing /sdcard size is optional however, even without this there are a lot space on /data because of decreasing /cache and preload partitions.

ChronoMonochrome said:
Hmm, I read everything above wholly, and didn't understand, why we can't accomplish this goal just by repartition. Default partition where dalvik cache is stored is data, so why just don't decrease another partitions in order to increase /data ? That way we already can achieve upto ~3.1Gb space on data(furthermore, /system size can be increased as well). As for automatized scripts, take look at this thread http://forum.xda-developers.com/galaxy-ace/ace-2-develop/guide-cwm-reparted-t2895673 . Decreasing /sdcard size is optional however, even without this there are a lot space on /data because of decreasing /cache and preload partitions.
Click to expand...
Click to collapse
Because repartitioning is quite "invasive". Besides using lvm has imho more educational value I'll look at the thread you link tomorrow.
Sent from my GT-I9070 using XDA Free mobile app

nss357 said:
I like that scripts/plugins repo idea.
Click to expand...
Click to collapse
GitHub repo
So far only ramdisk images, but I'll slowly add stuff...
And wow, ART takes a lot of space, I never knew that
Never try ART before, so I'm just gonna wait for your Vanir build so I can try it
Click to expand...
Click to collapse
Yeah, it's huge... But it's fast as well I've decided to try it after briefly using hasta's lollipop - while it's far from being usable for me, it was fast (although there's a very aggressive governor set as well). And i don't regret it - in fact with Art running I don't even care much about lollipop anymore - I like my KitKatVanir very much
I'll upload it soon - still need to work on few details.

ChronoMonochrome said:
Hmm, I read everything above wholly, and didn't understand, why we can't accomplish this goal just by repartition. Default partition where dalvik cache is stored is data, so why just don't decrease another partitions in order to increase /data ? That way we already can achieve upto ~3.1Gb space on data(furthermore, /system size can be increased as well). As for automatized scripts, take look at this thread http://forum.xda-developers.com/galaxy-ace/ace-2-develop/guide-cwm-reparted-t2895673 . Decreasing /sdcard size is optional however, even without this there are a lot space on /data because of decreasing /cache and preload partitions.
Click to expand...
Click to collapse
mkaluza said:
Because repartitioning is quite "invasive". Besides using lvm has imho more educational value I'll look at the thread you link tomorrow.
Sent from my GT-I9070 using XDA Free mobile app
Click to expand...
Click to collapse
Here is script for SGSA/i9070 to Re-Partition , modded by me from ChronoMonochrome's Script
Must Read this post before using this script
Download : SGSA i9070 Repartition 2.5GB Data 8MB Cache 5MB Preload
it'll murge /cache & /hidden (preload) partition to /data
so you will get 2.5 GB in /data
8MB in /cache
5MB in /preload
( if you are changing values for self use DON'T FURTHER DECREASE /CACHE & /PRELOAD SIZE otherwise u won't able to format it via recovery ( even though AntaresOne suggested min 128kb for /preload it won't let you format /preload via cwm so min 5mb require for that)
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Cradits:
Concept&Research by @AntaresOne
Script by @ChronoMonochrome
Moded for SGSA by Me

mkaluza said:
Because repartitioning is quite "invasive". Besides using lvm has imho more educational value I'll look at the thread you link tomorrow.
Sent from my GT-I9070 using XDA Free mobile app
Click to expand...
Click to collapse
yeah, I know what you mean. It's quite straight-line but what importantly, practical way. I tried to implement lwm feature being guided your wiki on github but caught myself thinking that I'm too lazy for that and decided to stick with repartition

ChronoMonochrome said:
yeah, I know what you mean. It's quite straight-line but what importantly, practical way. I tried to implement lwm feature being guided your wiki on github but caught myself thinking that I'm too lazy for that and decided to stick with repartition
Click to expand...
Click to collapse
i second that... actually i never properly understand what Antras's guide is suggesting to do, due to my lack of knowledge of adb and only one example in guide.
but after checking your script i thought logically this is straightforward and i can remove UMS and add all things to DATA as i wanted. so i checked my partition sizes as per Antras's guide and changed some values and on second trial i get all right (on 1st trail i got /preload not formatting due to very less size )
also did you checked my modification in scripts ? is it good ? or some cautions/addition needed ?
@mkaluza with all due respect , even though LVM method is much safer than Re-partitioning i think Re-partition script is easier to use if one knows what to do. plus it doesn't require kernel support.
btw it's always better to have alternatives so your work on LVM is much appreciated

jineshpatel30 said:
@mkaluza with all due respect , even though LVM method is much safer than Re-partitioning i think Re-partition script is easier to use if one knows what to do. plus it doesn't require kernel support.
btw it's always better to have alternatives so your work on LVM is much appreciated
Click to expand...
Click to collapse
I write those things in case someone was interested... my little wierdness ;P repartitioning is stone age (in terms of current state of knowledge) - lvm is much more flexible when one knows how to use it (like you can create new partitions on-the-fly i.e. to test f2fs or sth), while repartitioning is kind of a major surgery
But in no way I want to force them upon you Use whatever works for you I'll also prepare a cwm flashable version of lvm at some point probably...

jineshpatel30 said:
also did you checked my modification in scripts ? is it good ? or some cautions/addition needed ?
Click to expand...
Click to collapse
I haven't noticed big difference between original variant and this. Did you something besides of change of partition sizes? Btw, it is odd that you can't format preload partition, when it's too small (I've used script that resizes it to ~60kb, and it is still formattable, at least via shell script).

ChronoMonochrome said:
I haven't noticed big difference between original variant and this. Did you something besides of change of partition sizes? Btw, it is odd that you can't format preload partition, when it's too small (I've used script that resizes it to ~60kb, and it is still formattable, at least via shell script).
Click to expand...
Click to collapse
well i removed UMS part from your script as my janice is 16GB one so i don't need extra space there
and changed values according to Janice partitions.
that's pretty much
anyway when i set /preload for 128KB i got this message in recovery on formatting it
Code:
/preload
E: format_volume: make_extf4fs failed on /dev/block/mmcblk0p9

jineshpatel30 said:
well i removed UMS part from your script as my janice is 16GB one so i don't need extra space there
and changed values according to Janice partitions.
that's pretty much
anyway when i set /preload for 128KB i got this message in recovery on formatting it
Code:
/preload
E: format_volume: make_extf4fs failed on /dev/block/mmcblk0p9
Click to expand...
Click to collapse
If you don't need preload for anything then it doesn't need to be formatted... You're fine the way you are now. But remember you can't remove it completely because them partition numbers would change.

jineshpatel30 said:
Here is script for SGSA/i9070 to Re-Partition , modded by me from ChronoMonochrome's Script
Must Read this post before using this script
Download : SGSA i9070 Repartition 2.5GB Data 8MB Cache 5MB Preload
it'll murge /cache & /hidden (preload) partition to /data
so you will get 2.5 GB in /data
8MB in /cache
5MB in /preload
( if you are changing values for self use DON'T FURTHER DECREASE /CACHE & /PRELOAD SIZE otherwise u won't able to format it via recovery ( even though AntaresOne suggested min 128kb for /preload it won't let you format /preload via cwm so min 5mb require for that)
Click to expand...
Click to collapse
@jineshpatel30 @ChronoMonochrome
I'd like to have a variant of this script with 3,5GB of data , a system partition of 1GB and the rest to reduce sdcard (UMS) size for S Advance. Can you help me to edit this script? Unfortunately I didn't understand AntaresOne guide to edit it on my own.
My partition is this:
https://s18.postimg.org/b863m8lnd/Screenshot_2017-06-01-16-10-09.png
I know there is a safer solution like Repit, but it requires a TWRP kernel while I have a CWM kernel and I want to avoid the hassle to change rom or kernel (I''m using a vanir 4.4.4 with cwm recovery).

isaak said:
@jineshpatel30 @ChronoMonochrome
I'd like to have a variant of this script with 3,5GB of data , a system partition of 1GB and the rest to reduce sdcard (UMS) size for S Advance. Can you help me to edit this script? Unfortunately I didn't understand AntaresOne guide to edit it on my own.
My partition situation is this:
https://s18.postimg.org/b863m8lnd/Screenshot_2017-06-01-16-10-09.png
I know there is a safer solution like Repit, but it requires a TWRP kernel while I have a CWM kernel and I want to avoid the hassle to change rom or kernel (I''m using a vanir 4.4.4 with cwm recovery).
Click to expand...
Click to collapse
Sorry but i been away from SGSA for long time now (2+ years) and i don't even remember how i managed this script at 1st place so i'm afraid i can't help you with the script, as i don't have device and patience now
you may ask some of active experience members at i9070 they might able to help you :good:

isaak said:
@jineshpatel30 @ChronoMonochrome
I'd like to have a variant of this script with 3,5GB of data , a system partition of 1GB and the rest to reduce sdcard (UMS) size for S Advance. Can you help me to edit this script? Unfortunately I didn't understand AntaresOne guide to edit it on my own.
My partition is this:
https://s18.postimg.org/b863m8lnd/Screenshot_2017-06-01-16-10-09.png
I know there is a safer solution like Repit, but it requires a TWRP kernel while I have a CWM kernel and I want to avoid the hassle to change rom or kernel (I''m using a vanir 4.4.4 with cwm recovery).
Click to expand...
Click to collapse
Why TWRP is a requirement for the Repit, is there some tehnical dependence on TWRP (like /cache partition being unable unmount on CWM)? Anyway can't you flash TWRP kernel just to flash this zip, then flash your currently used kernel back?
I'd be keeping away from using command line instructions without fully understanding how it works. You can also check CWM reparted topic on codina forum, there are some internal memory layouts available (that can be theoretically be flashed on janice), though you need to thoroughly check whether the partition numbers used are matching with janice (I'd suggest anyway being cautious with it - check twice, cut once).

ChronoMonochrome said:
Why TWRP is a requirement for the Repit, is there some tehnical dependence on TWRP (like /cache partition being unable unmount on CWM)? Anyway can't you flash TWRP kernel just to flash this zip, then flash your currently used kernel back?
I'd be keeping away from using command line instructions without fully understanding how it works. You can also check CWM reparted topic on codina forum, there are some internal memory layouts available (that can be theoretically be flashed on janice), though you need to thoroughly check whether the partition numbers used are matching with janice (I'd suggest anyway being cautious with it - check twice, cut once).
Click to expand...
Click to collapse
After many attempts I solved using a TWRP kernel and flashing Repit zip with this name:
lanchon-repit-20160317-system=1.0-data=3.1-cache=same-preload=min+wipe-fota=min+wipe+ext4-sdcard=max-janice.zip
The result of this command is in the attachment below.
But, if want more data space, you can try something like this:
lanchon-repit-20160317-system=1.0-data=4.1-cache=same-preload=min+wipe-fota=min+wipe+ext4-sdcard=max-janice.zip
With this command, the additional data space would be taken directly from UMS (internal sdcard). Not from cache because it has the "same" parameter.
**If you don't know what is REPIT**
Read REPIT manual before using:
https://github.com/Lanchon/REPIT
Main topic support:
https://forum.xda-developers.com/galaxy-s-advance/development/flashable-emmc-repartition-t3369278
REPIT download (all versions):
https://androidfilehost.com/?w=files&flid=49911
Don't try it with stock Samsung ROMs. Only for custom ROMs. Make a backup first (including internal sdcard)!

Related

[Recovery] 4EXT v2.2.7 RC5 | Convert fs | Aligned Partitioning 3x (ext|swap)

Thanks to Ghiki and Imanol00 for testing, 4EXT Recovery is now also available for the Nexus One
​
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Quick note about themes:
Available themes as of Oct/17:
Themes by pravus_nephilim
Themes by Apaquette420
Themes by Whiskey103
Themes by Amresh
Themes by Apaquette420
Themes by CWhitney24
Themes by DaMyth
Themes by Blindndumb
To uninstall any "flashed theme" and to revert to your own custom settings you had before flashing, just use this Theme Uninstaller in recovery.
It will clear any theme you might have flashed and revert to your own custom settings you had before flashing that theme!​​
THANKS:
All credits and my deepest respect go to Koush for his extremely great code!
Without him 4EXT Recovery wouldn't have been possible!
Biggest thanks possible go to Sebastiaan15 for his brilliant ideas and who spent whole weeks testing my buggy code with his Desire
Without you I could never have made it!!!
So BIG THANKS to SEBASTIAAN15 and KOUSH for his hard work with CWMR !!!
Many credits to the Desire S community ( especially to loveboatcaptain - LBC Mod Android Development and Marylandcookie ) for testing, very nice ideas, feature suggestions and helping to get the code running on the Desire S!
Special big thanks to RAVENNA from android-hilfe.de board for hours of testing for the Desire!
BIG Thanks to Hussainmushahid who helped me a lot spending much of time with solving a bug I could not reproduce on my device.
And many thanks to all users who reported and helped to identify problems ( can't any longer list all of you here since the list has grown too large )!
Even more thanks to people who 've bought me some beer YOU ROCK!! ZEEKIZ, A USER, PHILOS64, STEVEATHOME, PREACHER65, BEN_PYETT, ULTRA DROID, PTR_HAMILTON, BEANBEAN50, SEBASTIAAN15 and LOVEBOATCAPTAIN
​
v2.2.6 RC4 Released: Oct/01
Rare Superuser problem when tar backups were enabled (disabled by default) was fixed.
Converting partitions between ext3 and ext4 without data loss now correctly calculates the space needed to successfully complete the operation
New option: check and optionally repair the file system on your sdcard (fat32)
Removed duplicate format cache option inside the format menu (wipe cache does the same)
When formatting fat32 it will now save your 4ext.prop settings and restore them afterwards
Changed partitioning of the sdcard to not use LBA mode for new fat32 partitions as requested by Ghiki
Added new size option (128mb) to the partitioning menu per request
Parted is no longer used to format fat32 in the partition menu
-> This solves a bug where sometimes the creation of the fat32 file system failed and produces better quality results​
4EXT Recovery themes should now stay when formatting /system or flashing new roms
New option: format /sdcard fat32
New 4EXT Recovery Control API because I'm forced to drop "extendedcommand" (see App for the reason why)
enables file names and directories to include spaces for installations​
calculates needed space to complete a full or advanced backup at the beginning of the backup.​
This ensures that you are not left with a non working backup.​
Size for recovery greatly reduced
New 4EXT Recovery Control Features
Please see www.4ext.net for more.
Fix permissions
Calculate real values for the space needed to create a new full or advanced backup
Advanced Backups: While you are selecting / deselecting partitions, it will display and update the currently needed space to complete that custom backup set.​
As an example, the following would be possible to do in just one session:
Restore a backup, set to create a backup / advanced backup before the restore,
format all partitions with a file system of your choice before the restore process starts,
flash additional zip files afterwards, fix permissions and select to stay inside recovery or to reboot automatically once all actions are complete.​
Features: Use 4EXT Recovery Control or Recovery Updater for complete Changelogs and Known issues!
not all features may be relevant for all devices
Displays additional information:
Identifies your current rom and displays its name
Current filesystems on your partitions
Free space remaining of all of your volumes
Current battery charge level
Backup | Restore:
Correctly calculates free space needed to complete a backup ( version > 2.2.6 RC4 )
Tar backups (can be switched on or off)
Complete CWMR5 compatibility
All Backups you create will be named after your currently installed Rom for easier identification.
Never unwillingly get "downgraded" to EXT3 again
Always restores backups using the file systems you HAD on your partitions at the time of creation!
-> all partitions formatted with ext4 at that time, will be restored to ext4. The same is true for ext3.​
You can manually change any existing Backup to ext4 or ext3
-> so that after a restore, all partitions and up with the file system you wanted!​
Advanced Backup: backup only a single partition
Convert any of your partitions to EXT4 or EXT3 without data loss.
Formatting:
When you wipe or format it will always use the same file system you currently have.
-> but you can change that​
When you format ext4 it will always create an aligned file system
Correctly identifies unformatted sd-ext partitions
-> if it finds one it displays a warning and suggests you may format them by visiting the 4EXT menu​
Filesystem check and repair option in advanced menu
Partitioning:
Alignment check of your partitions
Full support for up to 2 sd-ext partitions + swap (Backup/restore/format/convert, fsck, et.c.)
(RE-) Partition your sdcard for sd-ext without removing your fat32 partition.
All partitions created with 4EXTRecovery will be perfectly aligned to 4k
Installing:
Integrated md5sum checking option
Themes:
Customize all colours used throughout recovery
Use your own icons, background images, progress bars.. more to come.
Assign different backgrounds to different menu categories (version >= 2.1.2)
Create a flashable zip for others to flash your theme.
Menus:
Most popular menu items rearranged
Format menu
Power Menu + option to reboot into bootloader
Less "No's" in confirmation dialogues
Changed Advanced Restore: first select what you want to restore, then select the backup
-> Useful for restoring from "Advanced Backups"​
4ext.prop:
Configuration file on your sdcard where you can set options to be used by 4EXTRecovery
Change all settings conveniently with 4EXT Recovery Control
Many more options to come
Share your settings / themes by packing your config into a flashable theme
Other stuff:
USB Storage Autostart (must be switched on)
Mount usb storage exposes all partitions on your sdcard to the os (not just fat32)
-> you could even partition your sdcard from your PC while connected via USB​
Switch haptic feedback on/off
You don't need to reboot recovery if you transferred a file to show up in the install menu.
-> This bug affected only some users with either CWMR or previous versions of 4EXT.​
Button backlights (Desire S, Desire HD and Incredible S only)
​
Download:
All downloads are now available through 4EXT Recovery Updater. It's free, no ads, no tracking, no nothing, don't worry
.. and of course via the "pro" version 4EXT Recovery Control
This ensures that your downloads are ok by automatically verifying md5sums and that known issues and changelogs are easily accessible
It also notifies you when there are any new critical bugs found
Recovery images will be uploaded for download soon too, but they can also be acquired easily by using Updater or Control.
You can for example just download a recovery.zip containing the image. The download will be automatically verified for correct md5sums!
4EXT Recovery Control
Free version: Recovery Updater
Fully featured version: 4EXT Recovery Control
For a list of its many features, visit www.4ext.net
Some examples :
Flash as many zip files you want in one go
Automatically Calculate and display the md5sums of all zip files you are going to flash
Check your backups' health to ensure they will restore later when you need them, by verifying their md5sums!
Optionally, but highly not recommended:
If md5sums don't match but you REALLY NEED that backup BADLY, you might want to restore it anyway.
You can you this app to fix the md5sums of a given backup to "forcefully" restore it!​
Calculate real values for the space needed to create a new full or advanced backup
Advanced Backups: While you are selecting / deselecting partitions, it will display and update the currently needed space to complete that custom backup set.​
Identifies and adds your romname so you don't need to type so much when chosing a meaningful name for your backup
As an example, the following is possible to do in just one session:
Restore a backup, set to create a backup / advanced backup before the restore,
format all partitions with a file system of your choice before the restore process starts,
flash additional zip files afterwards, fix permissions and select to stay inside recovery or to reboot automatically once all actions are complete.​
Much, much more! See www.4ext.net
Recovery theming
Uninstall and Install themes with live preview and the option to change their colours without the need to reboot into recovery.
Change all colours with live preview and a nice colour picker.
​
Thanks to you, for your AMAZING recovery
ghiki said:
Thanks to you, for your AMAZING recovery
Click to expand...
Click to collapse
thanks for telling me about Imanol001 for testing
Curious to flash, but need to know how navigation is handled... trackball or volume (or both)? As my trackball is kinda messed up... thanks.
daveid said:
Curious to flash, but need to know how navigation is handled... trackball or volume (or both)? As my trackball is kinda messed up... thanks.
Click to expand...
Click to collapse
I'm not exactly sure about the trackball for the Desire as I don't have one. I think it should work. But the volume buttons always work!
Edit: sorry, mixed up the thread, but that also applies to the Nexus One
Volume buttons: definitely
Trackball: most probably
Wait, the free version is a trial? Or did I read that wrong?
Also, what are the benefits of paid?
This isn't meant in a disrespectful way but, if its a recovery, why use yours over Clockwork or Amron?
uoY_redruM said:
Wait, the free version is a trial? Or did I read that wrong?
Also, what are the benefits of paid?
This isn't meant in a disrespectful way but, if its a recovery, why use yours over Clockwork or Amron?
Click to expand...
Click to collapse
Recovery is free (of course ! ) and has nothing to do with any apps!
You can compare the app's features on www.4ext.net.
Free "Updater" app:
browse all versions of 4ext recovery
flash or download any version directly verifying md5sums automatically.
view changelogs / known issues while downloading
get news if any new critical bugs are found
send bug reports where you can include your last recovery log by ticking an option if you wish.
This App is a great time saver for me as I can add things to known issues if any very quickly for all devices, or send a notice that something was discovered, that you should know about (like a new bug found in a version released the day before or something).
I also increase the chance that people read the change logs or known issues, because they are immediately and easily accessible!
"Control" app: quite much, please see www.4ext.net
To be able to test all features of the "full version" app (which has nothing to do with recovery itself!),
the "Updater app" includes a full featured 3 day preview with all features of the paid one.
After that, it is just the free version.
There are no ads, or any other bull****
About the recovery features and why to use/not to use it over any other recovery, please see 1st post:
Features: Use 4EXT Recovery Control or Recovery Updater for complete Changelogs and Known issues!
not all features may be relevant for all devices
Displays additional information:
Identifies your current rom and displays its name
Current filesystems on your partitions
Free space remaining of all of your volumes
Current battery charge level
Backup | Restore:
Correctly calculates free space needed to complete a backup ( version > 2.2.6 RC4 )
Tar backups (can be switched on or off)
Complete CWMR5 compatibility
All Backups you create will be named after your currently installed Rom for easier identification.
Never unwillingly get "downgraded" to EXT3 again
Always restores backups using the file systems you HAD on your partitions at the time of creation!
-> all partitions formatted with ext4 at that time, will be restored to ext4. The same is true for ext3.​
You can manually change any existing Backup to ext4 or ext3
-> so that after a restore, all partitions and up with the file system you wanted!​
Advanced Backup: backup only a single partition
Convert any of your partitions to EXT4 or EXT3 without data loss.
Formatting:
When you wipe or format it will always use the same file system you currently have.
-> but you can change that​
When you format ext4 it will always create an aligned file system
Correctly identifies unformatted sd-ext partitions
-> if it finds one it displays a warning and suggests you may format them by visiting the 4EXT menu​
Filesystem check and repair option in advanced menu
Partitioning:
Alignment check of your partitions
Full support for up to 2 sd-ext partitions + swap (Backup/restore/format/convert, fsck, et.c.)
(RE-) Partition your sdcard for sd-ext without removing your fat32 partition.
All partitions created with 4EXTRecovery will be perfectly aligned to 4k
Installing:
Integrated md5sum checking option
Themes:
Customize all colours used throughout recovery
Use your own icons, background images, progress bars.. more to come.
Assign different backgrounds to different menu categories (version >= 2.1.2)
Create a flashable zip for others to flash your theme.
Menus:
Most popular menu items rearranged
Format menu
Power Menu + option to reboot into bootloader
Less "No's" in confirmation dialogues
Changed Advanced Restore: first select what you want to restore, then select the backup
-> Useful for restoring from "Advanced Backups"​
4ext.prop:
Configuration file on your sdcard where you can set options to be used by 4EXTRecovery
Change all settings conveniently with 4EXT Recovery Control
Many more options to come
Share your settings / themes by packing your config into a flashable theme
Other stuff:
USB Storage Autostart (must be switched on)
Mount usb storage exposes all partitions on your sdcard to the os (not just fat32)
-> you could even partition your sdcard from your PC while connected via USB​
Switch haptic feedback on/off
You don't need to reboot recovery if you transferred a file to show up in the install menu.
-> This bug affected only some users with either CWMR or previous versions of 4EXT.​
Button backlights (Desire S, Desire HD and Incredible S only)
​
Thank you for your quick response, and I plan to look into your recovery.
My other question would be, how do you install your recovery? On the website, I'm getting an .apk file when I click the link.
uoY_redruM said:
Thank you for your quick response, and I plan to look into your recovery.
My other question would be, how do you install your recovery? On the website, I'm getting an .apk file when I click the link.
Click to expand...
Click to collapse
Yes it's currently only available through the Updater app.
You can flash it directly using that or chose to download it and flash manually.
Need to get some sleep now.. again 5:30am here
If there are any remaining questions I'll gladly answer them in a few hours
You can also take a look at the other threads though as 4ext has been available for some other devices for many months already
uoY_redruM said:
Wait, the free version is a trial? Or did I read that wrong?
Also, what are the benefits of paid?
This isn't meant in a disrespectful way but, if its a recovery, why use yours over Clockwork or Amron?
Click to expand...
Click to collapse
Alignment of your card, the fat32 & the EXT partition, huge plus. Converting your EXT partition to EXT4 or EXT3 without data loss, nice… but the alignment feature & card display info nice touch in recovery.
This will make formatting/aligning my new 32gb CL6 much easier than sibere instructions…
Just installed this and the trackball/volume button is working for navigation, the capacitive back button is for back, the selection is still the trackball.
Tried it. Love it!!!!!!!!!!!!!!!
And so my Nexus One lives on....
In the screenshots, its shows the system and data partitions etc, but when I look on my partition printout it only shows partitions on the SD card. How can I make this show all partitions on my phone and then convert all of those partitions to EXT4?
Thank you all very much for that awesome feedback
Regarding system data cache extra info on mtd devices with yaffs2 partitions:
Back when 4ext recovery only displayed the current file system types of partitions it didn't make sense to include yaffs2 partitions, because the file system never changes there.
Since then displaying of capacity and free space has been added.
Now it absolutely makes sense, but I hadn't had the time yet to make those changes.
If you "print partition info" Inside the app though, you will see all the info already.
I will change that inside recovery in one of the next updates
Thanks for the info, one other thing. I tried making a backup of my current system, and then converting the backup to EXT4. I had assumed it would convert the yaffs2 partitions to EXT4 as well, but it didn't. When I checked the partition printout in the app, it still showed yaffs. In your screenshots in the OP, all the partitions are showing as EXT4. How can I format all of my system partitions to EXT4 as well?
Bohemus said:
Thanks for the info, one other thing. I tried making a backup of my current system, and then converting the backup to EXT4. I had assumed it would convert the yaffs2 partitions to EXT4 as well, but it didn't. When I checked the partition printout in the app, it still showed yaffs. In your screenshots in the OP, all the partitions are showing as EXT4. How can I format all of my system partitions to EXT4 as well?
Click to expand...
Click to collapse
This is simply not possible with yaffs2 partitions.
The screens are from Desire HD and Incredible S.
You can only convert sd-ext partitions between ext3 and ext4 on devices using yaffs2 for system, data and cache..
So when you are inside the convert menu you will only see sd-ext partitions to select.
And if you set one of your backups to either ext4 or ext3, only sd-ext partitions inside that backup will be effected.
Got it. So there is no way to format the N1's phone partitions to EXT4? Would there even be a point to doing this if it were possible?
Bohemus said:
Got it. So there is no way to format the N1's phone partitions to EXT4? Would there even be a point to doing this if it were possible?
Click to expand...
Click to collapse
It's not possible
At least not without an extreme hack. I don't know if anyone ever did something like that and I lack the knowledge about that matter.
Yes, ext4 would be faster.
awesome!
Best recovery! I've been switching to find the best but have always found problems in each i tryed until i found this! Well done!

[CWM UTIL] GS2PreloadBackup/Restore scripts for Samsung JB (02/03/2013)

The JB XXLSJ leak and the latest XWLS8 official JB releases have introduced a new partition on /dev/block/mmcblk0p12 mounted to /preload.
This was required due to the fact that the /system partition just isn't big enough to hold all the extra apps the JB leak requires.
The problem with this is that with the exception of PhilZ Kernel and Jeboo, CWM backups in bith Siyah and DorimanX omit the backing up this /preload partition. If you regularly try out different ROMs and restore back, this can mean your ROM's getting a little out of step as it would have the /preload files from the ROM you last flashed, with all other files coming from the ROM you performed the backup on.
Currently, if you are on Siyah/Dori, the only way to backup/restore everything via CWM backups is to:
a) reboot into recovery
b) flash PhilZ/Jeboo
c) go to advanced>reboot recovery
d) make your backup in PhilZ/Jeboo/Apolo recovery
and if you want to revert back to Siyah/Dori:
e) flash Siyah/Dori
f) advanced>reboot recovery
If you ever need to restore, and you are using Siyah/Dori then you will need to:
a) reboot into recovery
b) flash PhilZ/Jeboo
c) go to advanced>reboot recovery
d) restore your backup in PhilZ/Jeboo/Apolo recovery
e) flash Siyah/Dori
f) reboot
NOTE: Later versions of PhilZ require you to specifically set the backup/restore of /preload. This is done in PhilZ CWM Recovery:
1. boot into PhilZ recovery
2. Philz settings
3. Special backup and restore
4. Misc nandroid settings
5. Toggle /preload processing (make sure this says /preload will be processed)
To get around this current omission in Siyah and Dori, I have written the following 2 CWM flashable zips:
GS2PreloadBackup
This will backup your current /preload partition.
The backup is made on a per-ROM basis to /sdcard/MyBackups/preload/[ROM-Name]/preload.tar. Therefore, if you backup on several different ROMs, you will get several ROM folders in this preload backup location, one backup per ROM​GS2PreloadRestore
This will restore the /preload backup made by the above script for your current ROM.​
So if you are on Siyah/Dori and want to make a full backup without flashing between PhilZ, you can now do the following:
1. Boot up into recovery
2. Make your CWM backup
3. Run GS2PreloadBackup.zip
Further down the line, if you ever wanted to restore this, then
1. Boot up into recovery
2. Restore your CWM backup
3. Flash GS2PreloadRestore.zip
The restore is sensitive to the ROM you are currently on, so it will only restore the /preload for you current ROM, provided you have run the backup script previously for the ROM of course.
Changing the backup location
By default, backups are made to the internal SD card in /sdcard/MyBackups as described above. You can change the backup location to the external SD card if required. This can be done by editing /sdcard/MyBackups/HawkerOptions/MyWipeOptions.prop. Within this file there is a line that tells the script where the backups are to be stored. Edit the following line as required:
BKP_LOCATION=int (backs up to INTERNAL SD Card, ie. /sdcard/MyBackups)
BKP_LOCATION=ext (backs up to EXTERNAL SD Card, ie. /storage/extSdCard/MyBackups)
Please note, that if you change the location between int/ext in MyWipeOptions.prop, your backups will not get automatically moved to the new location. You would have to manually move the current backup over to the new location if you do not want to potentially have two copies of the backups.
Test Mode
The script inside the zip file that does all the work is called GS2Hawker.sh. This can be called via adb shell/Script Manager etc. in order to perform a test dummy-run. The Test Mode goes through all the motions as per a standard CWM Recovery run, but it does not remove any files/folders in any way, and merely shows the commands it would have done.
eg. extract GS2Hawker.sh from the zip using 7Zip or similar
adb shell
sh GS2Hawker.sh PreloadBackup
sh GS2Hawker.sh PreloadRestore
Summary of Files Created/Used
1. /sdcard/MyBackups/HawkerLogs/GS2PreloadBackup.log.
2. /sdcard/MyBackups/HawkerLogs/GS2PreloadRestore.log.
These shows the activity log of what the script has done. This gets overwritten the next time you run the script.
3. /sdcard/MyBackups/HawkerOptions/MyWipeOptions.prop. Options file for all my scripts. Currently this contains the option for backup location, internal or external SD card. (See Changing the backup location above)
These scripts are of course only a temporary measure as I am in no doubt that both Siyah and Dori will both also include the /preload partition in their CWM Recovery scripts very shortly, but for now, I hope this might help one or two of you out.
Known Issues
Free space checking prior to performing the backup always returns free space on internal sdcard even when
backing up to external sd card.
For some reason, when I do a df (on Siyah, not sure about other kernels)
I get the following:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/block/mmcblk0p11
12063840 231264 11832576 2% /mnt/.secondrom
/dev/block/mmcblk1p1 12063840 231264 11832576 2% /sdcard
/dev/block/mmcblk0p11
12063840 231264 11832576 2% /sdcard
/dev/block/mmcblk1p1 30648992 17592608 13056384 57% /emmc
It appears /dev/block/mmcblk1p1 is mounted to /emmc AND /sdcard?????!!!!
All file operations on /emmc gets performed on the extenral sd card as expected (ie your backups WILL go to external), BUT when the df command is issued to check for available space, it is performed on /sdcard! Therefore, if the script is trying to find the space left on /emmc, and the device returned from the df command is /sdcard, then an error is presumed, an no space check performed.
Please Note
I use these scripts myself between many flashes of different ROMS, and are provided here, as-is, out of my passion for development. Although every effort has been made to ensure everything works correctly on my handset I cannot be held responsible if things get messed up, or if you put something in your user-definable files that you shouldn't have included. As with everything else on here, you flash anything at your own risk. I always recommend performing a full CWM backup before attempting to flash anything onto your device.
Current Versions
GS2PreloadBackup 1.05 (22/05/2013)
GS2PreloadRestore 1.05 (02/03/2013)
Note: If the latest versions quoted above do not appear in the download devhost site, then please be patient!
ApriliaM3 should soon be uploading them.
Downoad Here
Download Here
My HUGE thanks goes out to ApriliaM3 for hosting the scripts.
Please give him the thanks he deserves.
To Do
....​
Work in Progress
....​
Changelog
GS2PreloadBackup v1.05 (22/05/2013)
1. Extra free space checking. (See OP for known issues)
GS2PreloadBackup v1.04 GS2PreloadRestore v1.05 (02/03/2013)
1. Backups can now go to either internal or external SD Card. See Post #1 for details
GS2PreloadRestore v1.04 (22/02/2013)
1. Now restores /preload/symlink instead of whole of /preload for greater flexibility in dual-boot systems
2. Current /preload/symlink contents removed before restore giving a better snapshot for the restore point
GS2PreloadBackup v1.03 (22/02/2013)
1. Now backs up /preload/symlink instead of whole of /preload
GS2PreloadRestore v1.03 (22/02/2013)
1. Current /preload contents removed before restore giving a better snapshot for the restore point
2. Progress now given in Mb during the restore process
v1.02 (13/02/2013)
1. Numerous display updates
2. Log file now goes to /sdcard/MyBackups/HawkerLogs so that they are grouped with logs from my other scripts
v1.01 (31/01/2013)
1. Progress now given during backup operation of the size of backup complete​
Thanks buddy:thumbup::thumbup:. I just wanted to get in first. :thumbup::thumbup:
Edit. I just ran a backup and it worked and so did the restore :thumbup:
In the meantime I'll leave this picture until I can post something constructive.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
SIGNATURE
PHONE : SGSII
Sent via: Tapatalk 2
Main ROM: Alliance rom v5.2
KERNEL : Dorimanx 7.39
(DEFAULT PROFILE AND SETTINGS )
MODEM : BVLP7
BATTERY : Stock 1650mAh
EXTERNAL Sdcard : Samsung Class 10 32gb
LAUNCHER : Apex
My Guides list to install NeatRom and other ROMS and kernels on LSJ + tools to have a bug free rom + how to back up and RESTORE FOM FULLY = http://forum.xda-developers.com/showthread.php?p=35923600
1.Rom Nuke script
http://forum.xda-developers.com/showthread.php?p=36268094
2.Kernel Clean script
http://forum.xda-developers.com/showthread.php?p=34879811
3.Fast Dormancy :
http://forum.xda-developers.com/showthread.php?p=36396636
4. How to install full wipe with rom nuke on LSJ
http://forum.xda-developers.com/showthread.php?p=36655790
Nice guide
Sent from my GT-I9100 using xda premium
Thanks Hawker, great work.
Red you got a nice ass!
Edit. ... I have done a backup and ran the zip after it and it worked great.
Thank you!
Sent From My Galaxy S2 Running
AllianceROM Powered By DorimanX Kernel
Some more great work and another great guide there Paul... well done!
I have now created a directory for your work on my Dev-Host mirror site HERE
ApriliaM3 said:
Some more great work and another great guide there Paul... well done!
I have now created a directory for your work on my Dev-Host mirror site HERE
Click to expand...
Click to collapse
Thanks Pete.
I've updated the links in the OP to yours.
I'll let you know if I update the scripts at all.
Cheers mate!
:good:
Thank you, really usefull script.
deleted
Updated to V1.01
See Changelog for details
hawkerpaul said:
Updated to V1.01 (pending upload to ApriliaM3's host.....)
Click to expand...
Click to collapse
All done Paul.
hawkerpaul said:
Updated to V1.01
See Changelog for details
Click to expand...
Click to collapse
I have been trying to backup preload to my external sd card by modifying /sdcard/MyBackups/MyBakDevice.txt ( see screenshot)
But the backup is stil made on the internal and after every attempt the content of MyBakDevice.txt is set back to the default /sdcard
I'm I doing something wrong here
EDIT: Tried 3 times, same result every time.
Backup to external sd card not possible currently, so I'm looking into getting this working properly. For now, ignore any information relating to MyBakDevice.txt. All backup will go to internal sd card only for the time being.
Updated to V1.02
See post #2 for details
Updated GS2PreloadRestore to v1.03
See post#2 for details
AW: [CWM UTIL] GS2PreloadBackup/Restore scripts for Samsung JB (22/02/2013)
This is awesome, thanks for your work!!!!!
May I ask something? (if not, ignore me)
Is it possible to not backup the full /preload partition but only the /preload/symlink part of it? I ask because it would be very helpful with this : http://forum.xda-developers.com/showthread.php?p=38209559
So, a user could backup /preload/symlink/... Then install a 2nd Rom, that will probably format /preload and just restore it easily with your File. This might be a very big step for Dual boot as it makes so many things easier!
Anyways, thank you very much for your efforts!!!
Greetings
Thomas
Sent from my GT-I9100 using xda app-developers app
As far as I'm aware, apart from the generic lost+found folder linux creates under each partition (which 99% of the time will be empty) the only contents of the /preload partition IS the symlink folder.
AW: [CWM UTIL] GS2PreloadBackup/Restore scripts for Samsung JB (22/02/2013)
hawkerpaul said:
As far as I'm aware, apart from the generic lost+found folder linux creates under each partition (which 99% of the time will be empty) the only contents of the /preload partition IS the symlink folder.
Click to expand...
Click to collapse
Thanks!
But in my /preload there is the /symlink part of my Sammy Rom (shorted to about 80mb) and the /system of 2nd Rom (MCM's 10.1)
The created Backup with your zip is about 390mb big so I figured that there has to be more than just the symlink stuff.
This could be solved, of course by a clean install of first Rom (Sammy), backup with your file, install 2nd Rom and then restore /preload.
But it would be easier if only /preload/symlink would be backed up and later restored.
But, important, I don't want to bug you, it's awesome as it is, seriously!!
Greetings
Thomas
Sent from my GT-I9100 using xda app-developers app
Ok mate, I'll have a look into it for you.
Edit:
Updated to GS2PreloadBackup v1.03 and GS2PreloadRestore V1.04
See post #2 for details
AW: [CWM UTIL] GS2PreloadBackup/Restore scripts for Samsung JB (22/02/2013)
hawkerpaul said:
Ok mate, I'll have a look into it for you.
Edit:
Updated to GS2PreloadBackup v1.03 and GS2PreloadRestore V1.04
See post #2 for details
Click to expand...
Click to collapse
Awesome, thank you very much!!!
If it's ok I will add a how-to to my thread and link to yours?
To me, this is an enormous step forward great!!
Sent from my GT-I9100 using xda app-developers app

[GUIDE] Make any rom OS2SD

OS2SD for any rom ​
As I see there is many P500 users interested to put their ROM to sd card, so I'm providing this tutorial how to make any rom bootable from sd.
Requirements:
Linux or cygwin for Windows
Boot.img tools
Modified updater-script
Modified fstab
Correctly partitioned sdcard (Guide)
TWRP-OS2SD or TWRP-MULTI
Steps:
Replace updater-script in your's ROM zip with provided. It will probably work with all kitkat based roms. If not the idea is mounting /system on sd card so change all "mount("yaffs2", "MTD", "system", "/system");" lines with "mount("ext4", "EMMC", "/dev/block/mmcblk0p2", "/system");" in original updater-script
Extract bootimg-tools.zip and paste boot.img from your rom in same foder
Open terminal or cygwin, locate folder with boot.img tools and type "./extractboot boot.img"
This will create out folder. Replace fstab.p500 and init.qcom.rc in out/ramdisk with provided (they might need rework on older roms)
In terminal type "./packboot"
Now rename boot_new.img to boot.img and pase it to rom zip
Flash rom zip with one of provided TWRP versions
should probably work back thru 4.0 but froyo/gingerbread init won't mount any sd partitions before boot is completed.
just curious, why this partition layout?
I used p2 for /data until wiping it by accident several times swapping my sd to a phone with pre-os2sd recovery.
of course, I've modded my own os2sd partition map several times now experimenting, and the order doesn't seem to matter.
and i was wondering, could you post your twrp modifications for internal/os2sd hybrid? i had one kinda working but it was glitchy.
I used this configuration to keep swap working if enabled, because default is p3. Also p4 for /data because it not used by anything else, so it's safe. I think you are right, order doesn't impact performance. Will send you config of twrp then be on pc.
Sent from my LG-P500 using xda premium
HardLight said:
I used this configuration to keep swap working if enabled, because default is p3. Also p4 for /data because it not used by anything else, so it's safe. I think you are right, order doesn't impact performance. Will send you config of twrp then be on pc.
Sent from my LG-P500 using xda premium
Click to expand...
Click to collapse
I'm not seeing any other ROMs of this style floating around.
The only reason I didn't leave p3 for swap is that it wasn't being used yet when I started with the os2sd stuff. I tried sticking it on p2 (instead of the stubby sd-ext I had there to satisfy the odd this-or-that which demanded sd-ext,) and that worked ok, but I hadn't set sd-swap as a default in any builds.
since you're building similar stuff now, maybe I'll drift mine into your partition map in the interest of some sort of unification. and I'd like to match up the twrps, too.
especially if the sd-swap is working well on the p500.
everybody who's been dealing with my versions for any length of time now since it came out in February, is used to having to upgrade recovery and deal with incompatible backups from earlier releases anyway.
thanks for your contributions.
Thank You
HardLight said:
OS2SD for any rom ​
As I see there is many P500 users interested to put their ROM to sd card, so I'm providing this tutorial how to make any rom bootable from sd.
Requirements:
Linux or cygwin for Windows
Boot.img tools
Modified updater-script
Modified fstab
Correctly partitioned sdcard (Guide)
TWRP-OS2SD or TWRP-MULTI
Steps:
Replace updater-script in your's ROM zip with provided. It will probably work with all kitkat based roms. If not the idea is mounting /system on sd card so change all "mount("yaffs2", "MTD", "system", "/system");" lines with "mount("ext4", "EMMC", "/dev/block/mmcblk0p2", "/system");" in original updater-script
Extract bootimg-tools.zip and paste boot.img from your rom in same foder
Open terminal or cygwin, locate folder with boot.img tools and type "./extractboot boot.img"
This will create out folder. Replace fstab.p500 and init.qcom.rc in out/ramdisk with provided (they might need rework on older roms)
In terminal type "./packboot"
Now rename boot_new.img to boot.img and pase it to rom zip
Flash rom zip with one of provided TWRP versions
Click to expand...
Click to collapse
Thank You for posting the guide as requested. Awesome, now I will try to make some ROMs bootable in sdcard, and try them in my phone.
bigsupersquid said:
should probably work back thru 4.0 but froyo/gingerbread init won't mount any sd partitions before boot is completed.
Click to expand...
Click to collapse
i think that you are wrong
i have a gingerbread installed on SD (and kitkat CM11 by mukulsoni on internal)
i used Multirom manager 5.1 by arnab321 based on work by Tassadar
http://forum.xda-developers.com/showthread.php?t=1828151
HardLight: can you make this procedure work like the one in Multirom ?
it allows me to have GB and KitKat installed at the same time, both are bootebel using the same recovery and im only a boot away from moving from one to the oder
danielboro said:
i think that you are wrong
i have a gingerbread installed on SD (and kitkat CM11 by mukulsoni on internal)
i used Multirom manager 5.1 by arnab321 based on work by Tassadar
http://forum.xda-developers.com/showthread.php?t=1828151
HardLight: can you make this procedure work like the one in Multirom ?
it allows me to have GB and KitKat installed at the same time, both are bootebel using the same recovery and im only a boot away from moving from one to the oder
Click to expand...
Click to collapse
multirom has preinit of its own, runs before GB init, and uses busybox to mount sd folders. It also mods init.rc to not mount the MTD partitions.
it would have to be recoded because, among other things, init.rc doesn't mount the filesystems anymore, it's moved to init.qcom.rc or init.device.rc (init.p500.rc or init.thunderc.rc in the current OS2SD versions.)
to use OS2SD like multirom, it would have to bind-mount folders or filesystem images from the card instead of mounting partitions directly, unless android can 'see' more than 4 card partitions now. It used to be limited to 4 back in GB.
Plus unless kexec is working every OS installed has to work with the kernel in the boot.img for tasssadar's original code (the app you're using is reflashing a new boot.img every time you change OS's, which will eventually trash your boot NAND memory,)
bigsupersquid said:
multirom has preinit of its own, runs before GB init, and uses busybox to mount sd folders. It also mods init.rc to not mount the MTD partitions.
it would have to be recoded because, among other things, init.rc doesn't mount the filesystems anymore, it's moved to init.qcom.rc or init.device.rc (init.p500.rc or init.thunderc.rc in the current OS2SD versions.)
to use OS2SD like multirom, it would have to bind-mount folders or filesystem images from the card instead of mounting partitions directly, unless android can 'see' more than 4 card partitions now. It used to be limited to 4 back in GB.
Plus unless kexec is working every OS installed has to work with the kernel in the boot.img for tasssadar's original code (the app you're using is reflashing a new boot.img every time you change OS's, which will eventually trash your boot NAND memory,)
Click to expand...
Click to collapse
ill start at the end
flashing boot is no worse then flashing a new rom but its less work and less time
i like GB for the speed and batt use but from time to time i need to run ting that wont work on GB(at list not on the 1 i chose after trying ~12 rom`s)
having kitkat installed and using multirom to change is faster
so, any chance of implementing the bind-mount option?
prite please
:fingers-crossed:
danielboro said:
ill start at the end
flashing boot is no worse then flashing a new rom but its less work and less time
i like GB for the speed and batt use but from time to time i need to run ting that wont work on GB(at list not on the 1 i chose after trying ~12 rom`s)
having kitkat installed and using multirom to change is faster
so, any chance of implementing the bind-mount option?
prite please
:fingers-crossed:
Click to expand...
Click to collapse
Just install your GB rom to internal memory and cm11 OS2SD to sd card, then make two flashable zips (or backups) of both roms boot.img and flash them respectively to rom you want to boot. Just keep in mind that GB won't be able to use sd-ext, because it's os2sd system partition.
Sent from my LG-P500 using xda premium
HardLight said:
Just keep in mind that GB won't be able to use sd-ext,
Click to expand...
Click to collapse
this is way i was hoping for the mount-bind
at the moment GB is on P2, swap on P3 and kitkat uses P4 as /sd-ext
i have some limited knowledge, ill try to see if i can do something wen ill have the time
any pointer on how i can use mount-bind ?
all the work on developing the p500 helps extend it life
thanks
p.s.
what is the MULTI in TWRP-MULTI?
danielboro said:
this is way i was hoping for the mount-bind
at the moment GB is on P2, swap on P3 and kitkat uses P4 as /sd-ext
i have some limited knowledge, ill try to see if i can do something wen ill have the time
any pointer on how i can use mount-bind ?
all the work on developing the p500 helps extend it life
thanks
p.s.
what is the MULTI in TWRP-MULTI?
Click to expand...
Click to collapse
the multi can flash os2sd & normal rom, so you have not to change between recoveries
ThAnKs
Thanks alot for this guide.....
have anyone tried it on an ICS rom ?
getting this error using cygwin
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
maybe it doesnt work with cygwin , i am trying to make genetICS 9.1.6 OS2SD compatible ..
nomancoolboy said:
getting this error using cygwin
maybe it doesnt work with cygwin , i am trying to make genetICS 9.1.6 OS2SD compatible ..
Click to expand...
Click to collapse
For starters , you need Perl installed for that script.
Second, ics don't use fstab, you'll have to change init.rc
And maybe even recompile init with a delay inside, like on GB.
otherwise init may not mount the card partitions.
The easy way to run ICS from card is tasssadar's multirom. You can find the thread buried in this forum.
I'm using HardLight's GenetICS 9.1.7 with the OS2SD mod. It's the most stable and smoothest with long battery life and 1.5GB in the data partition for my apps. Also successfully made it with Hephappy's ICS Plus simply modifying the updater-script inside the zip and search the mounting points in the 'init.rc' and 'init.qcom.rc', then just have to modify the lines following the first post.
Greetings from Costa Rica!
Enviado desde mi LG-P500 usando Tapatalk
@HardLight
This is twrp-multi, renamed to boot.img. I have previously extracted recovery images this way using apktool.
[email protected]:~/bootimg-tools$ ./extractboot boot.img
Page size: 2048 (0x00000800)
Kernel size: 2803424 (0x002ac6e0)
Ramdisk size: 2294087 (0x00230147)
Second size: 0 (0x00000000)
Board name:
Command line: mem=471M console=ttyMSM2,115200n8 androidboot.hardware=p500 no_console_suspend
Writing boot.img-kernel ... complete.
Writing boot.img-ramdisk.gz ... complete.
gzip: ../../boot.img-ramdisk.gz: not in gzip format
cpio: premature end of archive
Any other tools needed to make this work? (ubuntu 14.04)
manu3193 said:
I'm using HardLight's GenetICS 9.1.7 with the OS2SD mod. It's the most stable and smoothest with long battery life and 1.5GB in the data partition for my apps. Also successfully made it with Hephappy's ICS Plus simply modifying the updater-script inside the zip and search the mounting points in the 'init.rc' and 'init.qcom.rc', then just have to modify the lines following the first post.
Greetings from Costa Rica!
Enviado desde mi LG-P500 usando Tapatalk
Click to expand...
Click to collapse
Can you share the modified files to be replaced in the rom.
hi all - thanks for these instructions. I tried to apply these to cm-9.1.5-GenetICS-Final-P500+gapps.zip and cm-9.1.7-GenetICS-HardLight-p500.zip.
In those roms I had to update the updater-script (I had to remove the format command otherwise the install would fail - but i figured that should be ok since the ext4 partition can be formatted externally - if i remember to do it).
I also updated the init.rc in the (mount mtd partitions section), but no updates to the init.qcom.rc
Each time I try to install a ROM, the device gets stuck at the LG boot logo.
I get the same problem with those zip's installing from TWRP MULTI's "Internal" mode. So I suspect something else is wrong...
interestingly, the only zip I can install successfully is the cm11.0.0-20160101-os2sd-ext4-p500.zip. Works like a charm, just dies in a matter of hours with Wifi on.
eldamobo said:
hi all - thanks for these instructions. I tried to apply these to cm-9.1.5-GenetICS-Final-P500+gapps.zip and cm-9.1.7-GenetICS-HardLight-p500.zip.
In those roms I had to update the updater-script (I had to remove the format command otherwise the install would fail - but i figured that should be ok since the ext4 partition can be formatted externally - if i remember to do it).
I also updated the init.rc in the (mount mtd partitions section), but no updates to the init.qcom.rc
Each time I try to install a ROM, the device gets stuck at the LG boot logo.
I get the same problem with those zip's installing from TWRP MULTI's "Internal" mode. So I suspect something else is wrong...
interestingly, the only zip I can install successfully is the cm11.0.0-20160101-os2sd-ext4-p500.zip. Works like a charm, just dies in a matter of hours with Wifi on.
Click to expand...
Click to collapse
roms not built for kernel swapped system/userdata (kitkat only built this way, and not older kitkat versions) will flash to the wrong partition and won't boot.
change your updater-script to switch system and userdata for older roms to flash correctly with the twrp-multi in internal mode.

[CLOSED][GUIDE] Resizing partitions

OUTDATED METHOD, CAN RESIZE PARTITIONS DIRECTLY IN "HEKATE".
This seems to be a popular question on the release thread, so I thought I would share the method I used to resize the partitions included in the stock switchroot android image.
You can do this a number of ways, I'm lazy tho.. so I went the fastest route I could think of.
All of the following steps were done on a linux virtual machine running the gparted live ISO.. this is not a tutorial how to setup a virtual machine or linux, I'm going to assume you're competent enough to do that as all the steps will require one or the other!
What tools are we going to be using?
gparted (GUI interface)
gdisk (terminal)
The only steps taken prior to what I'm going to share here is that I flashed the 16gb image to my microsd.
So what is the end goal?
Expand the general storage (fat32) partition.
Expand the android user data partition.
Allocate a partition for emummc (optional).
Repair the MBR which we destroy by resizing the partitions.
First thing I did was capture some data of the default partition layout for reference:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Great now that we have that, lets get stuck into it.
GPARTED
Fire up gparted and you'll be presented with the following popup:
We want to hit the "Fix" button.. this will allow us to utilise all the remaining space on the microsd card.
As soon as we do this tho, there is no turning back.. you'll need to complete the tutorial.
What we're looking at here is the default layout, note the unallocated space highlighted below:
The first thing we're going to do is expand the android user data partition (sdd7 in the screenshot above).. Right click "userdata" -> "Resize/move".
I decided to go with 32GB which should be plenty, how large you want to make this partition is entirely up to you.
The next thing we're going to do is move the partition down the stack, we do this by entering "0" into the "free space following" field.
You'll notice the white box surrounded by the dark purple border has moved position to the far right to reflect your changes.. hit the "resize/move" button and confirm the warning window.
You can now see the "userdata" partition has moved down the stack, will be resized to 32GB and our unallocated space has moved up.
We're now going to repeat this process for the remaining android partitions (without resizing tho).. starting from the "dtb" partition and working our way up to "vendor".
Right click partition -> "Resize/move".
Modify "free space following" to "0".
Hit the "Resize/move" button.
Confirm the warning.
You get the idea.. repeat this process until you reach the "hos_data" partition.
Eventually you'll be left with something like this, note the unallocated space is now directly under our "hos_data" partition.
It's time to expand our fat32 partition, you can drag the black arrow on the right hand side all the way to the end to set the maximum size.
[EMUMMC USERS ONLY] If you intend on using emummc we can allocate some space for the partition by entering "29856" in the "free space following field", this will automatically reduce the partition size to accommodate the required free space.. this step is completely optional.
[EMUMMC USERS ONLY] We need to create a new partition (right click "unallocated" -> "new").. the only option we're going to change here is the "file system" field to "unformatted".
Now is the time to verify all our settings are correct before finally hitting the apply button.. confirm the warning and let it do its thing.
Before closing gparted, we want to take note of the drive identifier located on the top right of the screen.. mine is "/dev/sdd", we're going to be using the next steps.
GDISK
All the remaining steps will be executed using gdisk in a terminal window.. first of which will be the following command:
Code:
sudo gdisk /dev/sdd
Replace "/dev/sdd" with your drive identifier.
Input "r" as a command, this will enter us into the "recovery/transformation" submenu.
You can output the MBR & partition table by inputting "o" & "p" as commands, since we used gparted the MBR has been modified.. we need to revert this back to ensure everything plays nice.
Input "h" as a command, this will create a new hybrid MBR to replace the one we destroyed with gparted. If you intend on using emummc we need to add both the hos_data partition (#1) & the emummc partition (#8)..
You would do this by entering:
Code:
1 8
Otherwise if you're not planning to use emummc, we just add the hos_data partition (#1):
Code:
1
Place EFI GPT parition first in MBR?
Code:
N
Creating entry for GPT partition #1 (MBR partition #1)
Enter an MBR hex code:
Code:
EE
Set bootable flag?
Code:
N
[EMUMMC USERS ONLY] Creating entry for GPT partition #8 (MBR partition #2)
Enter an MBR hex code:
Code:
0b
[EMUMMC USERS ONLY] Set bootable flag?
Code:
N
Unused partition space found. Use one to protect more partitions?
Code:
N
Great, now lets output the MBR & partition table by inputting the "o" & "p" commands once again to confirm our changes.
Looking good! :good:
The last thing to do is write our changes, we do this by entering the "w" command.
Do you want to proceed?
Code:
Y
That's it folks, we're done! I know this was a little lengthy... hopefully this helps some of you out!
If you're interested in knowing more in-depth info about hybrid MBR's I came across the following website that contains invaluable information: HERE.
Awesome. Thanks for the guide! It seems as though my suspicions weren’t unfounded. Seems like we do have to write the android image to SD first before an easy change can be made. I’ve been trying to do this manually for the past week or two, but I’ve always failed because I never got the partition map setup correctly(have only tried a few times as well).
Are you familiar with how the partition map needs to be set? I’d love to practice getting this setup manually.
This is interesting. I'll give this a try. Thanks for putting this up.
Are steps 9 & 10 needed if I'm planning to create a fresh emummc via SX OS?
My current setup is one emummc/emunand and I'm using it for both Atmos and SX.
Thank you very much, especially for the gdisk part!
Move/Resize "Unknown filesystem" partitions?
Having trouble moving these. Gparted doesn't seem to want to let me do it. Any known variables that may influence this?
~~Tito~~ said:
Awesome. Thanks for the guide! It seems as though my suspicions weren’t unfounded. Seems like we do have to write the android image to SD first before an easy change can be made. I’ve been trying to do this manually for the past week or two, but I’ve always failed because I never got the partition map setup correctly(have only tried a few times as well).
Are you familiar with how the partition map needs to be set? I’d love to practice getting this setup manually.
Click to expand...
Click to collapse
You're very welcome!
What other info did you need beside what is shown above? Nothing is stopping you from creating the partitions manually, but why would you.. seems like a waste of time to me!
geckoquiver said:
This is interesting. I'll give this a try. Thanks for putting this up.
Are steps 9 & 10 needed if I'm planning to create a fresh emummc via SX OS?
My current setup is one emummc/emunand and I'm using it for both Atmos and SX.
Click to expand...
Click to collapse
Zero experience with SX OS, can't say for sure.
If it were me, I would backup my current emummc, create a new partition & restore it (this is actually exactly what I did, I was migrating sdcards tho).
tabzer said:
Having trouble moving these. Gparted doesn't seem to want to let me do it. Any known variables that may influence this?
Click to expand...
Click to collapse
I'm assuming you're not using the gparted live CD? You need to make sure the partitions are not mounted.
If you continue to struggle just do yourself a favour and use the gparted live CD/USB, don't waste your time chasing your tail trying to troubleshoot.
fOmey said:
I'm assuming you're not using the gparted live CD? You need to make sure the partitions are not mounted.
If you continue to struggle just do yourself a favour and use the gparted live CD/USB, don't waste your time chasing your tail trying to troubleshoot.
Click to expand...
Click to collapse
Thanks. I was using Ubuntu, and even with the partititons unmounted, I was only allowed to resize/move the partitions that were not "unknown". It seems the gdisk live is even more powerful. I don't really understand what the difference is. But it works.
If I resize after mounting the 128gb image to 64gb, will I'll be able to use the remaining 64gb like a normal sd card?
So after doing this, I can't run any of the games that are installed to my SD card (I copied my old fat32 partition off and back after following this guide). Any idea why this happened?
Also, any way to access the fat32 partition from within Android itself?
Did you restore an image to the partition, or did you copy your files manually?
~~Tito~~ said:
Did you restore an image to the partition, or did you copy your files manually?
Click to expand...
Click to collapse
Copied my files manually. I've done that before when upgraded SD card to a larger card and no issues.
First, Nice guide..... As the person that wrote the original guide, I would recommend creating the partition scheme from scratch, so you dont have to move the data a bunch. Then copy the partition info from the individual partitions manually, like my original guide said.
BTW @op congrats on posting a decent guide before me. I was getting there, but got caught up in life.
bfenty said:
So after doing this, I can't run any of the games that are installed to my SD card (I copied my old fat32 partition off and back after following this guide). Any idea why this happened?
Also, any way to access the fat32 partition from within Android itself?
Click to expand...
Click to collapse
Verify the hybrid MBR is setup correctly.
gavin_darkglider1 said:
First, Nice guide..... As the person that wrote the original guide, I would recommend creating the partition scheme from scratch, so you dont have to move the data a bunch. Then copy the partition info from the individual partitions manually, like my original guide said.
BTW @op congrats on posting a decent guide before me. I was getting there, but got caught up in life.
Click to expand...
Click to collapse
Original guide?
Creating partitions manually is a waste of time in my opinion.. much easier and faster to simply move them.
EDIT: I will add there's no wrong way to do this, if you prefer to create the partitions manually go for it.. whatever works!
fOmey said:
I'm assuming you're not using the gparted live CD? You need to make sure the partitions are not mounted.
If you continue to struggle just do yourself a favour and use the gparted live CD/USB, don't waste your time chasing your tail trying to troubleshoot.
Click to expand...
Click to collapse
I also cannot move the partitions with unknown filesystems in gparted. No partition is mounted and isn't possible via ubuntu gparted and also not via gparted live usb...
Any ideas?
Edit: Tried to write the 3 partitions with unknown filesystem to .img files, format the partitions, move them, write the .img files back and do the gdisk stuff.
This also didn't work, hekate says no fat32 partition recognized though I can mount it just fine in ubuntu...
...No idea how you moved the partitions with unknown filesystems, I read gparted doesn't allow this by default.
hey, I've been trying to get this done for some time now but I haven't has thought your guide would help me but I keep running into the same problem.
keeps telling me that it's unable to mount SD card
The flag for the main FAT partition needs to be 0C. Gdisk will be your friend.
trohn_javolta said:
I also cannot move the partitions with unknown filesystems in gparted. No partition is mounted and isn't possible via ubuntu gparted and also not via gparted live usb...
Any ideas?
Edit: Tried to write the 3 partitions with unknown filesystem to .img files, format the partitions, move them, write the .img files back and do the gdisk stuff.
This also didn't work, hekate says no fat32 partition recognized though I can mount it just fine in ubuntu...
...No idea how you moved the partitions with unknown filesystems, I read gparted doesn't allow this by default.
Click to expand...
Click to collapse
I didn't do anything special..
Post the output of gdisk o & p command from the recovery menu.
JaRocker said:
hey, I've been trying to get this done for some time now but I haven't has thought your guide would help me but I keep running into the same problem.
keeps telling me that it's unable to mount SD card
Click to expand...
Click to collapse
Post the output of gdisk o & p command from the recovery menu.
Any changes you make in gparted will require you to go back to gdisk and restore the hybrid MBR.
hey so i followed the guide before with 16gb and it worked great.
i'm redoing it with 64 gb and i can't get around the very first step of moving userdata to the end.
anytime i try to do anything to it i get a warning saying "moving a partition might cause your OS to fail to boot" which i didn't get the first time around.
then when i apply the changes, it immediately gets an error.
any suggestions for this problem? Thank you!
So i followed the guide and it works. Now i have some questions to further improve my current setup below:
256gb microsd with SX OS, Atmos, Android (No more swapping of cards).
My problem now is I cannot use SX OS to create hidden partition emunand as this will format the sd card and i will lose the android partitions and configs.
One option is file based partition but my preference is hidden partition so i can again use same emunand if i want to toggle between SX OS/Android/Atmos.
This is because atmosphere file based emunand is not stable as per devs and i also cannot get it to work using my SX OS file based partition.
I used atmos emummc but SX OS is not detecting it obviously.
The questions are:
1. For emummc, can i put that in front so it will be at sector 0X2 which i believe what SX OS config is looking for?
2. If i just use gpart to move the emummc partition in front do i need to repeat all the gdisk commands again?
3. If my aspiration is not possible at all then i will just stick with SX OS file based partition. Can i delete the atmos emummc and just extend the fat32 partition so i can reclaim space? Do i need to run the gdisk commands again?
~~Tito~~ said:
The flag for the main FAT partition needs to be 0C. Gdisk will be your friend.
Click to expand...
Click to collapse
Oh so flag is the mbr hex code, right? And you say it should be 0C? I will try that.
In the guide it says enter EE for mbr hex code.

[MOD] Storage Expansion for S4 Mini (microSD for /data)

------
TLDR
---
As most people know, 8GB is not enough for modern smartphones. With this mod, I provide a modified 'fstab' file and instructions on how to expand '/data' to install apps without root and in a universal way. All apps will install as if in internal storage.
Furthermore, given the old age of these phones, internal eMMC will progressively degrade until the phone dies completely. I have experienced going from 10MB/s writes, to 5, to 2 and then a completely dead phone. This extends the life of eMMC by only writing Android updates to eMMC and will improve responsiveness in phones with very worn eMMC flash.
This is work in progress (some slowdowns occur depending on the card), but I have been daily driving this mode for two months now. I have made adjustments so that the microSD stalls less than stock 'fstab' and EXT4 filesystem.
Example of 64GB card, w/ backup partition (p2) created, still 26GiB free for apps:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
---
THIS MAY DELETE YOUR DATA OR SOFT-BRICK YOUR PHONE. Be careful beforehand and backup your data to another microSD card.
IF YOUR PC HAS eMMC DRIVE, /dev/mmcblk1 MAY BE YOUR OS. Check before doing anything and after each reboot, as sometimes Linux reassigns them on machines with eMMC + card reader.
---
TODO/BUGS
---
- Used space will be messed up if you use more than one partition (can't be mounted as removable storage) but free space will be correct.
- Sometimes I have experienced reboots, with no data loss that I can find. I don't think it is related to this ROM mod.
- F2FS is still experimental and has no way to recover from a corrupted drive/card. If something goes wrong, your only option is to dump the files with PhotoRec software and try to recover what you can.
The data will be there but F2FS can't seem to recover from a damaged superblock.
I have used on one phone without issues for 3+ years but when there is SB corruption it can't recover.
- Push this to a 16.0 ROM, which is lighter on the RAM and has ambient display. (just personal preference) This requires a custom ROM.
---
HARDWARE
---
First you need a capable microSDXC card, I have only tested SanDisk Ultra A1 which are not perfect. SanDisk Extreme 64GB A2 class are probably good but please report performance if you try it. I only recommend this class of cards.
The problem with Sandisk Ultra is that sometimes they stall doing GC and the phone also stalls. This is quite random and will be worse if you use the phone for extended periods without time for background GC to run.
The advantages is they do some kind of wear-levelling and I am yet to see one of these cards die to wear out, despite being used on RPi machines 24/7.
SanDisk Ultra cards (A1 class) and most SanDisk USB drives have issues where they perform great when new but don't do proper garbage collection and will get very slow after a couple of days. So benchmarks look fine but real world it becomes really bad. I had a USB drive that only recovered to 5MB/s writes, that was the baseline, after three or four sequential wipes to most of the drive. These types of cards will also be very slow if you try them as adoptable storage.
Any microSD will work but choose a fast one and please help test different brands.
You also need a PC, preferably with Linux, and a card reader of any kind. This can be done in Windows through TWRP and ADB access but I don't recommend it.
---
BASICS
---
We will format the microSD card with one or two partitions. If you split it, you can do manual backups for the second partition but you can't mount it. Remember that by using /data on the SD card, you cannot use TWRP to backup to it. The modded '/data' partition will mount as a removable SD card in stock TWRP.
Download files:
Arco68's LineageOS 17.1 ROM
The new 'fstab' file from Pastebin: fstab.qcom.
Process flow:
Install 'adb' and enter TWRP mode to access shell,
Use fdisk to create a DOS partition table
Add a new partition with half or full size, starting at block 32768. Leave 1 or 2GiB space free and don't touch it with data. Some types of cards will be able to use these for better performance.
(OPTIONAL) Create 2nd partition right after the first one.
Change the partition(s) type to 'Linux' and spare space as 'Hidden HPFS/NTFS'.
Format partition(s) as F2FS (can also do ext4 but should be unusable),
After this, we will install arco68's 17.1 ROM and push a new 'fstab.qcom' file that will mount the microSD partiton as '/data' and the phone can use it to install apps and user data.
Encryption has not been tested and is not expected to work.
---
PREPARE microSDXC CARD
---
You should also format the card on a Linux PC if you can, as recovery has outdated f2fs-progs or not at all. The ROM has modules and will boot F2FS when instructed to do so.
Check that /dev/mmcblk1 is your microSD card reader BEFORE PROCEEDING! Otherwise, you may nuke your OS!
Do the procedure as listed before, first thing is to 'p' to check you are on the right microSD drive.
Then create the new DOS table and the partitions. This is for expert users only, at this time I will not post detailed fdisk commands.
The output from 'p' print command looks something like this:
Disk /dev/mmcblk1: 31.00 GiB, xxx bytes, 16252928 sectors
Disk model: Sandisk Ultra
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xZZZYYYXXX
Device Boot Start End Sectors Size Id Type
/dev/mmcblk1p1 * 32768 62947327 62914560 30G 83 Linux
/dev/mmcblk1p2 62947328 yyyyyyyy xxxxxx 900M 17 Hidden HPFS/NTFS
Click to expand...
Click to collapse
You have to manually type '62947328' for the start of the hidden partition. This is only required if you had put data on the card, upon which you should TRIM the unused blocks:
blkdiscard -v /dev/mmcblk1p2
Click to expand...
Click to collapse
If you have a partition to do backups, this moves to p3. Next we format p1 to use as '/data':
mkfs.f2fs -s 2 -z 1 -g android /dev/mmcblk1p1
Click to expand...
Click to collapse
Now we move the card into the phone.
---
ADB COMMANDS
---
This tutorial assumes you have arco68's LineageOS 17.1 from this ROM already installed.
You need to boot the phone in recovery mode by rebooting with VOLUME UP + HOME pressed, until you see 'recovery booting' on the top of the screen.
Next, mount the /system partition and push the new 'fstab' file from your PC:
adb push fstab.qcom /system/vendor/etc/fstab.qcom
Click to expand...
Click to collapse
After this is completed wait a few seconds, unmount system and reboot the phone. It should take a while for the first boot but you should see the setup screen and everything should be running.
If it is not booting, go to recovery or remove the microSD card and check if files are being created on the drive. If yes, everything seems ok. S4 Mini has a very long first boot, for some reason.
Enjoy your new S4 Mini storage of 32/64/128 GB!
RESERVED FOR microSDXC user reports.
I already have LOS 17.1 on my gt-i9192, is there any video tutorial to help out in the SDCARD mod process?
Not really. Are you familiar with Linux and formatting hard drives? If you are, it's mostly install the software and run the commands. You need to know how to find the sdcard device node in /dev (if it's sdX or mmcblk0/1, depending on the PC).
I can help you out or post a preformatted MBR file so you can just write it to the SDCard.
As my 18.1 phone has eaten it's eMMC, I think I'll do this on my next one. Have you used this with Magisk?
ivorget said:
As my 18.1 phone has eaten it's eMMC, I think I'll do this on my next one. Have you used this with Magisk?
Click to expand...
Click to collapse
I definitely recommend doing this then, as I had my eMMC also down to something like 2MiB/s sequential writes before it died - after a few months - and killed the phone completely.
I have never used Magisk nor really understand it's purpose. What would you want to accomplish?
so it's possible format microSD as EXT4?
Yes, it is but you would need to change the above FSTAB file entry for 'mmcblk1p1' from F2FS to:
/dev/block/platform/msm_sdcc.3/mmcblk1p1 /data noatime,nosuid,nodev,auto_da_alloc
I would advise you to not use EXT4 as that is usually more suited to flash with advanced FTL and even TRIM support.
tM&M said:
I definitely recommend doing this then, as I had my eMMC also down to something like 2MiB/s sequential writes before it died - after a few months - and killed the phone completely.
I have never used Magisk nor really understand it's purpose. What would you want to accomplish?
Click to expand...
Click to collapse
Sorry, just saw this now. Yeah I went and ahead and did on 18.1 and it's working great so thanks for making this guide. I guess it's not really necessary as it hasn't caused you issues but I also fixed the relevant userdata partition line in /vendor/etc/selinux/vendor_file_contexts.
A GPT partition table also works fine now, maybe was just lucky as I saw afterwards that was a recent fix lifted into our kernel. Using gparted and mkfs.f2fs from a recent linux system doesn't seem to have caused any issues either.
I'm using a V10 speed card which I think is about the speed of the original eMMC so should probably be the suggested minimum.
Magisk I use for root, mainly for a Tasker setup to tweak charging to extend battery life. I'll tidy it up enough to share at some stage.
Anyway I took a chance and Magisk does work on this setup too.
ivorget said:
Sorry, just saw this now. Yeah I went and ahead and did on 18.1 and it's working great so thanks for making this guide. I guess it's not really necessary as it hasn't caused you issues but I also fixed the relevant userdata partition line in /vendor/etc/selinux/vendor_file_contexts.
A GPT partition table also works fine now, maybe was just lucky as I saw afterwards that was a recent fix lifted into our kernel. Using gparted and mkfs.f2fs from a recent linux system doesn't seem to have caused any issues either.
I'm using a V10 speed card which I think is about the speed of the original eMMC so should probably be the suggested minimum.
Magisk I use for root, mainly for a Tasker setup to tweak charging to extend battery life. I'll tidy it up enough to share at some stage.
Anyway I took a chance and Magisk does work on this setup too.
Click to expand...
Click to collapse
If you can share the context file that would be great. I was having some issues with contexts but this was not MOD related - happened wit the stock ROM - and had to manually fix contexts on TWRP. So maybe that was the issue.
Do please post what card you are using and if you experience performance degradation after a couple of weeks. SanDisk cards are notorious for only running well the first couple of days as they don't have background GC and maybe are not suited to F2FS/EXT4 at all.
tM&M said:
If you can share the context file that would be great. I was having some issues with contexts but this was not MOD related - happened wit the stock ROM - and had to manually fix contexts on TWRP. So maybe that was the issue.
Do please post what card you are using and if you experience performance degradation after a couple of weeks. SanDisk cards are notorious for only running well the first couple of days as they don't have background GC and maybe are not suited to F2FS/EXT4 at all.
Click to expand...
Click to collapse
OK I've attached the file - remove the .txt extension. Search for mmcblk1p1 to see the changes - one line referencing mmcblk1p1 commented out and another line where the data partition is changed to that.
(Full disclosure: I'm using partition 4 so I didn't need to comment out the mmcblk1p1 partition line in my setup.)
Reminder that the file is for 18.1 (unless you find that it's the same for 17.1). And to be clear for anyone else reading the full path it goes under is:
/system/vendor/etc/selinux/
My SD card is a Kingston Canvas Select Plus. The package indicates Class 10 U1 so maybe better to say that as the V10 only appears on the card label.
I am a little concerned that the default android 3-day trim seems to be taking longer but I'll keep an eye on it:
$ logcat | grep -E 'trim |Trimmed'
02-04 06:50:34.969 191 9173 D vold : Starting trim of /data
02-04 06:51:09.778 191 9173 I vold : Trimmed 397697024 bytes on /data in 34799ms

Categories

Resources