yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] MarcoToo:
Check if you have /system/bin/sysinit. If you don't have it, download it below and push it. (rename it to sysinit, I had to add an extension for xda to take the upload)

In the following steps I assume you know how to edit the initfram, if not - there are several good tutorials out there. Just remember not to use notepad.

Replace the "old" init.d line

service sysinit

with

exec /system/bin/sysinit

. Then ctrl+F for the line containing init.d and remove it and the lines related to it (the two following I assume).

Repack your boot.img, flash it and voila!
[Android Software/Hacking General [Developers Only]] nqkoidrug:
I installed version by default aroma instaler M2SD but I think something not happened:
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
I can't read anything from that other than you might want to plugin your charger ;)

You cannot see the sd-ext from any build-in android settings. To see it you need to download a third party app. All you can see in settings is the remaining space getting bigger as the apps are moved away from the data partition.
[Android Software/Hacking General [Developers Only]] espi12:
Problem moving data to sd-ext

Hi,

First of all, many thanks dk_zero-cool for your work.

I'm having an issue trying to move data to sd-ext.

I'm on BCM RC4.0, with m2sd enabled with only apps selected.

Then I go to the M2sd menu enable data and reboot.

When it boots the data is not moved to sd-ext and the phone doesn't find it, it's like if all the data has been wiped althought it's still in the internal storage.

I've tryed to move it manually to sd-ext but without good results. The only way to recover it, is to restore from nandbackup.

V/sysinit ( 380): Executing /system/etc/init.d/10mounts2sd...
I/10mounts2sd( 382): grep: /props: No such file or directory
V/mounts2sd( 441): Initiating Mounts2SD (v:4.5.2) [Mon Jun 11 12:22:05 CEST 2012]
V/mounts2sd( 459): Checking configurations...
V/mounts2sd( 591): Optimizing /system readahead...
V/mounts2sd( 596): Disabling /system atime & diratime...
V/mounts2sd( 608): Optimizing /data readahead...
V/mounts2sd( 614): Disabling /data atime & diratime...
V/mounts2sd( 619): Waiting for sdcard to initiate...
V/mounts2sd( 631): sdcard found at /dev/block/mmcblk0...
V/mounts2sd( 643): Setting sdcard readahead to 2048kb...
V/mounts2sd( 679): Running e2fsck on sd-ext...
I/10mounts2sd( 382): e2fsck 1.41.10 (10-Feb-2009)
I/10mounts2sd( 382): /dev/block/mmcblk0p2: clean, 99/65664 files, 64458/262144 blocks
V/mounts2sd( 687): Disabling sd-ext atime & diratime...
V/mounts2sd( 705): The sd-ext partition was mounted successfully at /sd-ext forced as ext4!
I/10mounts2sd( 382): /system/etc/init.d/10mounts2sd: busybox.bcm: argument list too long
I/10mounts2sd( 382): grep: /sd-ext/data: No such file or directory
I/10mounts2sd( 382): /system/etc/init.d/10mounts2sd: busybox.bcm: argument list too long
V/mounts2sd( 768): Creating link between /data/data and /sd-ext/data...
V/mounts2sd( 789): Creating link between /data/app and /sd-ext/app...
V/mounts2sd( 810): Creating link between /data/app-private and /sd-ext/app-private...
V/mounts2sd( 829): Creating link between /data/app-system and /sd-ext/app-system...
V/mounts2sd( 1018): Linking apps from /data/app-system to /system/app...
I/10mounts2sd( 382): grep: /data/cache: No such file or directory
V/mounts2sd( 1103): Umounting pre-mounted /cache...
V/mounts2sd( 1109): Mounting /cache at /sd-ext/cache...
I/10mounts2sd( 382): grep: /cache/download: No such file or directory
V/mounts2sd( 1158): Creating link between /cache and /data/local/tmp...
V/mounts2sd( 1172): Mounts2SD has been loaded!
V/sysinit ( 1216): Executing /system/etc/init.d/90threshold.rc...
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
No I can see that busybox is complaining about something. Will look into this right away, thanks.
[Android Software/Hacking General [Developers Only]] guy_smiley:
dk,

