Related
I'm getting this error when trying to check if a2sd is working or not. SD partitioned properly 32 swap, 512 ext 2 moved to 3, remaining on fat32. im using aloysius 2.1 w/oc and used dconfig to move apps to sd and rebooted. just checked internal memory and still goes down after loading apps. thanks.
/system/bin/a2sd check
Starting Apps2SD script for DConfig at 06-11-2010 10:53:39
setting variables using values stored from DConfig tool
[ ] checking variables
[ ] Searching for Mount Point...
[ ] Mount point found..no further action required.
[!] Setting Dalvik VM Heapsize to 16mb.
[ ] Checking for ext partition
[!] Ext partition found.
[ ] Checking Ext partition...
e2fsck 1.40.8 (13-Mar-2008)
/system/bin/e2fsck: Device or resource busy while trying to open /dev/block/mmcb
lk0p2
Filesystem mounted or opened exclusively by another program?
8
[ ] Mounting ext partitions as ext3.
mount: mounting /dev/block/mmcblk0p2 on /system/sd failed: Device or resource bu
sy
[X] Mounting ext partition as ext3 failed.
[ ] Mounting ext partition as ext2.
mount: mounting /dev/block/mmcblk0p2 on /system/sd failed: Device or resource bu
sy
[X] Mounting ext partition as ext2 failed.
[X] Can't continue script...aborting.
Getting the same issue,
same rom, I just formatted my sd card. 1024 swap 1024 ext. (8gb card). Had issues with the reboot. i removed the card and booted up with it, installed it, noticed the fat32 is 5.**. tried dling some apps and i notice the internal storage is dropping.
Any advice would be great appreciated.
Introducing...
Darktremor Apps2SD 2.7.5.3 Beta 04
Date of Release: January 29, 2011
Download Current Version
Instructions - Change Log - Commands - ROM List - Developer's Guide
Darktremor Apps2SD Fan Page ----
Darktremor Apps2SD Development Group
Are you installing Darktremor Apps2SD on your phone? Here are the instructions to help you: Facebook
Are you a developer wanting to include Darktremor Apps2SD in your latest ROM? Here is the Developer Guide: Facebook
Click to expand...
Click to collapse
Update on Beta 4
It seems I'm getting mixed results with these betas. I'm not sure why this is occurring, some people have been able to get this working right while others have had a hard time with it.
Currently, I'm rebuilding the entire program. This takes a while because I have to figure out how to pack all these options into the program but make it small enough to where it will run correctly.
I will say that some of the beta features are coming back out...one of them is the search for a partition code. I suspect that code may be leading me into issues with certain platforms, so I'm going back to the 2.7.5.2 method of mounting (mmcblk0p2 or mmcblk1p2).
Also, parts of the code will use Busybox Ash (the only code that won't will be starta2sd, which will still use Bash for the time being). The startup code will definitely use Busybox Ash.
Until then, here are the links to the the last two betas and the last official release:
Version 2.7.5.3 Beta 04 - http://www.darktremor.info/files/a2sd/dtapps2sd-2.7.5.3-beta04-signed.zip
Version 2.7.5.3 Beta 03 - http://www.darktremor.info/files/a2sd/dtapps2sd-2.7.5.3-beta03-signed.zip
Version 2.7.5.2-1 - http://www.darktremor.info/files/a2sd/dtapps2sd-2.7.5.2-1-signed.zip
And, if you want past versions, you can view the repository: ftp://dtuser:[email protected] (ignore the smiley face...that's XDA doing that.)
Click to expand...
Click to collapse
Beta 04 took longer than I expected to release. I have done major changes to the code:
1. New commands: convert-ext4 - This will convert your EXT3 partition into EXT4. Just a friendly reminder on this command: Not every rom supports EXT4, so it is possible to go into a boot loop if you switch roms. Use with caution.
2. Reworked convert-ext3 (convert-ext4 gets similar code)...now a flag file is set before the reboot (no conversion is done before the reboot). At load time, the conversion is performed. This takes longer in the reboot process and you may think your phone has locked up...wait about five minutes before doing anything with the phone.
3. Repair is rebuilt...now it uses existing commands to repair the setup (reinstall, remove, cachesd, cachepart, nocache, datasd, nodata). Definitely shrinks the code.
4. Added fix_permissions program to the package. This may help with Superuser issues when using the datasd feature. It is used in reinstall, remove, datasd and nodata.
5. a2sd install is back!!! Both a2sd install and a2sd reinstall do the exact same thing.
6. Dalvik heap code has been shrunk and now creates a file called dalvikheap. Actually, the code has been doing this all along (since about 2.7.5.2, I think), but I never put the code in to use the file.
7. Low Memory Killer code has also been shrunk and uses a file caled dtset_lowmem to set the low memory killer parameter.
8. Replaced Busybox PS function with Toolbox PS. The issue with Busybox PS is that it gives a false reading when I look for android.process.acore (which is the main program when the GUI starts up). If that is present, the program thinks you are trying to run Darktremor without any command line parameters. This was because Busybox would report the process was there when, in reality, it wasn't (validated this when my phone was boot looping.) Toolbox's PS reports the correct setting. This should fix the bootlooping issues some people are experiencing.
9. New commands: usedtbusybox and usedefaultbusybox - these commands may help in diagnosing issues that is may be related to the native Busybox on your rom. a2sd usedtbusybox will use the Busybox that is packaged with Darktremor. a2sd usedefaultbusybox will turn back on the scan behavior of the program introduced in Beta 03.
10. Support for Darktremor Apps2SD version 2.7 and earlier has been discontinued. To upgrade correctly from one of those versions, use version 2.7.5.3 Beta 03b or earlier.
11. Finally fixed stalled boot issues (or at least my tests with several roms says so.)
See the change log for additional details.
You will notice that if the program runs repair and finds a problem, it will correct the issue and reboot. You will see a second reboot when the dalvik-cache clears (this is to fix timing issues with CyanogenMod...I can't control that startup as well as I can other roms). This only happens if repair is ran or you flash a new rom (as repair will realign all data). If you are upgrading from a previous version of Darktremor, you should not see the reboots.
Click to expand...
Click to collapse
This is Darktremor Apps2SD, a multipurpose program that primarily allows a user to execute applications created for the Android OS on their Secure Digital card (with the proper setup...more on that later). But, Darktremor Apps2SD is all about stability. The goal is to be able for all users of the Android OS to be able to take advantage of a method to run their applications from a secure digital card.
But just because the Darktremor Apps2SD is all about stability, doesn't mean it isn't packed with features:
- Move applications (both free and paid) to the Secure Digital card.
- Move Dalvik Cache to run either from your Secure Digital card or from your cache partition and clears the cache on demand.
- Boot Loop Protection: prevents the phone from boot looping in the event the SD card could not be mounted.
- Dalvik JIT for faster performance on Roms which support it.
- User selectable sizes for the Dalvik heap sizes, allowing a user to freely optimize their system.
- Activate a swap partition on your SD card and sets how often the swap partition is utilized.
- Automatically fixes configuration issues.
- Users can check the free space on their SD card and check the installation to make sure all is setup correctly.
- Runs ZipAlign on demand...this makes your programs load faster.
- Built in help system for easy reference of commands.
- All features can also be reversed without repartitioning your Secure Digital card.
- New logging features assists in troubleshooting issues.
- Commands to set the Low Memory Killer feature at boot time. Great for those people who are the "set it and forget it" type.
- And more...
Darktremor Apps2SD is not the same as Froyo Apps2SD. Froyo Apps2SD creates a secure folder on the FAT32 section of your SD card (this is the section that you see when you mount your phone to your computer) and stores the programs there. This is nice as you don't have to do anything special with the phone, but it isn't backwards compatible with older versions of Android (Cupcake, Donut, Eclair) and, because of the way Froyo works, older programs not designed for Froyo will automatically stay on your internal storage (unless you install a program that forces the move to your SD card).
Darktremor Apps2SD takes a different approach. Based on the original CyanogenMod works, Darktremor Apps2SD uses symbolic linking to force Android into moving your applications to the SD card. Because Android will not allow anything to be ran from the FAT32 partition on your SD card (and, in Froyo, it will only allow you to run programs from a special folder), Darktremor utilizes filesystems called EXT2, EXT3 and EXT4. Each one of these filesystems is native to Linux (the operating system running Android), which allows you to run programs from them (same as, say, a computer running Ubuntu). This method is completely compatible with all versions of Android, including Froyo. In fact, you can run both the Darktremor Apps2SD and Froyo Apps2SD at the same time.
Check out the list of Roms that either have Darktremor Apps2SD installed or are compatible with Darktremor Apps2SD. Click on the link labeled ROM List at the top of this message.
Darktremor Apps2SD Installation Instructions
For the list of people that helped me test this on the various roms that use or can use Darktremor Apps2SD and the changelog: http://forum.xda-developers.com/showpost.php?p=7034326&postcount=3
Click to expand...
Click to collapse
The installation instructions can be found here: http://forum.xda-developers.com/showpost.php?p=7021325&postcount=2
Click to expand...
Click to collapse
If you want a list of commands for Apps2SD, type a2sd help.
Tried installing it on Indigo Bean (CyanogenMod 5.0.8 port), didn't work. It seems it can't mount the ext3 partition:
[ ] Launching Darktremor A2SD
[*] Starting Darktremor Apps2SD version 2.7.5 preview fix 1
[ ] Mounting /system as read-write
[ ] Starting Apps2SD in install mode
[ ] Checking SD Card.
[ ] Searching for Mount Point...
[ ] Creating Mount point.
mkdir: cannot create directory '/system/sd': Cannot allocate memory
[X] Mount point could not be created.
Apps2SD cannot mount ext partition.
I re-partitioned my SD card just to be sure (32 / 512 / the rest) with the same results. Don't know if it's because of the ROM or a2sd. Let me know if there's anything I can do to help you diagnose the problem.
EDIT: I know that there were problems other a2sd solutions and the Legend, the fix was to put a short sleep in the a2sd script, don't know if this is of any help to you..
Your boot sequence is working similar to the Desire (with one exception...yours isn't rebooting when it tries to mount /system as read-write).
Try Preview Fix 3 Test 1: http://www.darktremor.info/files/a2sd/dtapps2sd-2.7.5-pf3-test1-signed.zip
This uses the flash to put the sd directory in /system. It also removes almost all references to remount /system as read-write (the only exception: JIT)
Let's see if this works and I really appreciate your help in testing this.
schpinn said:
Tried installing it on Indigo Bean (CyanogenMod 5.0.8 port), didn't work. It seems it can't mount the ext3 partition:
[ ] Launching Darktremor A2SD
[*] Starting Darktremor Apps2SD version 2.7.5 preview fix 1
[ ] Mounting /system as read-write
[ ] Starting Apps2SD in install mode
[ ] Checking SD Card.
[ ] Searching for Mount Point...
[ ] Creating Mount point.
mkdir: cannot create directory '/system/sd': Cannot allocate memory
[X] Mount point could not be created.
Apps2SD cannot mount ext partition.
I re-partitioned my SD card just to be sure (32 / 512 / the rest) with the same results. Don't know if it's because of the ROM or a2sd. Let me know if there's anything I can do to help you diagnose the problem.
EDIT: I know that there were problems other a2sd solutions and the Legend, the fix was to put a short sleep in the a2sd script, don't know if this is of any help to you..
Click to expand...
Click to collapse
Now I get the following error:
[ ] Launching Darktremor A2SD
[*] Starting Darktremor Apps2SD version 2.7.5 PF3 (Preview Fix 3)
[ ] Starting Apps2SD in install mode
[ ] Checking SD Card.
[ ] Checking for ext partition
[!] Ext partition found, but not mounted.
[ ] Checking Ext partition...
e2fsck 1.40.8 (13-Mar-2008)
/dev/block/mmcblk0p2: clean, 11/249856 files, 39620/499713 blocks
[ ] Mounting ext partitions
mount: mounting /dev/block/mmcblk0p2 on /system/sd failed: No such file or directory
[X] Mounting ext partition failed.
[X] Can't continue script...aborting.
[X] SD card not mounted. Install can't continue.
Problem may be one of the following:
But I was able to manually mount the ext3 partition to /sdcard/sd for instance.
Sorry...I did something stupid. Forgot to put the /system/sd as part of the package.
http://www.darktremor.info/files/a2sd/dtapps2sd-2.7.5-pf3-test2-signed.zip
schpinn said:
Now I get the following error:
[ ] Launching Darktremor A2SD
[*] Starting Darktremor Apps2SD version 2.7.5 PF3 (Preview Fix 3)
[ ] Starting Apps2SD in install mode
[ ] Checking SD Card.
[ ] Checking for ext partition
[!] Ext partition found, but not mounted.
[ ] Checking Ext partition...
e2fsck 1.40.8 (13-Mar-2008)
/dev/block/mmcblk0p2: clean, 11/249856 files, 39620/499713 blocks
[ ] Mounting ext partitions
mount: mounting /dev/block/mmcblk0p2 on /system/sd failed: No such file or directory
[X] Mounting ext partition failed.
[X] Can't continue script...aborting.
[X] SD card not mounted. Install can't continue.
Problem may be one of the following:
But I was able to manually mount the ext3 partition to /sdcard/sd for instance.
Click to expand...
Click to collapse
It works! Excellent .
One question, I tried enabling JIT and got the following errors, but I don't know exactly what they mean.
[ ] Launching Darktremor A2SD
[*] Starting Darktremor Apps2SD version 2.7.5 PF3 (Preview Fix 3)
[ ] Starting Apps2SD in jit mode
[ ] Running A2SD JIT Install Program.
[ ] Remounting /system in read-write
[ ] Running JIT Setup.
[ ] Installing JIT.
[ ] Backing up critical files.
cp: cannot create '/data/dalvik-backup/build.prop': No such file or directory
cp: cannot create '/data/dalvik-backup/bin/dalvikvm': No such file or directory
cp: cannot create '/data/dalvik-backup/lib/libdvm.so': No such file or directory
cp: cannot create '/data/dalvik-backup/lib/libnativehelper.so': No such file or
directory
cp: cannot stat '/system/app/HtcLockScreen.apk': No such file or directory
[ ] Modifying /system/build.prop
[ ] Removing HTC Lock Screen (for stability)
[ ] Installing JIT
cp: cannot create '/system/bin/dalvikvm': File exists
cp: cannot create '/system/lib/libdvm.so': File exists
cp: cannot create '/system/lib/libnativehelper.so': File exists
[ ] Synchronizing...
[ ] Erasing contents of Dalvik-Cache
[ ] Rebooting Phone.
reboot returned
[ ] Remounting /system in read-only.
[ ] Setting File System Ready property to 1.
could not set property
The dalvik-backup is pretty normal...it just means it couldn't find those files in /system/bin. Some roms have it, some don't.
The copying to the /system/bin and /system/lib concerns me...I checked the code, and the busybox cp command is told to force the copy (-f parameter). It doesn't look like that's happening here. I'll look into it and see if I can find out why that's happening.
schpinn said:
It works! Excellent .
One question, I tried enabling JIT and got the following errors, but I don't know exactly what they mean.
[ ] Launching Darktremor A2SD
[*] Starting Darktremor Apps2SD version 2.7.5 PF3 (Preview Fix 3)
[ ] Starting Apps2SD in jit mode
[ ] Running A2SD JIT Install Program.
[ ] Remounting /system in read-write
[ ] Running JIT Setup.
[ ] Installing JIT.
[ ] Backing up critical files.
cp: cannot create '/data/dalvik-backup/build.prop': No such file or directory
cp: cannot create '/data/dalvik-backup/bin/dalvikvm': No such file or directory
cp: cannot create '/data/dalvik-backup/lib/libdvm.so': No such file or directory
cp: cannot create '/data/dalvik-backup/lib/libnativehelper.so': No such file or
directory
cp: cannot stat '/system/app/HtcLockScreen.apk': No such file or directory
[ ] Modifying /system/build.prop
[ ] Removing HTC Lock Screen (for stability)
[ ] Installing JIT
cp: cannot create '/system/bin/dalvikvm': File exists
cp: cannot create '/system/lib/libdvm.so': File exists
cp: cannot create '/system/lib/libnativehelper.so': File exists
[ ] Synchronizing...
[ ] Erasing contents of Dalvik-Cache
[ ] Rebooting Phone.
reboot returned
[ ] Remounting /system in read-only.
[ ] Setting File System Ready property to 1.
could not set property
Click to expand...
Click to collapse
tkirton said:
The dalvik-backup is pretty normal...it just means it couldn't find those files in /system/bin. Some roms have it, some don't.
The copying to the /system/bin and /system/lib concerns me...I checked the code, and the busybox cp command is told to force the copy (-f parameter). It doesn't look like that's happening here. I'll look into it and see if I can find out why that's happening.
Click to expand...
Click to collapse
maybe you have to symlink those files afterwards ...
tkirton said:
The dalvik-backup is pretty normal...it just means it couldn't find those files in /system/bin. Some roms have it, some don't.
The copying to the /system/bin and /system/lib concerns me...I checked the code, and the busybox cp command is told to force the copy (-f parameter). It doesn't look like that's happening here. I'll look into it and see if I can find out why that's happening.
Click to expand...
Click to collapse
OK, if there's anything I can do to help you diagnose the problem please let me know.
EDIT: typo.
The only thing I can think of is the /system partition isn't switching to read-write or there's a NAND protection on it. I would think I would get some other error, i.e. read only system error.
I'll see if there's another way to put JIT on a Legend.
frullewulle said:
maybe you have to symlink those files afterwards ...
Click to expand...
Click to collapse
Will do. I'm going to look for an alternative method to add JIT.
schpinn said:
OK, if there's anything I can do to help you diagnose the problem please let me know.
EDIT: typo.
Click to expand...
Click to collapse
tkirton said:
Will do. I'm going to look for an alternative method to add JIT.
Click to expand...
Click to collapse
I don't know if I was supposed to do it this way, but now I tried running the command in recovery, it worked and now JIT is running !
Hi,
I have tried this application but I don't succeed in making to work it as it would owe.
My problem is that it creates badly the run where they owe the apks to be preserved, to it creates here him to me:
/ data/app
instead that to create here it:
/ system/sd/app
and if I check with adb shell (-> su -> ls -l /data) I don't find me these lines:
dalvik-cache -> /system/sd/dalvik-cache
app-private -> /system/sd/app-private
app -> /system/sd/app
Click to expand...
Click to collapse
Is there a remedy?
I have made the test on:
- ROM rooter (poul) [r4]
- My personal ROM
For me Android is new as operating system and therefore I have little experience about it.
Thanks for the answers
Hi.. I also just wanted to test this.. I have rooted Legend with r4..
Running the Modoco-Rodrigez 2.3 ROM..
When installing this zip.. my phone loops into a continues reboot..
Keeps rebooting itself..
OK! I have resolved, I had not modified the boot.img
thanks for the guide
UJ
After a clean install of the latest Indigo Bean I flashed Darktremor again, ran a2sd jit in recovery, after rebooting got a bunch of FCs (phone and gapps if I'm not mistaken) and the device became totally unusable. Is this somehow fixable?
This is what logcat had to say:
I/Process (22549): Sending signal. PID: 22549 SIG: 9
I/ActivityManager( 241): Process com.android.phone (pid 22549) has died.
I/ActivityManager( 241): Start proc com.android.phone for restart om.android.phone: pid=22559 uid=1001 gids={3002, 3001, 3003, 1015}
I/ActivityManager( 241): Low Memory: No more background processes.
D/dalvikvm(22559): Total arena pages for JIT: 2
D/dalvikvm(22559): Total arena pages for JIT: 3
E/dalvikvm(22559): Can't open dex cache '/data/dalvik-cache/[email protected]@[email protected]': No such file or directory
I/dalvikvm(22559): Unable to open or create cache for /system/app/Phone.apk (/data/dalvik-cache/[email protected]@[email protected])
D/AndroidRuntime(22559): Shutting down VM
W/dalvikvm(22559): threadid=3: thread exiting with uncaught exception (group=0x4001e178)
E/AndroidRuntime(22559): Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime(22559): java.lang.RuntimeException: Unable to instantiate application com.android.phone.PhoneApp: java.lang.ClassNotFoundException: com.android
.phone.PhoneApp in loader [email protected]
E/AndroidRuntime(22559): at android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:523)
E/AndroidRuntime(22559): at android.app.ActivityThread.handleBindApplicat
ion(ActivityThread.java:3996)
E/AndroidRuntime(22559): at android.app.ActivityThread.access$2900(ActivityThread.java:119)
E/AndroidRuntime(22559): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1901)
E/AndroidRuntime(22559): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(22559): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(22559): at android.app.ActivityThread.main(ActivityThrea
d.java:4363)
E/AndroidRuntime(22559): at java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime(22559): at java.lang.reflect.Method.invoke(Method.java:5
21)
E/AndroidRuntime(22559): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
E/AndroidRuntime(22559): at com.android.internal.os.ZygoteInit.main(Zygot
eInit.java:618)
E/AndroidRuntime(22559): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(22559): Caused by: java.lang.ClassNotFoundException: com.android.phone.PhoneApp in loader [email protected]
E/AndroidRuntime(22559): at dalvik.system.PathClassLoader.findClass(PathC
lassLoader.java:243)
E/AndroidRuntime(22559): at java.lang.ClassLoader.loadClass(ClassLoader.j
ava:573)
E/AndroidRuntime(22559): at java.lang.ClassLoader.loadClass(ClassLoader.j
ava:532)
E/AndroidRuntime(22559): at android.app.Instrumentation.newApplication(In
strumentation.java:942)
E/AndroidRuntime(22559): at android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:518)
E/AndroidRuntime(22559): ... 11 more
I/Process ( 241): Sending signal. PID: 22559 SIG: 3
I/dalvikvm(22559): threadid=7: reacting to signal 3
W/ActivityManager( 241): Process com.android.phone has crashed too many times: killing!
I/dalvikvm(22559): Wrote stack trace to '/data/anr/traces.txt'
I/DumpStateReceiver( 241): Added state dump to 1 crashes
I/power ( 241): *** set_screen_state 0
D/SurfaceFlinger( 241): About to give-up screen, flinger = 0x115d38
Click to expand...
Click to collapse
Thought I replied to this earlier...guess not.
JIT and SenseUI don't tend to work well together. Not sure if that's the issue here...I see you have a Low Memory issue (this looks oddly like the one that Flipzmode had on his).
Three things you can try:
1. Download 2.7.5 Preview Fix 4 - This was rebuilt last night due to the same issue you are seeing. I have tested on the Hero and all works well...unfortunately, I don't see the same issue you are seeing (or that Flipzmode saw). Hopefully, the rebuild will stop that.
2. After applying Dalvik JIT, erase the entire Dalvik-Cache (a2sd resetcache)
3. Increase the Dalvik Heap Size: 24mb = a2sd largeheap, 32mb = a2sd jumboheap.
schpinn said:
This is what logcat had to say:
Click to expand...
Click to collapse
tkirton said:
Thought I replied to this earlier...guess not.
JIT and SenseUI don't tend to work well together. Not sure if that's the issue here...I see you have a Low Memory issue (this looks oddly like the one that Flipzmode had on his).
Three things you can try:
1. Download 2.7.5 Preview Fix 4 - This was rebuilt last night due to the same issue you are seeing. I have tested on the Hero and all works well...unfortunately, I don't see the same issue you are seeing (or that Flipzmode saw). Hopefully, the rebuild will stop that.
2. After applying Dalvik JIT, erase the entire Dalvik-Cache (a2sd resetcache)
3. Increase the Dalvik Heap Size: 24mb = a2sd largeheap, 32mb = a2sd jumboheap.
Click to expand...
Click to collapse
You actually had already answered, my bad, I crossposted this to the original discussion thread, sorry for that.
I tried the new version, but it got me stuck in a bootloop. Also tried using the old version again, increasing the Dalvik heap size, but it didn't help. And I always cleaned my Dalvik cache when enabling JIT.
Hello,
I'm looking for explanation of how to auto-mount the a2sd (ext3) partition.
My rom is a simple rooted stock rom and so the init.rc is not already modified, so anyone could help ?
Best regards,
rXp>!<
As it happens, I've done just that recently:
http://forum.xda-developers.com/showthread.php?t=934777
I should have tried different words in my search ^^
Thank you for the link. Little follow-up question... can I extract the init.rc and put it in my phone without installing all over again ?
Short answer: no
Besides, you don't have to re-install your setup to use it, just flash the boot image, followed by DTA2SD and you're away.
Edit: Assuming your ROM is FRG83G anyway, I don't know if it'll work with other versions.
Rusty! said:
Short answer: no
Besides, you don't have to re-install your setup to use it, just flash the boot image, followed by DTA2SD and you're away.
Edit: Assuming your ROM is FRG83G anyway, I don't know if it'll work with other versions.
Click to expand...
Click to collapse
I have the FRG83(D) Stock.
Hmmm.
Well, given it's only stock rooted, I would use the OTA file to get on FRG83G then re-root with SoC... least then I know it will work, since that's what I based it on.
I use the http://forum.xda-developers.com/showthread.php?t=714184 rom.
So I tried to search but I didn't find how to update my rom already rooted ^^ because he hasn't upload the update.
Yeah you wont be able to update that one with the OTA file.
However, there is a changelog at the bottom that says it's already got the A2SD stuff there. Just install DT-A2SD and you're away.
Didn't see the changelog... but A2SD is on my phone already ! But I can't see the partition from the phone (root explorer).
A2SD doesn't create the partition, that's down to you. You can do it from recovery (after backing up your SD card), or you can do it on the fly using GParted Live CD.
I wanted to say that A2SD is up and ready. Partition is good and all the applications are on it and it works. But the partition is not auto-mount.
If it's not auto-mounting it kinda wont work?
It's mount point is /system/sd
But I still can't see it :/
Sent from my Nexus One using Tapatalk
If you run a2sd check it should say what it thinks the mount point is and if all is well
There is the check:
sh-3.2$ su
sh-3.2# a2sd check
[ ] Apps2SD is launching...
__ _____
| \ |
| | |
|__/ | Darktremor Apps2SD 2.7.5.2 (2010-09-30)
[ ] GetProp Command = /system/bin/toolbox getprop
[ ] SetProp Command = /system/bin/toolbox setprop
[ ] Mount Point = /system/sd
[ ] Creating /cache/dc
[ ] Symlinking /cache/dalvik-cache to /data/dalvik-cache
[ ] Starting Apps2SD Check Program.
[ ] Checking for ext partition
Darktremor 2.7.5.2 Apps2SD Status Report
===================================================================================
Legend: [*]=Setting is correct
[!]=Setting is correct, but not optimal.
[X]=Setting is incorrect and needs to be fixed or option is not available.
===================================================================================
Block Device - [*] Found
- [*] /dev/block/mmcblk0p2
EXT Partition - [*] Mounted
Mount Point - [ ] /system/sd
Partition Type - [*] EXT3
Support EXT2? - [*] Yes
Support EXT3? - [*] Yes
Support EXT4? - [X] No
Apps - [ ] Linked to SD Card.
[ ] No Apps2SD Flag File not found.
[*] Programs run from SD card
To run from internal storage, type a2sd remove
Private Apps - [ ] Linked to SD Card.
[ ] No Apps2SD Flag File not found.
[*] Private Programs run from SD card
To run from internal storage, type a2sd remove
Dalvik Cache - [ ] Symbolically Linked.
[ ] Dalvik to SD flag file found.
[*] Dalvik runs from SD card
To run from internal storage, type a2sd nocache
To run from /cache partition, type a2sd cachepart
Swap - [ ] Partition not present or no swap support.
[*] Swap does not start.
ZipAlign - [*] Not running at boot.
To activate it, type a2sd zipalign
Dalvik Heap(MB) - [*] 32m
Low Memory
Killer Settings - [*] 1536,2048,4096,4096,5120,15360
Note: Values are in pages.
1 page = 4KB memory.
Values represent the following:
1st number = Foreground App
2nd number = Visible App
3rd number = Secondary Server
4th number = Hidden App
5th number = Content Provider
6th number = Empty App
[] For a list of commands that you can use with Apps2SD
Type: a2sd help
sh-3.2#
Click to expand...
Click to collapse
Hi
Archos G9 devices are quite new so we should create some developement guidelines/standards to avoid total mess.
This thread is meant to be the place to create those, feel free to contribute.
1. Firmware file name- archos.ext4/squashfs/img
as propposed by letama (source) and agreed by suduru_petru (source)
2. Firmware updating
letama in his builds added a mechanism to painlessly update system image: new image is called [...].update, kernel initrd deletes "old" file and renames new one- there is no need to boot or install stock firmware.
My opinion- this should be the standard but subject is to be discussed
However updating/downgrading firmware may cause problems so-
3. Recovering from problems (bootloop, FC's etc)
This subject is to be discussed.
Archos G9 has specific system structure and "non-standard" Recovery. For now the only way to fix app FC's or a bootloop is to wipe data (Reset Android option in recovery) but this deletes all system data. Better solution is to wipe dalvik-cache- this deletes some files used by system but they are rebuilt during boot- but there is no way to do it now.
After talking with letama we've come to an idea: kernel init looks for .update files and
-if it's archos.ext4/squashfs/img.update kernel updates system image
-if it has another but predefined name- .update file is a shell script that is executed
This would give us a substitute for a "standard" recovery. Best way would be to use external SD-card for this task but first we have to check if there are any problematic cards (seems that letama has such card)
Please post your opinions/ideas/suggestions but keep in mind that this is not a system/app feature request topic
And if you have a better idea for the topic title- let me know
My idea how .update files should be handled:
during boot check if external sd card is present
1)yes- check for .update files
a)archos.[...].update present- delete current system image from /data/media, copy new one, delete archos.[...].update files from card AND from /data/media
b) .update script file present- run script, delete script .update from sd AND /data/media
2) no- check /data/media for .update files
a)archos.[...].update- delete current system image, rename update file
b).update script- run script and delete .update file
Notes:
-both types of .update files should be handled if found- when updating firmware wiping dalvik-cache (rm -r -f /data/dalvik-cache) is always advised and this can be done using a script since we don't have a "standard" recovery
-using external sd as the first choice- if adb can't be accessed (no PC, no USB cable, bootloop etc) there is no way to access internal storage
gen_scheisskopf said:
My idea how .update files should be handled:
during boot check if external sd card is present
1)yes- check for .update files
a)archos.[...].update present- delete current system image from /data/media, copy new one, delete archos.[...].update files from card AND from /data/media
b) .update script file present- run script, delete script .update from sd AND /data/media
2) no- check /data/media for .update files
a)archos.[...].update- delete current system image, rename update file
b).update script- run script and delete .update file
Notes:
-both types of .update files should be handled if found- when updating firmware wiping dalvik-cache (rm -r -f /data/dalvik-cache) is always advised and this can be done using a script since we don't have a "standard" recovery
-using external sd as the first choice- if adb can't be accessed (no PC, no USB cable, bootloop etc) there is no way to access internal storage
Click to expand...
Click to collapse
First...Thanks @gen_scheisskopf for your idea....ofcourse is very important for us to have a standard "language".....and you are rigt ( is also my opinion ) - is very unpleasant to take it from zero for an future update or custom rom , considering that many users have installed many custom applications ( games, contacts-data, calendar-data and other personalizated-data....or other stuff).
I hope that together , we'll found the right way for this inconvenience ......and what you began is a necessary and welcome environment to improve programming and use.
Without portability not succeed to have its own development !
I hope in a close collaboration among you especially as you have one of the best developers (Thanks @LeTama) .. but I hope to help us and other developers ....See you soon ! and you started a great job anyway !
Problems like bootloop or FC's can occur even if firmware wasn't changed but there is no *easy* way to fix this yet- so we should make one
One more thing from my side- [email protected] image should be mounted RO by default:
-system RO is a standard (also in official firmware)
-nobody can do any harm to system by accident- any changes will require remounting RW first and no app does this by itself
-all root apps that can make changes to system (TitaniumBackup, RootExplorer, Abslute Root Tools, SUFBS etc) will function properly for remounting RO/RW
gen_scheisskopf said:
-system RO is a standard (also in official firmware)
Click to expand...
Click to collapse
Agreed, it would be nice. However, Archos has not the android standard way of managing partitions, they don't mount a /system partition on top of initrd , they mount a root partition that contains a system directory and chroot it. In short, we mount /dev/loop0 on /new-sys then chroot /new-sys, we don't /dev/block/mmcblkp1 on /system.
More, /dev/loop0 is becoming /dev/block/loop0 when android is booted, so it's a bit tricky to remount r/w after that. I think most root applications are confused with this layout and can't remount properly, that's why I left default to r/w in my build.
It would be good to test it a bit more with few root apps to see if some are working, I didn't do much tests.
I understand.
How about "ln -s /dev/block/loop0 /"? This can be done in init.rc (both kernel initrd and in system image init), not sure if this will work properly
Another idea about .update files- possibly safer way would be to add a predefined set of scripts to initrd- like it's done in recovery- and to use .update files with a different names (like wipe-dalivik.update).
letama said:
It would be good to test it a bit more with few root apps to see if some are working, I didn't do much tests.
Click to expand...
Click to collapse
TitaniumBackup has problems with integrating updated apps into rom- device rebooted during Maps.apk processing (2nd of 4) and now Market is missing from /system/app
Can't say however what caused this- system img file location (loop0) or RW by default. Ext4 is not the cause, I've used ext2 and ext4 for /system on the other device before and there was no problem.
EDIT:
TB restored Market from backup straight to /system/app and it seems that manual integration works fine. Maybe that was just a system error.
Dalvik-cache wipe in init:
Code:
# Do updates if need
if [ -e /data/media/archos.ext4.update ] ; then
rm /data/media/archos.ext4
mv /data/media/archos.ext4.update /data/media/archos.ext4
[B]rm -r /data/dalvik-cache[/B]
fi
if [ -e /data/media/archos.squashfs.update ] ; then
rm /data/media/archos.squashfs
mv /data/media/archos.squashfs.update /data/media/archos.squashfs
[B]rm -r /data/dalvik-cache[/B]
fi
[B]if [ -e /data/media/wipe-dalvik.update ] ; then
rm -r /data/dalvik-cache
rm /data/media/wipe-dalvik.update
fi[/B]
-when archos.ext4/squashfs.update file is found dalvik-cache wipe is mandatory
-file /data/media/wipe-dalvik.update also triggers wipe (and dalvik-wipe.update file is removed
Tested, works fine
gen_scheisskopf said:
Dalvik-cache wipe in init:
Code:
# Do updates if need
if [ -e /data/media/archos.ext4.update ] ; then
rm /data/media/archos.ext4
mv /data/media/archos.ext4.update /data/media/archos.ext4
[B]rm -r /data/dalvik-cache[/B]
fi
if [ -e /data/media/archos.squashfs.update ] ; then
rm /data/media/archos.squashfs
mv /data/media/archos.squashfs.update /data/media/archos.squashfs
[B]rm -r /data/dalvik-cache[/B]
fi
[B]if [ -e /data/media/wipe-dalvik.update ] ; then
rm -r /data/dalvik-cache
rm /data/media/wipe-dalvik.update
fi[/B]
-when archos.ext4/squashfs.update file is found dalvik-cache wipe is mandatory
-file /data/media/wipe-dalvik.update also triggers wipe (and dalvik-wipe.update file is removed
Tested, works fine
Click to expand...
Click to collapse
Thanks...good job !
Another test, possibly will work for HDD models:
Code:
mount_p data
mount_p storage_`$GET_INFO p` #this should return product name and use correct storage mountpoint
#Check if system image is present, if not- copy from storage
if [ ! -e /data/local/archos.ext4 ] ; then
cp /mnt/storage/archos.ext4.update /data/local/archos.ext4
fi
# Do updates if need
if [ -e /mnt/storge/archos.ext4.update ] && [ -e /mnt/storage/system.update] ; then
rm /data/local/archos.ext4
cp /mnt/storage/archos.ext4.update /data/local/archos.ext4
rm /mnt/storage/system.update
rm -r /data/dalvik-cache
fi
if [ -e /mnt/storage/archos.squashfs.update ] && [ -e /mnt/storage/system.update ] ; then
rm /data/local/archos.squashfs
cp /mnt/storage/archos.squashfs.update /data/local/archos.squashfs
rm /mnt/storage/system.update
rm -r /data/dalvik-cache
fi
if [ -e /mnt/storage/wipe-dalvik.update ] ; then
rm -r /data/dalvik-cache
rm /storage/wipe-dalvik.update
fi
umount_p storage_`$GET_INFO p`
# Now boot
if [ -e /data/local/archos.ext4 ] ; then
$LOSETUP `get_mount_info d rfsext4` /data/local/archos.ext4 || log_and_die "Mounting system partition failed"
mount_p rfsext4 || log_and_reboot "Mounting system partition failed"
umount_p rawfs
rootfs_path=`get_mount_info p rfsext4`
umount_pseudo_fs
log "SWITCHING TO REAL ROOT"
exec switch_root $rootfs_path /init
fi
$LOSETUP `get_mount_info d rootfs` /data/loacl/archos.squashfs || log_and_die "Mounting system partition failed"
mount_p rootfs || log_and_reboot "Mounting system partition failed"
umount_p rawfs
rootfs_path=`get_mount_info p rootfs`
umount_pseudo_fs
log "SWITCHING TO REAL ROOT"
exec switch_root $rootfs_path /init
Changes
-system image file is mounted from /data/local (not /data/media)
-archos.ext4.update file is preserved on storage (/data/media or hdd) in case of data wipe- init copies it to the right place if file is not present
-updating firmware requires two files- archos.ext4.update and system.update- second one is an empty file, it is removed after system update (archos.ext4.update is not removed)
-I did not add checking for archos.squashfs file
Prequisites
-minimum 512 MB free on /data for hdd models- they have much smaller /data- about 1.5GB
This works fine on 16GB model- file is copied without any problem and possibly will work on HDD models too- I've sent test version to philmein (he was willing to test)
Android does not touch /data/local/archos.ext4 file (/data/local belongs to shell, not system so it's a safe place)
Other thoughts:
-maybe we drop archos.squashfs support?
-archos.ext4 can be made smaller- 191 MB is free so 400 MB should be more than enough
-maybe add mounting official system file (.squashfs.secure) if there is no custom one present and no archos.ext4.update on storage?
-other possible location can be /data/customization but I didn't test it
Hi @gen_scheisskopf...
I think ( not sure ...) , that until we find a way for mount proper HDD into initramfs , we can't load any files system ( .ext4, .squashfs, .update ) for Archos HDD !
Your test it's work great because for flash 8/16G , @letama modified initramfs
for mounting (.ext4, .squashfs ) -proper !
I believe the solution to root version Archos HDD,is just find a solution to change something in initramfs for a proper mount , after that I do not think it matters where you are place the files system ( /data/media, /data/local , /data/customization - is the same way )
Still believe that /data/media was not chosen at random - when we connect the tablet to the computer we see just Internal Storage ( ..or + SD Card), which is equal to /data/media/....you don't need root, you don't need any other app for look into Internal Storage....
surdu_petru said:
Hi @gen_scheisskopf...
I think ( not sure ...) , that until we find a way for mount proper HDD into initramfs , we can't load any files system ( .ext4, .squashfs, .update ) for Archos HDD !
Click to expand...
Click to collapse
All proper mountpoints are stored in /etc/mountpoints- init reads device name and uses correct mount. The only thing that possibly can be required is
Code:
wait_blk_device storage_$DEVICENAME
(I'm not sure if it's wait_blk_device, will check)
surdu_petru said:
Your test it's work great because for flash 8/16G , @letama modified initramfs
for mounting (.ext4, .squashfs ) -proper !
I believe the solution to root version Archos HDD,is just find a solution to change something in initramfs for a proper mount , after that I do not think it matters where you are place the files system ( /data/media, /data/local , /data/customization - is the same way )
Still believe that /data/media was not chosen at random - when we connect the tablet to the computer we see just Internal Storage ( ..or + SD Card), which is equal to /data/media/....you don't need root, you don't need any other app for look into Internal Storage....
Click to expand...
Click to collapse
Problem is that after android boots all mountpoints change.
Using /data/media may not work- on HDD there may be problems with mounts if /data/media belongs to hdd.
I've chosen /data/local not by mistake:
-android does not touch files placed there (as they may be vendor specific)
-/data/local is chmoded to shell while most of other /data folders are chmoded to root
-running system form HDD may decrease battery life greatly while /data/local is for sure flash memory
-modified initrd check for required files/updates on storage (/mnt/storage) and does not delete possibly necessary archos.ext4.update file (in case of data wipe) so copying those files doesn't change at all- just drag'n'drop on PC
It seems that modified init works for HDD models but more tests are required: http://forum.xda-developers.com/showpost.php?p=22309411&postcount=72
Modified part of init:
Code:
mount_p data
mount_p storage
#Check if system image is present, if not- copy from storage
if [ ! -e /data/local/archos.ext4 ] && [ ! -e /mnt/storage/archos.ext4.update] ; then
cp /mnt/storage/archos.ext4.backup /data/local/archos.ext4
rm -r /data/dalvik-cache
fi
# Do updates if need
if [ -e /mnt/storage/archos.ext4.update ] ; then
rm /data/local/archos.ext4
cp /mnt/storage/archos.ext4.update /data/local/archos.ext4
mv /mnt/storage/archos.ext4.update /mnt/storage/archos.ext4.backup
rm -r /data/dalvik-cache
fi
if [ -e /mnt/sdcard/wipe-dalvik.update ] ; then
rm -r /data/dalvik-cache
rm /mnt/sdcard/wipe-dalvik.update
fi
umount_p storage
# Now boot
if [ -e /data/local/archos.ext4 ] ; then
$LOSETUP `get_mount_info d rfsext4` /data/local/archos.ext4 || log_and_die "Mounting system partition failed"
mount_p rfsext4 || log_and_reboot "Mounting system partition failed"
umount_p rawfs
rootfs_path=`get_mount_info p rfsext4`
umount_pseudo_fs
log "SWITCHING TO REAL ROOT"
exec switch_root $rootfs_path /init
fi
$LOSETUP `get_mount_info d rootfs` /data/local/archos.squashfs || log_and_die "Mounting system partition failed"
mount_p rootfs || log_and_reboot "Mounting system partition failed"
umount_p rawfs
rootfs_path=`get_mount_info p rootfs`
umount_pseudo_fs
log "SWITCHING TO REAL ROOT"
exec switch_root $rootfs_path /init
Changes:
-support only for archos.ext4
-after update a backup file is created in case of data wipe (archos.ext4.backup)
Works on flash model, to be tested on HDD models:
http://dl.dropbox.com/u/14106051/archos/kernel_hdd_test7.zip
EDIT:
As it was just reported- G9 80 HDD does not have SD card slot so earlier idea to use external SD has to be dropped.
Backup & restore of archos.ext4 without wiping data (in case something went wrong with merging changes into the system).
Code:
#backup & restore of system image
if [ -e /mnt/storage/backup.update ] ; then
rm /mnt/storage/archos.ext4.backup
cp /data/local/archos.ext4 /mnt/storage/archos.ext4.backup
fi
if [ -e /mnt/storage/restore.update ] ; then
rm /data/local/archos.ext4
cp /mnt/storage/archos.ext4.backup /data/local/archos.ext4
rm -r /data/dalvik-cache
fi
umount_p storage[...]
UPDATES, WARNINGS, AND INSTALLATION STEPS ARE AVAILABLE IN THE 2ND POST
WHAT DOES THIS SCRIPT DO?
* It is the only method, that I am aware of to have apps trully run, and be installed directly to the external storage without completely switching the internal storage with the external storage.
This bings different benefits to different people:
1 - If you have a device that comes from factory with only a small amount of storage available, you can now install as many apps, and apps as big as the partition you setup to use with this script. For example, if you have a phone with only 512 MB of app storage, you can now install games that take over 1GB of app storage so long as your external partition has the space available.
2 - If you bought a 16GB device and wish you had bought a 32GB device, this is great for you as well (I'm one of these). With this script, your apps will not take up any space in your internal storage, which means that your 16GB (or whatever is left of it after factory partitioning, 11.66 GB in my case) is now available for pictures, videos, downloads, backups, or whatever else you might want to put there or have easy access to when you connect your device to your computer.
3 - If you have a lot of Android games, this is great for you too, specially if you're playing games that take a lot of space. Just get a large MicroSD (I have a 64GB partitioned to 32/32) and put as much space as you need in the second partition, and now you can have all your games intalled at the same time. No need to keep uninstalling games so that you can install other ones.
* Once and Done, across the board setup. That's right, launchers, keyboards and widgets will run from the external storage natively, something never done before in Android as far as I know.
This means that once you have the script up and running, you're good to go until the next time you reflash your /system partition. No need to choose what apps to move. No symlinks or anything. Your apps now belong in the external storage, plain and simple.
* No need to backup all your stuff before running the script (and eventually no need to back up your stuff when you want to disable it either).
That's right, the script does the hard work for you. All your stuff gets safely moved to the external storage, with all ownerships and permissions intact. It all happens so smoothly that some people have a hard time telling that the script is already at work. Nothing gets deleted from the internal storage until you're certain that everything is working as expected either. So even if something goes wrong, as long as you have ADB, all your stuff can go back to normal without a problem
(Even though you don't have to backup and restore in order to get the script going, it's always greatly recommended that you keep a backup of your apps).
* Simple intallation:
To get the script going all you have to do is download it, extract it, and run 3 commands in the terminal. It will then ask you a couple of questions, and then you'll be all set. The one downfall is that because the script requires user input (no, the required information cannot be picked from a list), the script cannot be run from a recovery zip. However, I'll emphasize once again that it only takes 3 commands to get the script going.
Also, the script comes with an options file that allows you to setup device specific variables, making the script malleable to work on just about any Android device. Just open the USER_OPTIONS file before runing the install script, and as long as you have the variables there set correctly, the script should be compatible with your device.
* You can still use the external partition for other stuff if you want to. Just remember that it's mounted to /mnt/sd-ext (or /storage/sd-ext in JB). So if you still have a ton of space left in the partition and need the space, you can still use it. Just ensure not to touch the folders Android, app and data.
* Now this is a bit more technically, but in theory, you could a third partition for this script instead of the second partition, and then still be able to use app2sd solutions, though personally I don't see what advantage there would be to doing this since apps would still be in the external storage no matter what.
WHAT DOES THIS SCRIPT NOT DO?
*** IT CANNOT BE CONVERTED INTO A RECOVERY ZIP DUE TO USER INPUT REQUIREMENT ***
*** YOU CANNOT PICK AND CHOOSE WHAT APPS TO MOVE, THAT'S PLAIN AND SIMPLE NOT THE PURPOSE OF THIS SCRIPT ***
SCREENSHOTS
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Above you can see my storage screen. If you add the amount of used space and the amount of available space, it's ~18 GB, well over the available 11.66GB in the internal storage. Also note that when the script is enabled, the bar displaying storage usage is unreliable. All other information is reliable, including, and most importantly, the amount of available free space.
Above you can see the output of some commands in the terminal. The most important part of the output for mount above are
Code:
/dev/block/mmcblk0p12 on /mnt/temp/data type ext4 (rw,relatime,barrier=1,journal_async_commit,data=ordered,noauto_da_alloc,discard)
/dev/block/mmcblk1p2 on /mnt/sd-ext/data type ext4 (rw,nosuid,nodev,noatime,barrier=1,data=ordered)
/dev/block/mmcblk1p2 on /data/media/Android type ext4 (rw,nosuid,nodev,noatime,barrier=1,data=ordered)
/dev/block/mmcblk1p2 on /data/app type ext4 (rw,nosuid,nodev,noatime,barrier=1,data=ordered)
/dev/block/mmcblk1p2 on /data/data type ext4 (rw,nosuid,nodev,noatime,barrier=1,data=ordered)
As you can see, mmcblk1p2, the external storage, is mounted to /data/app, /data/data and /data/media/Android, which means that as far as Android is concerned, those folders are in the external storage. Also note that all these mounts took place before /sdcard itself was mounted, meaning that the script is ensuring that these mounts take place soon enough in the boot process to avoid problems related to mounting the app storage locations after Android has loaded the available apps.
Finally, the fact that mmcblk0p12 is mounted to /mnt/temp/data is important because of the next two commands
The output of du -sh shows the amount of storage used by a folder, and as such because the internal storage is mounted to /mnt/temp/data;
/mnt/temp/data/app = internal /data/app = 8KB
/mnt/temp/data/data = internal /data/data = 72KB
/mnt/temp/data/media/Android = internal /data/media/Android = 4KB
whereas
/data/app = 1GB
/data/data = 624.3 MB
/data/media/Android = 5.6 GB
For a grand total of 7.22 GB of used app storage in the external storage as opposed to 84 KB in the internal storage.
CREDITS
*smaw51 - Testing
*ArangeLTX - Testing and Debugging
*Laggan - Testing
*aadiflesher - Testing
*Others who tested the script but weren't in direct contact with me.
*People who said it wasn't possible to run widgets, launchers and keyboards from External Storage (They provided the challenge I needed to make this work)
If anybody needs help or if anything doesn't work, I'll help through irc (much quicker than posting here) on freenode - #and-host
UPDATES:
09-26-2012: Major Update, Overhauled most of previous code.
09-27-2012: Found badass typo in one of the files, fixed and uploaded correction.
09-27-2012: Added install Script.
10-02-2012: Corrected install script so that things now run properly. Don't forget to double check USER_OPTIONS and set ENABLED=true
10-02-2012: Added MMCBLKXPX variable to user options so now devices that mount SD-EXT to different block can use script easily.
10-03-2012: More fixes to the install script, also added check for storage location as well as user input. Started working on compatibility for devices where /sdcard/Android is in different partition from /data
10-03-2012: Updated this post with more organized information.
10-04-2012: Modified script so that debugging output works properly in JB
10-05-2012: Finished working on compatibility for devices with /sdcard and /data in different partitions (PENDING TESTING)
10-05-2012: Added automatic detection for such devices ^ (New variable is automatically created in USER_OPTIONS, called fukedupFS)
10-05-2012: Added extra security for $deletepostmove (Will not take effect until stage 3 is detected)
10-05-2012: Added switch on install script to do a clean install, (using sh ./install-a2sd -clean) which will erase all current options/vars and reset stage to 0.
WARNINGS:
1 - PROCEED WITH THE FOLLOWING STEPS AT YOUR OWN RISK. IF ANYTHING BREAKS I'LL GLADLY TRY TO HELP (IF I CAN), BUT YOU DO WHAT YOU DO AT YOUR OWN RESPONSIBILITY.
2 - THE INSTALLATION SCRIPT REQUIRES USER INPUT, WHICH MEANS THAT IT CANNOT BE MADE INTO A RECOVERY ZIP. DO NOT BOTHER TO ASK FOR ONE. IF YOU CAN'T LEARN HOW TO USE THE TERMINAL, THEN JUST STICK TO OTHER SUCKY APP2SD SOLUTIONS.
3 - THIS SCRIPT IMPLEMENTS INIT.D BY DEFAULT, IF YOU ALREADY HAVE INIT.D FUNCTIONALITY MAKE SURE TO CHANGE:
Code:
/system/bin/logwrapper busybox run-parts /system/etc/init.d
TO
Code:
# /system/bin/logwrapper busybox run-parts /system/etc/init.d
IN THE B]sysinit[/B] FILE.
4 - THIS SCRIPT IMPLEMENTS INIT.A, WHICH IS ESSENTIALLY LIKE INIT.D, BUT HAPPENS EXTREMELY EARLY AT BOOT TIME, IT IS SUGGESTED THAT REGULAR USERS DO NOT PUT ANY SCRIPTS IN INIT.A UNLESS THEY KNOW WHAT THEY'RE DOING, JUST USE INIT.D FOR OTHER SCRIPTS.
5 - UPDATE YOUR BUSYBOX TO THE LATEST VERSION (1.20.2 AT THE WRITING OF THIS). SOME EARLIER VERSIONS OF BUSYBOX ARE KNOWN TO NOT HAVE SOME OF THE REQUIRED SWITCHES FOR THE COMMANDS USED IN THE SCRIPT.
6 - AT THIS POINT THE SCRIPT REQUIRES THAT YOU HAVE A SECOND PARTITION IN YOUR MICROSD FORMATTED TO EXT4, ANYTHING ELSE WILL NOT WORK. THIS MAY CHANGE IN THE FUTURE, BUT AT THIS POINT IT'S A REQUIREMENT.
7 - FULLY READ THE INSTALLATION INSTRUCTIONS, MORE THAN ONCE IF POSSIBLE, BEFORE RUNNING THE SCRIPT. FAILING TO COMPREHEND WHAT'S GOING ON CAN POSSIBLY LEAVE YOUR DEVICE SEMI-BRICKED/CAUSE MAJOR HAVOC AND FORCE-CLOSES AND YOU'LL HAVE TO RESTORE A BACKUP. MORE THAN ANYTHING MAKE SURE TO BACKUP YOUR APPS.
INSTALLATION:
1 - Download the attached file on your device or PC.
2 - Extract the files and move it to an easy to access location in your device, such as /sdcard. Open USER_OPTIONS and ensure that all variables correctly apply to your device, LEAVE deletepostmove='false' until later. Set ENABLED='true' once you're reviewed everything.
3 - Open a terminal app (Rom Toolbox and such probably won't work because the script requires user input)
4 - Assuming that you moved all 6 files to /sdcard, execute the following commands in the terminal:
Code:
su
cd /sdcard
sh ./install-a2sd
You can also perform a clean install by using the command:
Code:
sh ./install-a2sd -clean
5 - The script will ask a couple of questions, answer them (ask someone for help if you're not sure).
6 - If all went well (The script will tell you that folders were created, files were copied and permissions were set) you'll be told that upon pressing enter your device will be rebooted. Press ENTER when ready or reboot manually if it fails to reboot on its own.
7 - STAGE 1 - NOTHING WILL HAVE NOTICIABLY CHANGED UPON THE FIRST REBOOT. This is normal. The first reboot will only garther many variables needed for the script to run properly, it will also give the opportunity to review the variables and ensure that everything is ok, so that you can disable the script in case the gathered variables are not correct, so that things don't get broken unecessarily. Please take a look at:
Code:
/sdcard/Tweaked.Scripts/A2SD/options/vars
If all looks good in there (even if you don't understand what the variables are for, ensure that the paths make sense, don't worry if you don't have /mnt/sd-ext and /mnt/temp, or /storage/sd-ext and /storage/temp as these will be created).
Reboot again after reviewing the variables.
8 - STAGE 2 - ONCE AGAIN, WHEN YOU REBOOT, NOTHING WILL APPEAR TO HAVE HAPPENED. In fact, this is not the case this time. If all variables were correct in STAGE 1, every app along with their data and files will have started to be copied over to the external storage as soon as the device finished booting. You should be able to see the process for this by opening the terminal and running the command:
Code:
logcat | busybox grep "01a2sd"
You can also run the following command in the terminal to ensure that there are extra mounts that did not exist prior:
Code:
mount
***THIS IS THE MOST IMPORTANT STEP IN THE PROCESS. MAKE SURE THAT YOU DO NOT REBOOT YOUR DEVICE UNTILL THE FOLLOWING FILE IS CREATED:
Code:
/sdcard/Tweaked.Scripts/A2SD/DEVICE_IS_READY
Failing to do so is the single worst mistake that you can do. Rebooting the device before the copying is done might cause all your apps to look like they're not installed, as well as major FCs, to the point where stuff is unusable and you have to restore a backup.
Just be patient during this step, specially if you already have a lot of apps installed, even more so if you have games that use a large amount of space.
9 - STAGE 3 - After rebooting from STAGE 2, the device will mount the external storage in every location where apps would reside in the internal storage. This is why it's extremely important that STAGE 2 is completed properly, because unless everything has been moved properly, files that were not copied will seem like they don't exist, possibly causing FCs and major havoc.
If everything went ok, it will actually look like nothing happened, but in fact, everything should be running from the external storage. You can confirm this by running the following command in the terminal:
Code:
mount
You should see three mounts that weren't there before that look like
Code:
/dev/block/mmcblk1p2 on /data/media/Android type ext4 (rw,nosuid,nodev,noatime,barrier=1,data=ordered)
/dev/block/mmcblk1p2 on /data/app type ext4 (rw,nosuid,nodev,noatime,barrier=1,data=ordered)
/dev/block/mmcblk1p2 on /data/data type ext4 (rw,nosuid,nodev,noatime,barrier=1,data=ordered)
At this point, it should be safe to open USER_OPTIONS in /sdcard/Tweaked.Scripts/A2SD/options and change deletepostmove='true'. Just remember that with this variable set on, all your apps will be wiped from external storage. This means that if you reboot without your MicroSD or if you lose the stuff in the MicroSD your alls will be gone. Becase of this, ensure that you have your apps backed up somewhere.
TweakerL said:
To install, download attached file (then rename it to 01a2sd) or copy code and save it to (01a2sd).
Copy the file to /system/etc/init.d (Can be done with any file manager that has root access)
Change permission to 755 (Can be done with most file managers with root access)
Change Options in script to your liking.
Enjoy the extra storage after reboot.
Code:
#! /system/bin/sh
########################################################################################################
########################################################################################################
## ##
## Super APP2SD by TweakerL ##
## Visit us at http://and-host.com ##
## Chat with us on freenot at #and-host ##
## ##
########################################################################################################
########################################################################################################
export PATH=/sbin:/system/sbin:/system/bin:/system/xbin
########################################################################################################
## Options #############################################################################################
## ##
## Feel free to change these: ##
## ##
## moveAndroid: Moves /sdcard/Android to external storage. ##
## moveApps: Not yet implemented ##
## moveData: Not yet implemented ##
## ##
## deletepostmove: If 'true ' Deletes files from internal storage after they have been moved. ##
## ##
## pruneoldlogs: If 'true' Deletes logs older than X hours set in prunehoursold. ##
## prunehoursold: If 'X' greater than 0 logs older than X hours will be deleted ##
## If 'X' equal 0 all logs will be deleted ##
## ##
## debugging: If 'true' files will be created in /sdcard for debugging purposes ##
## ##
moveAndroid='true' ##
##
deletepostmove='true' ##
##
pruneoldlogs='true' ##
prunehoursold='1' ##
##
debugging='false' ##
########################################################################################################
########################################################################################################
## Constants ###########################################################################################
## ##
## Don't touch these unless you're told to by someone who knows what they're doing: ##
## ##
append_android='/Android' ##
append_data='/data' ##
append_obb='/obb' ##
append_ext4='/ext4' ##
append_tweaked='/Tweaked.Scripts' ##
append_movethis='/movethis.txt' ##
append_temp='/temp' ##
append_media='/media' ##
append_A='A' ##
append_logs='/logs' ##
##
data='/data' ##
########################################################################################################
########################################################################################################
if [ -f /sbin/busybox -o -f /system/sbin/busybox -o -f /system/xbin/busybox -o -f /system/bin/busybox ]
then
has_busybox='true'
fi
if busybox blkid | busybox egrep -i "mmcblk1p2" > /dev/null
then
has_mmcblk1p2='true'
fi
if busybox blkid | busybox egrep -i "mmcblk1p2" | busybox awk '{print $4}' | busybox cut -f2 -d'"' > /dev/null
then
is_ext4='true'
fi
if [ $has_busybox == 'true' -a $has_mmcblk1p2 == 'true' -a $is_ext4 == 'true' ]
then
# DEBUGGING
# Get vars part 1
if [ $debugging == 'true' ]
then
set > /sdcard/vars.1
fi
# END DEBUGGING
# Start defining functions
makedir () {
if [ ! -d $1 ]
then
busybox mkdir -p $1
fi
busybox chmod $2 $1
busybox chown $3:$4 $1
}
# End defining functions
mnt_sd=$( busybox mount | busybox egrep -i '/sdcard' | busybox awk '{print $3}' )
mnt=$( busybox dirname $mnt_sd )
sd_uid=$( busybox ls -ln $mnt_sd | busybox egrep -i "Android" | busybox awk '{print $3}' )
sd_gid=$( busybox ls -ln $mnt_sd | busybox egrep -i "Android" | busybox awk '{print $4}' )
blk_ext4=$( busybox ls -lR /dev | busybox egrep -i "mmcblk1p2 ->" | busybox awk '{print $11}' )
blk_data=$( busybox mount | busybox egrep -m 1 '/data' | busybox awk '{print $1}' )
mnt_ext4=$mnt$append_ext4
ext_data=$mnt_ext4$data
ext_android=$ext_data$append_android
mnt_temp=$mnt_ext4$append_temp
temp_android=$mnt_temp$append_media$append_android
datetime=$( busybox date -Iseconds )
sd_android=$mnt_sd$append_android
sd_tweaked=$mnt_sd$append_tweaked
tweaked_logs=$sd_tweaked$append_logs
txt_movethis=$sd_tweaked$append_movethis
makedir $sd_tweaked 775 $sd_uid $sd_gid
data_media=$( busybox dirname $( busybox find /data -type d -follow -name 'Tweaked.Scripts' ) )
data_android=$data_media$append_android
data_uid=$( busybox ls -lnd $data | busybox awk '{print $3}' )
data_gid=$( busybox ls -lnd $data | busybox awk '{print $4}' )
android_uid=$( busybox ls -ln $data_media | busybox egrep -i "Android" | busybox awk '{print $3}' )
android_gid=$( busybox ls -ln $data_media | busybox egrep -i "Android" | busybox awk '{print $4}' )
# DEBUGGING
# Get vars part 2
if [ $debugging == 'true' ]
then
set > /sdcard/vars.2
busybox diff /sdcard/vars.1 /sdcard/vars.2 | busybox grep "+" | busybox egrep -v "@|_=" > /sdcard/vars.txt
fi
# END DEBUGGING
busybox chmod 775 $sd_tweaked
busybox chown $android_uid:$android_gid $sd_tweaked
makedir $tweaked_logs 775 $sd_uid $sd_gid
echo 'Logging Started' > $tweaked_logs/a2sd-$datetime.log
echo '' >> $tweaked_logs/a2sd-$datetime.log
busybox mount -o remount,rw /
makedir $mnt_ext4 775 $data_uid $data_gid
busybox mount $blk_ext4 $mnt_ext4
sleep 1
makedir $mnt_temp 775 $data_uid $data_gid
busybox mount $blk_data $mnt_temp
sleep 1
makedir $ext_data 775 $data_uid $data_gid
makedir $ext_android 775 $android_uid $android_gid
busybox mount -o bind $ext_android $data_android
sleep 3
busybox mount -o remount,ro /
if [ $moveAndroid == 'true' ]
then
busybox find $temp_android -type f -follow -print > $txt_movethis
fi
if [ $moveAndroid == 'true' ]
then
echo 'Copying files from internal storage to external storage\n' >> $tweaked_logs/a2sd-$datetime.log
while read line
do
source=$line
destappend=$append_A$( echo "$line" | busybox cut -f2-100 -d'A' )
dest=$ext_android/$destappend
destfolder=$( busybox dirname $dest )
if [ ! -f "$dest" ]
then
if [ ! -d "$destfolder" ]
then
busybox mkdir -p "$destfolder"
fi
busybox cp -pdf "$source" "$dest"
if [ -f "$dest" ]
then
echo -e $source'\ncopied to\n'$dest'\n' >> $tweaked_logs/a2sd-$datetime.log
else
echo -e 'Failed to copy: '$source'\n' >> $tweaked_logs/a2sd-$datetime.log
fi
else
echo -e 'Already exists: '$dest'\n' >> $tweaked_logs/a2sd-$datetime.log
fi
if [ $deletepostmove == 'true' ]
then
if [ -f "$dest" ]
then
busybox rm -f "$line"
if [ ! -f "$line" ]
then
echo -e 'deletepostmove = true - Deleted: '$source'\n' >> $tweaked_logs/a2sd-$datetime.log
echo -e '____________________________________________________________ ' >> $tweaked_logs/a2sd-$datetime.log
else
echo -e 'Failed to delete: '$source'\n' >> $tweaked_logs/a2sd-$datetime.log
echo -e '____________________________________________________________ ' >> $tweaked_logs/a2sd-$datetime.log
fi
fi
fi
done < $txt_movethis
busybox rm -f $txt_movethis
busybox chmod -R 775 $ext_android/*
busybox chown -R $android_uid:$android_gid $ext_android/*
fi
busybox umount $mnt_temp
if [ $pruneoldlogs == 'true' ]
then
(( prunehours = ($prunehoursold * 60) ))
find $tweaked_logs -mmin +$prunehours -exec rm {} \;
echo "All logs older than "$prunehoursold" hours old have been deleted"
fi
echo -e '\nEnd of Log' >> $tweaked_logs/a2sd-$datetime.log
fi
Click to expand...
Click to collapse
Where to find premission? Please advice.
Sent from my GT-N8000 using xda app-developers app
andylam16 said:
Where to find premission? Please advice.
Sent from my GT-N8000 using xda app-developers app
Click to expand...
Click to collapse
use a root file browser then press and hold on the file, select permissions. Change to: Owner (rwx), group and other (rx)
Sent from my GT-N8013 using Tapatalk 2
My device doesn't have intI. D folder in system/Etc
I have to create new folder?
Rename the file without . Txt?
Sent from my GT-N8000 using Tapatalk 2
lm that guy said:
use a root file browser then press and hold on the file, select permissions. Change to: Owner (rwx), group and other (rx)
Sent from my GT-N8013 using Tapatalk 2
Click to expand...
Click to collapse
Thanks bro, is r = read , w = write , x = ???
Please advice.
Sent from my GT-N8000 using xda app-developers app
andylam16 said:
Thanks bro, is r = read , w = write , x = ???
Please advice.
Sent from my GT-N8000 using xda app-developers app
Click to expand...
Click to collapse
Execute
Sent from my GT-N8013 using Tapatalk 2
lm that guy said:
Execute
Sent from my GT-N8013 using Tapatalk 2
Click to expand...
Click to collapse
Got it, thanks!:thumbup:
Sent from my GT-N8000 using xda app-developers app
kaipro said:
My device doesn't have intI. D folder in system/Etc
I have to create new folder?
Rename the file without . Txt?
Sent from my GT-N8000 using Tapatalk 2
Click to expand...
Click to collapse
+1
fauzin said:
+1
Click to expand...
Click to collapse
I suggest this thread: http://forum.xda-developers.com/showthread.php?t=1883125
Sent from my GT-N8013 using Tapatalk 2
kaipro said:
My device doesn't have intI. D folder in system/Etc
I have to create new folder?
Rename the file without . Txt?
Sent from my GT-N8000 using Tapatalk 2
Click to expand...
Click to collapse
Check link in my sig for my other thread where you can get the init.d enabler.
After did the procedure as mentioned nothing happened the apps still go to the scared not the external. Please advice anything I missed. Thanks
Sent from my GT-N8000 using xda app-developers app
---------- Post added at 10:54 AM ---------- Previous post was at 10:12 AM ----------
One more thing there is a file "99testinit" inside the init.d , do I need to anything about it?
Sent from my GT-N8000 using xda app-developers app
andylam16 said:
After did the procedure as mentioned nothing happened the apps still go to the scared not the external. Please advice anything I missed. Thanks
Sent from my GT-N8000 using xda app-developers app
---------- Post added at 10:54 AM ---------- Previous post was at 10:12 AM ----------
One more thing there is a file "99testinit" inside the init.d , do I need to anything about it?
Sent from my GT-N8000 using xda app-developers app
Click to expand...
Click to collapse
Exactly same as me.
Sent from my GT-N8000 using Tapatalk 2
If you guys read everything, this is still an early version. At the moment, only /sdcard/Android is getting moved, which is the location that stores extra files downloaded by apps, not the apps themselves. If the script is running, you can go on terminal and type:
Code:
df -h
and you should see mmcblk1p2 (which is the ext4 partition in the MicroSD) and how much space is being used, which is the amount of space that should be getting saved from the internal storage. Also, if you look under storage under settings, the amount of space available should have increased considerably, specially if you have a lot of games.
I'll be working on the other two parts throughout this week (moving APK and DATA) Then you will be able to notice a bigger difference, although it will always look like apps are installed in the internal storage, even when they're in the external storage.
The reason for this is because the script works by mounting the external storage to:
/data/app (not yet implemented)
/data/data (not yet implemented)
/data/media/Android (already implemented)
while at the same time copying the contents of those locations from internal to external then wiping them from internal. Essentially when it's all said and done, the OS pretty much thinks that nothing has changed, except that whenever anything gets written to those folders it takes space from the external storage instead of internal.
A good way to test it would be to download a free gameloft game like MIB3 or Six Guns. Take a look at storage before installing. After you install MIB3, your available storage should drop by roughly 500MB, but if you're using the script, even at preview stage, the available storage will only drop by about 30MB, even though storage settings will say that the game takes up ~500MB.
Also, you can mount your normal data partition and take a look at how much space is being used there, as opposed to the external partition like this:
(All the following commands in terminal)
make sure which partition is mounted to /data
# mount
mount data to temp location (assuming data is mmcblk0p12)
# mount /dev/block/mmcblk0p12 /mnt/ext4/temp
check amount of space used in internal storage:
# du -dh /mnt/ext4/temp/media/Android
check amount of space used in external storage
# du -dh /mnt/ext4/data/Android
In the future I'll add to the script a way to automatically calculate the amount of space saved
The script itself is not working. Init.d is working, did rename the file and changed permission. I use script manger and try to run the script but it's got error,
Sent from my GT-N8000 using xda app-developers app
htainlin said:
The script itself is not working. Init.d is working, did rename the file and changed permission. I use script manger and try to run the script but it's got error,
Sent from my GT-N8000 using xda app-developers app
Click to expand...
Click to collapse
I'm gonna be uploading a new version soon with more debugging so I can see why people might have issues.
EDIT - Done updating OP
Is there any recommendations for the partition other than ext4, like swap size and what not? I also assume a reboot is required in order to get it to run right? I am still getting insufficient storage available when updating apps in the play store. I was getting that error before, even though I have plenty of space, like more than 10 gb on the internal memory so I don't know if it is just a batch update issue on the play store with my note for whatever reason. But even individual updates stop with an insufficient storage error.
I have tried using both the attached file in the op as well as the copy and paste method. The file should have no extension once in place right?
It seems as though it is still not working right
I have init.d working, confirmed with the test file and your method, Busybox installed, partitions with 0 swap and 1024 size at ext4
I have not been able to locate a log created, where is it dumped to to see if it is even running the script?
EDIT: never-mind, I figured out why my stuff was't updating but still able to add new apps, in rom tool box, I set it to install to sd card after most of my apps were already put on the internal memory. Just switched it to auto and it fixed it up
smaw51 said:
Is there any recommendations for the partition other than ext4, like swap size and what not? I also assume a reboot is required in order to get it to run right? I am still getting insufficient storage available when updating apps in the play store. I was getting that error before, even though I have plenty of space, like more than 10 gb on the internal memory so I don't know if it is just a batch update issue on the play store with my note for whatever reason. But even individual updates stop with an insufficient storage error.
I have tried using both the attached file in the op as well as the copy and paste method. The file should have no extension once in place right?
It seems as though it is still not working right
I have init.d working, confirmed with the test file and your method, Busybox installed, partitions with 0 swap and 1024 size at ext4
I have not been able to locate a log created, where is it dumped to to see if it is even running the script?
EDIT: never-mind, I figured out why my stuff was't updating but still able to add new apps, in rom tool box, I set it to install to sd card after most of my apps were already put on the internal memory. Just switched it to auto and it fixed it up
Click to expand...
Click to collapse
Had a similar problem when i had the tf201, kept getting an error whenever playstore started installing an app after the initial download, and i had the same problem a couple of days ago with the note which i resolved by deleting all odex files in the data\apps folder, i used es file explorer, navigated to the app folder and did a search for 'odex', then deleted them, i can now install apps again
Dont know if this is the same issue as yours , and ive just now seen your edit, so i see youve resolved it, so no worries, hopefully our solutions will help out others
Edit: dont quote me but my particular issue i 'think' has something to do with titanium backup, so for those having 'inssuficient storage errorr' in the playstore AND you have titanium backup, this may help
It might be a restore from backup in general issue, after you mention you used titanium. I used my backup pro to restore apps and data from my tf 700 to the my note. Only halfsies worked but maybe that caused some issues.
This is going to be very nice one apk and data are enabled to move to sd
how do I know that I have ext4 in my SDcard? and if I dont have it , How do I make ext4 ?
Thanks