sd card swappage - Hero CDMA Android Development

first post here. just been lurking getting the balls to start playing with my phone.
I need to put a larger microsd(4GB) card in the phone and wonder what specifics I should know. running mount from my mac shows that the card has a msdos(fat16) file system. I don't know if my phone depends on the data that is currently on it and also how are people repartitioning their cards and which fs are they using? Is it necessary to copy the data back onto the card?
thanks in advance.

jack_straw said:
first post here. just been lurking getting the balls to start playing with my phone.
I need to put a larger microsd(4GB) card in the phone and wonder what specifics I should know. running mount from my mac shows that the card has a msdos(fat16) file system. I don't know if my phone depends on the data that is currently on it and also how are people repartitioning their cards and which fs are they using? Is it necessary to copy the data back onto the card?
thanks in advance.
Click to expand...
Click to collapse
all the stuff on the sd is just app files that dont do much. all vital apps are stored of the phone or on the sd card if using the new rom. the stuff on the sd card is just user data pics and such. it can be backed up but it isnt crucial. if you want to take advantage of the new roms and their ability to to app2sd then u need to use the recovery app to format the sd with fat32 ext2 swap.

I partitioned my 2G SD already and apps2SD is working (on Modaco ROM). I want to switch to a 16G card now. Don't I need to move or copy the apps from the 2G to the 16G? What's the best way to do this?

watzone69 said:
I partitioned my 2G SD already and apps2SD is working (on Modaco ROM). I want to switch to a 16G card now. Don't I need to move or copy the apps from the 2G to the 16G? What's the best way to do this?
Click to expand...
Click to collapse
I'm getting ready to upgrade as well and am curious about this. Easy enough to copy the stuff off the /sdcard partition, but what about the ext2 one? I can figure out how to copy off, but not sure how to get it back without booting the phone.. and booting the phone with that stuff missing is bad news.

jonnythan said:
I'm getting ready to upgrade as well and am curious about this. Easy enough to copy the stuff off the /sdcard partition, but what about the ext2 one? I can figure out how to copy off, but not sure how to get it back without booting the phone.. and booting the phone with that stuff missing is bad news.
Click to expand...
Click to collapse
Perhaps moving your apps back to your phone, then putting the new sd card in and starting the process over?

simplyphp said:
Perhaps moving your apps back to your phone, then putting the new sd card in and starting the process over?
Click to expand...
Click to collapse
I'm actually thinking that I'll do this:
take a nandroid backup
boot the phone, open a shell and copy the app and app-private directories
put in the new card, partition it, copy the files back over the fat32 partition
boot it, ignore force-close warnings, then use a shell to copy back the app directories.
then restore the nandroid backup

jonnythan said:
I'm actually thinking that I'll do this:
take a nandroid backup
boot the phone, open a shell and copy the app and app-private directories
put in the new card, partition it, copy the files back over the fat32 partition
boot it, ignore force-close warnings, then use a shell to copy back the app directories.
then restore the nandroid backup
Click to expand...
Click to collapse
That sounds pretty good. Let us know how this works. My 16G card arrives tomorrow and I need a game plan!

Well, I tried the above method (kind of) with mixed results.
1. Made a nandroid backup.
2. Mounted the original SD and copied everything over to my computer.
3. Powered the phone down.
4. Swapped the 2G card with the new 16G.
5. Started the phone in recovery/bootloader mode and partitioned FAT32/EXT2/Swap.
6. Mounted the new SD in USB drive mode while still in bootloader.
7. Copied everything back from my desktop to the SD.
8. Did nandroid restore to the newest backup (finally... see below).
9. Booted the phone.
What I didn't do was open a shell and copy the whole SD card. I just don't know enough about Linux commands to do it. What I ended up with were a bunch of apps that didn't make it over. I had to uninstall/reinstall a lot of apps and replace the broken icons.
One other thing I discovered (which gave me trouble) is that nandroid restores the first folder in the nandroid backup folder, NOT the newest one. After the third attempt to restore my newest backup I figured it out and got rid of the older one (I only had 2). My next attempt restored the right (and only) backup. I wondered for a while if that was what killed my newer apps but they should have been included in the newest backup, right?
Oh well, live and (hopefully) learn.

I'm not sure if the partion will show up when you mount the card, but you could try http://www.fs-driver.org/ and see. And that's weird how nand selected the first folder. I have four backups and it selected my newest one when I restored the other day.
Edit: Hmm, I would if you could just copy the contents of /system/sd.
So you'd do a backup, copy the contents of /system/sd, partition the new card, pop it in, and then put /system/sd back.

jonnythan said:
I'm actually thinking that I'll do this:
take a nandroid backup
boot the phone, open a shell and copy the app and app-private directories
put in the new card, partition it, copy the files back over the fat32 partition
boot it, ignore force-close warnings, then use a shell to copy back the app directories.
then restore the nandroid backup
Click to expand...
Click to collapse
I just reformatted and redid the whole phone and I can confirm that:
1) Nandroid does NOT back up /system/sd/app or app-private
2) This procedure works.

That's because nandroid doesn't back up the sd card at all. That's why I was saying you should manually copy it and put it back.

ajones7279 said:
That's because nandroid doesn't back up the sd card at all. That's why I was saying you should manually copy it and put it back.
Click to expand...
Click to collapse
There was some confusion about whether nandroid would back up and restore the /system/sd/app folder since it was accessible as /data/app. Just confirming that it does not. Presumably doesn't follow symlinks.