I believe you may have mentioned that you put a built in menu into Settings for your BCM ROM, is this the case? If so, is it possible to get an apk, lines to edit in framework, etc or some such that it can be added to other ROMs using Mount2SD?
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
I was considering building a small app, but have not yet had the time. The one in BCM is built into the Settings application and is not a stand-alone app.

But:

https://github.com/dk-zero-cool/android_packages_apps_Settings

Just search commits by me starting with "Mounts2SD:" if you want the codes.
[Android Software/Hacking General [Developers Only]] Loureiro:
Just want to thank you dk_zero-cool for this awesome script. It's working flawlessly on Huawei U8800 with Aurora ICS 4.0.4.

I've used legacy installer. Just had to fix "umount" typo on updater-script. Everything's working good here.

Respect from portugal!
[Android Software/Hacking General [Developers Only]] lyg73:
There is syntax error in install script of legacy version.

This is a my recovery log.

Isn't it not umount but unmount?

This issue is in only legacy version. In aroma version, no problem.

Please fix this.

Thank you..
[Android Software/Hacking General [Developers Only]] DarkIceGB:
Nobody replied about my issue with this script. Again, my sd-ext partition is now 1.5GB, it's properly formatted like last time and all partitions that I can move are on the sd-ext with have plenty of free space.

After installing 60 or so apps, I can't install a launcher - it fails with "insufficient storage available".

Here's a log from aLogcat of the issue with a few irrelevant lines removed:

This is interesting, with the same errors messages (insufficient storage and no content providers); they said, "By deleting the dalvik cache, I managed to resolve the problem".

So is this one; they said, "/data/local needs to have write and execute rights to others in order for adb packages to install correctly".
[Android Software/Hacking General [Developers Only]] Loureiro:
You can try wiping Cache / Dalvik Cache. After that try fix permissions under CWM. if still does not work, try wipe data from google play app.

If you install from apk directly instead of downloading from "market", it completes installation successfully right?
[Android Software/Hacking General [Developers Only]] impactor:
Is it necessary to re-flash it after every ROM update, as with darktremor's script? And if so, does it retain previous values (if customised) or do they need to be set again?
[Android Software/Hacking General [Developers Only]] movfan:
I have managed to get the script working with a Galaxy Gio.

but encountered some errors.

First of all the legacy installer gives an error during install,

signed or not, it makes no difference.

The aroma installer does not respond to the screen touches,

you have to select things with the sound + home buttons.

Finaly it starts up in safemode, so you have to disable the save mode

and reboot.

During this reboot the phone hangs at boot, only removing the battery

and a power up revives the phone and makes the script working.:cool:

I forgot to mention that this script gives me 168 mb of free phone space.

This is more then cm7 with s2e, a good job.
[Android Software/Hacking General [Developers Only]] DarkIceGB:
Already tried that but thanks.

Yes.
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
Of course you need to re-flash. It is stored in /system/etc/init.d/ which is wiped during ROM flash. The Settings however is stored on /data which means that they will continue to exist after re-flash.

I know about the legacy installer, have just not had time to fix it yet. The Aroma problem is something you need to take up with the Aroma dev (Amarullz). And as for the safe-mode. That is not an issue. This mode was added to avoid problems on ROM's using wrong init.d execution methods which means that if the script starts in this mode, then it's a ROM issue. Disabling this mode is done at your own risk as it may produce issues with some of the options.
[Android Software/Hacking General [Developers Only]] m_speksnijder:
Have a look in /system/app for a file with .odex extension.

If there is one with the name of the aplication you try to install like "com.<appname>.odex", remove the .odex file.

Then reinstall the app.

I had this too, all apps installed just fine, exept one.

I removed the .odex file and all great again.
[Android Software/Hacking General [Developers Only]] DarkIceGB:
Is there anything you could do to help please dk_zero-cool?
[Android Software/Hacking General [Developers Only]] lohyitchun:
Disable m2sd safemode

First thanks for such a good script!

I am with Tytung's NexusHD2 ICS v2.2. I just did a clean install of of the ROM again, then followed by flashing the m2sd, selected Apps, Data, and Dalvik.

Then when I booted in the ROM, I immediately installed Titanium backup and have all (about 50 apps) my apps restored. Then I go to Settings > Storage, and find that only 39MB left on my phone internal memory.

