FORUMS

NexusHD2-ICS-CM9 A2SD Discussion

3,574 posts
Thanks Meter: 15,080
 
By tytung, Senior Member on 20th January 2012, 06:19 AM
Post Reply Email Thread
How to increase the internal storage size for the NexusHD2-ICS-CM9 ROM.

May 17 updated:
  • Another choice. Don't need to flash anything.
  • Just install Link2SD app from the Google Play (a.k.a. Android Market).

Jan. 20:
  1. Flash any of the A2SD scripts below when you install too many apps and the internal memory (i.e. data partition) is out of space.
  2. Caution: Don't use any of them if you are not an advanced user. Otherwise you may have low volume, performance lag and other strange issues.
The Following 41 Users Say Thank You to tytung For This Useful Post: [ View ] Gift tytung Ad-Free
20th January 2012, 06:59 AM |#2  
Axelman8's Avatar
Senior Member
Flag Rotterdam
Thanks Meter: 249
 
More
This rom gets better by the hour! Thank you very much Tytung

Sent from my HD2 using XDA App
The Following User Says Thank You to Axelman8 For This Useful Post: [ View ] Gift Axelman8 Ad-Free
20th January 2012, 07:32 AM |#3  
Member
Thanks Meter: 0
 
More
Thanks

Does the freeze issue related to A2SD ? My phone working and connected to GSM network but the touch screen is not working at all.
20th January 2012, 10:16 AM |#4  
DevMonkey's Avatar
Junior Member
Flag Molln
Thanks Meter: 1
 
More
Thank you very much Tytung for the nice Rom !!!!
20th January 2012, 10:52 AM |#5  
geenyous's Avatar
Inactive Recognized Themer
Flag Shanghai
Thanks Meter: 856
 
Donate to Me
More
From the other thread:
Quote:
Originally Posted by manu44

I have installed the Rom v1.1 by using the 40ext script to move the dalvik to sd card
and now i used it without the script

The DIfferemce is there
- No more apps lagging...Whatsapp used to take around 25 sec to show up when i was using my adtosd script
- No more screen lagging
- No more low sound issue

Of course you will get no more low sound issue, but since I have changed the read ahead SD speed to 2048 (not sure if thats the reason though) and changed the script that it copies all to SD card ext partition, I have a lot fewer lags than before, when the read ahead was 8mb and I used the unmodified Amarullz script (which leaves dalvik on internal).

Here are my posts for reference:

Quote:
Originally Posted by geenyous

Thanks tytung, will upload there next time.

Hmm, but I am using Amarullz script and still have ~300mb left.
Appears that it does the same as the app2sd script TyphooN is using, so every app you install still leaves a bit on internal but the majority goes to sd-ext. This would be about right as I have now 50mb less internal than with TyphooN (150mb partition compared to 200 now) and I had roughly 57mb free space on TyphooN internal with the same apps installed.

Anyone has an idea what to do besides uninstalling some apps?
Thx!

Quote:
Originally Posted by bobjbain

You can delete the stuff in the cache directory under /sd-ext/data_s/com.android.providers.downloads

...
That's bizarre, I don't know where it gets the 208m for /sd-ext when I have 2G ext4 partition on my card.

And why is /data 1G??

Anyway geenyous, in adb cd to /sd-ext/data_s/com.android.providers.downloads and issue a 'df *' that will tell you how much free space the system actually thinks you have in that directory.

HTH

This didn't work, that directory was almost empty...
OK, just to report on the above Issue:

I have now reinstalled everything with the modified script posted by uzi2 above, now I have plenty of space (actually the internal sd-ext is empty, feels like bit of a waste) as all my stuff is on sd-ext4 (SD card), even dalvik cache. I can now install and update apps again. Just to make it clear for everyone: there is an sd-ext, which is located on NAND and there is sd-ext4 which is located on your SD card after you format it properly.
If you look at Amarullz script, you will see that per default, it will leave dalvik cache as well as system apps on sd-ext (internal). Now, this together with a 200mb system partition will lead to the sd-ext filling up as you install more apps which are considered system apps and consequently you will not be able to dl and update from market anymore. What uzi did, is remove the parts from the script that copy dalvik and those apps to sd-ext. Now, sd-ext is empty, no matter how many apps you install. Maybe it would be good to keep dalvik on sd-ext and only remove the "system apps move to sd-ext" part of the script? Dalvik was like 170mb of size last time I checked, is that constant or number of apps dependent? I must say I don't see any performance issue with dalvik on SD, but it just feels like a bit of a waste