jonnythan said:
I'm actually thinking that I'll do this:
take a nandroid backup
boot the phone, open a shell and copy the app and app-private directories
put in the new card, partition it, copy the files back over the fat32 partition
boot it, ignore force-close warnings, then use a shell to copy back the app directories.
then restore the nandroid backup
Click to expand...
Click to collapse
soooo.... please help edit jonnythan
1. Nandroid backup
2. reboot phone
3. adb shell into the phone
4. cp /sdcard/app & cp /sdcard/app/private (to PC) [or use usb mode to copy to pc?]
5. copy sd card to pc
6. remove and insert new sdcard
7. partition new sdcard
8. In usb mode, copy data from old sdcard to newly partitioned sdcard
9. reboot and ignore force closings
10. adb shell and cp app directories (from where to where? lost me)
11. Restore most recent nandroid
12. reboot and enjoy

Yeah, that's it. Here are the details you were fuzzy on:
4) You want to copy the /data/app and /data/app-private directories to somewhere else, since they actually exist on the ext2 partition of the SD card. The way to do this would be:
mkdir /sdcard/backup/
mkdir /sdcard/backup/app
mkdir /sdcard/backup/app-private
cp -r /data/app/* /sdcard/backup/app/
cp -r /data/app-private/* /sdcard/backup/app-private/
Then in step 10:
rm -r /data/app/*
rm -r /data/app-private/*
[chances are those directories are empty already, but you never know]
cp -r /sdcard/backup/app/* /data/app/
cp -r /sdcard/backup/app-private/* /data/app-private
Then reboot and do the nandroid restore.
Enjoy.

jonnythan said:
Yeah, that's it. Here are the details you were fuzzy on:
4) You want to copy the /data/app and /data/app-private directories to somewhere else, since they actually exist on the ext2 partition of the SD card. The way to do this would be:
mkdir /sdcard/backup/
mkdir /sdcard/backup/app
mkdir /sdcard/backup/app-private
cp -r /data/app/* /sdcard/backup/app/
cp -r /data/app-private/* /sdcard/backup/app-private/
Then in step 10:
rm -r /data/app/*
rm -r /data/app-private/*
[chances are those directories are empty already, but you never know]
cp -r /sdcard/backup/app/* /data/app/
cp -r /sdcard/backup/app-private/* /data/app-private
Then reboot and do the nandroid restore.
Enjoy.
Click to expand...
Click to collapse
Thank you for clearing this up. This is very valuable info! Quite a few of us are still a little new to android and especially the command formats.

I just got my new 32GB micro sdhc card in. Will let you know.

jonnythan said:
Yeah, that's it. Here are the details you were fuzzy on:
4) You want to copy the /data/app and /data/app-private directories to somewhere else, since they actually exist on the ext2 partition of the SD card. The way to do this would be:
mkdir /sdcard/backup/
mkdir /sdcard/backup/app
mkdir /sdcard/backup/app-private
cp -r /data/app/* /sdcard/backup/app/
cp -r /data/app-private/* /sdcard/backup/app-private/
Then in step 10:
rm -r /data/app/*
rm -r /data/app-private/*
[chances are those directories are empty already, but you never know]
cp -r /sdcard/backup/app/* /data/app/
cp -r /sdcard/backup/app-private/* /data/app-private
Then reboot and do the nandroid restore.
Enjoy.
Click to expand...
Click to collapse
Thanks a ton. Now.. buy that 8 gb class 6 transcend microsdhc card from newegg... only 16.99 shipped... or pony up for a 16gb.. lol.

esoteric1311 said:
Thanks a ton. Now.. buy that 8 gb class 6 transcend microsdhc card from newegg... only 16.99 shipped... or pony up for a 16gb.. lol.
Click to expand...
Click to collapse
Figures the price drops by $5 a couple days after I buy it.
Should be here any day now.....

jonnythan said:
Figures the price drops by $5 a couple days after I buy it.
Should be here any day now.....
Click to expand...
Click to collapse
I hate when that happens. I just pulled the trigger and got the 8gb.... Gonna make a post of the steps so maybe the mods will sticky it. Thanks again.

Got mine today. Procedure I outlined worked fine.
I can confirm that the Transcend is much much faster than the old card. Only took 44 seconds to copy a 236 MB file to it via the phone, compared to 79 for the old card.

Related

Issues with apps to sdcard?? POST HERE ONLY!!!

I was able to install and run apps from the sd card (ext2), but somehow I still uninstall some apps that i don't use frequently. Is there anyway I can remove the apps from the sd card that i uninstalled? I know the fact that they don't occupy that much spaces, but still I'm thirsty for the knowledge on that issue
uuummm you can go to your terminal and
1- su
2- cd /system/sd/app or app-private
3- ls
4- rm "filename you wanna remove" without double quotes
5- Thats it !!!
samysam05 said:
uuummm you can go to your terminal and
1- su
2- cd /system/sd/app or app-private
3- ls
4- rm "filename you wanna remove" without double quotes
5- Thats it !!!
Click to expand...
Click to collapse
and because of the "ln -s" command you could also cd /data/data/app .. it all points to the same place now
issues partitioning SD card for moving apps
I am having ALOT of trouble trying to format my 4GB SD card to the fat32/ext2 partitions.
I have tried using partition manager 9, setting the fat32 (2.8GB) as a primary, and also setting the SECOND partition ext2 as a primary (1GB). I also tried using gparted and did the same EXACT partition, size and settings in all the different programs. I also tried a mixture of FAT16/FAT32 and ext2 for all the settings. I then tried using ext2fsx on my mac using the same exact settings as before. No matter what, it doesn't mount /system/sd, it always is mounted to /system/sdcard.
(the below are estimated because I was entering all commands in the terminal on my G1)
I'm suppose to see something similar to the following:
dev/mmcblk0p2 1.2G 9.1M 1.1G 1% /system/sd
I always get something to similar to:
dev/mmcblk0p2 1.2G 9.1M 1.1G 1% /system/sdcard
I always see the fat32 partition but never the ext2. I know that alot of people on this forum seem to be able to do this without issue. I unfortunately have been working it on all day.
Can someone PLEASE help me out? Thanks!!!
have you tried moving the apps to sd? see if you actually move all your apps and look at that line again to see if there is an adjustment in size
Which directory does your mountd.conf and init.rc files specify in it if you open them up? Does it say /system/sd or system/sdcard? I believe tempo had his saying system/sdcard and used different files than the ones in the post by dwang that does basically the same thing. I recall one of them using /system/sdcard in their post and the other doing just /system/sd. Use the same file from the same post and don't mix the 2 up because they are not the same.
I used dwang's instructions and files and got my 2GB card partitioned and working. I have had a problem getting my 8gb card working for some reason but that is another story. It seems my 8gb isn't readable or writeable after I partition the ext2 section although the fat32 is ok. I'm familiar with linux but don't know what I need to do to make that partition writeable when I can't get it to show up at all except in gparted and partition manager under windows. I tried busybox df -h without it showing so no luck there...
Hopefully what I metioned helps you and maybe somebody has an idea why mine didn't work either although I wasn't very specific.
I tried both files and mounting on both /system/sd and /sd neither of which worked . I also tried various programs to partition the sd card. I have no other ideas...
Hi,
This is how it should look.
I use an adb shell through the computer (windows xp).
The drive with 1.5g available is the sd card drive.
Non-market apps on SD card issue
Okay... Getting this to work has sucked horribly for me and after rooting through the other forums that would apply to my issue i've found no solution. I have RC33 JFv1.42 LucidREM mod, with /app, /app-private, and /data all copied to the EXT2 partition of my SD card. I am trying to install the AndroidVNC viewer using the AppsInstaller app, I have AndroidVNC saved onto the root of the FAT32 partition of my SD card. The Appsinstaller sees it but when I go to install the .apk itself it's giving me the following error:
"androidVNC could not be viewed. Free up some space on your phone and try again." Giving me a 'cancel,' and 'manage applications' button under.
The error doesn't make any sense because when I login to my terminal as root and # busybox df -h, the only parts of my system that are full are the usual suspects:
/system
/system/modules
/system/xbin
all of which are full, but they always have been for me, so I'm not sure if the Appsinstaller is trying to use one of those blocks to extract to temporarily or something like that. what am i missing here!?!?
bump
Partial App migration to SD card...possible?
Has anyone tried to move only *some* of the apps to the SD card?
I'm stuck with a class 4 mSD card, so as I understand it, moving the apps en masse to the SD card isn't a recommended option.
But I was wondering if perhaps I might move *some* apps to the SD card...maybe just ones that I don't use often, or aren't particularly complicated, or maybe just ones that seem to run perfectly fine from the card.
Some of the "high performance" apps, or ones with a lot of I/O dependency I'd leave on the phone internal storage.
As it stands right now, I'm at total app saturation. I've uninstalled infrequently used apps and have them backed up for ready restoration anytime/anyplace. I've moved every cache possible. Yet even at 13MB free, the phone still complains I don't have enough room to install the latest build of AndNav2.
Should I even attempt a partial migration? I have no paid apps (and apparently couldn't install any even if I wanted to) so I'd just be moving the *.apk file and maybe the *.odex files? Is that all I need to move and then symlink to?
Bump for day crew.....
I'm using this setup. I use my own bash script to move apps:
Code:
#!/bin/bash
# mvappndata.sh 1.1 by Autarkis
# GPL OpenSource
adb remount
adb shell cp -rp /data/app/$1.apk /system/sd/app/$1.apk
adb shell rm /data/app/$1.apk
adb shell ln -s /system/sd/app/$1.apk /data/app/$1.apk
adb shell cp -rp /data/data/$1 /system/sd/data/$1
adb shell rm -r /data/data/$1
adb shell ln -s /system/sd/data/$1 /data/data/$1
You call it with the application's name without the .apk suffix.
Code:
mvappndata.sh com.mobisystems.msdict.embedded.wireless.pons.ssd
Known Bugs:
* apps moved this way don't show as Installed or Updated in Market, but as Free
* sometimes, when you are running out of memory, it won't be possible to install new apps from market - the downloading process will hang right at the beginning. Making even more room does the trick
I leave all apps that are being started at boot time or once started should run as a service in the internal memory. I move all the big apps (like dictionaries) to the SD. It mostly works, but since many apps are buggy themselves it's difficult to tell where a certain Force Close is coming from.
Cheers from Switzerland,
Autarkis
Ah...precisely what I was looking to do. Thanks....that helps a lot.
I'm guessing I can modify the script to run directly on the phone....it appears you have constructed to move apps while connected to a PC via the USB cable. Is this correct?
f4phantomii said:
Ah...precisely what I was looking to do. Thanks....that helps a lot.
I'm guessing I can modify the script to run directly on the phone....it appears you have constructed to move apps while connected to a PC via the USB cable. Is this correct?
Click to expand...
Click to collapse
Yes on both counts. I also use ls -laS to display installed apps sorted by size.
looping on android, home button & silent not working on 1.42
Hi,
Had a weird experience the other day. Phone was fine (rooted RC33/JF1.41). Got some AK Notepad reminders but was busy with something so I ignored them (but heard the alert go off). A few minutes later, the phone spontaneously rebooted and from that point on just looped on the android screen.
I figured I was due for an upgrade, so I popped out the sdcard and upgraded to JF1.42. The phone did come back to life, but at that point the home button won't work (wasn't a hardware issue as it worked to get me to the home+power loader) and when I held down power to shut down, I got only the "power off phone" option but no "silent mode" option. Very strange. This was obviously no good, so I went back to 1.41.
Long story short, the phone still looped, so I took this as a sign that a wipe was unavoidable (I didn't have a recent nandroid backup), but since I had WAY too many apps I never used (~200) and my phone was getting unstable (things were constantly force-quitting), I figured I may as well do some spring cleaning and start fresh.
I learned my lesson and finally got the important apps reinstalled and the phone reconfigured the way I want it -- and then did a nandroid backup so I can avoid this in the future.
But what the heck happened that made the buttons not work? That one freaked me out a bit...
And of course I still wonder what caused me to loop in the first place, totally randomly and spontaneously. Are there specific things that can cause that and if it happens again, is there an easy way to fix it?
Thanks
Gah! This is driving me nuts! I absolutely can't make this work.
I can transfer the whole /data/app and /data/data directories to /system/sd, but as I have a class 4 SD card, I get tons of force closes on apps.
So then I try just moving single apps. For example, moving the OI Flashlight app to the sd card.
Code:
# busybox -a /data/app/org.openintents.flashlight.apk /system/sd/app
# rm -r /data/app/org.openintents.flashlight.apk
# ln -s /system/sd/app/org.openintents.flashlight.apk /data/app/org.openintents.flashlight.apk
I do the same thing with the appropriate data directory for the app. I check and the files are moved. The symlinks are present.
But when I try to run the app, it just tells me that the application is not installed on my phone!
Grr! Then if I delete the symlinks and cp the files back to their original locations, same result. I end up having to re-install from backup.
Very frustrating. Any advice?
I don't know what busybox -a does.
It probably shoud say "cp -rp" instead.
It's important that you preserve access rights.
It's also very important that /system/sd is an ext2 partition. vfat won't do.
My script also assumes that as a preparation, /system/sd/app and /system/sd/data have been created. Like that:
Code:
mkdir /system/sd/app
mkdir /system/sd/data
I assumed that was self-explanatory, but it probably wasn't.
unionfs works for this:
have cake and eat it micro-howto:
(Use a recent jf dist)
/system/bin/insmod /system/modules/2.6.25-01843-gfea26b0/kernel/fs/ext2/ext2.ko /system/modules/2.6.25-01843-gfea26b0/kernel/fs/unionfs/unionfs.ko
(partition sd card as described in the aps-on-sd howto)
(mount to /data/local/ext for this example)
mkdir /data/local/ext/app
busybox mount -v -t unionfs -o dirs=/data/local/ext/app=rw:/data/app=ro unionfs /data/app
This has been tested; downloaded apps go to sd card but the system sees apps in /data as well.
The only issue with this is you can't umount the unionfs mount. In theory, you can have writes go to the real /data/app with:
busybox mount -o remount,dirs=/data/local/ext/app=ro:/data/app=rw /data/app
But I have not tested this.
losing storage after moving cache and apps.
Hi all,
I have moved apps to Sd Card.. I have moved cache to sd card and when all is said and done I had 47mb of 74mb free.. YES... but wait..
Now in using my phone I keep losing free space I am now at 45 of 74mb free. How can I found out what is taking my free space up .?
Please help. Thanks in advance for your time.

Tried apps to SD now phone wont boot!

I was trying to install my apps to my sd card today and now my phone wont reboot. This is what went down. I partitioned my 4g micro sd card, or so i thought. I used Paragon and it gave me an error after reboot;
invalid partition data- partition control blocks information incompatible"
So I restarted my computer. I checked on my phone and it showed i only had 3 gigs available. The partition i made was for 1, so i figured what the hell. It did work. I checked in Paragon and it showed the two partitions. Anyway, i proceeded to input the prompts in adb and it connected, but the second cmd wouldnt work $ mkdir /backup. I went ahead and followed the rest of the commands. At $ adb shell reboot the phone of course rebooted.
I didnt finish the last two commands but accidently restarted my phone. Now it hangs at the G1 screen. rooted g1 by the way.
I have wiped the data and cache, but of course that will do nothing in this case. So it does get me to that screen. I can also hold the camera and power and see my skating androids. But how do i get my phone to boot back up?
At the recovery utility using Alt X to get to console gives me a # prompt.
Help would be greatly appreciated guys, i dont have another phone haha!
Thanks
I'm guessing what you means by "I didnt finish the last two commands but accidently restarted my phone." is that you weren't able to do the "ln -s /system/sd/app /data/app"? If so then at that # prompt, you need to type those very same commands,
Code:
ln -s /system/sd/app /data/app
reboot
hopefully will work after that
Nope. Thats a no go. However, i decided to throw the update back onto my sdcard via sdcard reader. I put the sd card back in and its about done updating back to rc33. I'll report. Seems good so far.
Its all good!
Thanks
you wiped data and that symbolic link is still there?
I wiped my phone and want to redo the app to sd process, but the apps are still on my sd card ext2 partition is there a way I can restore those apps after a wipe or do I have to wipe the ext2 partition and just start over, if so how would I go about doing so.
Joeriginal said:
I wiped my phone and want to redo the app to sd process, but the apps are still on my sd card ext2 partition is there a way I can restore those apps after a wipe or do I have to wipe the ext2 partition and just start over, if so how would I go about doing so.
Click to expand...
Click to collapse
You've done accidentally what I did intentionally.
I moved apps and data over to the SD ext2 partition, then intentionally wiped the phone to start as fresh as possible.
I thought all I needed to do was recreate the symlinks with:
Code:
ln -s /system/sd/app /data/app
ln -s /system/sd/data /data/data
reboot
That should have worked, but didn't. Maybe you'll have better luck than I did.
I was using the LucidREM mod of the JF1.42 firmware which comes with scripts for moving the data and apps.
If you aren't using this version, you'll need repeat the whole manual process of modifying the mount.d and init.rc files so you can see the /system/sd partition on the card.
If you are, you can use the copy.sh undoapps and copy.sh undodata commands and that will put everything back on your phone. At that point it should be exactly as it was before.
If successful, you can try moving everything back either with the Market app, or one of the other scripts floating around on here....
For what it's worth, I never could get things to work when I moved /data/data.....I've had to keep that on my phone and just move the apps. Others seem to have more success moving both without issue.
Joeriginal said:
I wiped my phone and want to redo the app to sd process, but the apps are still on my sd card ext2 partition is there a way I can restore those apps after a wipe or do I have to wipe the ext2 partition and just start over, if so how would I go about doing so.
Click to expand...
Click to collapse
I can give you the code to do it, or you can just use my app that runs the same commands I'd give you. If you use the app just uncheck the checkbox before pressing the move apps to sd button. If you want to go the code route, follow my tutorial starting from the recovery terminal part.
EDIT: oh and 4phantomii: did you just do that code or did you rm -r /data/data and rm -r /data/app first? If you didn't remove the directories first I have no idea what that would do but it seems like it'd make a symlink INSIDE the /data/app and /data/data rather than making them the symlinks.

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

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 emulator 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.
I have a ?, if i have been using your app what dod i do diferent or what should i change?
Thanks
Good job, thanks!
[email protected] said:
will still boot, etc even if there's no sim card
Click to expand...
Click to collapse
You mean SD card?
[email protected] said:
Alright, first there's some files you need.
1: unionfs.ko from here:
Click to expand...
Click to collapse
JF1.5 build has already unionfs.ko in it, doesn't it? Is there any difference between this unionfs.ko and the one included?
1. I hear unionfs is not really stable at this point, is it true?
2. Why do you want to move the whole /data folder to sd, instead of just /data/app, /data/app-private?
3. You might want to add a command to remove previous app2sd changes (i.e. delete symlinks, create folders.)
4. How do you put selected apps to internal memory after this? Copying to /data will copy to sd card again.
The whole idea is really interesting! Thank you for your work!
ArmandHammer said:
I have a ?, if i have been using your app what dod i do diferent or what should i change?
Thanks
Click to expand...
Click to collapse
You don't have to do anything different. It will find all the apps you put on the sd card. If you want to set the phone back to normal(so the phone memory apps can still be there), you can do the following in the recovery terminal:
Code:
mount data
rm /data/app
rm /data/dalvik-cache (only if you moved the dalvik-cache)
mkdir /data/app
mkdir /data/dalvik-cache
@Dimath: yes, I did mean SD card, good catch
1:JF didn't mention it and from a little bit of using it, it seems stable to me. Plus, no matter how much I've screwed up, I haven't managed to boot loop my phone yet.
2: You could just mount those independently. I might end up doing that eventually but for now the way it is works for reasons I'll get to.
3: True, although it's not strictly necessary. If apps2sd already works, this won't break it. I'll put in a guide on undoing the symlink method
4: Actually, no. My script sets the internal memory as the main file system in the union, so apps automatically go there. Moving apps to the sd card just involves copying them to /system/sd.
Ok, just a little confusing.
I didn't use the apps2sd to move apps over to my SD card. What I did was set it with the busybox ls command. I guess that's the symlink.
My question is, if I didn't use apps2sd, can I still use your method? I also moved the dalvik cache also, everything works fine for me now, my apps go directly to the SD card when installing since my memory stays at around 65 MB no matter what I do.
Just need some laymen terms to help me understand that if I'm NOT using apps2sd, and I just linked them with the recovery method, what's my pitfalls / advantages?
Thanks.
larrygates said:
Ok, just a little confusing.
I didn't use the apps2sd to move apps over to my SD card. What I did was set it with the busybox ls command. I guess that's the symlink.
My question is, if I didn't use apps2sd, can I still use your method? I also moved the dalvik cache also, everything works fine for me now, my apps go directly to the SD card when installing since my memory stays at around 65 MB no matter what I do.
Just need some laymen terms to help me understand that if I'm NOT using apps2sd, and I just linked them with the recovery method, what's my pitfalls / advantages?
Thanks.
Click to expand...
Click to collapse
Yes, any other method of apps to sd currently uses the same symlink method, so following the directions as if you installed my app will work. A note though is that all future apps will install to the internal memory by default. I did that because it's MUCH easier to move apps from the memory to the sd card than vice versa. You can use the code I posted if you want it the other way around.
would this also work for /data/data and app-private?
or is this particular setup only for dalvik-cache and app?
oh and before I do this, just wondering, so in theory, since I have a 1.5GB ext2 partition, my free memory will be 1.573GB (1.5GB + 73Mb internal)? The internal memory will just run down and switch over to the sdcard when needed (but be seen as one filesystem)?
andonnguyen said:
would this also work for /data/data and app-private?
or is this particular setup only for dalvik-cache and app?
Click to expand...
Click to collapse
This works for the whole /data folder and everything under it. Everything is automatically installed to the phone memory right now so you can just move over anything you don't want on it(will be making an app to do this automatically)
EDIT: oh and anything you already moved over to the sd card will still show up.
Code:
su
mount -o remount,rw /dev/block/mtdblock3 /system
cp /sdcard/unionfs.ko /system/
cp /sdcard/init.rc /data/
cp /runme.sh /data/
cp /sdcard/a2sd.sh /data/
I see, when I run these lines of code (I can do this from adb also right using adb remount) this IS the new symlink method. It's just all at one time without me having to manually link anything.
Right?
larrygates said:
Code:
su
mount -o remount,rw /dev/block/mtdblock3 /system
cp /sdcard/unionfs.ko /system/
cp /sdcard/init.rc /data/
cp /runme.sh /data/
cp /sdcard/a2sd.sh /data/
I see, when I run these lines of code (I can do this from adb also right using adb remount) this IS the new symlink method. It's just all at one time without me having to manually link anything.
Right?
Click to expand...
Click to collapse
Wrong, no symlinks here. Pure unionfs goodness. Basically it convinces the operating system that /data and /system/sd are the same thing. So anything that's on /system/sd shows up under /data but everything that's normally under /data is still there. Think of it like what happens in windows when you merge folders with the same name, but in this case in actuality everything stays exactly where it was.
New news: If you haven't seen it, I updated this tutorial(and the scripts with it) quite a bit and would now consider it to be completely fully functional.
Also The Dude will be sending me an advance copy of his next ROM tomorrow to verify it works. In his build the apps to sd will be automatic, with no user setup(although if you want apps on the sd card you'll have to make an app directory under /system/sd(mkdir /system/sd/app), ditto for dalvik-cache and data).
Finally, I will attempt to add this into my apps to sd app tonight, thus rounding out everything I can do.
After all this, the only thing left is for Haykuro to build it into his ROM and me to make an app to move specific apps to/from the sd card automatically.
This will no doubt be the method of choice in no time. Great work. Sticky?
If anyone dl'd the latest version(that fixed the race condition, etc), please download the one I just put up. I made that one in windows and I believe the funky carraige return(that indicates a new line) that windows uses screwed it up
So I got some kind of error, and I don't know what is going on.
I put in all the lines in the terminal emulator app..
but after line cp /runme.sh /data/ it gives me an error
it says "cp: cannot stat '/runme.sh': No such file or directory
Any help? I rooted my phone just so I could run my apps off of my SD card.. and now I can't figure out how to get it to work. Somebody help me please.
GTASouthPark said:
So I got some kind of error, and I don't know what is going on.
I put in all the lines in the terminal emulator app..
but after line cp /runme.sh /data/ it gives me an error
it says "cp: cannot stat '/runme.sh': No such file or directory
Any help? I rooted my phone just so I could run my apps off of my SD card.. and now I can't figure out how to get it to work. Somebody help me please.
Click to expand...
Click to collapse
Which ROM is this? JF1.5 should have runme.sh there...
[email protected] said:
Which ROM is this? JF1.5 should have runme.sh there...
Click to expand...
Click to collapse
Ok, I am going to re-partition my memory card.. and then re flash to JF1.5 and try it again.
Just tried it, one issue I'm seeing is android seems to install [email protected]@[email protected] into /system/intmem/dalvik-cache at boot. Is there anyway to have that only in my dalvik-cache on the sdcard?
Its a fairly large file at 3megs so I want it to reside solely on the sdcard and even if I delete it from intmem, whenever I reboot it gets added again.
Now when I display the internal phone storage from the settings menu, it shows up at 835 megs.
I wonder if this is possible to use unionfs and make an ext2 fs object as a file on the FAT fs. That way no 2nd partition is necessary. Plus, if you remove the sdcard, everything will still work.
Maybe we could combine unionfs and this method that uses an ext2 image on the fat32 for apps to sd.
http://forum.xda-developers.com/showpost.php?p=3402947&postcount=687
mkefs can be downloaded here:
http://sites.google.com/site/juanjosec/android
dwang said:
I wonder if this is possible to use unionfs and make an ext2 fs object as a file on the FAT fs. That way no 2nd partition is necessary. Plus, if you remove the sdcard, everything will still work.
Maybe we could combine unionfs and this method that uses an ext2 image on the fat32 for apps to sd.
http://forum.xda-developers.com/showpost.php?p=3402947&postcount=687
mkefs can be downloaded here:
http://sites.google.com/site/juanjosec/android
Click to expand...
Click to collapse
I've been looking at that possibility with JF and MartinFick as well, seems like it could be a good plan but I wanted to get this bit done first. It's a good point about the dalvik-cache, but in order to fix it JF(in this case) would have to change /init.rc to make sure to do this bit before building the dalvik-cache.
Can't download apps from market
hmm so I didn't hit any errors when doing this, but afterwards I am unable to download any apps from the market. It just continually says "Starting Download..." Everything else seems to work well.
I had this same issue when I tried to manually setup apps to sd using the symbolic links. I narrowed the issue down and figured out this only occurred after I moved the dalvik-cache over to the sd card. I'm assuming I'm doing something wrong, but can't seem to figure it out. Any pointers in a general direction would be most helpful
I'm using JFv1.50 ADP1.5, not the modded version by LucidREM. For some reason the bootloader couldn't pickup his version on my phone and --edit-- I'm pretty sure I have the SD card partitioned correctly... everything else seemed to work ok. The ext2 partition shows up as the correct size
*EDIT* So apparently my issue was the SD card as well. Just did a format of the sd card and it fixed it. I also formatted data and cache (alt+w in recovery mode). Thanks MarcusMaximus!
[email protected] said:
New news: If you haven't seen it, I updated this tutorial(and the scripts with it) quite a bit and would now consider it to be completely fully functional.
Also The Dude will be sending me an advance copy of his next ROM tomorrow to verify it works. In his build the apps to sd will be automatic, with no user setup(although if you want apps on the sd card you'll have to make an app directory under /system/sd(mkdir /system/sd/app), ditto for dalvik-cache and data).
Finally, I will attempt to add this into my apps to sd app tonight, thus rounding out everything I can do.
After all this, the only thing left is for Haykuro to build it into his ROM and me to make an app to move specific apps to/from the sd card automatically.
Click to expand...
Click to collapse
If I have apps2SD and the dalvik-cache both moved on the dudes builds already, do I still have to create those directories or will my existing setup still work fine? I would like to know what kind of issues I may run into when the dude releases .95 with this (hopefully, not getting my hopes up just in case).

[HOW-TO] Flashing Back To a Stable Rom After Hero Without Reformating Ext Partition

I Wrote This Because I searched and searched and could never find an answer I dont like wiping or reformating my ext partition and then having to redownload all my market apps everytime i want to try a hero rom and go back to a normal one (and by normal i mean anything that isnt hero)
1. Make sure the build you want to revert to is on the root of your sdcard
2. Now go into the Recovery Console and type in these commands
(Access this using Home+power and when the screen comes up alt+x)
# mount -o rw /dev/block/mmcblk0p2 /system/sd (enter)
# cd /system/sd (enter)
# rm -r /system/sd/app_s (enter)
# recovery
now just wipe (alt+w) and flash (alt+s)
If you have already gone to another Build and your not having any problems
you can check check to see if this file still remains on your ext partition by
doing the following commands in the Terminal Emulator
$su
# cd /system/sd
# ls -la
on the right hand side of the screen your going to see folder names that
are located on your Ext partition if You see app_s do the first set of commands
to remove it
* I realize there is alot of ppl that already know this but theres some ppl that
dont (like me when i flashed my first hero build) and this guide was meant
for the ppl that dont *
* I am not responsible for ppl that cannot follow simple instructions so if you
by some act of God manage to mess up your phone with this tutorial its on
you *
* Just thought i would throw this in for ppl this is from his cyanogen build
page *
By cyanogen
3. I keep getting foreclosures why?
The only thing i can think off is apps on your sd try formating ur sd and flash the full update. If you had a previous ROM installed that copied stuff to your SD card (like most of the Hero ROMs), you'll need to clean that out.
Hmm why should i reformat my ext partition? I moved from jacHeroSki to Cyanogen's build without that . Anyway good tutorial for newbies .
read his build information he tweaked the apps2sd.sh because it was corrupting the app_s folder when it was on the sdcard therefore his maybe putting it somewhere else but if the app_s folder is put in /system/sd when you reload another build it still tries to load that app_s folder therefore all you get is force close popups
Also this folder remains on your ext taking up space
I actually asked someone about this in another thread, but I didn't get a complete answer. And since you were kind enough to post about it I thought I would ask you:
- lets say I have Cyanogen 3.x with apps on SD with lots of apps installed
- lets say I want to try Hero with apps on SD since the hero builds are so big
- lets say I want to revert to Cyanogen 3.x with all my apps still there after playing with Hero since I suspect it won't be good enough for me (yet)
What is the process to do this?
1. Start with Cyanogen 3.x and apps on SD and lots of apps
2. nandroid backup to sd card fat partition
3. put hero build as update.zip on sd card fat partition
?4. tar the ext partition to a file in the nandroid subdir in the fat partition?
?5. remove all files from the ext partition like you show?
6. install update.zip for hero, it sets up its apps on sd, I play with it for a while
?7. to switch back I nuke the ext files like you show?
?8. I use fastboot or just burn the flash images to put back my internal flash to the nandroid state?
?9. I extract the tar of my ext back to the ext partition from the fat partition?
10. back in the same state as step 1
Thanks for any insite you can give.
knox you have a pm
im having a problem with switching builds (non hero) and am sure its the apps on the sd card. what do i do to just wipe the partition without having to reformat?
Woodard2589 said:
im having a problem with switching builds (non hero) and am sure its the apps on the sd card. what do i do to just wipe the partition without having to reformat?
Click to expand...
Click to collapse
you can do it two ways the easiest way is to get lucid script by following his tutorial which can be found using search
the other way is to boot into recovery go to the console and do these commands
#mount -o rw /dev/block/mmcblk0p2 /system/sd
#cd /system/sd
#rm -r /system/sd
i have not tried the above commands because i have not wished to totally wipe my Ext partition which would defeat the purpose of my tutorial
P.S also i have never had a problem switching between non hero builds with apps on my ext partition so it could be caused from something else did you wipe first before goin to another build if not you may want to try that first because the commands will wipe everything from your partition and you will have to remake the directory folders (app, app-private,etc)
ive been on on an old cyan build and when trying anything past 3.4 it gets stuck at the second splash screen unless i boot with no memory card in. then it works fine. had apps on sd before using his build and when using it its never used the sd card. tried wiping before installing and still doesnt work. ended up just flashing over without wiping and booting with no sd card. all my apps shows as installed in the market but none show on the phone, when i reinstall the apps act as tho they were never not installed. didnt get much help in his thread except that my cat log shows that its out of mem, which it has plenty of on both the sd and phone memory.
Removed due to double post
Woodard2589 said:
ive been on on an old cyan build and when trying anything past 3.4 it gets stuck at the second splash screen unless i boot with no memory card in. then it works fine. had apps on sd before using his build and when using it its never used the sd card. tried wiping before installing and still doesnt work. ended up just flashing over without wiping and booting with no sd card. all my apps shows as installed in the market but none show on the phone, when i reinstall the apps act as tho they were never not installed. didnt get much help in his thread except that my cat log shows that its out of mem, which it has plenty of on both the sd and phone memory.
Click to expand...
Click to collapse
ok that may be the problem the older builds use an old apps2sd method the newer builds use a newer one if your using his recovery image 1.3.x boot into recovery the scroll down to fix file systems if it doesnt work go into the console and run the fix file systems script manually by typing in this command
#e2fsck /dev/block/mmcblk0p2
#apps2sd
The easiest way for me was nandroid...I've flashed about 6 Hero roms in the last 3 days lol. And all I did was nandroid before I started the flashing...and if I didn't like the build I was currently using I just used the recovery console to roll back to my back up. Simple as that.
slow xda causing dups
slow xda causing dups
Yeah but i dont think nandroid affects your memory card i may
Be wrong but nandroid only restores the state of your phone i dont
Think it removes trash files from your memory card or ext

[Workaround/Mod]Download Large Apps From Market(Over 25MB)(CM7/MIUI/STOCK)(Cache2SD).

I had a problem recently when trying to download SummitX Snowboarding (49.7 MB) from the Android Market. Did try several methods like Apps2SD, Wipe Cache, dalvik, etc. But none of them could solve my problem. DID A LOT OF SEARCHING and found the method that worked for me. So i thought i could share it with you guys.
P.S.- I am not an advanced user of android. I just did some searching around and found this script. Therefore, i cannot provide any further assistance or answer your advanced queries
Things you will need -
1. Terminal Emulator.
2. Root Access.
Lets Start -
1. Install and open terminal emulator (if you don't see the keyboard, press menu and then toggle soft keyboard on).
2. Type 'su' (without quotes). and grant the application superuser permission. After giving it permission, type 'su' again (because the permission was denied on the first time).
3. Now You Have 2 options. Click on the one you want and then get back to the OP -
Option 1 :- Use External memory card for cache, if you don't want to use internal memory. But the downloads will/may fail if the SDcard gets removed. Not recommended.
Option 2 :- Use the internal memory card for cache, if you are already using external memory card (CM7 Users) for your apps and don't want to waste any more space. Recommended.
4. If you didn't receive any error, its now done !! Be sure to type 'exit' and close the terminal (just to be on safer side).
5. Reboot the phone (Although it works without rebooting, its better to reboot just to let the cache partition take effect).
6. Download large games without any trouble.
NOTE - I have Not Used SDCard Swap mod yet. So i don't know the path of the internal and external memory card in that mod. If someone can tell me the location of internal and external sdcard in that mod, i will surely make the mod to work with SDCard Swap Mod.
I have personally tested it on MIUI and CM7. MIUI's SDcard mounting is same as Stock, so i guess it would work with stock.
I think this method would work for every Rom and even on any phone. I may be wrong
Credits -
I don't know who is the author of Original script because i just searched it like crazy and can't find the link to the post in the mess. If i find, i will surely add it to the OP.
this should be stickied
thanks
Tried and worked flawlessly. Great find.
PS: I cancelled the download after few bars as i am out of wifi. But it's downloading..
Thanks.
After typing mkdir /mnt/sdcard/cache-download in terminal emulator it shows me error like this mkdir /mnt/sdcard/cache-download: not found
sharp87 said:
After typing mkdir /mnt/sdcard/cache-download in terminal emulator it shows me error like this mkdir /mnt/sdcard/cache-download: not found
it is better you can use Int-Ext SD CARD swap mod
Click to expand...
Click to collapse
Are you on MIUI or CM7 ??
Strange error. From what i know, mkdir is used for creating a new directory. I suppose you are either using CM7 (which already has swap mod built in, i suppose) or the SD Card swap mod.
I'll try to make correct script for every rom and add it to the OP. Although its gonna be tough for me untill i don't sort out my confusion between sdcard and external_sd
Use External Memory for Cache Partition.
Method 1 : Use external memory for cache partition.
Type this in Terminal Emulator -
For MIUI/Stock Users -
Code:
mkdir /mnt/sdcard/external_sd/cache-download
cd /sdcard/external_sd/cache-download
mkdir download
rm -rf /cache/download
ln -s /mnt/sdcard/external_sd/cache-download/download /cache/download
For CM7 Users -
Code:
cd /cache/
rm -R download
mkdir /mnt/sdcard/cache-download
ln -s /mnt/sdcard/cache-download download
Note - Be sure to hit enter After every line.
Go Back to OP.
Use Internal Memory for Cache Partition.
Method 2 : Use internal memory for cache partition.
Type this in Terminal Emulator -
For MIUI/Stock Users -
Code:
mkdir /mnt/sdcard/cache-download
cd /sdcard/cache-download
mkdir download
rm -rf /cache/download
ln -s /mnt/sdcard/cache-download/download /cache/download
For CM7 Users -
Code:
cd /cache/
rm -R download
mkdir /mnt/emmc/cache-download
ln -s /mnt/emmc/cache-download download
Note - Be sure to hit enter After every line.
Go Back to OP.
thankkkkkkkkkkks *___* finally i was able to download WMW DDDDD
just one question:
in miui external and internal are swapped, so if I use internal script cache goes to sd card, isn't it?
Siso93 said:
thankkkkkkkkkkks *___* finally i was able to download WMW DDDDD
just one question:
in miui external and internal are swapped, so if I use internal script cache goes to sd card, isn't it?
Click to expand...
Click to collapse
I am running MIUI v8 and the SD cards aren't swapped in it by default.
If you are running miui with no sd-card swap mod of any sort, the cache will go into the desired place (in this case, internal memory). But if you are using sd-card swap mod (i don't know if it exists in MIUI), the cache will go into external sd card.
EDIT - My bad, the sd card swap mod is there for MIUI. If you use it, the methods would work the opposite way. Internal for external, external for internal.
Man,
This is great! Thank you!
Sent from my HTC Desire using xda premium
how to do this for cm 10? looks like asphalt 7 can't be downloaded, it stays stuck in downloading

Categories

Resources