In Root Explorer, I find that dalvik cache still sitting in data/dalvik-cache, instead in sd-ext. I then disable m2sd safemode in terminal emulator, as code provided by in the first post. Restart my phone, when my phone first booted it show "Android is Upgrading: Optimizing 118 applications". Once everything settle down, I again go to settings > Storage and find that my internal memory has 200MB free space. Which means that all data and dalvik cache has moved to sd ext for now.

I hope this is the correct way, and any comment please...?
[Android Software/Hacking General [Developers Only]] MarcoToo:
Feature request:

Implement option to change journaling interval for /system, /data, and /sd-ext.

Your "noatime" option was already an epic idea. Let's extend it :D

And btw, it is running great on the the GT-S5360. Did anyone expect it not to?
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
The correct way is for the ROM to use the correct init.d method, but as this is not the case with your ROM (Hence safe-mode) you don't have much of a choice if moving only the apps are not enough.

Just note that with your ROM's way of executing init.d, dexopt will (possibly) start running before M2SD has properly mounted /sd-ext/dalvik-cache to /data/dalvik-cache. So you could end up having your phone rebuild the dalvik cache on each boot.

Disabling safe-mode is at your own risk. It depends on your phone and ROM how well it will work, but if your not experiencing any issues with it, then there is no harm in doing so. This is just not the case for everyone which is why I added safe-mode to begin with.

Will look at that
[Android Software/Hacking General [Developers Only]] lohyitchun:
Thanks for your advise...

I have no problem taking the risk, and I will post feedback here if I experience any problem out of disabled safemode.

But before hand, would you expected or know that what sort of probable problems could occur by disabling safemode? Apps not running? Phone freeze? Lost data? Or....?

Besides taking the risk, any possibility to have the init.d to work correctly? I can follow your instructions supplying any data, logcat, in order to get it working. I think this would benefit a lot NexusHD2 users. I am sorry for the request if it is not possible technically.

Thanks again...
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
Don't need logcat to get proper init.d

It needs changes in the ramdisk/boot.img

Best way is to get your ROM dev to change it.

And about any issues, I have no idea what you can expect. All kinds of things can happen when moving content around while the system is using it. It depends on what kind of content, how much (How long it takes to move it) and so on. Moving dalvik-cache will properly not do to much harm. Data and especially r-mount will certainly produce a lot of issues.

While using dalvik, just make sure that android does not start rebuilding the dalvik-cache on each boot. Because if dexopt starts running before M2SD has linked it from sd-ext, then M2SD will delete the whole dalvik-cache from both locations to avoid conflicts.
[Android Software/Hacking General [Developers Only]] MarcoToo:
First of all, copy this file to /system/bin. (You might have to right click and download it, save it as sysinit (without format extension))

Then, assuming you have a boot.img for your device:

Extract it. You can use dsixda's kitchen for that.

Open /boot.img-ramdisk/init.rc with a good text editor like Notepad++ or GNUedit (DO NOT USE NOTEPAD OR THE LIKES, IT WILL **** YOUR KERNEL).

Find the line saying

class_start default

and insert

exec /system/bin/sysinit

above it.

If there is a line saying

start sysinit

remove it.

If further down there are these 3 lines:

service sysinit /system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
disabled
oneshot

remove them.