Btw, I also changed the SD speed fix value to 2048 from ~8000 in the script as I think I can recall to have read that this would give the best performance.
Here is the code I am using atm (all the same like uzis except the SD speed):
Code:
#!/system/bin/sh
#
# AMARULLZ DATA TO SD-EXT MOD FOR ANDROID ( AD2SDX )
# ==================================================
#
#  by amarullz [at] yahoo [dot] com
#  xda-developers : amarullz
#  (c) 2011
#  * Oct 19 (ALPHA01)
#
#  Info: ~ For Changing Log
##

###
# Initializing
###

#-- SDCard Speed Fix
if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]
then
  /system/xbin/echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
fi;

#-- Unmount /sd-ext if it already mounted
busybox umount /sd-ext;

#-- Mount /data and move it to /sd-ext
busybox mount /data;
busybox mount --move /data /sd-ext;

#-- Mount sd-ext to /data ( You Will Get 1GB/2GB Internal Memory :D )
busybox mount -t ext4 -o noauto_da_alloc,data=ordered,commit=15,barrier=1,nouser_xattr,errors=continue,noatime,nodiratime,nosuid,nodev /dev/block/mmcblk0p2 /data;
busybox chown 1000:1000 /data;
busybox chmod 771 /data;

###[ SDEXT mmcblk0p2 STRICT ]###
# app, app_s, lib_s, app-private, data : should in /data (mmcblk0p2)
#
# ~ ALPHA02 - Add framework_s into (mmcblk0p2) strict - MODIFIED
###
for i in dalvik-cache tts_s app app_s lib_s plugins_s app-private framework_s weather_s data;
do
  #-- If Symlink in /data, delete it
  if [ -h /data/$i ]
  then
    busybox rm /data/$i;
  fi;
    
  #-- If Directory Exists in /sd-ext, move it to /data
  if [ -d /sd-ext/$i ]
  then
    busybox mv /sd-ext/$i /data/;
  fi;
  
  #-- If Directory Not Extst in /data, create it
  if [ ! -d /data/$i ]
  then
    busybox mkdir /data/$i;
    #-- Just Open All Permissions ;)
    busybox chmod 0777 /data/$i;
  fi;
  
  #-- Now Create Symlink From /sd-ext to /data
  if [ ! -h /sd-ext/$i ]
  then
    busybox ln -s /data/$i /sd-ext/$i;
  fi;
done;

###
# Now create symlink of the rest non Symlink Directories and Files on /sd-ext to /data
#
# ~ ALPHA02 - Fix ls to ls -a, it's ok, because we test -h for symlink
###
cd /sd-ext;
for i in `ls -a`;
do
  if [ $i != ".." -a $i != "." ]
  then
    if [ ! -h /sd-ext/$i ]
    then
      if [ ! -h /data/$i ]
      then
        busybox ln -s /sd-ext/$i /data/$i;
      fi;
    fi;
  fi;
done;
cd /;

###
# It should also need to create the rest non Symlink Directories and Files on /data to /sd-ext
# ~ ALPHA02 - Some Directory may be missing if we don't use it
###
cd /data;
for i in `ls -a`;
do
  if [ $i != ".." -a $i != "." ]
  then
    if [ ! -h /data/$i ]
    then
      if [ ! -h /sd-ext/$i ]
      then
        busybox ln -s /data/$i /sd-ext/$i;
      fi;
    fi;
  fi;
done;
cd /;

