yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] :
Hi,

Maybe the problem is in /etc/init.d/

Your script is set as 10mount2sd and set root to ro but ppp script start later as 97ppp. There are some commands to create files in /etc directory

df -h do not work for me but df list is about 5 posts earlier.
[Android Software/Hacking General [Developers Only]] :
So I change 10mounts2sd file in the end of it (FINALIZE THE INIT PROCESS) so I have now

$BB mount -o remount,rw /system

It works fine and data conn. is available after reboot

Thx for your work & time
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
I find it very strange that there is a script in init.d which needs write on /system to enable data connection. But I'm not familiar with HD2, so...

However I have changed my script to ONLY reset /system into RO mode IF the partition was in that state before M2SD started executing. This should take care of that problem. I will upload this later to day along with a few other minor fixes and changes. I am still looking into a couple of other problems on some ROM's which should be fixed before uploading.
[Android Software/Hacking General [Developers Only]] Xani.e:
got the same problem here.

HTC Desire - ICS

Any solutions?
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
Okay I tried M2SD with this ROM (Version 6.1.1, could not download 6.0). It works fine. I think your problem might be that you enable R-Mount. This ROM places a lot of the system apps and system libraries on to the sd-ext and links them to /system. If you enable R-Mount these files will change from being on /sd-ext to being on /data (Same partition though) and the ROM can no longer find them.

This script is made to handle the native way of storing data, app, caches etc. It cannot take care of all of the different custom ways that some ROM's are using in order to store to big frameworks on small internal nand's, in this case /sd-ext/app_s and /sd-ext/lib_s
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
Script has been updated with fixes latest issues and more.
[Android Software/Hacking General [Developers Only]] twics:
There should be no major difference between v6.1.1 and v6.0 however I cant be 100% sure, but ill give it another go later on or tomorrow thanks a lot for your help.

ps v6.0 can be downloaded you just had to click (skip add) top right of screen after page is loaded.:)
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
I tried 3 times. Always stopped at about 70MB
[Android Software/Hacking General [Developers Only]] Cookie Ninja:
I'm now having no memory available issues, when updating apps on Google playstore. Any help?
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
Deleted ...
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
Try enabling the cache option
[Android Software/Hacking General [Developers Only]] deviil:
How to move data and Dalvik to sd-ext with mount sd

Hi,

I have successfully installed the latest version using the aroma installer. The internal memory has moved the ext partition.

However the data and dalvik still seem to be on the limited 151 mb space. This even after choosing the correct options in the Aroma installer.

Any steps that i may have missed out??:confused:

I am using the MIUI ICS 2.5.25 Ported by smokin901 [tytung r2.4 HWA] ROM and followed all the steps as indicated in both the threads (Mount2SD thread and ROM Thread)
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
m2sd status

Could I get the output from this?
[Android Software/Hacking General [Developers Only]] twics:
Ok I just tried again but no success, installed via aroma custom didnt select r-mount just app/dalvik/cache rebooted got stuck at htc screen, tried again full wipe everything reinstalled Rom v6 then mount2sd rebooted, phoned booted this time but low mem warning like last time, this time I got to install terminal emulator and typed m2sd help and got:

Mount2SD is currently running in safe mode and some options is therefore hiddin/disabled. In order to use all of the options of the script your rom must use sysinit execute. Your rom is currently using sysinit service which is highly unstable.

So it seems its a Rom issue and not the script:)
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
It is because init.d in your ROM is set to be executed along side the rest of the boot process. The best way is for init.d to execute before the rest of the boot.

When detected M2SD will disable options like dalvik, data, r-mount etc because dexopt and such has already started while executing init.d. It is not a good idea to start moving dalvik-cache around while it is being processed, the same goes for app data.
[Android Software/Hacking General [Developers Only]] mperezm77:
And is it possible to change the way init.d is executed?

I have same issue with ICS Nexus 2.2 HD2 ROM from Tytung. Other than that would be my best choice.

