New and improved Apps to SD(more stable, more powerful, etc) Tutorial

Search This thread

jrherras

Senior Member
Feb 7, 2009
160
1
Belleville, NJ
It hung on me the first time as I opened the keypad - so I waited till it asked to force close so did that and retried and it worked - on that section it takes about a 30 seconds or so to do.

I did not pressed force close or wait when popped out i just wait for 15 mins lol and when i decided to take out the battery it deleted my fat32 partition and created another partition but still no ext2
 

Binary100100

Retired Forum Moderator
Apr 6, 2008
6,470
1,649
Detroit, Mi
Well, some of you may have heard my ramblings around here that I've been working with some of the devs here(JF and MartinFick deserve major praise, probably more than me) on getting a better way to do the whole apps to sd thing.

After 3 days of talking/discussing/working on it, I've finally reached the fruits of that investigation and thought I'd share. This new method uses the filesystem unionfs to essentially meld the /data directory with the /system/sd directory, so that they appear to be one. This has the potential to allow users to move specific apps to or from the sd card, is far more stable than the normal symlink method(will still boot, etc even if there's no SD card) and should be easier to set up. Now, onto the tutorial of setting this up.

BIG DISCLAIMER NOTE: This is a major hack of the phone and it is fully possible that it will break your phone(I've seen no permanently bricked phones but that doesn't make it impossible). Use this method, and my app along with it at your own risk.

REQUIREMENTS:
1: This only works on JF(possibly only on 1.5, not sure about the others) and The Dude's v.1.0 or greater. The Dude's 1.0 or greater actually does the steps in this tutorial for you so you can just run appstosd2 and set it all up from there if you're using his ROM.
2: This still requires you to have 2 partitions set up, first FAT32 and second ext2. Although you can use the appstosd2 app attached to this post and available in the market for $0.99 which will partition the card for you.
3: If you want your apps to go to the sd card, you must have a directory "/system/sd/app" If you didn't have apps to sd before on the ext2 partition do the following in terminal emulator or run my appstosd2 app after finishing the tutorial:
Code:
su
mkdir /system/sd/app
If you want the private-apps, or dalvik-cache moved you can replace "app" in that code with ""app-private", or "dalvik-cache" respectively. Do not copy "data" to the sd card. My script will delete it on the next reboot.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Alright, first there's some files you need.
1: init.rc in .zip attached to this thread
2: a2sd.sh in .zip attached to this thread

All the above listed files should be put on your sd card(my tutorial will assume they are in the root directory of the sdcard(the topmost folder)

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

If you need to undo the normal apps to SD first do the following in the recovery terminal(it's not strictly necessary but I'd recommend it):
Code:
mount data
rm /data/app
mkdir /data/app
if you moved the dalvik cache, repeat steps 2-3 with "dalvik-cache" instead of app. Ditto with "data" for the data cache.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

Then go to terminal editor and type the following:
Code:
su
cp /sdcard/init.rc /data/
cp /sdcard/a2sd.sh /data/

Then reboot and you're set. By default all future apps are installed to the sd card. In order to move an app to the internal memory do the following in terminal emulator:

Code:
su
cp /system/sd/app/[the app you want to move] /system/intmem/app/
rm /system/sd/app/[the app you want to move]

I will be incorporating this into my appstosd app soon(probably as a JF and TheDude-only version until the rest of the devs get on board).

I have included a copy of appstosd 2, which will copy all apps from internal memory to the sd card with an option to remove them from the internal memory. This will only work if you have followed this tutorial.

If you don't have partitions set up, appstosd2 will now do that for you with user-set partition sizes.

NOTE: If you're using The Dude's ROM and find yourself with an outdated version of this since he doesn't always update his ROMs at the same time I update this, do the following in terminal emulator to update(after putting a2sd.sh from the attached a2sd.zip on your sdcard):

Code:
su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
rm /system/bin/a2sd.sh
cp /sdcard/a2sd.sh /system/bin/
reboot

For JF1.5, do the following to update:

Code:
su
rm /system/intmem/a2sd.sh
rm /system/intmem/init.rc
cp /sdcard/a2sd.sh /system/intmem/
cp /sdcard/init.rc /system/intmem/
reboot

NOTE FOR UPDATERS: If you had your data on the sdcard(/system/sd/data), it WILL GET DELETED with the new version. This is a necessity in order to get both wallpaper and protected apps working. I recommend moving it back to the phone.

EDIT: And here's another tutorial from ThatsBS(might be easier for the less tech savvy to follow?):
I am still learning a lot everyday from this forum. So for people new to this process let me noobify it, if I can, as I am one too.
Start by reading the first page!! Get all the stuff you need from page 1. (apps2sd2.zip and a2sd.zip )

I started from a fresh wipe and flash of jf1.51 adp.
A newly formatted fat32, non partitioned sd.
Put the init.rc and app2sd.sh on the sd (the files NOT the zip)

Then go to the terminal emulator and typed:
su
cp /sdcard/init.rc /data/
cp /sdcard/a2sd.sh /data/

Then reboot

Next I ran the apps2sd 2 app. It will ask you how much to you want to partition. I did 3000mb the first successful time and the dreaded low mem notice would not leave the status bar. I have read not to make it more then 1500mb. Have a good connection, dont force close it. It will reboot.

Next, after the reboot, I ran the apps2sd 2 app again and pressed "copy apps to sd" (let it do its thing)
Reboot.

Next I went back to the emulator and typed:
su
mkdir /system/sd/app-private
mkdir /system/sd/dalvik-cache
Reboot.

Go back to the apps2sd 2 app and hit move dalvik-cache.
Reboot for good measure and your done.

I did this in about 10 mins. Worked flawlessly.


So I gave this a shot. I have over 250 apps stored to my sd (1gb on ext2) and I have about 600mb free. So I can't move my apps back to my phones internal memory (obviously). I performed the steps above and I noticed a Retro Clock/Date Widgets were missing, GV (Google Voice) and a couple others. I went back to Market to reinstall and my phone rebooted itself when the app (GV) started to install. I tried installing the apps2sd 2 app with an app installer and it rebooted again. What did I do wrong?
 

cyanogen

Retired Recognized Developer
Jan 4, 2009
2,515
5,752
Seattle
cyanogenmod.com
I added UnionFS to my ROM by default. I modified the script somewhat so that /data isn't mounted twice, and trigger the service later in the init.

Thanks!
 

sjbayer3

Senior Member
Jan 30, 2009
242
10
Samsung Galaxy S10+
It hung on me the first time as I opened the keypad - so I waited till it asked to force close so did that and retried and it worked - on that section it takes about a 30 seconds or so to do.



extract the the contents to root of sdcard, next in terminal emulator when copying the init.rc before the rebooting enter this

cp /sdcard/appstosd2.apk /data/app/

when reboot phone it will show up in list of applications

okay, I copied both the AppstoSD2.zip AND the extracted files to my SD card and it says AppstoSD2.apk No such file or directory.

furthermore, when I unzip it its not an apk but a few files and a few folders:
AndroidManifest.xml
classes.dex
META-INF (folder)
res (folder)
resources.arsc

Please help
 
Last edited:

sjbayer3

Senior Member
Jan 30, 2009
242
10
Samsung Galaxy S10+
This whole process re-iterates why I hate everything that apple is.

For some reason their unzipper doesnt unzip it the way every other operating system does. After I downloaded a google code unzipper it unzipped as an apk.

Basically, **** mac I want my Ubuntu pc back :(
 

Stigy

Senior Member
Feb 4, 2009
527
56
201
I have one important question that I am really looking to get answered...

I did this Apps2SD on the SD card that came with the G1 and obviously its a bit slow since its a class 2. I decided to purchase an 8GB Class 6 card from Newegg and I am just curious how to go about using the new 8GB card.

Can I just boot into Linux, create an ext2 partition on the new card and copy the contents over from the new card to the old card? Could it really be that simple?

Thanks in advance for your response!!
 

overground

Retired Senior Moderator / Inactive Recognized Dev
I have one important question that I am really looking to get answered...

I did this Apps2SD on the SD card that came with the G1 and obviously its a bit slow since its a class 2. I decided to purchase an 8GB Class 6 card from Newegg and I am just curious how to go about using the new 8GB card.

Can I just boot into Linux, create an ext2 partition on the new card and copy the contents over from the new card to the old card? Could it really be that simple?

Thanks in advance for your response!!

Definitely worth a try, but I don't think it's going to be that simple. I would back up what you can from the FAT32 portion of your old card (also backing up your installed apps using appmanager or mybackuppro). Copy the entire contents of your FAT32 partition to your computer. Then insert your new card and mount it in settings. Use Apps to SD 2 (or partition manager of your choice) to partition your new card to the sizes you prefer. Then use Apps to SD 2 to set up apps and/or dalvik-cache to sd. When that's done, restore your copied files from your computer to the new FAT32 portion of your card. Finally restore your backed up apps. Make sure you follow any rom specific instructions for the build you're using.
 

Binary100100

Retired Forum Moderator
Apr 6, 2008
6,470
1,649
Detroit, Mi
Can't install

So I gave this a shot. I have over 250 apps stored to my sd (1gb on ext2) and I have about 600mb free. So I can't move my apps back to my phones internal memory (obviously). I performed the steps above and I noticed a Retro Clock/Date Widgets were missing, GV (Google Voice) and a couple others. I went back to Market to reinstall and my phone rebooted itself when the app (GV) started to install. I tried installing the apps2sd 2 app with an app installer and it rebooted again. What did I do wrong?
 

cronin4392

Senior Member
Jul 9, 2007
188
0
ok just tried your new method and i ran into some problems. im on the dudes build 1.2b and i didnt have any apps on the sd. so i followed these steps in the first post:
"Next, after the reboot, I ran the apps2sd 2 app again and pressed "copy apps to sd" (let it do its thing)
Reboot.

Next I went back to the emulator and typed:
su
mkdir /system/sd/app-private
mkdir /system/sd/dalvik-cache
Reboot.

Go back to the apps2sd 2 app and hit move dalvik-cache.
Reboot for good measure and your done.

I did this in about 10 mins. Worked flawlessly."

after typing this:
su
mkdir /system/sd/app-private
mkdir /system/sd/dalvik-cache

i rebooted, but once the phone booted alot of my apps werent there are some were named com.___.___. one of the apps not there was appstosd. so what went wrong? should i not have rebooted?
 

borodin1

Senior Member
Jan 3, 2009
1,436
45
Minneapolis MN
okay, I copied both the AppstoSD2.zip AND the extracted files to my SD card and it says AppstoSD2.apk No such file or directory.

furthermore, when I unzip it its not an apk but a few files and a few folders:
AndroidManifest.xml
classes.dex
META-INF (folder)
res (folder)
resources.arsc

Please help

Don't unzip it... just rename it toAppstoSD2.apk
 

driguez

Senior Member
Oct 8, 2007
1,021
28
O-Town
God, i been dying to A2SD but i read nothing but small issues which i dont want to deal with... Hopefully this will become even better and more stable. Till then ill stick with my 20mb free.
 

pentace

Senior Member
Oct 25, 2006
402
1
these are the best folders to move for optimal space and speed

This is the old school way but the exact order to do it in maybe scripts can be modded.

cp -a /system/app system/sd/app
mv /system/sd/app /system/sd/appsys

<<<hero only>>> cp -a /system/app_s /system/sd

cp -a /data/app /system/sd
cp -a /data/app-private /system/sd
cp -a /data/dalvik-cache /system/sd

reboot in recovery
mount system

rm -rf /system/app
<<hero>> rm -rf /system/app_s

ln -s /system/sd/appsys /system/app
ln -s /system/sd/app_s /system/app_s

mount data

rm -rf /data/app
rm -rf /data/app-private
rm -rf /data/dalvik-cache

ln -s /system/sd/app /data/app
ln -s /system/sd/app-private /data/app-private
ln -s /system/sd/dalvik-cache /data/dalvik-cache
 
Last edited:

mrmonto

Senior Member
May 7, 2009
82
3
Any known issues with moving dalvik cache to sd? I have app and app-private on sd now. Thanks!
 
Feb 10, 2009
13
0
after a wipe to the dudes build.. i install mybackup pro so i can upload apps2sd app onto my phone

when i move apps2sd all of my apps from the market including mybackup pro are erased off my phone and if i restart my phone it'll stay in a loop

is this an issue with my sd card ? thanks in advance
 

dwang

Senior Member
Nov 23, 2008
2,453
318
There's definitely seems to be some performance issues with unionfs.

I can get my g1 to lock up if I'm running unionfs with apps/app-private/dalvik-cache on the sd card by doing the following:

1. Play IMEEM in the background
2. Go to this website


http://blogs.suntimes.com/ebert/2009/05/up_up_and_away_in_my_beautiful.html

If I do the same thing with everything in internal flash or using symlink a2sd method, I don't get the same lockup.

I'm sticking with symlinks for now.

I also see more menu lagging with unionfs. Meaning if I press "menu", it takes a split second to come up, while using symlinks its faster.
 
Last edited:

beagz

Senior Member
Jan 11, 2009
1,187
23
Greenacres, FL
I always thought the stuttering was just something I was doing.

AUFS seems to be reported as better. Any chance of switching to that other than using cyanogen's build?
 

DMaverick50

Senior Member
May 1, 2009
1,274
1
San Antonio, Tx
i ran the appstosd2 app and partitioned my card and my internal memory says like 775mb. The first page is a bit confusing though im not sure which step to pick up the process on after running the app. anybody want to throw me a bone? thanks
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    umm when i run appstosd it says it formats but then when i push reboot now nothing happens.. also, when i type reboot at the terminal it tells me i dont have permission even tho im already running su