#-- Of Finished.... :D
And this is the part I would suggest maybe you could leave it in to get dalvik to sd-ext (internal):
Code:
###[ SDEXT mmcblk0p2 STRICT ]###
# app, app_s, lib_s, app-private, data : should in /data (mmcblk0p2)
#
# ~ ALPHA02 - Add framework_s into (mmcblk0p2) strict 
###
for i in framework_s app app_s lib_s app-private data;
do
  #-- If Symlink in /data, delete it
  if [ -h /data/$i ]
  then
    busybox rm /data/$i;
  fi;
    
  #-- If Directory Exists in /sd-ext, move it to /data
  if [ -d /sd-ext/$i ]
  then
    busybox mv /sd-ext/$i /data/;
  fi;
  
  #-- If Directory Not Extst in /data, create it
  if [ ! -d /data/$i ]
  then
    busybox mkdir /data/$i;
    #-- Just Open All Permissions ;)
    busybox chmod 0777 /data/$i;
  fi;
  
  #-- Now Create Symlink From /sd-ext to /data
  if [ ! -h /sd-ext/$i ]
  then
    busybox ln -s /data/$i /sd-ext/$i;
  fi;
done;

###[ INTERNAL mtdblock5 STRICT ]###
# For performance, dalvik-cache should be on /sd-ext
###
for i in dalvik-cache;
do
  #-- If Symlink in /data, delete it
  if [ -h /sd-ext/$i ]
  then
    busybox rm /sd-ext/$i;
  fi;
    
  #-- If Directory Exists in /sd-ext, move it to /data
  if [ -d /data/$i ]
  then
    busybox mv /data/$i /sd-ext/;
  fi;
  
  #-- If Directory Not Extst in /data, create it
  if [ ! -d /sd-ext/$i ]
  then
    busybox mkdir /sd-ext/$i;
    #-- Just Open All Permissions ;)
    busybox chmod 0777 /sd-ext/$i;
  fi;
  
  #-- Now Create Symlink From /sd-ext to /data
  if [ ! -h /data/$i ]
  then
    busybox ln -s /sd-ext/$i /data/$i;
  fi;
done;
And this the part that should be removed:
Code:
###
# Now Important Thing, is to move the com.htc* and com.android* data to /sd-ext (internal) 
# For Good performance. So the system applications will run smooth.
#
# System application will read/write in Internal memory, and 3rd apps will run on sdcard
#
# Notice: Will be affected in 2nd boot :D, so Reboot the system after 1st boot...
###

#-- Prepare data_s in /sd-ext ( For system data )
if [ ! -d /sd-ext/data_s ]
then
  busybox mkdir /sd-ext/data_s;
  #-- Just Open All Permissions ;)
  busybox chmod 0777 /sd-ext/data_s;
fi;

#-- Now Move All com.htc* and com.android* to Internal Memory
cd /data/data/;
for i in `ls -d com.htc* com.android*`;
do
  #-- Only Non Symlink
  if [ ! -h /data/data/$i ]
  then
	  busybox mv /data/data/$i /sd-ext/data_s/;
	fi;
done;

#-- Create Symlink of /data/data_s/* to /data/data/ (mmcblk0p2)
cd /sd-ext/data_s/
for i in `ls -d *`;
do
  #-- Only If Symlink Not Exists
  if [ ! -h /data/data/$i ]
  then
	  busybox ln -s /sd-ext/data_s/$i /data/data/$i
	fi;
done;
Or you could do it the other way around, leave system apps on sd-ext (internal) and move dalvik to SD card? Uzi2, as you say your script is tested, did you test this and what were your findings?

I have attached the script in a flashable zip the way I use it now, all on SD card as well as SD speed fix change for anyone that also runs into market install / update troubles.
You have to do a fresh install though, clearing dalvik with the modified script will not move it to SD card and you have to install it the tried way, i.e. flash ROM (kernel), boot, reboot, reboot into recovery, flash script, reboot, set up google account and restore apps. Putting it in right from the beginning gave me bootloops (factory wipe install).

EDIT: Ok, it is confirmed that Dalvik cache is app dependent, it now has a size of 187MB (compared to the 178 I saw before) and I have another 200mb of sd-ext4 left to install more apps. So it is very well possible, that after installing further apps, the 10% space threshold of sd-ext (internal) will be reached again and Market will quit dl / updating apps as it did before. So it looks like the only viable option will be to leave the second part of the script in, the one where all the system (and htc) apps get moved to internal. Looking at the script, it appears that you could put this part in and it will move the apps to internal even after all has been on SD card, can anyone with coding skills please confirm?
The Following User Says Thank You to geenyous For This Useful Post: [ View ] Gift geenyous Ad-Free
20th January 2012, 10:54 AM |#6  
d33f's Avatar
Senior Member
Flag Kerkrade, The Netherlands
Thanks Meter: 52
 
