[PRJ] apps2sd discussion

Well, I maxed out on App space. My apps2sd attempt Did not work.

Sent from my sdk using Android Tablet Forum App
 
What I did to check if my apps were loading to SD, was to run terminal, get root (su), and run "busybox df -h" (show disk usage in a readable format)

That showed /data using 3%, and my new partition using around 103mb out of 998mb. (last lines show /dev/block/vold/179:18)

You can check from terminal on the s7 or through adb.

Sent from my sdk using Android Tablet Forum App
 
Thank you to everyone who's worked on this..... This is really incredible (I'm such a noob I can't find the "thanks" buttons, though).

I'm intent on doing this, but was wondering if it would be feasible at all to partition either of the SD cards for extra ram/ cache space? (forgive me if that is not the proper way to phrase it - it's been a while since I've done it - but I think you would know what I mean). Like with other android phones, when the external SD card can be partitioned 3 ways (whether through ADB or the Rom Manager program); the first partition being fat32, the second ext2 or ext3, and the third a linux format.
 
Last edited:
Hi DamnPixie,

Just as a side note, we can only have 4 partitions.

ext2, is the only linux file system the kernel on the s7 supports right now. If I can get a custom kernel working then any of the file systems that linux supports could be possibly used.

~Ivy

Oh, okay! Thank you for explaining it to me.

I finally followed kevmueller's directions, thanks to the hard work of you and others (Pvella, Shanksv, etc)... when I followed step 4, starting with the cp command, I continually got "cp: not found." Titanium Backup continually listed that I had busybox and that it had installed its version of busybox (since I did it twice).... but when I searched for an answer about why I would get a "cp: not found", the answer was because there was no busybox. Installing the busybox from the market confirmed that there was no busybox and then it installed correctly..... and then everything worked.

I am SO mad at Titanium Backup. :) Not the first time it's been unreliable for me. But everything is working now. I had to "trash" and re-choose some widgets, and that was it.

Thanks again!

edit: The "Thanks" button finally appeared for me!! :D
 
Last edited:
I am going to improve the install process for this when I get a chance to document. I want to put a lot more checking into the procedure. I am thinking along these lines, which should make it easier for people.

1) Do the partition (current documentation is enough)

2) Validate the partition
- This would involve just doing the test mount

3) Auto mount the partition
- This would involve just putting in the scripts and rebooting. Validation steps. Noone should continue until this works. This is totally non-destructive at this point.

4) Backup and copy the apps, data, cache. reboot. Validation steps. Noone should continue until this works. This is currently reverseable if it goes wrong.

5) Cleanup. reboot. There is no going back now.

This should help to reduce the risk for people. It also puts the most complicated bit first, and makes it totally non-destructive. The aim is to reduce the number of problems from this. Also for the risk adverse, we should give the option of just moving the apps only, and leaving the data and cache.
 
Damnpixie- I'm totally Jealous!!!! Good Job!!!!

Also, I had to uninstall my market busybox cause it wouldn't start with the initial steps.It wouldn't recognize the initial command lines. I had to use the titanium busybox and then I could start with command lines.

pvella- this would have saved my butt somewhat. Since I wasn't sure if what I was doing was turning out correct, parameters to know would be great to double check our work. I have to say I learned quite a bit as I went and this hs7 is harder to hack than the PDN.
 
Last edited:
Buzzman, I agree with you totally. We need to cater for people of warying proficiency of android skills. Unfortunately I have a very busy work and social life, so I will do this when I can. If someone wants to pick this up, I am also happy to help, please don't feel that you are stepping on anyone's toes. This is a collaborative effort and strong community contributions will benefit everyone. If this is not documented by the middle of this week, I should have a chance to have a go at it by then.
 
buzzman, have you got it going? Why don't you start from scratch, I know it is a pain but you seem to be pretty resilient:) Save the contents of your internal card and reformat it using your device. Go to Settings - SD card and Tablet storage - Unmount internal SD card - Format internal SD card. This should now compeltely reformat the card and you will now have the 8GB card back. I take it you get all the steps working but looks like the final script is not being copied properly. The symptoms you are having sounds like the script is either not executing or somehow have got corrupted when you downloaded them. Why don't you download the original ones posted by ivy and just change the 179:2 to 179:18 using notepad++ Or try to and download kev's scripts again.
 