Enviado desde mi HTC HD2 usando Tapatalk
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
Well if you know how to extract and re-assemble boot images, you could include this: http://xdaforums.com/showthread.php?t=1671670
[Android Software/Hacking General [Developers Only]] vikasb32:
Best script for move aap to ext.i am using it in my lg p500 and work fine.i used 3 command.rmount,dalvik enable to move dalvik cache to phone memory and m2sd aap disable to move aap to sd-ext partition.thank you so much.
[Android Software/Hacking General [Developers Only]] MonY960:
great script, thanks :D
[Android Software/Hacking General [Developers Only]] Robobob1221:
can I clarify a few things before going ahead:

if I have apps already installed to sd-ext (using dta2sd), then flash this mod over will that cause issues with the current set up?

will i need to move all apps and data back to internal memory before flashing this script?

also, does it now clear all previous a2sd files from the phone before installing, so there aren't any conflicts?

in anyones opinion, does this function better than dta2sd?

Thanks!
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
Just flash the ZIP which will remove the current a2sd script. In Aroma you just make the setup which matches your current settings and M2SD will just keep it that way, no need to move anything back.

But do make a backup. Better having it without needing it rather than the other way around ;)
[Android Software/Hacking General [Developers Only]] Robobob1221:
It seemed to get stuck on the splash screen so I cleared data and it booted ok. I got my data and apps on TiB.

Ok, sorry just read the op about safe mode, so I'll try editing the init.rc and see if that solves my problem.

Ok so I added the line you suggested in the op to the beginning of my init.rc file "exec /system/bin/sysinit". Also I changed the sysinit to be executable. I did both of these with script manager. Should that get m2sd working, as at the moment it's not?!

When I reboot the edited init.rc reverts back to its original state. What am I doing wrong?

thanks for the advice:)
[Android Software/Hacking General [Developers Only]] exitmood:
hi dk_zero-cool

great thanks for the script at first

I have a question

is there any way to auto install apps on the ext memory? it means I don't want to move on SD after app installation and installing apps in to the ext memory as default...
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
You can't edit it like that. This file is placed inside what is called ramdisk. The ramdisk is merged with the kernel inside the boot.img. It is called a ramdisk because it only exists in the memory when the phone is booted. Every time the phone is booted, the ramdisk is extracted to memory. You need to extract the boot.img from the boot partition, extract the ramdisk image from the boot.img and extract that as well. Then you can change the file, assemble the ramdisk, assemble the boot.img and flash it back to the boot partition.

No.

The sd-ext folders are merged with the original data folders in a way that both folders links to the same place. It does not matter which folder you place the files, they will end up in the same place no matter what.
[Android Software/Hacking General [Developers Only]] exitmood:
ok but why the phone memory going to full after several apps instillation? I have 1 gig space on the sd-ext (settings/ storage show me 1 gig for internal storage and 200 mg in use , 0.9 gig available but phone alert me there is no more space to install apps)
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
Android does not read the sd-ext partition. It is not a part of android and android does not know it exists.

/data is the only thing android is seeing. Also the problem is not where the apps are placed when installed. The problem is properly the different caches. Try enabling the cache option in M2SD, reboot and see.
[Android Software/Hacking General [Developers Only]] jackson0829:
Hi,dk_zero-cool:

I tested your mount2SD_V4.4.6 aroma in my Hauwei v8150 Android phone(ARM V6 device) still could not work with beneath custom ROM:

(1) Dronix 0.6 Android 2.2.2 ROM

(2) Ice Cream Sandwich[MIUIv4][2.5.25]

(3) LeanFUSION 2.0

Most of them already have their own A2SD script (Ex. Link2SD..) and I do not know

how to disable their original A2SD script and replace by your "mount2SD" script??

Can you help me that I prefer to install your "mount2SD" script ???:rolleyes:

P.S: So far mount2SD_V4.4.6 aroma only can work fine with CyanogenMod 7.2-RC2