More
Best way to use this script
May i add, that the best possible method is to copy the script file to the ROM zip Before Flashing. This way i didn't encounter any crashes, low volume, whatsoever!
20th January 2012, 10:59 AM |#7  
uzi2's Avatar
Senior Member
Thanks Meter: 640
 
More
Quote:
Originally Posted by d33f

May i add, that the best possible method is to copy the script file to the ROM zip Before Flashing. This way i didn't encounter any crashes, low volume, whatsoever!

This is because, there is no need to fix permissions using this method.
Obviously there is no need to wipe dalvik-cache on a fresh install, but if you refrain from doing so on an update, you should not encounter problems.

Please remember to copy the script into init.d on every update.
20th January 2012, 12:19 PM |#8  
geenyous's Avatar
Inactive Recognized Themer
Flag Shanghai
Thanks Meter: 856
 
Donate to Me
More
Quote:
Originally Posted by d33f

May i add, that the best possible method is to copy the script file to the ROM zip Before Flashing. This way i didn't encounter any crashes, low volume, whatsoever!

I really hate to ruin the party here, especially as I am also a fan of easy solutions, but after I made a factory wipe (a state where most new users will come from when they change CWM partition) and put the script in an otherwise unmodified zip, I had bootloops. And not just one, several.

This then worked for me:

- Format SD card with one FAT32 partition (primary, 32kb block) and one ext4 partition (primary, 4kb block)
- Boot into CWM
- Flash ROM (& Flash Kernel)
- Reboot and don't touch anything
- Reboot into recovery
- Flash script
- Reboot into ROM
- Reboot into CWM and fix permissions
- Reboot into ROM and start setting up your phone
- Done

If you update your ROM, then do the following:

- Unzip script zip (not ROM!)
- Copy the script (called something like "10ad2sd" or "40ad2sdx") to system/etc/init.d/ in ROM zip with something like 7zip
- Boot to CWM
- Flash ROM (& Kernel)
- Done
The Following 3 Users Say Thank You to geenyous For This Useful Post: [ View ] Gift geenyous Ad-Free
20th January 2012, 12:39 PM |#9  
Junior Member
Thanks Meter: 1
 
More
Thank you for this
This solved all my storage issues. Especially on this new rom. Now I am not experiencing any bugs whatsoever.
20th January 2012, 12:39 PM |#10  
uzi2's Avatar
Senior Member
Thanks Meter: 640
 
More
Quote:
Originally Posted by geenyous

I really hate to ruin the party here, especially as I am also a fan of easy solutions, but after I made a factory wipe (a state where most new users will come from when they change CWM partition) and put the script in an otherwise unmodified zip, I had bootloops. And not just one, several.

Was it a bootloop? How long did you leave it, before deciding this?
It will also depend on which a2sd script you use, so just because you encounter problems doesn't mean it's universal.

Edit:Having read the FAQ, I think you may be using Amarullz RC02, whilst I am using Alpha02 (amended)
The Following User Says Thank You to uzi2 For This Useful Post: [ View ] Gift uzi2 Ad-Free
20th January 2012, 12:58 PM |#11  
geenyous's Avatar
Inactive Recognized Themer
Flag Shanghai
Thanks Meter: 856
 
Donate to Me
More
Quote:
Originally Posted by uzi2

Was it a bootloop? How long did you leave it, before deciding this?
It will also depend on which a2sd script you use, so just because you encounter problems doesn't mean it's universal.

You know me, I am not screaming wolf just to get attention. I was using exactly the same script you posted and I never said it was universal. I waited 10 mins, 3 times in a row before I decided to reflash without the script. Took some 3-5 mins and the Set up screen was there. Whatever is the cause here, none of us seem to understand it, at least I don't and you have not posted the reason.
So lets just leave it as it is, if it works, fine, if not, then go the long way, as easy as that
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes