there are already similar method to save our internal memory such as: link2sd, a2sd darktremor, amarullz, and my previous data2sd method. those method is quite popular and I believe you're using one of them now. some of you might also already use my data2sd method which used a script in init.d to mount sdcard ext partition to /data or use my data2sd kernel. however, both that methods have several bugs. in my data2sd kernel, script manager doesnt work. while if you use script in init.d, some 3rd party gps app like ndrive won't work. thats not a big deal if you're using gmaps, but its a lil bit frustrating for me since I hate to use gmaps app. so, I was experimenting with some other script several days ago and find a new method to overcome the bug from my previous method.
in this method, we use similar method with a2sd darktremor and amarullz but its a lot simpler. my method will mount sdcard ext partition on /system/sd then replace the partition on /data/app, /data/dalvik-cache, and /data/data with the one in /system/sd.
the link
http://d-h.st/JV4
Click to expand...
Click to collapse
pre requirement:
1. good sdcard with ext3 partition
2. kernel with init.d support
3. cwm
4. luck
preparation step
1. copy cwm and my script on your sdcard
2. with your terminal emulator type
Code:
su
mount -t ext3 /dev/block/mmcblk0p2 /system/sd
3. with your explorer go to /data. copy everything inside it to /system/sd
4. unmount your ext partition "umount /system/sd"
5. go to recovery.
6. flash my script via cwm.
7. reboot.
I made this tweak as a modular stuff. it consist of 1 script used to mount the ext partition and the other three script used to mount the partition on /data. in this way, you can get four mode.
- a2sd mode (cache2sd-data2sd) --> delete 01akuro2_app (to activate cache2sd only, delete 01akuro4_data)
- amarullz-like mode --> delete 01akuro3_dalvik
- akuro mode --> delete nothing
- old data2sd mode --> delete 01akuro2_app, 01akuro3_dalvik, 01akuro4_data. make a new script "01akuro5_adata" contain
Code:
#!/system/bin/sh
mount -o bind /system/sd /data
notes:
1. I highly recommend to install my script on fresh installed rom
2. a2sd, amarullz, data2sd script and link2sd will conflict with this method
3. this mod only works on ext3 partition. you'll need to modify the script by yourself if you're using another partition type
Click to expand...
Click to collapse
credits:
1. amarullz for the idea
2. irfanbagus n savie
3. all xda member here
TERM OF USE AND SHARING:
this thread intent is for sharing. feel free to use, edit, distribute all material inside this thread which came from me. if there any parts of this mod which comes not from me please refer to the original dev I've mentioned in this thread. if want to share it to another forum or modify it you don't have to ask my permission. no need to credits, put links or whatsoever. you'll only need to remember that you should held all the responsibility by using this mod, modify it or distribute it. DO IT WITH YOUR OWN RISK
Click to expand...
Click to collapse
updates and changelog:
v2.0 : http://d-h.st/HB4
installation procedure:
- flash this file via CWM
- reboot. check /data/kuro_akuro.log if the app and dalvik succesfully mounted copy /data/data to /system/sd.
- reboot your device.
changelog:
v1
- first release project. link in 1st post
v2
- log system. check /data/kuro_akuro.log
- semi automated system. app and dalvik cache auto move. data should be manually copied to /system/sd after reboot.
- auto mount for all type partition
- aroma installer
Click to expand...
Click to collapse
Tweeekerss...
Good job...
haha...its just a side project. I still don't have a linux environment yet, so I was experimenting with several tweaks. here is one of the result. I think I'll need your help when I've setted up my system :3
Reserved
Sir kurotsugi, Can you make this and other tweaks of your built in in one kernel? I think it is easier for newbies to flash a kernel than to go over the steps above -just a thought.
BTW, Good work!
Added to Samsung Galaxy Young for Dummies 2nd Edition - New Users Start Here under Guide to Tweaking and Modding
kurotsugi said:
haha...its just a side project. I still don't have a linux environment yet, so I was experimenting with several tweaks. here is one of the result. I think I'll need your help when I've setted up my system :3
Click to expand...
Click to collapse
Something for me to include in my next update
Btw, use wubi.That's a good method to install linux.I've setup the linux environment today:good:
Wow thanks for the great guide.......
Sent from my GT-S6102 using Tapatalk 2
CarlDeanCatabay said:
Reserved
Sir kurotsugi, Can you make this and other tweaks of your built in in one kernel? I think it is easier for newbies to flash a kernel than to go over the steps above -just a thought.
BTW, Good work!
Added to Samsung Galaxy Young for Dummies 2nd Edition - New Users Start Here under Guide to Tweaking and Modding
Click to expand...
Click to collapse
not everyone want to have those tweak on one flash file. sorry.
b16h22 said:
Something for me to include in my next update
Btw, use wubi.That's a good method to install linux.I've setup the linux environment today:good:
Click to expand...
Click to collapse
I'll consider that option. the problem is that I don't have any distro linux on my comp at this moment. (lol)
manoranjan2050 said:
Wow thanks for the great guide.......
Sent from my GT-S6102 using Tapatalk 2
Click to expand...
Click to collapse
this is the method I've discussed with you via PM several days ago. you can extract it and see inside it. amarullz works in backwards. it mount ext partition in /data then mount dev/block/bmlXX (the data partition) to /sd-ext. after that it mounts /sd-ext/dalvik-cache and /sd-ext/data to /data.
Is it okay to use this method on a class4 sd card . So far i have been using link2sd only , never tried other options under the impression that they might require class 10 or something.
yup...you can use it but your phone will get laggy afterwards.
I will try this. Thank for yur post
Sent from my GT-S5360 using xda premium
it is not good. It is takes my internal memory. Like, before install apps memory was used 61.4mb. After 4apps installed memory 64.9mb
Sent from my GT-S5360 using Xparent ICS Blue Tapatalk 2
yup it still use internal memory for system data and log. check into /system/sd to see if you can find files like in /data. if you can find them it means its installed correctly. go to /data, clean your log files, tombstones, and dropbox files.
kurotsugi said:
yup it still use internal memory for system data and log. check into /system/sd to see if you can find files like in /data. if you can find them it means its installed correctly. go to /data, clean your log files, tombstones, and dropbox files.
Click to expand...
Click to collapse
fix it. Thanks
kickthefreak said:
how to turn off this script so i can access my MicroSD and transfering files ?
or any idea so i can entering microSD.
Click to expand...
Click to collapse
fix it. Thanks.
this is the new script for akuro. its still in beta and not yet released to public. can anyone see into this and give me some suggestion?
Code:
#!/system/bin/sh
# kuro akuro: new data2sd method
# [email protected] (2012) - lol...i'm just joking. no copyright or whatsoever
# contact : [email protected]
# v.1 - first release
# v.1.1 - automated system, new build,
LOG_FILE=/data/kuro_akuro.log
if [ -e $LOG_FILE ]; then
rm $LOG_FILE;
fi;
# the preface
echo "==========================
# TWEAK AKURO-LOG FILE #
==========================
in the name of Allah,
the most beneficent,
the most mercifull
==========================
system information:
vendor : $( getprop ro.product.brand )
model : $( getprop ro.product.model )
ROM : $( getprop ro.build.display.id )
running the script...
start at:
$( date +"%m-%d-%Y %H:%M:%S" )
==========================" | tee -a $LOG_FILE;
# unmount sdext if mounted
umount /system/sd
# fix sdcard speed
if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]; then
echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
echo "fix sdcard speed tweak [OK]" | tee -a $LOG_FILE;
fi;
# create sdext dir in /system
if [ ! -e /system/sd ]; then
echo "WARNING!: no sdext dir
please create dir /system/sd" | tee -a $LOG_FILE;
fi;
echo "SDEXT directory check [OK]" | tee -a $LOG_FILE;
# mount sdcard all type
busybox mount -o noatime,nodiratime,nosuid,nodev /dev/block/mmcblk0p2 /system/sd;
mountext=`busybox mount | egrep 'ext2|ext3|ext4'`;
if [ -n "$mountext" ]; then
chown 1000:1000 /system/sd;
chmod 771 /system/sd;
fi;
echo "akuro: sd-ext mount [OK]" | tee -a $LOG_FILE;
# create the directories
if [ ! -e /system/sd/app ]; then
mkdir /system/sd/app;
mv /data/app/* /system/sd/app;
fi;
if [ ! -e /system/sd/dalvik-cache ]; then
mkdir /system/sd/dalvik-cache;
mv /data/dalvik-cache/* /system/sd/dalvik-cache;
fi;
echo "akuro: preparation step [OK]" | tee -a $LOG_FILE;
# mount sd to data directories
mount -o bind /system/sd/app /data/app;
chown 1000:1000 /system/sd/app;
chmod 771 /system/sd/app;
if [ -e /system/sd/app ]; then
echo "akuro: app mount step [OK]" | tee -a $LOG_FILE; else
echo "akuro: app mount step [FAIL]" | tee -a $LOG_FILE;
fi;
mount -o bind /system/sd/dalvik-cache /data/dalvik-cache;
chown 1000:1000 /system/sd/dalvik-cache;
chmod 771 /system/sd/dalvik-cache;
if [ -e /system/sd/dalvik-cache ]; then
echo "akuro: dalvik mount step [OK]" | tee -a $LOG_FILE; else
echo "akuro: dalvik mount step [FAIL]" | tee -a $LOG_FILE;
fi;
if [ -e /system/sd/data ]; then
mount -o bind /system/sd/data /data/data;
chown 1000:1000 /system/sd/data;
chmod 771 /system/sd/data;
fi;
if [ -e /system/sd/data ]; then
echo "akuro: data mount step [OK]" | tee -a $LOG_FILE; else
echo "akuro: data mount step [FAIL]" | tee -a $LOG_FILE;
fi;
sync;
# end
echo "==========================
done at:
$( date +"%m-%d-%Y %H:%M:%S" )
all praise is due to Allah
==========================
-- have a nice day --
[email protected]
==========================" | tee -a $LOG_FILE;
Thanks, lets see if i could use it..
post updated. link on 2nd post.
Aroma... mmm... smell good... lol...
seeMyDOT !!!
aroma...i hope they know how to use it (lol)
btw, my init.d method have several limitation. your a2ad doesn't work in my kernel. this project is still not finished. the script still contain several bug including:
- wrong syntax @ unmount command (forgot to change it when upload it)
- ext4 can't be mounted
- can't create /system/sd folder when it doesn't exist
- can't move /data/data partition automatically (kernel limitation. only in my kernel. init.d method failure)
- app and dalvik cache not moved if sdext have both folder.
Related
many of you, including me, may find that it's time consuming to rebuild the kernel even for minor changes to init.rc, or to modify the init itself. with this small tip, you can change the init process on boot time and perhaps to perform different init processes easily.
reminded and inspired by sztupy's work, i change the whole init for easy customization and be able to let the init to process in a more dynamic way (for the term 'dynamic', it's borrowed from the internet - dynamic and static internet web pages)
let's start
the original file structure on the root looks like this (extracted):
init.rc
init
where init will be processed on boot time, and init.rc will be read to create dir/mount and services, etc
with dynamic init, the root will look like (sample):
init --> myinit.sh
init.original
myinit.sh
the original init is moved/renamed to init.original, with a symlink created named init pointing to a shell script or program, in this case, myinit.sh. a sample myinit.sh looks like this (u need to have a busybox resides on /sbin in this case):
#!/sbin/busybox sh
mount -t ext2 -o rw,noatime,nodiratime /dev/block/stl9 /system
mount -t rfs -o rw,noatime,nodiratime /dev/block/stl9 /system
/system/scripts/init/myinit2.sh
exec /init.original
###end###
in this example, the /system will be mounted, by attempt to mout it as ext2 first (it wont mount if /system is not in ext2), followed by mounting it as rfs. note that only one mount command line will be succeessfully performed here (PS -o remount is needed for remounting the system, so no need to worry the system will be mounted as ext2 first, and then mounted again as rfs).
i also added a file called myinit2.sh under /system/scripts/init/ (you can choose other dir but make sure u've mounted it), which contains some commmands you want to perform like a while loop, etc (becareful, if a infinite loop is used in myinit2.sh, append a "&" at the end to run it in background, so it will look like:
/system/scripts/init/myinit2.sh &
and finally, call init.original (if you wish)
the reason i call it dynamic is, the original init can be replaced or generated base on certain criteria in myinit.sh or myinit2.sh. below is an example which the original init is completely replaced in myinit2.sh:
#!/sbin/busybox sh
mount -o remount,rw rootfs /
rm /init.rc
rm /init.original
ln -s /system/scripts/init/myinit.rc /init.rc
ln -s /system/scripts/init/myinit /init.original
### end
since root is mounted as rw, the original init and init.rc can be removed and link to your own init and init.rc
that's it! you can now modify init and init.rc without the need to recmpile the kernel again
some possible usages:
- add/remove/modify services contained in init.rc
- change the filesystem for specific mount point in init.rc like switching from rfs to ext2 or jfs
- remove repeating dir creations in init.rc, and much more..
hope this help!
PS do it at ur own risk
Have you tried this? I don't think it's going to work without 'mknod' before doing the mounts.
RyanZA said:
Have you tried this? I don't think it's going to work without 'mknod' before doing the mounts.
Click to expand...
Click to collapse
Yes.
I don need mknod
I didn't see the mention of this on this forum, but if one has root one can force apps to move to internal storage (or SD if that's where one's device stores them), even if the developers didn't allow it. Just use adb shell or a terminal emulator and then do:
Code:
su
cd /data/app
ls
Now find the name of your app (app.name.apk, say). Then:
Code:
cp app.name.apk /sdcard
pm install -r -s /sdcard/app.name.apk
And if it works fine, you can clean up by deleting /sdcard/app.name.apk
Would be easy to make an app that does that. I like working with a command-line, so I made a little shell script: force-storage.sh:
Code:
mkdir /sdcard/tmp 2> /dev/null
for x in $* ; do
echo Forcing $x to storage
cp $x /sdcard/tmp
pm install -r -s /sdcard/tmp/$x
done
Here is a list of the kinds of apps you shouldn't do this with.
My apologies if everyone already knows this.
A bonus/downside (depending on how you think about it) is that the apps so moved won't automatically start on boot. Seems to work with Amazon App Store and Appslib (I didn't try with Market).
And of course (and I assume this is well-known) you can set all apps to install by default to sdcard / internal storage even without root:
Code:
pm setInstallLocation 2
(Do pm setInstallLocation 0 to return to the default.) I think there's an app that does that.
As part of my learning how to program on Android, I made a little app to force-move apps to SD/internal-storage. Needs root. Be careful what apps you move--some won't work so well when moved.
Hi guys, gonna be clear as possible,
using custom sense rom, free space /system partition will be around 700mb and AOSP rom will be around 1GB, any tick of your mind to utilize this space to install more apps?
Before this, i create new folder on /system and copy several .apk to it. then using symlink to linking them on /data/app.. however im getting tired as i need to re-create symlink everytime after flashing new rom.
Now i think its better to utilize it with moving dalvik cache directory to /system partition. Last night i try using symbolic link implementation for the idea, but its goes wrong, then I try adding script to init.d but nothing happen. - wrong script maybe.
Did anyone have the same idea??, or can you guys help me to create script to move dalvik cache to /system partition? :silly:
I'm sure I used to do this (move apps) with Titanium Backup on my Desire HD.
I have used this.. have to reboot the phone a few times.. to get it to totally work.. seems to duplicate certain system entries in the data partition..
Needs a tweak here n there I think.. stumped though
Why no one has tried to implement this yet, I dunno... Given the space System partition can have.
Note; system partition has to be mounted as RW on boot..
Code:
#!/system/bin/sh
echo "++++ DALVIK 2 SYSTEM STARTING ++++"
mount -o remount,rw /system
if [ ! -d /system/dalvik-cache ]
then
mkdir /system/dalvik-cache
chown 1000:1000 /system/dalvik-cache
chmod 775 /system/dalvik-cache
fi
if [ -L /data/dalvik-cache ]
then
rm -f /data/dalvik-cache
mkdir /data/dalvik-cache
chown 1000:1000 /data/dalvik-cache
chmod 775 /data/dalvik-cache
elif [ ! -d /data/dalvik-cache ]
then
mkdir /data/dalvik-cache
chown 1000:1000 /data/dalvik-cache
chmod 775 /data/dalvik-cache
elif [ -d /data/dalvik-cache ]
then
for filename in /data/dalvik-cache/*
do
if [ -L $filename ]
then
rm -f $filename
fi
done
mv /data/dalvik-cache/* /system/dalvik-cache/
fi
mount -o bind /system/dalvik-cache/ /data/dalvik-cache/
[Tweak root] add extra +700mb to Internal memory storage from /cache & +600-900MB from /system folders.
just run terminal with root & paste code
su
chmod -R 777 /cache
mkdir /cache/"your-program-folder"
mount -o bind /cache/"your-program-folder" /storage/sdcard0/"your-program-folder"
add extra +600mb (+900mb if you have LiteRom) from /system folder.
su
mkdir /system/share
chmod -R 777 /system/share
mount -o bind /system/share /storage/sdcard0/sharе
before you can write to /storage/sdcard/share mount it RW
su
mount -o rw,remount /system
after every reboot do it again. how add script to startup folder, any Idea?
all work great. I have 4.5GB + 700MB + 800MB internal storage for my music and maps.
But you cant use any OTA updates because your download /cache folder filed now. Remove all data before update
rm -R /system/share/*
rm -R /cache/*
Re: [Tweak root] add extra +700mb to Internal memory storage
Are you sure you got these commands right? And why don't you just make a script to automatically run these commands at boot? You know, so you don't have to keep running the commands over and over? And you have the work "program" spelled wrong. Its spelled with only 1 "m". Program, not programm.
Sent from my XT907 using Tapatalk 2
Re: [Tweak root] add extra +700mb to Internal memory storage
So what happens if you are using your whole internal sd including this 700 megs and you reboot? Does the system freak out?
Sent from my XT907 using Tapatalk 2
Update
sniperkill
absolutely right. And why don't you just make a script to automatically run these commands at boot?
How, do it, init.rc not work.
Clienterror said:
So what happens if you are using your whole internal sd including this 700 megs and you reboot? Does the system freak out?
Sent from my XT907 using Tapatalk 2
Click to expand...
Click to collapse
everything will be fine, just live little more space on /cache (100mb at least)
UPDATE 1st post. add extra +600mb (+900mb if you have LiteRom) from /system folder. Now I have 6GB internal storage for my music and maps.
su
mkdir /system/share
chmod -R 777 /system/share
mount -o bind /system/share /storage/sdcard0/share
before you can write to /storage/sdcard/shear mount it RW
su
mount -o rw,remount /system
But you cant use any OTA updates because your download /cache folder filed now. Remove all before update
rm -R /system/share/*
rm -R /cache/*
serraxer said:
sniperkill
absolutely right. And why don't you just make a script to automatically run these commands at boot?
How, do it, init.rc not work.
everything will be fine, just live little more space on /cache (100mb at least)
UPDATE 1st post. add extra +600mb (+900mb if you have LiteRom) from /system folder. Now I have 6GB internal storage for my music and maps.
su
mkdir /system/share
chmod -R 777 /system/share
mount -o bind /system/share /storage/sdcard0/share
before you can write to /storage/sdcard/shear mount it RW
su
mount -o rw,remount /system
But you cant use any OTA updates because your download /cache folder filed now. Remove all before update
rm -R /system/share/*
rm -R /cache/*
Click to expand...
Click to collapse
Well, make a new folder on your sdcard, I used root explorer. I called it "67tweaks", I then zipped up the folder, then navigated to my zipped folder and I removed the .zip extension (doing it this way allowed me to make a new text document, but theres prolly an easier way, but this is the way i used) and then I long pressed it so it would let me open it up as a text document. I deleted some jibberish that was inside, I then started with #!/system/bin/sh, then space, then pasted your commands under the space and I then placed the file under system/etc/init.d folder. Now every time I boot up, the script gets run. You can also use an app like "ROM toolbox" and go to scripts and just create a new script and select it to run at boot, or you can use SMmanager and create a script to run at boot.
serraxer said:
sniperkill
absolutely right. And why don't you just make a script to automatically run these commands at boot?
How, do it, init.rc not work.
I'm no dev so I wouldn't be able to make a script to run at boot, but if you don't have init.d support you can add a script to your init.qcom.post_boot.sh file in system/etc folder and it should run at boot.
Sent from my HTCONE using Tapatalk 2
Click to expand...
Click to collapse
Looks right to me.
Thanks for the info. I am learning to love my M more and more.
thinks, I'm going to have a try.
serraxer said:
[Tweak root] add extra +700mb to Internal memory storage from /cache & +600-900MB from /system folders.
just run terminal with root & paste code
su
chmod -R 777 /cache
mkdir /cache/"your-program-folder"
mount -o bind /cache/"your-program-folder" /storage/sdcard0/"your-program-folder"
add extra +600mb (+900mb if you have LiteRom) from /system folder.
su
mkdir /system/share
chmod -R 777 /system/share
mount -o bind /system/share /storage/sdcard0/sharе
before you can write to /storage/sdcard/share mount it RW
su
mount -o rw,remount /system
after every reboot do it again. how add script to startup folder, any Idea?
all work great. I have 4.5GB + 700MB + 800MB internal storage for my music and maps.
But you cant use any OTA updates because your download /cache folder filed now. Remove all data before update
rm -R /system/share/*
rm -R /cache/*
Click to expand...
Click to collapse
I cut and pasted this exactly and it doesn't work. Can you please reply with exact sequences. I keep getting mkdir failed for /cache/your-program-folder, File exists
Will this work on a bionic?
Sent from my DROID BIONIC using XDA Premium HD app
I recently (successfully) upgraded my Samsung i9505 with Janjan's Pure Google ROM version 4.3-2.1. While everything worked like a charm, I was frustrated with the little space I had in /sdcard, whereas I have a 32Gb sdcard plugged on that smartphone.
Android is GNU/Linux based, and the shell commands provided by most ROMs know how to handle mountpoints, especially mount -o bind, which permits to mount a directory on another directory. This is the trick you can use in order to have a lot more space within your DCIM directory:
Code:
# mkdir /storage/extSdCard/DCIM
# mount -o bind /storage/extSdCard/DCIM /sdcard/DCIM
There you go:
Code:
# df|grep DCIM
/mnt/shell/emulated/0/DCIM 29.5G 11.8G 17.7G 32768
Much better
Those commands are to be used with the root user. Obviously, you can use this trick for every other directory you'd like to extend. In order to make that mount point permanent, use the ROM's init script capabilities, for example with Janjan's ROM:
Code:
# mount -o remount,rw /system
# cat > /etc/init.d/99local
#!/system/bin/sh
/system/bin/mount -o bind /storage/extSdCard/DCIM /sdcard/DCIM
^D # press Control-D here
# chmod 755 /etc/init.d/99local
# mount -o remount,ro /system
Enjoy more space!