custom ROM (can move all (/data/app & /data/app-private & /data/Dalvik

Cache to SD-ext ):D
[Android Software/Hacking General [Developers Only]] Robobob1221:
I've extracted the ramdisk from the boot.img and I'm looking to add the line exec /system/bin/sysinit however I'm not quite sure where to place it.

Should it be added in "on fs" before the script to mount mtd partitions?

Or should it be placed in the "on boot", above the "start sysinit"?
[Android Software/Hacking General [Developers Only]] gary0406:
installation done, but nothing happened

Many thanks for the script!

Things I want to move to ext2 of SD still at their original places, though the installation seemed OK.

Moto XT701, android 2.3.5, miui2.3.7 rom(already /data/dalvik-cache ->/cache), 16G Class10 SD (1 Fat32, 2 ext2, 1 swap)

Could you please have a look at the log bellow and give me kinda suggestion?

Heartful thanks in advance!

-----------------------------------------------------------------------

AROMA INSTALLER version 1.63

(c) 2012 by amarullz xda-developers

ROM Name : Mounts2SD

ROM Version : 4.4.2

ROM Author : DK_Zero-Cool

Device : All

Start at : Wed Jun 6 03:48:10 2012

--------------------------------

Mounts2SD by DK_Zero-Cool

--------------------------------

Preparing installation

Mounting partitions

Removing old files

Removing any existing app2sd scripts

about to run program [/tmp/app2sd_search.sh] with 2 args

FIX ME! implement ttyname() bionic/libc/bionic/stubs.c:360

Starting installation

Unpacking Mounts2SD

Setting Permissions

set_perm: chown of /system/etc/init.d/90threshold to 0 0 failed: No such file or directory

set_perm: chmod of /system/etc/init.d/90threshold to 777 failed: No such file or directory

Creating symlinks

Configuring Mounts2SD

about to run program [/tmp/m2sd_configure.sh] with 2 args

FIX ME! implement ttyname() bionic/libc/bionic/stubs.c:360

Finalizing installation

Unmounting partitions...

Done!

script result was [Done!]

Extract: /system/etc/init.d/10mounts2sd

Installer Sucessfull (Status 0)

End at : Wed Jun 6 03:48:12 2012
[Android Software/Hacking General [Developers Only]] vikasb32:
Thanks after flashing the script no more low space notification

I installed approx 1gb app and still 600mb memory free
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
M2SD will auto delete the current a2sd scripts. What problems do you have with these ROM's?

You should replace the line "start sysinit" with "exec /system/bin/sysinit". Otherwise you will execute the scripts twice during boot.

No they are not. M2SD links the folders from sd-ext to data so that android thinks that they are in the same place. How else would android find the files?
[Android Software/Hacking General [Developers Only]] jackson0829:
Same issues descriptions as beneath thread

http://xdaforums.com/showthread.php?t=1342387&page=32

---> could not move /data/dalvik-cache into /sd-ext/dalvik-cache

(only can move /data/app & app-private,app-system into /sd-ext/xxx...,):confused:

According to the reply of Developer of LeanFUSION & FUSIONideos :

---> LeanFUSION moves dalvik cache on /cache/dalvik-cache using a

symbolic link for the dalvik-cache directory

Maybe I have to enable "CM Dalvik " during M2SD installation which I did not enable before ?
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
That is because some ROM's uses different ways of executing init.d scripts. The way CM does it is the correct way, the other 3 ROM's you have mentioned uses a another method of executing the scripts which does not always work properly. Because of this, M2SD goes into safe-mode where only the apps option will work and where data and dalvik is automatically disabled to avoid issues.
[Android Software/Hacking General [Developers Only]] jackson0829:
Do you mean that M2SD have no way to move dalvik-cache to sd-ext FROM

THOSE 3 ROMs ?

In case M2SD could not move the dalvik-cache contents to sd-ext then it

will be useless than Link2sd or A2SDGUI (GUI for Darktremor A2SD) ,both

already can move the dalvik-cache contents to sd-ext in those 3 ROMs !:confused:
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
M2SD could properly as well, but people some times ran into problems because dexopt is running while dalvik is being moved or deleted. The same goes for data. So I made the script like this.

I don't care what other script does use those if you like them better. It is wrong to move things like dalvik when dexopt is running. It is also wrong not giving init.d script the chance to alter things before starting the boot process. So talk to the dev's of the ROM's and see if they could implement the CORRECT way of handling init.d scripts.

My script is not useless. Your ROM's init.d method is useless ;)
[Android Software/Hacking General [Developers Only]] Robobob1221:
If we alter the method of init.rc to handle script will it affect the performance of other a2sd script or will they run as usual?

私はローボーボブ。 Haro！！
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
They will work as usual. At least they do on my ROM, and they do on CM ROM's, and other ROM's I know which uses that method.
[Android Software/Hacking General [Developers Only]] Robobob1221:
I ran it before I read this and yeah it does work. Thanks:thumbup:

I was reading the previous post and I didn't quite understand. If we use the system-app to sd function, will the rom system storage increase?

私はローボーボブ。 Haro！！
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
No that's the point of this. The apps will be installed on /data or /sd-ext (Apps enabled) but will act as system apps.
[Android Software/Hacking General [Developers Only]] DarkIceGB:
Finally something that can move the Cache (not Dalvik Cache)! Mine is full so I can't install any apps.

Thanks! :D
[Android Software/Hacking General [Developers Only]] Dunc001:
Cool, thanks for this superb piece of work. Would you mind if we use it in our ROM in place of our current a2sd script? BTW, what are the benefits of having an sd-cache partition - I haven't come across this before, so how is it best set up and is anything additional required to make use of it?
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
Use it as you like :)