When I had the problem with the scripts not running, I found the only solution was to edit the files using vi under Linux. Even Notepad++ did not fix the files. It looks like Android is very fussy about the format of its shell files.
 
the big issue is if that they were originally written with notepad (the windows notepad) you will find a lot of control characters on the end of every line ^M to be exact.

Now if you can write these files on a linux box using the ever mighty vi, you won't have this issue. Or use the correct settings in notepad++ and you'd be fine.

~Ivy
 
Thanks for all your input. I reflashed and started again. But I did not reformat the inner sd card. Wasn't sure what that would do for me, and things seem to be ok. I started with a new 16 GB ext sd card, recopied all my apps to that, reinstalled manually. I also found my lost apps on my titaniun back up and restored them. That was nice. All my books came back to Aldiko and E reader automatically. :) And I still have 2 partitions on the inner sd card.

My music still seemed to be in my players- stock and real player. But they could not open the files?? So I resynced with doubletwist pc program and redownloaded, and now they play. Oddly, doubletwist player has never been able to play my music. Won't recognize any music. I haven't tried any videos.

For some reason the new rom holds alot more apps. More than I need. It seems like I have 1/3 more than before. So just to see if I can do it isn't worth the effort. And I do see all the warnings about reflashing. But with good instructions I had no problem. Just read and reread, double check your files, methods, and have good people (all you guys) behind you. My thanks to you all.

If you guys come up with a more foolproof method, I'm game to be your guinea pig.
Otherwise I can wait for 2.2.

You should have seen my face when all my apps turned to little android robots. And clicking on them said not installed and no way to install them. . I still can't understand why they were all on my screen where I left them and not poofed somewhere..

All is good here. Good luck to anyone who's got the b***s to try this.

And damnpixie--I'm still jealous. LOL...

If you smart guys can make all these commands into a .bat script I might be able to run those..I made some of my own for drms...mobi, pdf,epub, nate the great got me started with his very simple python instructions. It always amazes me to watch those scripts run. Magic..

Sent from my sdk using Android Tablet Forum App
 
The ^M character is the second character of the windows cr/lf eol combination. Linux, and by extension android, only uses cr, iirc.
 
[FONT=&quot]Step by Step installation - Windows on S7 with internal and external SD cards [/FONT]
[FONT=&quot]Apps2sd is for applications to sdcard installation for Android 2.1 using Windows on the Australian and US Tablet (internal storage and SD card slot) [/FONT]
[FONT=&quot]ONLY FOLLOW THESE INSTRUCTIONS IF YOU WANT THE APPS ON THE INTERNAL CARD AND WILL HAVE A SD CARD ALWAYS INSERTED AT BOOTUP. [/FONT][FONT=&quot]

Before you start you will need to perform the following pre-requisite steps:[/FONT]
· [FONT=&quot]Pre-requisite software Installation (root phone and usb drivers installation especially)[/FONT]

· [FONT=&quot]Partition your internal SD card.[/FONT]

· [FONT=&quot]Make the new partition a ext2 file system

[/FONT]
· Backup all your apps using Titanium Backup or Android Mate (or BOTH )

· [FONT=&quot]Create the following two files and have them on your sdcard. Use a notepad++ to create the files.[/FONT]




1) install-recovery.sh

#!/system/bin/sh
#
/system/etc/init-sd.sh&


2) init-sd.sh

#!/system/bin/sh
#
MYLOG=/data/install-recovery.log
echo "$(date) Starting install-recovery.sh" > $MYLOG
echo "$(date) Waiting SD to become ready..." >> $MYLOG
sleep 10
mount -t ext2 /dev/block/vold/179:18 /system/sd 1>>$MYLOG 2>>$MYLOG
#mount -o bind /system/sd/app /data/app 1>>$MYLOG 2>>$MYLOG
#mount -o bind /system/sd/data /data/data 1>>$MYLOG 2>>$MYLOG
#mount -o bind /system/sd/dalvik-cache /data/dalvik-cache 1>>$MYLOG 2>>$MYLOG
mount >> $MYLOG
echo "$(date) Finishing install-recovery.sh" >> $MYLOG[FONT=&quot]

[/FONT]

