modified: Installing & Run application on sdcard

Search This thread

bhang

Senior Member
Aug 19, 2006
443
5
megalopolis
internal memory usage after this mod

what becomes of the internal fs and or the mem that it occupied?

Is it all used like ram on a pc to run apps on?

If the web and market caches don't seem to purge untill the "low space" error comes up, would they just bloat on up to fill the extra space if not moved or do they get moved by default, because the phone now thinks the partition on the sd is the internal FS?

I just want to understand how this affects the phone, I can make out from the commands what is going on but that is not what I want to know..thanks :)

If a g1 with its FS moved to sd rings in the woods but nobody is around to hear it, did somebody really call?


bhang

edit:
It just seems like there will be alot of storage on the handset FS that would sit unused, unless you added more *nix type stuff to like /bin or /sbin, or maybe debian or sumthin but ATM its just sitting unused, please correct me if im wrong, the OS doesn't see both /app dirs, correct?
 
Last edited:

dwang

Senior Member
Nov 23, 2008
2,453
318
I wonder if its possible to move /data/data to the ext2 sdcard fs? Will that cause any issues?

Also, would running apps off of the sdcard be slower than running it from internal memory?
 

jashsu

Senior Member
Nov 15, 2008
1,849
20
I wonder if its possible to move /data/data to the ext2 sdcard fs? Will that cause any issues?

Also, would running apps off of the sdcard be slower than running it from internal memory?

It is definitely possible. The only concern would be getting it mounted in the init.rc, as the sdcard service starts after /data/init.rc.
 

dwang

Senior Member
Nov 23, 2008
2,453
318
Ok I got it working. The missing piece from the OP is that you need to manually create the sd directory under /system (ie /system/sd) instead of rootfs (/)

adb remount

adb mkdir /system/sd

and then change the supplied init.rc

FROM

mount ext2 /dev/mmcblk0p2 /sd noatime nodiratime

TO

mount ext2 /dev/mmcblk0p2 /system/sd noatime nodiratime

all apps moved from /data/apps to /system/sd/apps run fine from the sdcard.

Now I'm going to try to move /data/data to the sdcard and hope it works!

EDIT:

Managed to move /data/data/com.android.browser to the ext2 sdcard partition (/system/sd/data) and the browser runs fine, but performance is significantly reduced. Is the sdcard that much slower than internal memory? :-(
 
Last edited:

dwang

Senior Member
Nov 23, 2008
2,453
318
So far this hack is working great. I have 35 apps installed and still have 60 megs of internal memory left. i use to be very careful about what apps i install, but now i just go crazy.

only problem i've encountered is that pacman won't install. it gives an out of space error or something. every other app i've installed works though. i would like to know if others are having the same issue w pacman.

df shows plenty of free storage


Filesystem Size Used Available Use% Mounted on
tmpfs 48.4M 0 48.4M 0% /dev
tmpfs 4.0M 0 4.0M 0% /sqlite_stmt_journals
/dev/block/mtdblock3 67.5M 67.2M 304.0k 100% /system
/dev/block/loop0 4.7M 4.7M 0 100% /system/modules
/dev/block/loop1 6.0M 6.0M 0 100% /system/xbin
/dev/mmcblk0p2 493.8M 26.8M 441.5M 6% /system/sd
/dev/block/mtdblock5 74.8M 14.2M 60.6M 19% /data
/dev/block/mtdblock4 67.5M 1.1M 66.4M 2% /cache
/dev/block/mmcblk0p1 1.4G 3.5M 1.4G 0% /sdcard
#

EDIT:

Fixed the pac-man issue. Pac-man is installed in /data/app-private and for some reason pac-man complains about lack of space even though I have plenty of internal memory, so I just created a symlink from /data/app-private to /system/sd/app-private and pac-man installed fine. I'm guessing the app and app-private directories need to reside on the same partition?
 
Last edited:

JBDynamics

Senior Member
Dec 23, 2008
166
8
Denver
www.jbdynamics.com
Will this mod work on the Android Dev Phone 1 (ADP1)? I just got a new one today from BrightStar. I bought a G1 that was supposed to be over a month old, and it already had RC30 installed . I don't think that the init.rc and mountd.conf are the same on the different firmwares.

If the procedure is the same minus being able to use Tempo10's pre-configured files for JF's RC30 v1.2: My question is where do I add those 3 lines (insmod, mknod, & mount) in the init.rc file? And does "adb remount | adb mkdir /system/sd" come after step 3: "adb push /*the path of modified mount.conf */mount.conf /system/etc/mountd.conf" ?

Also, it is my first time using ADB, when I am specifying a path on my computer do I use for example c:\Users\Name\whatever ? Or do I copy it to the SDK directory on my desktop and /folder/mountd.conf is mountd located in the SDK directory in the folder named "folder"? I am new again to *nix again, I haven't run a *nix OS since Redhat version 4.* came out.

Last and finally, does anyone know if the ext2fsd utility will format a second partition on the MicroSD card after I make the first FAT32 with a Windows SD card format utility. Also, do I need to format the SD card while it is in the ADP1 or can I use a USB MicroSD reader or MicroSD to SD adapter and plug it into the SD card slot on my desktop?

Thanks Guys! :)
 