I don't think there are any benefits to a seperate cacge partition on the sdcard. But the internal nand has a seperate partition for this, so I just added the option if people would like the same on the sdcard.

It works by adding a third partition to the cache. So to use it, make a cache partition after fat32 and sdext on the sdcard. Otherwise it uses /sd-ext/cache if no third partition exists or /data/cache if no sdext partition exists either (If you boot without sdcard for an example).
[Android Software/Hacking General [Developers Only]] Dunc001:
Thanks, and thanks for the reply. So I guess we'll just stick with a single sd-ext ext4 partition and a Swap partition. Can I PM you or chat anywhere re whether your script will require our existing ROM updater-script modifying in terms of how it is currently set up with symlinks etc?
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
PM away :)

Also believe my email should be public for everyone.
[Android Software/Hacking General [Developers Only]] uzi2:
I have an EU HD2 with very limited internal memory. At present I use an amended version of Amarullz' script to move apps, data and dalvik-cache to my ext4 partition. This works well and I can just drop the script into init.d when updating or testing new Roms.

I was looking to test your solution in a similar way, but it would appear that there is no way of setting it the way I want it at first run or will it recognise my current layout?
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
By default this script will move /data/app and /data/app-private to /sd-ext (Second partition on sdcard).

If you don't have a second ext partition, it will then by default move /cache to /sd-ext/cache

Then when booted, you can change the config using "m2sd <option> <value>". These settings is saved in separate files for each setting in /data/.m2sd/

So on each new ROM flash, it will remember your settings.

However, if you would like to add settings before first boot, just create a folder "/data/.m2sd/". Then add the files you need, for an example to move dalvik-cache to /sd-ext you add the do "echo 'enable' > /data/.m2sd/.dalvik" or if you want to change sdcard-readahead for sdcard before first boot you do "echo '1024' > /data/.m2sd/.readahead" and so on.
[Android Software/Hacking General [Developers Only]] Dunc001:
OK, so if we are going to include your script in our ROM as discussed and we want to enable moving dalvik, apps, apps-private to sd-ext but not cache how do we do that in the ROM zip? Just add a folder in /data in the ROM zip and name it .m2sd, and then add script files called .dalvik .cache etc with no extension containing just the one word disable or enable in it? Or is there another way?
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
That is correct
[Android Software/Hacking General [Developers Only]] Dunc001:
How do you create a folder with the name .m2sd LOL Every time I try to rename it I get an error saying 'You must type a filename'...
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
In Linux, files and folder starting with . are hidden. Windows however wants name and extensions on files.

Web Developers working on Windows has this problems with Apaches .htaccess file to, do what they do http://www.hotscripts.com/forums/perl/6606-creating-htaccess-windows.html
[Android Software/Hacking General [Developers Only]] Dunc001:
Yeah, I have no problem creating the .cache and .dalvik files with Notepad++, it's the actual folder with the folder name .m2sd that I can't create to include in the ROM zip! I guess we could just use mkdir data/.m2sd in the updater-script and then package_extract_dir("m2sd", "/data/.m2sd") - what permissions does the folder/files need?
[Android Software/Hacking General [Developers Only]] uzi2:
You can create the folder using your phone on your sd card and it will copy to Windows.
[Android Software/Hacking General [Developers Only]] Dunc001:
Thanks for a very simple solution :D