[FONT=&quot]Note:[/FONT]
A few of the lines are commented out on purpose to make it non-destructive. Also note that the line that reads….
mount -t ext2 /dev/block/vold/179:18 /system/sd 1>>$MYLOG 2>>$MYLOG
[FONT=&quot]could also be….[/FONT]
mount -t ext2 /dev/block/vold/179:2 /system/sd 1>>$MYLOG 2>>$MYLOG[FONT=&quot]
[/FONT]
[FONT=&quot]for Australian users or anyone without an internal sdcard.[/FONT]

[FONT=&quot]MODIFICATION STARTS HERE[/FONT]
[FONT=&quot]Start a new DOS command window (Start->run CMD enter).[/FONT]
[FONT=&quot]Enter the command:[/FONT]
[FONT=&quot]C:>adb shell[/FONT]
[FONT=&quot]You should now see the following, otherwise you have not installed the usb driver software properly. Go back to the pre-requisite steps and complete those.[/FONT]
[FONT=&quot]$ su[/FONT]
[FONT=&quot]You should see the following prompt or you have not correctly rooted your phone. Go back to the pre-requisite steps and root your phone.[/FONT]
[FONT=&quot]# [/FONT]

[FONT=&quot]Step 1 – Mounting your new partition.[/FONT]
[FONT=&quot]The following will install the scripts and test that you have a working and valid partition for apps2sd. This is non-destructive and low risk at this point.[/FONT]
[FONT=&quot]# [/FONT][FONT=&quot]mount -o rw,remount -t yaffs2 /dev/block/mtdblock1 /system
# mkdir /system/sd
[/FONT]
[FONT=&quot]# mount -t ext2 /dev/block/vold/179:18 /system/sd (US users)[/FONT]
[FONT=&quot]OR[/FONT]
[FONT=&quot]# mount -t ext2 /dev/block/vold/179:2 /system/sd (Australian users)[/FONT]
[FONT=&quot]# mount[/FONT]
[FONT=&quot]At this point you should see your something like this….[/FONT]
mount
rootfs / rootfs ro 0 0
tmpfs /dev tmpfs rw,mode=755 0 0
devpts /dev/pts devpts rw,mode=600 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
tmpfs /sqlite_stmt_journals tmpfs rw,size=4096k 0 0
/dev/block/mtdblock1 /system yaffs2 ro 0 0
/dev/block/mtdblock2 /system yaffs2 ro 0 0 - froyo
/dev/block/mtdblock6 /data yaffs2 rw,nosuid,nodev 0 0
/dev/block/mtdblock5 /cache yaffs2 rw,nosuid,nodev 0 0
/dev/block//vold/179:1 /sdcard2 vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid
=1015,fmask=0702,dmask=0702,allow_utime=0020,codep age=cp437,iocharset=iso8859-1,
shortname=mixed,utf8,flush 0 0
/dev/block//vold/179:17 /sdcard vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid
=1015,fmask=0702,dmask=0702,allow_utime=0020,codep age=cp437,iocharset=iso8859-1,
shortname=mixed,utf8,flush 0 0
/dev/block/vold/179:18 /system/sd ext2 rw,errors=continue 0 0

[FONT=&quot]The last line might look like this if you are in Australia or do not have an internal sdcard.[/FONT]
/dev/block/vold/179:2 /system/sd ext2 rw,errors=continue 0 0
[FONT=&quot]Congratulations if this has worked so far. If you do not see this line, don’t panic, but you have done something wrong; fix this before proceeding any further. Your machine will operate as normal.[/FONT]

[FONT=&quot]Step 2 – Auto mounting your new partition[/FONT]
[FONT=&quot]We are going to just try and do this automatically now. Again this is not destructive at this point. It will test that your machine is able to auto-mount the apps2sd partition on your device. [/FONT]
[FONT=&quot]C:>adb shell[/FONT]
[FONT=&quot]$ su[/FONT]
[FONT=&quot]# [/FONT][FONT=&quot]mount -o rw,remount -t yaffs2 /dev/block/mtdblock1 /system [/FONT][FONT=&quot]# [/FONT][FONT=&quot]mount -o rw,remount -t yaffs2 /dev/block/mtdblock2 /system - froyo[/FONT]
[FONT=&quot]# busybox cp /sdcard/install-recovery.sh /system/etc
# busybox cp /sdcard/init-sd.sh /system/etc[/FONT]
[FONT=&quot]#chmod 755 /system/etc/install-recovery.sh[/FONT]
[FONT=&quot]# chmod 755 /system/etc/init-sd.sh[/FONT]
[FONT=&quot]Reboot your machine. Then type the following commands on your PC when the S7 has finished rebooting.[/FONT]
[FONT=&quot]C:>adb shell[/FONT]
[FONT=&quot]$ su[/FONT]
[FONT=&quot]# mount[/FONT]
[FONT=&quot]In the listing you should see one of the following lines….[/FONT]
/dev/block/vold/179:2 /system/sd ext2 rw,errors=continue 0 0
/dev/block/vold/179:18 /system/sd ext2 rw,errors=continue 0 0

