yashsingh1/xdaforums huggingface dataset:
[Galaxy Note 10.1 Android Development] aadiflesher:
Need Help!

Hello

I have a bit of problem installing the script.

I have changed this: # /system/bin/logwrapper busybox run-parts /system/etc/init.d and this: Set ENABLED='true'

I have installed the script using the terminal app on my phone.

su

cd /sdcard

sh ./install-a2sd

I just had to answer one question with "yes" and the phone rebooted by itself.

After reboot if i go to /sdcard/Tweaked.Scripts/A2SD/options I have a "install-vars" file and not a "vars" file. And in that "install-vars" file there is only one line: SDCARD=/storage/sdcard0.

Reboot again...

On the phone I only have installed Adobe flash player and Abode air, so my phone boots up fast.

I go in the terminal on my phone again and type "logcat | busybox grep "01a2sd"" (I hope this is correct) but nothing happens. If I try with su and type the same thing again it gives me this:

I/busybox ( 291): /system/etc/init.d/01a2sd[33]: can`t create /sdcard/Tweaked.Scripts/debugging/vars.1: No such file or directory

I/busybox ( 291): run-parts: /system/etc/init.d/01a2sd exited with code 1

but not all the time....

I have waited and waited but nothing has happened and there is no DEVICE_IS_READY file in /sdcard/Tweaked.Scripts/A2SD

I know it says not to reboot the phone at this time, but I finally do it, but all the same, there is no DEVICE_IS_READY file and the apps are working.

So please tell me what am I doing wrong and how to fix it, because I need a good Apps2SD!

I have a Google Nexus One, running a custom ROM on JB.

http://xdaforums.com/showthread.php?t=1823415

Thank you!
[Galaxy Note 10.1 Android Development] Tony84:
Other weird thing now is that small apps don't install, it just says not enough space. btw bigger apps install.
[Galaxy Note 10.1 Android Development] TweakerL:
If you look at post #2 you'll see that I'm still working on compatibility for devices where /sdcard/Android is not in the same partition as /data, which I think is the case in your device.

Just to be sure, please post the output of

mount

and

cat /proc/partitions

EDIT - I uploaded an updated zip that should solve the error with debugging/vars not being created. It may very well be that the script is failing because of that error. Please update and reinstall.
[Galaxy Note 10.1 Android Development] TweakerL:
That is pretty weird. But before I go into that, if you have the 3 mounts, and all the apps that you had before running the script still work, then I guarantee you that the apps have been copied to the external storage.

I'll have to try and think of why you might have a problem downloading small apps though. My first suggestion is to go into settings > application manager > all > google play store > force close + clear data; then try to go back into play store and download again.

But yea, if you have those 3 mounts, and your apps work, they MUST be running from external storage. Once you're sure, and once you figure the issue with small apps, going into USER_OPTIONS and setting deletepostmove to true will free the space in the internal storage.
[Galaxy Note 10.1 Android Development] Tony84:
Ok I can confirm that android data and obb folders have moved to the ext sd, checked it by mounting scared on my linux netbook. B

So the problem with storage space that was the same is that the script just copies files, Iraq actually dosnt move them so I need to delete them manually from int sdcard. But the problem with small space is still weird. I'LL try as you said. But now automatically every app I will install will be installed on extsd?
[Galaxy Note 10.1 Android Development] TweakerL:
Yes, every app will be installed directly into the external MicroSD. Also, you don't have to manually delete the files, open USER_OPTIONS in /sdcard/Tweaked.Scripts/A2SD/options and change deletepostmove='false' to deletepostmove='true', that way the script will automatically delete every file that exists in the internal storage that has already been copied to the external storage.
[Galaxy Note 10.1 Android Development] Tony84:
But installing every app to sdcard will not decrease overall tablet's speed? Is jt possible to just push some huge apps on extsd as I do for example on Sony Ericsson xperia x10?
[Galaxy Note 10.1 Android Development] TweakerL:
If you want to do that, open USER_OPTIONS and have moveAndroid='true', moveApps='false', moveData='false'

Most of the stuff that takes a lot of space, such as games and streaming (such as spotify for example) gets saved to /sdcard/Android. So if all you want to do is save space on the stuff that takes a lot of space, moving that folder should take care of that.

Now, to answer your question, this script is never gonna have the option for moving only specific apps. For two reasons. #1, because it would be kind of impossible to do that with a INIT.D script alone. Secondly because there's already plenty of apps that let you do that... Well, actually there aren't because the only app with app2sd functionality is link2sd, and it moves everything EXCEPT the stuff in /sdcard/Android....

The purpose of this script is to be a system wide thing, and to have apps get installed straight into the external storage (to help people with phones that have very little storage), and I guess to prove that launchers, keyboards, and widgets can in fact be run from external storage.

I'll be honest with you, my tab feels just as fast now as it did before I installed the script. I still haven't seen a single ANR, and I have no problems using it in any way. Then again, I do have a 64gb Sandisk Ultra, which is roughly the best 64gb MicroSD card out there, or at least the best one when I bought it a few weeks ago.
[Galaxy Note 10.1 Android Development] Tony84:
I have a SanDisk class 10 32gb sd. Class 10 is fast enough?

Btw thanks for your fast answers ^^

---------- Post added at 10:01 PM ---------- Previous post was at 09:56 PM ----------

Other question. If I do as you said andat one moment I want to stop installing all apps inside ext sdcard , I just need to set false android also?
[Galaxy Note 10.1 Android Development] TweakerL:
It depends, if you set deletepostmove='true', then files will get deleted from internal storage, which means that if you set moveAndroid='false' afterwards, then even though the files will exist in the external storage, the external storage will no longer be mounted, which for android will make it seem like the files don't exist. As a result, you'd have to manually copy the files back to where they used to be in the first place.

I'll be working on a recovery option once I get the script working in a way that it works for every device. The way it will work is going to be that you set the recovery option in USER_OPTIONS, and if it's set to true, then it overrides everything else and copies everything back into the external storage and then disables the script.

Also, a class 10 Sandisk should work pretty good (assuming it's not fake, yes there are fake MicroSD cards out there, I suggest you use CrystalDiskMark to ensure you have a good MicroSD, if it's good you'll probably have over 1mbps random write speed)

I'll be honest though, if you have a good class 10 MicroSD I think your concern for lowering the speed is misplaced. For a couple of reasons... #1, say you're playing a game on android, the only time when IO speed will really really matter, is when the game is loading stuff. Now, a class 10 MicroSD card will usually have at least 20MB/s read speeds, which quite honestly is probably comparable, if not better, than the internal storage of most android devices, if not all. Granted, MicroSD cards don't have better random write speeds than most internal storage on android devices (except Asus devices since their IO is the worst POS ever), which makes it irrelevant for most situations. And then, in most situations when you do encounter random write, it's often gonna involve the cache partition, which is still untouched by this script, once again making it irrelevant.

Here's what I would do, if you want an app2sd solution, give this one a try all the way,with all options enabled. If you feel that your device got slower, you can always disable the script or play with the options. Just don't enable deletepostmove until you're sure that you're happy with what you got, that way you can always just disable the script without having to go through too much problems. I would just suggest that you do a Titanium Backup before enabling or disabling the script, that way you have all your apps backed up in their current conditions just in case something goes wrong. And of course, always have a nand backup should you find yourself in a situation where just a TiBu backup is not enough.

EDIT - One more thing, most people are concerned with app2sd solutions that move everything because generally, it's impossible to properly run widgets, launchers or keyboards from the external storage. This script, unlike anything ever made for android that I'm aware of, takes care of that problem, being the only way that, i know of, where you can run every single app that exists from the external storage without problem, at least without completely mounting /data to the external storage.
[Galaxy Note 10.1 Android Development] Tony84:
But what happens. when ext sd will run full with no space left? Do the apps then will install automatically to internal. storage?
[Galaxy Note 10.1 Android Development] TweakerL:
Yea, it is as I thought, you have /data and /sdcard/Android in different partitions, and I still haven't got the script to work in devices like that. I might have it working by the end of the day though, so just take a look at the thread later in the update section to see if I got the new file up.

Also, if my assumption is correct, and your sd-ext partition is mmcblk0p2, it would probably be a bad idea for you to use this script as that partition is only ~500MB and that's by no means enough storage for apps. If that's your sd-ext partition, you either need a bigger one or a bigger MicroSD before it makes sense to use this script.

I would imagine that it's impossible to have that happen. Once you mount the external storage as the app storage, you can't just remount the internal storage without a reboot. But I would imagine that the only people who would use this script are people with more external storage than internal storage, in which case they would have run out of internal storage sooner than they would run out of external storage. Also, you can't have apps running from both internal and external storage using this method.

Somehow I failed to see this post before altogether ^

Anyway, something still looks off. Essentially, the amount of app space used should stay the same while the amount of available space should increase. Come to think of it, another way to tell that the script is running right is to add all the used space + available space and it should be greater than the total space. I'll attach some screenshots soon to show what I mean.

Also, I was looking for your post where you mentioned possible incompatibility with the latest firmware update. I restored back to full stock with Odin because I couldn't apply the update (had changed too many things in system), then applied the firmware update, then applied the app2sd script, and all works perfectly fine.

EDIT - Zip updated, now with tentative support for devices where /sdcard and /data are on different partitions.

EDIT - Attached is the screenshot I promised, sorry it took a while, I got carried away doing other modfications to the script.

As you can see, if you add just the used storage for apps and available storage, it's well over 18GB even though I only have 11.66 available. Also, note that the bar can no longer be trusted once you enable the script.
[Galaxy Note 10.1 Android Development] aadiflesher:
Thank you again for the answer.

My sdcard is 8GB and the sd-ex partition is 512 MB ext4. I can make it bigger if necessary. Is 1 GB ok for the script?

I saw that you got the script updated so it would work on devices where /sdcard and /data are on different partitions. I will give it a try :)
[Galaxy Note 10.1 Android Development] TweakerL:
Go into settings > storage, and see if tells you how much space has been used for apps. You need at least that much space in the partition. Also, be careful, as you can see in the 2ND post it says that the update is (PENDING TESTING) because I don't have a device that I can test it on (that is, I don't have a device where /data and /sdcard are on different partitions). So if you don't know how to debug and/or don't want to risk having to restore a backup, you might want to wait for someone to test it and help me fix it if there's a problem.
[Galaxy Note 10.1 Android Development] aadiflesher:
I don`t have like a ton of apps and I don`t have any games. But I have enough and they don`t fit on my internal storage, that is why I need this a2sd.

