modified: Installing & Run application on sdcard

Search This thread

tempo10

Member
Mar 29, 2007
32
0
WARNING: Proceed at your own risk, this may damage your phone and/or make it unstable. This is for advanced users only and should only be attempted by those who understand the risks of the following changes


Original post: http://www.androidin.net/thread-1099-1-1.html
AS usual, this is for those WITH ROOT ONLY

Preparation:
1. Installed JF RC30 V1.2 (only if you are using JF RC30 1.2 , this is not compatible with RC8)
2. Make a NANDROID backup (you may get everything back to normal if the phone screw up)
3. A MICRO-SD card with 2 partitions divided : (1) a fat-32 partition, (2) a ext2, you need a linux/mac to format the sdcard with ext2 partition
* the fat 32 will be mounted as sdcard and the ext2 will be mounted as /sd for application data, make your own decision for the size*
4. insert the sdcard with 2 partition on the phone
5. set the phone to aeroplane mode for safe



Procedure:
1. adb pull /system/etc/mountd.conf /*somewhere you may want to back it up*
2. rm -f /system/etc/mountd.conf
3. using the modified mountd.conf, adb push /*the path of modified mount.conf */mount.conf /system/etc/mountd.conf
4. adb pull /system/init.rc /*somewhere you may want to back it up*
5. rm -f /system/init.rc
6. using the modified init.rc, adb push /*the path of modified init.rc*/init.rc /system/init.rc
7. reboot
8. busybox cp -a /data/app /sd/
9. rm -r /data/app
10. ln -s /sd/app /data/app
11. reboot

Now, the phone will install and run everyone on /sd, still mounting /sdcard as usual. It is possible that to mount or unmount /sdcard by usb without everything screwed up. Beware that your sdcard will be used as part of system, removing the sdcard may freeze the phone. If the phone get freeze because of removing the sdcard, plug the sdcard again and soft reset.
It is also possible that copy the application data to another card. If you want to change the sdcard, switch the phone off, mounting the sdcard to computer directory, copy the /sd partition to another sdcard with ext2 partition