Still need to know what permissions it needs though...
[Android Software/Hacking General [Developers Only]] uzi2:
As it's not in the system folder, it won't need any special permissions.
[Android Software/Hacking General [Developers Only]] jolas:
Hi dh_zero_cool

I have an fat32, an ext4 and a swap partition in my sd card.

In every ROM I am going to flash I want to move dalvik to ext4 and cache to swap (128MB).

So, what I did is to insert in your flashable zip in root the folder 'data' and inside another folder '.m2sd'.

Inside '.m2sd' folder, I added 4 files

.app (with value 'disable')

.app-private (with value 'disable')

.cache (with value 'enable')

.dalvik (with value 'disable')

Before I test it, I want to be sure that it is going to work and move only dalvik to ext4 and cache to swap partition...

Is it??? :confused:
[Android Software/Hacking General [Developers Only]] Dunc001:
Well two things - dalvik won't be moved if you've added .dalvik with the value 'disable', and secondly just adding data/.m2sd to the flashable zip won't do anything if you don't add a line in the updater-script in the zip to actually copy it to your phone. To do this you need to open the flashable zip with WinRAR or similar (don't unzip/extract it, just open it) and then navigate in to META-INF/com/google/android and pull the updater-script out onto your desktop. Open it with Notepad++ and below this:

ui_print("Installing Mounts2SD...");
package_extract_dir("system", "/system");

you need to add this line:

package_extract_dir("data", "/data");

Save the changes and drag it back from your desktop into META-INF/com/google/android and close the zip. Now you can flash it.
[Android Software/Hacking General [Developers Only]] jolas:
Thank you very much for your detailed answer!!! :)

EDIT:

I did change the script file but script does not run.

It only creates (inside .m2sd folder) a couple of other files, like .journal, .swap, etc, but dalvik is still inside data folder...
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
The files .app ad .app-private will not work. These settings does not exist. App2SD cannot be disabled unless you remove the sd-ext partition. This is an App2SD script with extra options. But the app part is the scripts priority, only extra options can be disabled such as swap, cache and dalvik.
[Android Software/Hacking General [Developers Only]] jolas:
It did not work either with .dalvik (dalvik still exists in data folder) nor with .cache (I set both values to 'enable')...:confused:
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
Cache should be enabled by default.

Check the folder /data/.m2sd and see what you have and the values.

Also type "m2sd log" and see what it does during boot.
[Android Software/Hacking General [Developers Only]] AlxMAX:
I might have asked the same question, but I haven't got an answer. On HTC desire, the 10mounts2sd script mounts the /cache file system as a memory buffer. In my opinion, I consider this occupies too much memory. Is there any way to bind mount /cache from /sd-ext/cache or from /data/cache ?
[Android Software/Hacking General [Developers Only]] dk_zero-cool:
No, it mount a partition that is ABLE to use some memory. As long as it is empty, which it is most of the time, it does not take up any memory.

I have had this script use data and sd-ext before which gave a lot more problems.

But I will see if I can find a good way of auto handling these 3 different partitions depended on available space. Maybe use data or sd-ext when there is enough free space and then use tmpfs as fallback.
[Android Software/Hacking General [Developers Only]] AlxMAX:
As far as I know, that buffer is reserved to that file system. The applications which need more memory can't use that space.

It's a matter of the mount order! As long as I could see on my phone, the sequence of scripts run at boot is like this: 01sysctl, 05hostname, 09mkloops then 10mounts2sd. Consequently, it should be the 10mounts2sd task to mount /sd-ext first (and it does), then all the other mount points.

Edit: why don't you use awk instead of those tr -s ' ', cut -d ' ' -f4 commands? It seems to be integrated in busybox in CM9.

Edit 2: There's also a solution for sharing only the FAT32 partition of the SD card: put dev_mount sdcard /mnt/sdcard 1 /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.2/mmc_host/mmc1 in /etc/vold.fstab