I don`t mint having to restore a backup, it is no problem. I have not tried the updated script yet, was waiting for your response.

Maybe I will give it a try now. What should I expect, look for or worry about? Maybe I can give you some info on how the script is responding.

But mind you, I am a beginner and don`t know much about scripting and all that. What I know I have learned from here, XDA :)
[Galaxy Note 10.1 Android Development] TweakerL:
Main thing is to follow the steps in the 2nd post.

Before you actually run the script, open USER_OPTIONS with a text editor, and I'm sure you'll have to change ANDROID='/data/media/Android' to something that applies to your device. I think your best bet is to have ANDROID='/storage/sdcard0/Android'

First thing to look for is that after reboot you should have a folder in /sdcard called /Tweaked.Scripts, and in the very least you need to have

/sdcard/Tweaked.Scripts/A2SD/options/USER_OPTIONS

/sdcard/Tweaked.Scripts/A2SD/options/vars

/sdcard/Tweaked.Scripts/A2SD/options/install_vars

The most important file here is /vars, you can open it with a text file, and you should see all the variables that the script needs. The paths may all seem kind of confusing, but it basically goes like this, at least for your device

Storage devices get mounted to /storage, so all mounts will be /storage/something

the external partition will go to /storage/sd-ext/data

the temporaty partitions will go to /storage/temp/data and /storage/temp/sdcard