Back to normal:
1. rm -f /system/etc/mountd.conf
2. adb push /*the backup of mountd.conf* /system/etc/mountd.conf
3. rm -f /system/init.rc
4. adb push /*the backup of init.rc* /system/init.rc
5. busybox cp -a /sd/ /data/app
6. rm -r /sd/

Change of mountd.conf:
changing /dev/block/mmcblk0 to /dev/block/mmcblk0p1
change of init.rc:
adding
insmod /system/modules/2.6.25-01843-gfea26b0/kernel/fs/ext2/ext2.ko
mknod /dev/mmcblk0p2 b 179 2 1000
mount ext2 /dev/mmcblk0p2 /sd noatime nodiratime
 
Last edited:

UnkzDomain

Senior Member
Nov 9, 2008
408
4
Louisville
unkzdomain.com
Any chance of this being simplified into the actual commands necessary for this!?

I'm a semi-noob at *nix stuff... I can format my SD card into 2 partitions, but I'm lost at step 4... What do we need to edit??
 

tempo10

Member
Mar 29, 2007
32
0
Changed step 4...just adb pull the mount.conf for editing..open the file in text editor..find "mmcblk0" and change it "mmcblk0p1" ..save the .conf...del the original one..push the new one to the original directory..
 

bhang

Senior Member
Aug 19, 2006
443
5
megalopolis
REPLACES the internal memory...?

So the internal memory isnt used?

kinda the same trick as the browser cache and market cache, just a bit more complex as its an entire filesystem your moving, which wouldnt let the sys see the internal, mem, please correct me if im reading it wrong, Im not a total noob at linux but no guru dev either...


bhang
 

jashsu

Senior Member
Nov 15, 2008
1,849
20
The internal memory is still used, just not for /data/app

19.rm -r /data/app
20.ln -s /sd/app /data/app

It should probably be /sdcard/app. In any case, this is a fairly complex mod that is not suited for Linux newbies. I would advise against folks considering this mod unless they understand and can test each step before attempting.
 

Stericson

Retired Senior Mod / Retired Senior RD
Nov 10, 2008
1,203
417
Ummm yea, so what happens when you mount your sdcard for storage? I expect the phone goes crazy?

This tutorial, if you could call it that,(no offense) is really badly written and this process seems too risky for what you gain considering that if we are patient google will come out with this themselves.

Stericson
 
Last edited:

jashsu

Senior Member
Nov 15, 2008
1,849
20
Ummm yea, so what happens when you mount your sdcard for storage? I expect the phone goes crazy?

This tutorial, if you could call it that,(no offense) is really badly written and this process seems too risky for what you gain considering that if we are patient google will come out with this themselves.

Stericson

The procedure calls for two partitions on the microsd, one FAT32, other EXT. Theoretically it should work with mounting for mass storage. However, I agree that it's a rather sloppy hack.

There is talk about a similar strategy being officially implemented by the Android team. Instead of two partitions, it would be loopback mounted to a file in the FAT32. That would also provide some encryption security. See here. It's just talk though. Won't be a reality for at least a few months.
 

Stericson

Retired Senior Mod / Retired Senior RD
Nov 10, 2008
1,203
417
Well talk is certainly better than nothing...thanks for the info....

Stericson
 

tempo10

Member
Mar 29, 2007
32
0
I post a method withtout compiling the ramdisk.img but that do not force mounting the sd ext2 drive under rootfs but still workable...probably when i back to work I can compile 1 to flash
 

TheDudeOfLife

Senior Member
Jul 21, 2008
895
42
Chicago
thedudesandroid.com
Am I the only one that thinks there are a few things that are getting 'lost in translation' here?

I'm not getting /sd mounted properly upon reboot...there's no way I'm going to continue attempting this till I see a better (no offense) tutorial or do a little more research on the command lines.

I would really shy away from this if you're an average user or don't know what mountd and init.rc files are used for....this could flat out wreck your phone.
 

pershoot

Inactive Recognized Developer
Dec 1, 2008
8,077
4,426
Am I the only one that thinks there are a few things that are getting 'lost in translation' here?

I'm not getting /sd mounted properly upon reboot...there's no way I'm going to continue attempting this till I see a better (no offense) tutorial or do a little more research on the command lines.

I would really shy away from this if you're an average user or don't know what mountd and init.rc files are used for....this could flat out wreck your phone.

/sd is /sdcard (mount point for the micro sd card's partition)
 

IzzeLing

Senior Member
Nov 9, 2008
56
3
I'm getting stuck right here:

8. busybox cp -a /data/app /sd/
9. rm -r /data/app
10. ln -s /sd/app /data/app
11. reboot


It's saying read only system blah blah, even though I have indeed mounted it is rw
 

TheDudeOfLife

Senior Member
Jul 21, 2008
895
42
Chicago
thedudesandroid.com
I'm getting stuck right here:

8. busybox cp -a /data/app /sd/
9. rm -r /data/app
10. ln -s /sd/app /data/app
11. reboot


It's saying read only system blah blah, even though I have indeed mounted it is rw

Type mount in adb shell and see if /sd is even mounted. I wasn't seeing it in my list. I don't think his mount command in the init.rc is correct, but I'm too busy with holiday stuff.

Don't rm -r /data/app if you have not 100% verified the copy works.
 

jashsu

Senior Member
Nov 15, 2008
1,849
20
This line looks mangled (need flags in the args):

Edit: nevermind, looks like it should work in the init.rc
 
Last edited:

pershoot

Inactive Recognized Developer
Dec 1, 2008
8,077
4,426
No....no it is not.
/sd is a mount of the ext2 partition used for the 'copy' of /data/app (one of the things i disagreed with is picking /sd as a mount point for the second partition.)

/sdcard is the fat32 mount point...used as usual for mounting files.

ahh yea. i just re-glanced over the instructions.

cool.