Repack the boot.img and flash it (I don't know which methods there are for your device, just ask around in your forum).

And that's it. You now have the CM way of running init.d enabled instead of the lame way. :D
[Android Software/Hacking General [Developers Only]] puckshock:
I'm on SethPDA's SlimGen CM7.2 rom for the P500 and I tried your script but my internal storage still shows 200mb total =/

My sd-ext partition still has 900mb free so I'm not sure if my rom just isn't compatible or if there's something that I am messing up. Help would be appreciated

EDIT: Okay... Turned the phone today and after unlocking, it sent me to a black screen where I am usually greeted by Nemus Launcher. So I mounted the USB storage and checked it out and looks like all the contents on my SD except for Android and Android.Secure have disappeared?

I'm just going to Nandroid restore and not use this script even though it seems to work for everyone else =/
[Android Software/Hacking General [Developers Only]] danawr:
playstore error 492

Hello,

I have a Nexus One running Cyanogenmod 7.1.0-N1.

Since running Cyanogenmod I moved all possible apps to SD-Card using Settings>Manage Applications.

Before running the Mount2sd install I switched the Settings>Cyanogenmod settings>Applications>install location to "internal".

I installed Mount2sd using the default settings.

I realized that I needed to enable further settings to get internal memory to increase.

I then used a terminal emulator and the m2sd status command showed that I had only "Apps" loaded.

I enabled the following : Data & Cache.

I then proceeded to move the app from the SD-card to "phone".

This only slightly increased internal memory.

Another ms2d status command showed that I also had Cmdalvik loaded. I am not sure when this was loaded.

I enabled Dalvik and then I got 192 mb of internal space.

Unfortunately, I can no longer download new apps or update existing apps.

I get the following error message:

"Update for "app name here" could not be downloaded due to an error. (429)

Any help would be greatly appreciated.

Dana

Clearing cache, dalvik cache, playstore data, fixing permissions did not work.

I found a post about a "/data/download" directory that needed 777 set as the permissions. That location did not exist on my phone. After a little searching I found a "/data/cache/download" directory. After setting the permissions to 777 playstore is now working.

Dana
[Android Software/Hacking General [Developers Only]] topgeardave:
Enable R-mount with dalvik enabled. That way Apps and Data remain on the sd-ext whilst dalvik is on NAND for performance
[Android Software/Hacking General [Developers Only]] puckshock:
Alright well the Nandroid restore didn't solve anything. I'm still left with a black screen after unlocking o.o

Seems like my launcher or something got royally screwed by using Mount2sd >_>
[Android Software/Hacking General [Developers Only]] shaunblyde:
app-system as a separate option?

Hi there,

I haven't been following this thread, but from a quick search this doesn't appear to have been covered before. Apologies if it has. And apologies if what I say below doesn't make sense or is stupid :P

I have a GSM Desire using Data++ and M2SD. I have been using your BCM ROM since its early days and have been following the thread there. Recently I've had issues with certain things going slowly (particularly Trebuchet and keyboard/LatinIME) and I believe it was because of the system apps stored in /sd-ext/app-system (I had apps and data selected to move to the ext partition).

It may be that I'm wrong and that it makes no discernible difference, but as I understand these system apps would be better placed in the /data partition if there is enough space.

I manually edited the 10mounts2sd script so it would no longer move these on boot, and shifted /sd-ext/app-system to an unlinked /data/app-system folder and things that were noticeably slow before (in particular Trebuchet and the Keyboard/LatinIME), now seem to be running much smoother.

My suggestion would be to add another option in M2SD to allow/disallow for the movement of this app-system folder to the ext partition, independent of all non-system apps.

Thanks dk, and appreciate all the work you do on this script and the BCM ROM.
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
I actually had that option at first and then later merged it with the apps option as it seamed more logically. Before re-adding that option, what other options have you enabled? Have you added a specific file system type, or is it set to "auto"? Have you got journal enabled, disabled or auto? Have you enabled noatime?

For best porformance, you should use Ext4 and specify this in M2SD settings. You should enable noatime and disable journal (This one is important for speed).

It should not affect the performance where you place the APK files. What affects it is where you place dalvik-cache and app data. I did a lot of testing with these things using both a class 2 and class 4 card which are some of the slowest cards you can get. And I did not find much difference in where the APK's where placed.
[Android Software/Hacking General [Developers Only]] shaunblyde:
Thanks for the reply, I'm using ext3 at the moment and its set to auto so I'll have to try reformatting as ext4 and change the setting in M2SD also. Also have No Atime unchecked and jounraling as auto so will alter those settings.

It does seem that the apps I moved to /data are running much quicker that previously, although that could simply be some form of the placebo affect on my mind, I'll definitely try all you've suggested.

Using a 16GB class 10 SD card (unless its a fake, but I don't think so)

M2SD settings:

Applications and Data on ext3

Dalvik remains on /data

Cache is Auto

Download Cache Off

SWAP partition created and enabled

Journal is auto (trying with disabled now)

Readahead speed have been using 2048kb mostly

Filesystem type is ext3 but set to auto

No Atime unchecked (will try checking this)

Reversed mount off

Also using ondemand governor and KSM.

Thanks for the help, I'll report back on how things run after this. As you say, there's no point adding the option I suggested if it doesn't matter where the apks are, which despite my experience is probably correct.
[Android Software/Hacking General [Developers Only]] Vinaltap:
I am having a lot of issues with M2SD with my BCM ICS ROM, no matter which config I choose I get 'Unfortunately, #app# has stopped'. I can't seem to fix it, any ideas?

I'm running:

latest BCM ICS ROM

Alpha ++

4EXT Touch
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
Seams more like you are having issues with your ROM installation, old data or the sdcard.

Try reflashing the ROM. If that does not help, try doing full wipe (You can always do a nandroid restore if none of those work)
[Android Software/Hacking General [Developers Only]] Vinaltap:
Hi dk_zero-cool, great job with this ROM, it is fantastic!

Thanks for getting back to me. I've had this problem for about 3 weeks and I have reflashed (including with full wipe and fresh partition) around 10 times, but I still get 'unfortunately, # has stopped' errors when M2SD is enabled. However, the ROM works perfectly when M2SD is disabled.

I have wiped, rebooted, factory reset and had a go with any other options I could read about on here.

Setup:

Running the latest BCM ICS.

Alpharev Data ++

S-OFF

HBOOT-6.93.1002

Radio-5.17.05.23

Thanks in advance
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
Hmm. Okay, do a nandroid backup. Reflash the ROM (Full wipe), this time activate the debug option (Should be available in Aroma).

Once the phone has booted, grap the file /system/etc/m2sd.debug and attach it here. It will contain a lot of logcat entries which might help me figure out what goes wrong.
[Android Software/Hacking General [Developers Only]] Vinaltap:
I did this, but 2 weeks ago I packed my Linux comp away and I'm not sure how to get access to the logcat with Windows. I did try installing a Linux format viewer but it wouldn't show /system. Any ideas?

However, I thought I would have a go with my 8gb sd card and low and behold it works perfectly first time! So is there an issue with the Sandisk 32GB micro SD cards and using M2SD. What should I try to get it working with the 32gb?

Thanks I appreciate it!
[Android Software/Hacking General [Developers Only]] guy_smiley:
What size was your ext partition? Recommended is no larger than 1.5Gb. Use 4EXT recovery to create it properly.

Is it a dodgy card that won't allow partitioning? I bought what was supposed to be a good 32Gb class 10 card which said it partitioned but it didn't actually work. Dodgy eBay...
[Android Software/Hacking General [Developers Only]] DarkIceGB:
My sd-ext partition is 1.5GB, it's properly formatted with 4ext and all partitions (data, apps, dalvik cache, cache) are on the sd-ext with plenty of free space on the sd card and internal memory. The SD card is 16GB class 10 and was sold and shipped by Amazon.

After installing 60 or so apps (from Google Play), I can't install a launcher or larger apps - it fails with "insufficient storage available". I can however update some apps.

Here's a log from aLogcat of the issue with a few irrelevant lines removed:

These might be relevant:

This link has the same error messages (insufficient storage and no content providers).

Another link; they said, "/data/local needs to have write and execute rights to others in order for adb packages to install correctly".

Please could someone help?
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
Are you having problems installing from market or using ADB? You could try to run "adb root" before installing.
[Android Software/Hacking General [Developers Only]] DarkIceGB:
Google Play.
[Android Software/Hacking General [Developers Only]] danawr:
Expand SD-EXT size?

Hello,

I currently have my SD-EXT partition set to 512mb.

I would like like to double the size.

If I use Gparted to increase the partition will mount2sd recognize the new partition size?

If not, what steps should I take to double the partition size?

Thank you,

Dana

Nexus One

Cyanogenmod 7.2

Mount2SD

32GB Class 4 SD Card
[Android Software/Hacking General [Developers Only]] hgmichna:
Just stumbled over your comment.

Are you saying that m2sd cannot be uninstalled? That sounds pretty crazy to me. What if you upgrade later to a ROM that is incompatible with m2sd? What if the developer drops out one day? So far this is the first Android program I meet that cannot be uninstalled. Who in his right mind would install any program that cannot be uninstalled, particularly one that makes severe changes to the operating system, one that rocks the boat like this one?
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
This is not an application, this is a script. You want to uninstall? Delete the script file. You want to restore everything to normal? Disable all options before deleting the script.

How about just making sure that a ROM has init.d support (Which most custom ROM's has) before flashing it.