then things should get moved like this

/data/app > /storage/sd-ext/data/app

/data/data > /storage/sd-ext/data/data

/sdcard0/Android > /storage/sd-ext/Android

Now, because the script mounts the external as if it were the internal, we have to copy from the temporary mount so the above becomes

/storage/temp/data/app > /storage/sd-ext/data/app

/storage/temp/data/data > /storage/sd-ext/data/data

/storage/temp/sdcard/Android > /storage/sd-ext/Android

So, basically, when you look at the ./vars file, you will pretty much want to see all paths look like they have to do with the above, if anything is off, or specially if you don't have the ./vars file, then something went wrong. Feel free to copy and paste the contents here, and I'll take a look and see how things are going.

Also, the next most important thing to do assuming everything looks good based on the above, is that after the second reboot, you want to wait patiently for /sdcard/Tweaked.Scripts/A2SD/DEVICE_IS_READY to be created. The worst mistake that you can make in the whole process is to reboot prematurely in which case only half of your apps might have been copied over. They should be able to continue copying fine in that situation, but you might get swarmed with force closes, and have a hard time checking that the DEVICE_IS_READY file got created. However, once you do get that file, you should be able to safely reboot, and upon booting, everything should be working fine with everything running form the MicroSD.

Finally, as for the size of the partition, just think of how much space you might need in the future and make the partition that size. Remember that ALL apps will be running completely from this partition.Including any extra files that they might download.
[Galaxy Note 10.1 Android Development] aadiflesher:
I will get started in a few minutes. And thanks again for the quick responses and information.