dwang

Senior Member
Nov 23, 2008
2,453
318
Hi JB,

This mod won't work on a stock ADP1 phone. You'll have to install jc 1.2 or 1.3 on it first.

Once you do, you can follow the directions from the OP. Only change you need to do is modify the supplied init.rc to point to /system/sd instead of /sd and run adb remount & adb mkdir /system/sd.

You can do adb remount and adb mkdir /system/sd after step3. That's fine.

I'm not sure if ext2fsd utility will partition your sdcard. I booted up linux and used gparted myself.

The easiest way to install linux is to use wubi.

http://wubi-installer.org/


Good Luck!

Will this mod work on the Android Dev Phone 1 (ADP1)? I just got a new one today from BrightStar. I bought a G1 that was supposed to be over a month old, and it already had RC30 installed . I don't think that the init.rc and mountd.conf are the same on the different firmwares.

If the procedure is the same minus being able to use Tempo10's pre-configured files for JF's RC30 v1.2: My question is where do I add those 3 lines (insmod, mknod, & mount) in the init.rc file? And does "adb remount | adb mkdir /system/sd" come after step 3: "adb push /*the path of modified mount.conf */mount.conf /system/etc/mountd.conf" ?

Also, it is my first time using ADB, when I am specifying a path on my computer do I use for example c:\Users\Name\whatever ? Or do I copy it to the SDK directory on my desktop and /folder/mountd.conf is mountd located in the SDK directory in the folder named "folder"? I am new again to *nix again, I haven't run a *nix OS since Redhat version 4.* came out.

Last and finally, does anyone know if the ext2fsd utility will format a second partition on the MicroSD card after I make the first FAT32 with a Windows SD card format utility. Also, do I need to format the SD card while it is in the ADP1 or can I use a USB MicroSD reader or MicroSD to SD adapter and plug it into the SD card slot on my desktop?

Thanks Guys! :)
 
Last edited:

nodens2099

Member
Jan 3, 2009
23
1
brings back some memory...

All this makes me think of my old sharp zaurus. Same problem : not enough space to install all the nifty apps out there, but sdcard support...

The approach used on the zaurus by the openzaurus / angstrom guy was to use a package manager that would be able to install packages on the sd (or flash). Then it would use the packages metadata (list of files) to symlink every file on root memory.

The big advantage to this method is to be able to have "root" apps (necessary for a functional device) and "sd" apps (not a big deal if not available because the sd card is removed).

Here, we could use a similar approach. I'm an android noob (got my ADP1 a week ago and only started to really play with it), but I understand that an application is only an apk file in /system/apps or /data/apps, so it would be even simpler (please correct me if I'm wrong).

So we need :
  1. a partitioned micro-sd as described here by tempo10 (or by saurik in this thread)
  2. a modified installer to install apps on the sdcard and symlink it in the /system or /data directory
  3. a service to add/remove symlinks, plus doing the necessary homework (what is needed to install/deinstall, that is, register/unregister an app ?) when we need to change the card
  4. optionnaly, the ability to move an app to or from the sdcard and creating/erasing symlinks as needed

Actually, all this could be done easily with some shell scripting, but I lack the (java, android) knowledge to make a nice usable app.
I'll first play a bit with symlinks to see what it does, thought :)
 

CardinS2U

Senior Member
Nov 23, 2006
132
22
thanks!

it work perfect! instruction need to be modify for newbies

but it worked fine.......

now got like 50% apps installed....haha no more watching out what stuff you install then uninstall
 

diabolical28

Senior Member
Feb 3, 2008
160
0
Milwaukee
Can anyone who has done this say if moving the apps to the SD card resolves the phone getting a common case of errors due to high SMS/MMS's as is mentioned in other posted? or is still a problem
 

dwang

Senior Member
Nov 23, 2008
2,453
318
Can anyone who has done this say if moving the apps to the SD card resolves the phone getting a common case of errors due to high SMS/MMS's as is mentioned in other posted? or is still a problem

why do you think doing this would fix the sms problem? Are the sms errors due to out of space issues?
 

ashshlay

Senior Member
Jul 27, 2003
99
10
this would free up memory and possibly help with the SMS/MMS memory issue if you are talking about when you get over several hundred threaded SMS/MMS without deleting them. It is advised that you delete your SMS/MMS threaded messages when they get around 300 per person.

I got caught up here:
busybox cp -a /data/apps /sd/
where it wouldn't copy from /data/apps saying the directory didn't exist.
I'm running the jf 1.31 update and was able to run the other adb commands but I needed to remount in between

Any ideas? I even edited the files to dwang's suggestions before I pushed them over

I ended up just pushing back my backup files as of now.
 
AMAZING!!!!!!! PLEASE Make an BACK TO NORMAL ZIP.

