How to force Link2SD to use internal SD as second partition? - Android Q&A, Help & Troubleshooting

Hi.
I own Chinese tablet based on MTK6582 and Android 4.4.2, I somehow managed to install drivers and root it. The device has only 8GB of internal storge and is so horribly partitioned that I can install apps only in 1GB and 4,62GB is internal storage. I tried repartioning - it was horrible idea, worked for only 1 week, tablet was crashing and I wasn't able to open any stock app. I had to restore original EBR files. Then I tried Link2SD (after using SDFix) and it works. However, my sdcard is quite slow (write speed 8 mb/s) so apps are quite slow too. I thought that I can use this internal SD Card as second partition and googled something about it. I tried to follow this tutorial http://www.modaco.com/topic/356349-using-link2sd-to-use-internal-sd-as-extsd but my install-recovery.sh contains only this
#!/system/bin/sh
# If you're implementing this in a custom kernel/firmware,
# I suggest you use a different script name, and add a service
# to launch it from init.rc
# Launches SuperSU in daemon mode only on Android 4.3+.
# Nothing will happen on 4.2.x or older, unless SELinux+Enforcing.
# If you want to force loading the daemon, use "--daemon" instead
/system/xbin/daemonsu --auto-daemon &
# Some apps like to run stuff from this script as well, that will
# obviously break root - in your code, just search this file
# for "install-recovery-2.sh", and if present, write there instead.
/system/etc/install-recovery-2.sh
(I have two install-recovery.sh files BTW)
This tutorial looks good too but probably my ROM does not support init.d scripts http://forum.xda-developers.com/showthread.php?t=2201192
So any ideas how to make Link2SD see my internal SD card as second partition of physical SD card?

Related

[Q] moving apps data file to external sd card

i would like to move the apps downloaded data file to external sd card
i have try app2sd but result is not promising
it does not move the data file (still in the internal memory or known as /sd)
i using script manager to help with the code as below
#!/system/bin/sh
sleep 60
mount --bind /sdcard/external_sd/gameloft/ /sdcard/gameloft/
or
#!/system/bin/sh
sleep 60
mount -0 bind /sdcard/external_sd/gameloft/ /sdcard/gameloft/
Click to expand...
Click to collapse
which one is correct?
for now gameloft is successfull at the moment
but if i use on other folder like from "ea" it is not successfull it tend to read back to the internal memory card which require me to redownload the data again
sometime it can read at external but once i restart, it fail again
if i got few app needed to use the command (currently gameloft, ea, lexi-comp) i wanted the data to stay in external sd card
should i create 3 different file for the script manager to run or i just create one single file and dump all 3 command into one single file?
your reply is very much appreciated
I try something similar with DCIM and MEDIA
I tried something similar with folders DCIM / Camera, Media and Music
I create a script with the script program manager and even try to get into the rc.d but I have not found a way to run at startup and run it from root explorer no problem but to run automatically at startup does not work
Use this http://forum.xda-developers.com/showthread.php?t=1410262

[Solved] Mounting ext. sdcard folders to int. sdcard