At the beginning when I tested and wanted to install I did not have /vars just /install/vars

The phone has a fresh ROM installed and I only have the apps that came with the ROM. I will test it like this for now, so I don`t have to wait for all the apps to move in case it really works :P

I will do as you instructed and post the contents of the files here if there is any problem.

Thanks again!

---------- Post added at 12:39 AM ---------- Previous post was at 12:10 AM ----------

ok, so this is the things I get....

First of all I have changed this: # /system/bin/logwrapper busybox run-parts /system/etc/init.d

And then in the USER_OPTIONS I have changed this: ENABLED='true' and ANDROID='/storage/sdcard0/Android'

I have entered in the terminal and installed the script. When I hit install it asked me this: According to your system /sdcard points to /storage/sdcard0, is this correct? [yes/no] And I say "yes". That is the only question and after that it reboots.

After the first reboot I have the /Tweaked.Scripts folder on my SDcard but only this in the folder:

/sdcard/Tweaked.Scripts/A2SD/options/USER_OPTIONS

/sdcard/Tweaked.Scripts/A2SD/options/install_vars

Again no vars file, the important one :))

This is as far as I went....

If I give "sh ./install-a2sd -clean" it will uninstall the script to start fresh or.. ?
[Galaxy Note 10.1 Android Development] TweakerL:
If you DON'T ALREADY have init.d, you want DON'T want to add the # to that line. If you don't have init.d, adding # would cause you to not get the vars file. One easy way to check beyond doubt is, open terminal and run the following commands:

su
logcat | busybox grep "01a2sd"

You should in the very least get either an error, or a line saying that the script is being run with root permission. If you don't get anything, that means you didn't have init.d, so uncomment that line, that is, remove the #, and run sh ./install-a2sd -clean.

Btw, the -clean doesn't uninstall it, it reinstalls it, but also deletes any files that may have been created since the last install, hence, a clean installation.
[Galaxy Note 10.1 Android Development] aadiflesher:
I did that because in my ROM there is a /system/etc/init.d that contains this: 00_zram, 00cpufreq, 01modules, 02cpufreq, 03mic_level, 05mountext, 90userinit. There is no a2sd there...

If I run the command I get this:

a/local/bin:$PATH <

u0_a11@android:/ $ su

u0_a11@android:/ # logcat | busybox grep "01a2sd"

I/busybox ( 291): /system/etc/init.d/01a2sd[22]: .: /A2SD/options/USER_OPTIONS: No such file or directory

I/busybox ( 291): run-parts: /system/etc/init.d/01a2sd exited with code 1

D/Explorer( 1147): -rwxr-xr-x 1 0 2000 9918 Oct 6 01:34 01a2sd

I/ActivityManager( 266): START {act=android.intent.action.VIEW dat=file:///system/etc/init.d/01a2sd typ=text/plain cmp=pl.solidexplorer/.TextEditor (has extras) u=0} from pid 1147

If I run the script install with -clean again it says: "You have fukedupFS, variable set to true in USER_OPTIONS" and this again: According to your system /sdcard points to /storage/sdcard0, is this correct? [yes/no]

I say yes and it reboots ...

Also no vars file ... I am really mad now :))
[Galaxy Note 10.1 Android Development] blz_phnx:
how do i know if i have init.d functioning
[Galaxy Note 10.1 Android Development] relldroid:
So Scared

I really want this on my 16g model since im already out of space, but its so scary when i read i can semibrick, Im usually able to handle this no problem but I dont have much time to really feel comfortable to know exactly what im doing. Perhaps it can be baked in a rom? Since it cannot simply be flashed. This is the solution I was looking for.
[Galaxy Note 10.1 Android Development] blz_phnx:
Still in testing mode and it's user input for now, so won't get anytime soon, I'm guessing
[Galaxy Note 10.1 Android Development] aadiflesher:
I am writing once again everything that I get when running the script, maybe someone figures out how to make it work on my device (Google Nexus One)

I have /sysytem/etc/init.d that contains this: 00_zram, 00cpufreq, 01modules, 02cpufreq, 03mic_level, 05mountext, 90userinit

I also did not add # to /system/bin/logwrapper busybox run-parts /system/etc/init.d

And I changed ANDROID='/data/media/Android' to ANDROID='/storage/sdcard0/Android' If I use a root explorer, i use Solid Explorer Beta2, it tells me this is right, i mean ANDROID='/storage/sdcard0/Android') I also have /mnt/sdcard, but if I go in there and look at the path it still says /storage/sdcard0/

Set ENABLED='true'

And finally install the script.

After reboot i still don`t have the vars file only install-vars and USER_OPTIONS.