Yo "Tempo10" I luv you man. This SD Card Problem was killing me. I thank you a million and one times. Check this out im gonna compile a folder of everything u need to "Run & Install Apps From Your SD Card FOR DUMMIES" and Uplopad it on the site & on RapidShare. So I was wondering if you can also make a Zip File with the "Back To Normal" settings that you posted (Below) so people can RENAME it to "Update.Zip" & flash the "Back To Normal" Settings back on there G1's so that it could store apps to regular INTERNAL memory again; just incase they need it back to orginal settings. I will be putting this as well as Windows SD Card partitoning programs and instructions in a Folder on RapidShare.


These were the Settings You Gave:

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/



Thank You Tempo!


PREECH
 

dwang

Senior Member
Nov 23, 2008
2,453
318
this would free up memory and possibly help with the SMS/MMS memory issue if you are talking about when you get over several hundred threaded SMS/MMS without deleting them. It is advised that you delete your SMS/MMS threaded messages when they get around 300 per person.

I got caught up here:
busybox cp -a /data/apps /sd/
where it wouldn't copy from /data/apps saying the directory didn't exist.
I'm running the jf 1.31 update and was able to run the other adb commands but I needed to remount in between

Any ideas? I even edited the files to dwang's suggestions before I pushed them over

I ended up just pushing back my backup files as of now.

You need to create the sd directory under /system/sd and then copy it over there ie:

busybox cp -a /data/apps /system/sd/

If I have time, I'll create a new thread that outlines the correct steps to do this.. the original post is missing a few steps. Either that or tempo10 needs to update his original post.

IMO, the hardest part of this procedure is actually partitioning the sdcard for ext2 fs. For that you have to have linux or osx installed. I don't know of a way to that under windows.
 
Last edited:

phreke

Senior Member
Jul 22, 2007
64
0
Austin, TX
Getting ext2 under Windows

Koush has done a great job explaining ways to get Linux working for Windows. VMWare is an excellent option to virtually create a Linux environment so you can format your SD card with ext2. His site is here. You have to search for it.

phreke
 

mark925

Senior Member
Jan 3, 2009
248
4
You need to create the sd directory under /system/sd and then copy it over there ie:

busybox cp -a /data/apps /system/sd/

If I have time, I'll create a new thread that outlines the correct steps to do this.. the original post is missing a few steps. Either that or tempo10 needs to update his original post.

IMO, the hardest part of this procedure is actually partitioning the sdcard for ext2 fs. For that you have to have linux or osx installed. I don't know of a way to that under windows.

I hope that someone will put together a complete list of steps.

As for formatting to ext2, Paragon Partition Manager for Windows will do it. It will even let you partition the card if you already have data on it. I used it and it worked flawlessly.
 
Part 1: Partition your sd cards on windows for dummies

PARTITION YOUR SD CARDS ON WINDOWS:


Original Post:

http://www.modaco.com/content/mpx220-mpx220-modaco-com/239450/partition-your-sd-minisd-card-here/


Programs:

*Partition Manager

*Hp Sd Card Format Tool

-WARNING! YOUR CARD WILL BE FORMATTED AFTER THESE STEPS! YOU NEED TO BACKUP YOUR IMPORTANT

FILES!


First, install the programs above, restart your computer.


01. Here, we should see that card is formatted Fat16 (in pic. it seems free, yours will be soon:)
Right click to the Primary in the red box and Delete.

02. Right click to the primary again and click on create. be sure you made the settings on the picture. new size =

"Storage Card" size so write what you want

03. Right click on the second primary(free one) and click create

04. Be sure to make the setting on picture. new size = "Storage Card2" size so write what you want

05. Press apply on the red box

when finished, you can use as below:)

NOTE: If any problem occurs, Format your card with "HP Tool" and Retry.
You can't see the second partition under windows, you must use Active Sync to send files into "StorageCard2"

Folder.


NOTE:

VERY IMPORTANT: Get an SD Card with a HIGH Transfer Rate (CLASS RATE). If the transfer
rate is slow your phone will move slow. So When u buy your MicroSD Card make sure
you look at the "CLASS" Rate. Class 2 is to slow for G1, Dont buy Class 2. Class 4 is good
and class 6 is fast. Class 6 is really what u want but Class 4 will do perfectly. Now remember
they dont make a 8GB MicroSD or a 16GB MicroSD with a Class 6 Transfer Rate Yet but its
comming soon. So in the mean while search On-line for a 4GB or 2GB micro with a Class 4/Class
6 Rating. This Tip is good wether your storing Apps in "INTERNAL" memory OR! on the SD CARD.
So always remember this note. Alot of people dont know this. This matters wether your putting
your SD Card into your Phone, Stereo System, Video Game System, DVD Player w/ SD Slot,
or your Car Stereo System with SD Card Slot. Either way Class 2 means that ***** will load slowly.

Here's A Hook Up, this is a link to a "A-DATA 8GB MicroSDHC Class 6 with 1 Adapter" for only
$23.99 & Free Shipping!!: http://www.supermediastore.com/adata-8gb-micro-sdhc-sd-class-6.html

Your Welcome. Enjoy That ****.

-PREECH