Hi folks,
As you know, the Sony media and video player didn't show the mp3 and videos on the external SD card in his library.
Now my idea was to mount folders of the external sdcard into folders on the internal sdcard.
Solution:
I created a script for mounting photo, video and music folders from ext. sdcard to the corresponding folders on the int. sdcard. After successful tests, I implemented init.d support on my Tablet S for a 'autostart' solution at boot time and moved the script to 'init.d' folder. For me it works great and fulfilled my requirements 100%.
Enclosed the content of my 'automount' script:
#!/system/bin/sh
# need sleep 75 for right timing maybe you can reduce it to 30
sleep 75
mount -o bind /mnt/sdcard2/Music /mnt/sdcard/Music
mount -o bind /mnt/sdcard2/Video /mnt/sdcard/VIDEO
mount -o bind /mnt/sdcard2/Fotos /mnt/sdcard/Pictures
Click to expand...
Click to collapse
Here you can find my [HOW_TO] for init.d support:
http://forum.xda-developers.com/showthread.php?t=1505340
P.S.: If it do not work for you, try to increase the sleep value. If you have a 'fresh' system 30 should be enough ... if you use two or three widgets 'sleep 75' could be ok ... and so on ...
I hope that someone has the technical knowhow how to do this, that would be great to access extra memory
also one interesting thing in build.prop:
Code:
ro.separated.external.storage=true
Would you try what happened if you change to "false"?
I found the same entry ... but do not know what it mean.
Saw the same thing myself, but don't have an SD card with me, so I wont get to try till I get home.
But I guess the change of the mount point in the /etc/svold.fstab is particularly promising. I still waiting for a rating of a expert. No one here?
Changed that line in true, rebooted.
Openend up Poweramp and this had to scan my folders again.
Sd Card still there and working but nothing more I think.
Can't really see if there's anything changed.
I tried:
Removing nosdcard from ro.build.characteristics
Changing ro.external.storage.removable to true
Changing ro.separated.external.storage to false
I haven't been able to see any difference.
Things I looked at:
The stock video player won't recognize videos on my SD card.
Videos on SD card will play if I navigate to them using Root Explorer
I can move apps to SD card using Titanium Backup, and play them from the SD card.
Anyone have some tips on what else I can look for?
50% Solution
Hi guys,
I tried a other way (and more secure) from a hint in an other forum.
If you use the following command with adb or a app like "scripter" on your tablet,
you will mount the external card into the internal, but step by step:
1. create a new folder /external_sd under /mnt/scard/
e.g. with adb shell : mkdir -p /mnt/sdcard/external_sd
2. then mount the /mnt/sdcard2 to this folder
e.g. with adb shell: mount -o bind /mnt/sdcard2 /mnt/sdcard/external_sd
3. now it is done and if you now refresh your media library, you will find all your media stuff on your media player.
Unfortunately you have to do the same after a reboot or switch off/on.
I am a little bit afraid to add this command line in init.rc or something else.
Do one of you have a proposal how we can make it permanent, without a risk?
obicom said:
Hi guys,
I tried a other way (and more secure) from a hint in an other forum.
If you use the following command with adb or a app like "scripter" on your tablet,
you will mount the external card into the internal, but step by step:
1. create a new folder /external_sd under /mnt/scard/
e.g. with adb shell : mkdir -p /mnt/sdcard/external_sd
2. then mount the /mnt/sdcard2 to this folder
e.g. with adb shell: mount -o bind /mnt/sdcard2 /mnt/sdcard/external_sd
3. now it is done and if you now refresh your media library, you will find all your media stuff on your media player.
Unfortunately you have to do the same after a reboot or switch off/on.
I am a little bit afraid to add this command line in init.rc or something else.
Do one of you have a proposal how we can make it permanent, without a risk?
Click to expand...
Click to collapse
I will check it for you if you want but after work, evening
These are good news
I am sure for you it is a "child's play", but I think helpful for all of us.
Please let me know if I can test something ...
THANKS IN ADVANCE !
-- Edit --
Maybe we can add this command to rescan media files after mount command:
mount -o bind /mnt/sdcard2 /mnt/sdcard/external_sd
pm enable com.android.providers.media/com.android.providers.media.MediaScannerReceiver
Click to expand...
Click to collapse
50%...............phew, getting closer, keep up the good work chaps.
http://www.androidtablets.net/forum...cation-discussion-post-root-2.html#post149151
Maybe this helps?
Good find there. Wonder if the Vizio is similar to the Sony.
Link2SD
If you want app data to be moved to external sd Link2Sd works but with a few extra steps only. Here is how I manage this on mine.
Installed Link2SD on tablet.
Formatted external card (in my case a 32GB microsd in an SD adapter) on my laptop using EASEUS to have to PRIMARY partitions 1st in FAT32 and second in EXT3 formats.
At first Link2SD does not recognise any ext partition present and if I try to recreate mounting script on it telling it EXT3 format it says something like could not do, directory does not exist or similar.
Then after a reboot Link2sd warning pops up saying the sd card was not mounted at boot and therefore the system did not load apps on it. You have an option to recreate a mounting script (which I did not need to do as did it already previously) and the quick reboot option (which is different from the regular reboot in the way that it only restarts the android interface not the whole hardware) - so I do this reboot and after everything starts you can see the extra partition and use it.
So currently quick reboot is needed after every total shutdown of the tablet - thankfully I almost never shut down the tablet completely unless run out of battery completely or some other rare reason or testing like this one.
Also note that quick reboot sometimes gives a close/wait warning just after it is done - I always chose wait and everything seemed ok after that.
Make sure you give Link2sd superuser permission. I decided to leave out Lib out of the app data I link because I noticed that if I move data back to internal storage link2SD shows that libs are unlinked already/ I know there is an option in link2sd to relink libs at boot but I was not able to confirm if it works and they tend to take little space internally anyway.
Regarding extra partition size I tried less than 1GB and ca 14Gb. With bigger than 1GB partition it seems to recognise its size in link2sd but once you move more than 1gb data to it does not reflect the increase above 1gb but still seems to make the apps I moved before and after that work still.
I wonder if multi mount widget could help when combined with link2SD somehow. My guess best solution would be to make android mount external card early in its boot.
Hope it helps
I tried today several things ....
@ps3taker
that sound a little bit more complicated then my solution with app scripter and the mount command.
I tried today several things to get a "autostart" solution but unfortunately without success:
- App "autostart (root)" don't work on Tablet S
- Change in svold.fstab need sd card eject and insert to be mounted after rboot
- Change in vold.fstab need sd card eject and insert to be mounted after reboot
- Add mount command in init.goldfish.sh don't work
- Startup script tweaks can't work, no "/system/bin/playlogosnow" on Tablet S
(http://forum.xda-developers.com/showthread.php?t=813309)
Someone additional ideas for a autostart option for the mount command?
-- Edit --
I did a little bit more investigations and find out, that after a reboot it needs a short time before the internal sd card is ready to use. Therefore it is senseless to search a solution during boot time. I guess this is the reason why the change in svold.fstab and vold.fstab didn't work.
That means we need a "autostart" App, as a Widget or a Virus scanner that mount the device and rescan the medias. Who is willing and to do that for us?
just create an init.d script and symlink the ext_sd folder to the desired folder on sdcard...
check if this device has:
/system/etc/install-recovery.sh
if it doesnt then check if the /init.rc (or other init.*.rc) files contain the text "install-recovery.sh"
if the text exists then just create the file /system/etc/install-recovery.sh which has the following at the top:
Code:
#!/system/bin/sh
followed by the symlink/bind code
and save file and give it 777 permission (chmod 777 /system/etc/install-recovery.sh)
that should automatically run the desired commands at each boot...
if the above is not possible then just create a GScipt script and execute it at startup
DooMLoRD said:
just create an init.d script and symlink the ext_sd folder to the desired folder on sdcard...
Click to expand...
Click to collapse
Hi DooMLoRD,
symlink will not work - because of fat32 sdcard! We've got to use mount -o bind, it works without problem, about autorun thing - thanks - i've got to try it
br
condi
@DooMLoRD & Condi
I did exactly this in my tests before, with the "install-recovery.sh".
The file "/system/etc/install-recovery.sh" don't exist but the the "init.rc" files contains the text "install-recovery.sh".
So I created the file "/system/etc/install-recovery.sh" with the commands:
#!/system/bin/sh
mount -o bind /mnt/sdcard2 /mnt/sdcard/external_sd
Click to expand...
Click to collapse
and give it 777 permission but unfortunately it dosen't work.
I guess the reason is the timing problem, that sdcard mount is not ready in this moment. I will try tomorrow add first the mount command for "/mnt/sdcard" in this file and will see what will happen.
Keep you informed.
thank you all for trying.
Could you please summarise what works currently please.
a) Do you manage to link apps to external sd as in rooted gingerbread?
b) or is it just for showing external sd media in the native player in a separate subfolder or something similar
c) do you manage to swap around external and internal sds, i.e. mnt\sdcard is now external as on gingebread and mnt\sdcard2 is the built-in/internal one
I think all of the above is useful but would like to know what's the initial plan.