[FONT=&quot]If you do not see this line, don’t panic, but you have done something wrong; fix this before proceeding any further. [/FONT]

[FONT=&quot]Step 3 – Moving your apps to sdcard[/FONT][FONT=&quot]
[/FONT]
[FONT=&quot]If step 1 or 2 did not proceed well, then DO NOTcontinue with this step or you will DEFINITELY lose your apps and data.[/FONT]
[FONT=&quot]Edit your [/FONT]init-sd.sh file and uncomment the following lines. You uncomment lines by removing the ‘#’ at the start of the line. You may have to do this back on your PC using Notepad++ and put them on your sdcard.

Change #mount -o bind /system/sd/app /data/app 1>>$MYLOG 2>>$MYLOG
to mount -o bind /system/sd/app /data/app 1>>$MYLOG 2>>$MYLOG
The following can also be uncommented if you want even more storage. You will get a lot more space available if you just uncomment the first line, the next two lines MAY also cause more problems. If you are experiencing a lot of “Force Close” errors, then try the apps2sd procedure without moving the cache and data.
Change….
#mount -o bind /system/sd/data /data/data 1>>$MYLOG 2>>$MYLOG
#mount -o bind /system/sd/dalvik-cache /data/dalvik-cache 1>>$MYLOG 2>>$MYLOG
[FONT=&quot]To….[/FONT]
mount -o bind /system/sd/data /data/data 1>>$MYLOG 2>>$MYLOG
mount -o bind /system/sd/dalvik-cache /data/dalvik-cache 1>>$MYLOG 2>>$MYLOG

[FONT=&quot]Save the file, and copy it to your sdcard, then run the following commands….[/FONT]
[FONT=&quot]C:>adb shell[/FONT]
[FONT=&quot]$ su[/FONT]
[FONT=&quot]# mount -o rw,remount -t yaffs2 /dev/block/mtdblock1 /system
# cd /data/
# busybox tar -cvf /system/sd/app.tar app
# busybox tar -cvf /system/sd/data.tar data
# busybox tar -cvf /system/sd/dalvik-cache.tar dalvik-cache

# cd /system/sd
# busybox tar -xvf app.tar
# busybox tar -xvf data.tar
# busybox tar -xvf dalvik-cache.tar
[/FONT][FONT=&quot]
Now copy the two files that we put on the sdcard to the system folder.

# busybox cp /sdcard/install-recovery.sh /system/etc
# busybox cp /sdcard/init-sd.sh /system/etc
# chmod 755 /system/etc/install-recovery.sh
# chmod 755 /system/etc/init-sd.sh

Now we Clean Up.

#cd /data/app
#busybox rm -rf *
[/FONT]
[FONT=&quot]ONLY DO THE FOLLOWING COMMANDS IF YOU PLANNED TO MOVE THE DATA AND CACHE AS WELL AS YOUR APPS.[/FONT]
[FONT=&quot]
#cd /data/data/
#busybox rm -rf *

#cd /data/dalvik-cache
#busybox rm -rf *

You may notice some things happening on your screen, don't worry. Just type this last command in to the console.

#reboot

Now your tablet will reboot. You can disconnect it from the PC and if all went well you now have all your applications on the sdcard.

You may have some trouble with some apps and especially widgets. Remove the widgets and place them on the screen again. For apps that cause any issues, restore them from your Titanium Backup you did at the beginning.

Do not reboot your device without an external sdcard inserted or you will get errors. If you happen to do this, don't panic, just reboot with the card inserted. You will have to redo your widgets and any apps that you have on the screen.

All credit and thanks to the many contributors to this process, including the developers, testers and documenters. You know who you are :)[/FONT]
 
Last edited:
Back
Top