But now I have /system/etc/init.a and in /sysytem/etc/init.d there is an extra file named 01a2sd.

If I comment out this line /system/bin/logwrapper busybox run-parts /system/etc/init.d and install the script again using sh ./install-a2sd -clean, is the same deal. No vars file.

Do I have to comment out the line or not?

I have:

/data

/sd-ext

/storage/sdcard0

Thank you! :)
[Galaxy Note 10.1 Android Development] jlb777:
I have exactly the same problem, I have tried various times and no joy - I am running jelly bean on an xperia arc.

I have modded the instructed files to point at my second SD card ext4 partition (mmcblk0p2) and set correct paths to the 3 folders, I have tried with the init.d line enabled and hashed out - no joy. I have checked to ensure I am running busy box and that it s working - all good.

Going nuts now :).

Any advice would be much appreciated.
[Galaxy Note 10.1 Android Development] aadiflesher:
So you also have /storage/sdcar0 and not ANDROID='/data/media/Android' or something like that?

What are the 3 folders that you set the paths?

I have to try everything right now to get this to work on my device :))

Thanks! :)
[Galaxy Note 10.1 Android Development] jlb777:
I included:

/data/data

/data/app

/storage/sdcard0/android

Still only the 2 files in folder after first reboot.

Tried with init.d line hashed and active - no joy.

Tested busy box to ensure it responds to commands - all OK.

Me thinks this script isn't going to work for cooked ics-jb nixed roms :(

Let me know if u have any joy?

Ta muchly
[Galaxy Note 10.1 Android Development] aadiflesher:
I did the exact same things on my phone with a JB ROM and the same results :( only 2 files...

If I make any progress and get it working I will let you know, yes :)

Maybe the developer fixes the issues, that would be nice. We will see.
[Galaxy Note 10.1 Android Development] ajayshoots:
..

me too have same problem , i am on stock and have data/media/android and done everything as told but after first boot no var instead user option and install var in sdcard/tweaked.scripts/A2SD/options