Need help to swap desire x dual SIM

Dear All
I could able to create swap partition on my phone SD card using AParted.
Now, I want to make use of that by creating swap file.
I tried to use swapit script which I found in some other thread.
The script says swap can be done and I was given few options
1. Create swap in SD card
2. Create swap in internal memory
3. Create swap in system memory
4. Choose own location
I was unsuccessful with 1,2,4 and fortunately successful with option 3
It says success. I rebooted my phone and run free in emulator which given me 0 and 0.
Im not sure what went wrong.
But I feel my mobile is faster after doing this exercise..not sure if its my myth
Can you please let me know how can I implement swap for my phone..
Is swap working fine through it is showing 0 in terminal emulator
Your help is very much appreciated.
Thanks for your help in advance
Any update..pleaseeeeeee
Swap partion only applies for one boot, don't reboot afterwards, so you will have to run the script at the beginning of every startup. Also keep in mind you cannot mount a swap partion at boot(i.e via init.d script), as the sd card is often not mounted at that point. I also do not recommended making a physical partion on your sd card, instead you should be using an image file(a random one will do). Here's the commands to make things easier:
To create a swap image:
Code:
touch /sdcard/swap.img
dd if=/dev/zero of=/sdcard/swap.img bs=1024k count=262144
mkswap /sdcard/swap.img
This creates a 256mb image
To mount image(This one is the one to be run at startup)
Code:
su
swapon /sdcard/swap.img

[HOWTO] Use external SD card as internal storage in KitKat

Beware, this guide is more or less untested, it will interfere with stuff like memory encryption and OTA or other firmware updates. You have been warned, I assume no warranties for bricked phones, SD cards or lost data.
Many cheap-ass Mediatek phones ship with Android 4.4.2 or later and only ridiculous amounts of internal storage (2GB in my case, CAT B15Q). That may be enough for basic apps, but as soon as you install Navigon or other data-heavy apps (or WhatsApp with a load of videos) you're going to run out of space in no time - and because Google is a bunch of fools, they disallowed app installations to SD cards entirely in 4.4!
So, we're going to move /data in its entirety to our nice huge SD card and be able to use even bigger apps on small phones. It might be possible that this guide works on other phones, but that depends on how they boot and where the fstab and init.rc reside!
Prerequisites:
Mediatek-based 4.4.2 or later phone with root access in recovery (boot it in recovery, run adb shell, therein run id. If it says root, all fine. If not, install CWM)
A large enough SD card (I chose a 32GB card with a 50:50 split between /data and the "external sd card")
Solid Linux knowledge, one Linux PC and one Windows PCs. I urge you to NOT use any kind of VM unless you have experience with USB passthrough.
spFlashTool and the Mediatek drivers from http://forum.xda-developers.com/general/general/stock-rom-cat-b15q-rom-development-t2988774, for a flashing guide see http://forum.xda-developers.com/android/help/howto-firmware-flashing-cat-b15q-t2989627
mtkdroidtools from https://www.androidfilehost.com/?fid=23501681358558543 on the Windows PC
mtk-tools from https://github.com/bgcngm/mtk-tools on the Linux PC (no, Cygwin does not work, it messes up the permission bits), cloned on an ext4 partition (not sure if ext2/3 can handle the extended permission bits...)
a network connection between the PCs or a USB stick to transfer files
Take the sd card out of the phone and insert it into your computer. Many laptop SD slots don't like SDXC (>4GB), you might need e.g. a Huawei 3G stick or a SDXC-compatible USB dongle.
Repartition the SD card using Acronis Disk Director, gparted or whatever you're familiar with. The first partition must only be resized (this is the FAT partition), the second partition is a ext4 (!) partition. Both MUST be primary partitions. Acronis and other tools on Windows might require a reboot to repartition SD cards. I recommend a 50:50% split, but if you're heavy on apps or their data, you might go for a 25% FAT: 75% EXT4 split.
Boot your phone into recovery, connect to it with adb in a root shell.
Assuming your data partition is at /dev/mmcblk0p8 (look in /fstab to find it out, followed by mount /data and ls /data to verify), execute the command "dd if=/dev/mmcblk0p8 of=/dev/mmcblk1p2", wait until it is finished. This can take up to ten minutes or more, depending how much data there is.
Shut down the phone, take out battery and SD card.
Insert the SD card into your Linux machine, run resize2fs /dev/sdb2 (or wherever the ext4 sd card partition ended up, check it in dmesg) as root so that the filesystem grows; then eject the SD card and put it back into your phone
Readback your BOOTIMG partition, transfer it to the linux PC (or, if you already have a boot.img for your current firmware, use this one)
On the Linux PC, open a rootshell (to avoid permission issues when building the ramdisk).
Run "./unpack-MTK.pl /path/to/bootimg"
"cd boot.img-ramdisk" (directory might be named different, depending on how you named the bootimg dump file)
Using a text editor, edit the "fstab" file(s) (there might be multiple, with suffixes): From (adjust if needed)
Code:
/[email protected] /data ext4 noatime,nosuid,nodev,noauto_da_alloc wait,check,encryptable=footer
to:
Code:
/dev/block/mmcblk1p2 /data ext4 noatime,nosuid,nodev,noauto_da_alloc wait,check,encryptable=footer
Now, edit the init.rc file (beware, other .rc files in the ramdisk root might also contain mount commands!).
Search for "on fs_property:ro.mount.fs=EXT4" and again replace /[email protected] (or whatever the node for /data had been) with /dev/block/mmcblk1p2 in the commands in this block (should be fsck, tune2fs,ext4_resize and mount).
Repack the boot image: ./repack-MTK.pl -boot boot.img-kernel.img boot.img-ramdisk/ /path/to/newboot.img
Transfer newboot.img to the Windows PC and flash it using spFlashTool
boot your phone, look in Settings->Memory to see if it went OK!
If the memory view didn't change, also modify the other blocks of on fs_property, in case your device does not use an ext4 rootfs (but yaffs or ubifs instead).
Functionality
It is a good idea, but
Are I still have part of it as external storage?
If yes, it means I can not remove it because there are some apps used it.
If no, it means I will not have external storage anymore!
e.ahmedmahfouz said:
It is a good idea, but
Are I still have part of it as external storage?
If yes, it means I can not remove it because there are some apps used it.
If no, it means I will not have external storage anymore!
Click to expand...
Click to collapse
The SD card is now both internal and external storage! You are not able to remove it because else your system will not boot anymore.
harddisk_wp said:
The SD card is now both internal and external storage! You are not able to remove it because else your system will not boot anymore.
Click to expand...
Click to collapse
what if the sd card is damaged ?
Can my phone boot again..or will booltloop
madthinker said:
what if the sd card is damaged ?
Can my phone boot again..or will booltloop
Click to expand...
Click to collapse
If you manage to kill your sdcard while you have my sdcard hack installed, then the phone will bootloop until you insert a new sd card partitioned just like the old one. Then it will act like you had factory-resetted it.
Alternatively you can always reflash original boot.img/recovery.img and use the phone with limited internal memory.
harddisk_wp said:
If you manage to kill your sdcard while you have my sdcard hack installed, then the phone will bootloop until you insert a new sd card partitioned just like the old one. Then it will act like you had factory-resetted it.
Alternatively you can always reflash original boot.img/recovery.img and use the phone with limited internal memory.
Click to expand...
Click to collapse
i see, thanks to explain me :good:
There is another way to get more space: Link2SD (2.- euros) with a second partition on your external SD-card exactly like shown above (ext4 partition, primary).
The advantage is, that if the sdcard is faulty the system still runs, just the apps which are symlinked to the ext4 partition won't run.
So I use this for all these not absolutely important apps which needs lots of internal memory, e.g. kindle bookreader, Amazon, WhatsApp etc. I dont use it for all apps, most importantly not for any app, where there is no alternative. Last week my two years old 64 GB MicroSD card (SanDisk, with warranty 10 years) in my SGS4 stopped working and this could happen all the time. They are not that reliable I think, that I would put my system on it.
I did this now with the Cat B15Q of my friend.
EDIT: and she has now more than 1 GB free internal space
I think this is the best solution, 2 GB for the pure ROM and the system apps is more than enough and all user apps go to the external sd-card (2nd partition).
good day!
hope you can help me.
what if i want vice versa? because my phone's default storage (0) is sd card.and i want my default storage will be its internal since it is 32gb rom. tried all ways but i think the answer is its boot.img. thank you..hoping for a help

[MOD][STOCK] Int2Ext.mikewse for Xperia 2011 Stock ICS firmware

ABOUT
This is a solution for the dreaded warning about running low on internal memory on 2011 Xperia phones. My own Xperia Mini Pro has only 420MB of internal storage and this fills up quickly when installing apps. In this post I provide instructions and scripts to use the external SD card to extend the available internal storage, a so called “int2ext” solution which there are many flavours of.
The goal has been to solve the storage problem while at the same doing as small changes as possible to the system as possible (not unlocking bootloader, not installing custom recovery, etc).
Note that when the SD card is used to extend internal storage you should never power on the phone without the SD card inserted. Failing that you will probably need to factory reset and start over with the installation.
The whole 2011 Xperia range should be compatible, maybe other devices too.
BACKGROUND
After trying (and failing) with a number of the other solutions for enlarging internal storage with the external SD card, I've made my own solution that works on the Xperia Mini Pro (XMP) stock ICS ROM. In the second post I describe some properties of my implementation that may count as advantages for some, YMMV though.
COMPARED TO OTHER SOLUTIONS
See second post for technical description.
PREREQUISITES
Sony-Ericsson stock ICS ROM installed on your phone (you don’t need unlocked bootloader, recovery or any other mods)
Remove any other similar apps or tweaks (Link2SD, Apps2SD, INT2EXT etc) as they may interfere with this implementation. The installation script will abort if any of these are found.
USB Debugging enabled in your phone’s Developer settings.
Micro-SD card to install in the phone’s SD slot.
Cydia Impactor (optional)
Download from http://www.cydiaimpactor.com/.
Flashtool (optional)
Download from http://www.flashtool.net/. I have used version 0.9.18.6 which worked fine for the XMP while 0.9.20.0 had some problems. I have been told this has been fixed in 0.9.21.0 but have not verified it myself.
DOWNLOAD SCRIPTS
You find zip files as attachments at the bottom of this post.
INSTALLING
Check current firmware CDA (optional)
It is good to have a record of the exact firmware variant and version currently installed in case you need to flash back the stock ROM.
Go to the right place in the phone’s service menu:
open Phone Dialer
dial the secret code appropriate for your phone (for XMP it is *#*#7378423#*#*)
go into Service Info
go into Software Info
Note down the CDA number shown under the Customization Number heading
(see also http://www.hanfei.name/what-is-cust...xperia-device-and-how-to-view-or-find-it.html)
Partition your SD card
Your SD card should be partitioned as an MBR disk with (at least) two primary partitions:
The first partition should be formatted as FAT32 and will become your new (and smaller) SD card storage that you seen when connecting the phone to a computer.
The second partition should be formatted as Linux Ext2 and will become your extended internal storage.
You can have more partitions after these but these scripts will only care about the first two. I use a 16GB SD card and split even with 8GB to each partition.
There are many ways to perform the partitioning; I put the card in the SD slot on my computer and use the Minitool Partition Wizard Free Edition (http://www.minitool.com/partition-manager/partition-wizard-home.html) under Windows. For kicks you can install it using the Chocolatey auto-installer (https://chocolatey.org/packages/partitionwizard) if you like. You have more info about Minitool and other tools here:
http://forum.xda-developers.com/wiki/index.php?title=SD_card_partitioning
Note 1: Remember to set that partitions should be primary as some tools may default to logical and not primary partitions.
Note 2: You probably want to copy all your SD card files to your computer while partitioning and formatting, and copy them back after, as all data will be erased on the SD card.
Prepare your phone
Insert the partitioned SD card.
Enable USB debugging in Developer settings.
Have a USB cable ready for connecting between your phone and computer.
Root
If you have already rooted you can skip this step. All you need is the su binary on the system - you don't need the SuperSU app installed.
I use Cydia Impactor to root:
connect phone
select "# drop SuperSU su to /system/xbin/su"
click Start
(see also http://forum.xda-developers.com/showthread.php?t=2399464)
You can verify that it worked by opening a root shell.
I do this from Cydia Impactor:
menu Device > Open Shell…
type “su” at the prompt
type “id”
“uid=0(root)” should be shown
Update Busybox
The existing Busybox on the XMP is too old and will not support the way directories are mounted here. I have used Busybox 1.22.1 so I highly recommend that you install this version using the procedure below. If you already have this or a higher version installed you can skip this step but please verify that you have all the needed applets in your Busybox binary by checking against all the busybox aliases at the top of my scripts.
I use Flashtool to upgrade Busybox:
connect phone
Device menu > Install busybox
choose version 1.22.1
Install init.d support
The stock ROM does not have init.d support so we need to add it. If you have already added init.d support using some other software then you can skip this step.
Unpack the init.d.mikewse-<nn>.zip file to a directory (f ex init.d.mikewse) on your SD card.
Open a root shell on the phone using Cydia Impactor:
menu Device > Open Shell…
su
Install by running the install script:
Code:
sh /sdcard/init.d.mikewse/install.sh
You can verify the installation by checking the existence of the init.d directory:
Code:
ls -d /system/etc/init.d
The init.d function will be active after the next reboot and you can see messages from it in the kernel log:
Code:
dmesg | grep init.d
Install int2ext support
Unpack the int2ext.mikewse-<nn>.zip file to a directory (f ex int2ext.mikewse) on your SD card.
Open a root shell on the phone using Cydia Impactor:
menu Device > Open Shell…
su
Install by running the install script:
Code:
sh /sdcard/int2ext.mikewse/install.sh
You can verify the installation by checking the existence of the int2ext boot file:
Code:
ls /system/etc/init.d/40int2ext
The int2ext function will be active after the next reboot and you can see messages from it in the kernel log:
Code:
dmesg | grep int2ext
You should also be able to see the new larger size of your storage in the Storage menu of system settings.
Tweak what’s put on the SD card
The default int2ext script is set up with a good compromise between what files are delegated to the SD card vs are kept in the original location in internal storage. Apk files and app data are delegated to the SD card while unpacked app code (dalvik-cache) is kept on internal storage for speed and availability.
If you are installing a large number of apps your dalvik-cache may grow too large for internal storage. You can check how much it has filled up from a root shell:
Code:
df /mnt/int-stor
and also see how much of this is due to files in dalvik-cache:
Code:
du -s /mnt/int-stor/dalvik-cache
If you are hitting the limit then you can configure delegation of dalvik-cache to the SD card:
open a text editor with the 40int2ext file that you unzipped to the SD card in the int2ext.mikewse directory
edit the line
Code:
EXTDIRS="app app-private data"
so it becomes
Code:
EXTDIRS="app app-private data dalvik-cache"
then reinstall int2ext by running the install script again
REFLASH STOCK ROM
If you want to start from fresh or need to recover from some failure in the installation then you can flash back the stock ROM using Flashtool.
First let Flashtool download and assemble the appropriate stock ROM for you:
click XperiFirm icon in toolbar (furthest to right)
select your phone model
select the appropriate CDA (collected at the beginning of this post)
click the release info in the right pane to start download
Then flash it to the phone:
click Flash icon in toolbar (furthest to left)
choose Flashmode
follow instructions (for XMP press Volume Down)
If you have any questions or problems regarding Flashtool there are lots of threads on XDA were you can find solutions about drivers etc.
CREDIT / INSPIRATION / OTHER ALTERNATIVES
Extend internal storage
CronMod-INT2EXT http://forum.xda-developers.com/showthread.php?t=1716124
Int2ext fixed for Xperia mini http://forum.xda-developers.com/xpe...fix-loosing-network-flashing-int2ext-t3039205
Link2SD http://forum.xda-developers.com/showthread.php?t=919326
Apps2SD http://forum.xda-developers.com/android/apps-games/apps2sd-partition-sd-card-link-apps-to-t3122919
Mounts2SD http://forum.xda-developers.com/showthread.php?t=2432479
init.d support
init.d Terminit http://forum.xda-developers.com/showthread.php?t=1933849
init.d for stock ROM http://forum.xda-developers.com/showthread.php?t=1417375
Bye now and hope it works well for you
DEVELOPER INFO
If you publish a modified version of these scripts or include them in a ROM then please give credit by linking to this thread.
GOALS AND TECHNICAL DESCRIPTION
Here's a few thoughts that have influenced the implementation:
Working for autostart apps, widgets etc
I have seen mentions that Link2SD and others have problems with redirecting widgets and other types of early-start apps. I have not seen this myself and suspect this may have to do with other factors (f ex doing install steps in the wrong sequence may bork your installed apps).
Anyway, I have verified that my solution works with all apps (early-start, system and downloaded) on the XMP.
No extra bells and whistles
Many of the available solutions add extra "nice to have" features to make scripts more universal or maybe optimize speed on some devices. I actually ran into problems with some of these optimizations on the XMP so deciced to only perform what is exactly necessary on the XMP and nothing else. This script only performs mounting of partitions and moving of files therein.
Mount the /data base directory on external SD card
Several other solutions keep /data mounted on internal storage and just redirects /data/app and others to the SD card. That is good in theory but at least on the XMP this causes you to still get warnings that storage is full as the phone detects that your apps take up more space than fits in /data. With my solution the phone will see the enlarged /data partition and will f ex report this correctly in the Storage menu.
Keep most /data subdirs uninterrupted on internal storage
There are some critical directories on /data that should be available without interruption from boot and onwards. Having these come and go during startup can lead to different problems such as signal loss (correlated to /data/radio). To avoid surprises this script only keeps the typical hogger directories app, app-private and data on the SD card and rebinds everything else back to internal storage in one rbind-mount command that eliminates interruption of these subdirs.
If you want you can customize which /data subdirectories are used on the SD card by simply editing the EXTDIRS variable in the 40int2ext script. Existing files will be moved accordingly on the next boot.
Simple install script run from terminal instead of flashing from recovery
Stock ROM doesn't have recovery with flash function so I have instead made simple install scripts that you run from the Android shell.
Follow standard principles
Like several other solutions this script hooks the debuggerd binary as that seem to be triggered earliest during startup. I also look for installations of other solutions and will abort if any are found as that could lead to problems.
Naming is kept similar to other solutions apart from the strange habit to use "sd-ext" as the name for internal storage. In my implementation internal storage is mounted to /mnt/int-stor and the external SD card to /mnt/sd-ext.
CHANGE LOG
1.0 (2016-05-03)
Inital version

Categories

Resources