Results 1 to 25 of 27
- 05-13-2011, 10:12 PM
Thread Author #1
[MOD] Move Dalvik to /cache to free up 40-60 M on /data
This is a mod to move your phone's Dalvik cache to the /cache partition, freeing up the space it would normally take up in /data. Depending on how many apps you've got installed, you'll free up 40+ M of space on /data.
This is an old mod that has been around a while and in all of the Optimus S ROMs. Recently I flashed my phone back to stock to build my own ROM, and was shocked to learn I had to delete half my apps until I'd reimplemented this feature! Finally, I understood why all the V people were messing around with old-school link2sd/app2sd instead of just using the froyo-native "Move to SD card"!
Personally, I have tons of apps installed and around 60 M free on /data.
I recently contributed this mod to LeslieAnn for Harmonia, so here I'm just putting it out separately. I don't know if he's the original author, but I owe props to KSmith since I originally cribbed mvdalvik.sh from ThundeROM. Thanks!
Can I use this mod?
This mod will only help you if you don't already have it. So, it's great if you're running mostly stock, like me.
I don't know about every ROM, but these ROMs already have this feature (so you don't need to add it):
- Harmonia (upgrade to latest)
- Nameless/Reborn
- CM7
These ROMs don't (yet) have this feature (so you can add it):
- stock (obviously)
- Aphrodite
- Bumblebee
- Rodimus
Other ROMs ... I haven't checked, but I'll update this list as people provide info.
Count'em ... TWO ways to install
1. There is an easy way, an update .zip. However, it may not be compatible with your ROM.
2. There is the hard way, for which I will give full instructions. It is compatible with everything! However, it requires a Linux machine, the Android SDK installed, and familiarity with the command line. (You *could* also do it on an OS X or Win machine, if you've got mkbootimg and mkbootfs binaries ... but in that case you probably don't need this tutorial).
So, first see if meet the requirements for the easy way. If you don't, or you're just a nerd, look at the hard way.
1. The Easy Way
The update .zip will replace the root filesystem (all the .rc files and other stuff in /) of your phone with a modded one from a stock Optimus V.
Why could this possibly be bad? Well, your ROM may have done customizations in there that you want to keep. Or, it may have done customizations that don't matter to you, at least not as much as 40 M free on /data!
I will try to make recs based on what I know about various ROMs, but you've got to make the decision for yourself.
DO flash the .zip for:
- stock ROM, including flashed with alternate kernel
- Aphrodite
- Bumblebee (NOTE you will lose init.d support ... so if you care about this move on to the hard way)
- Rodimus (NOTE you will lose init.d support ... so if you care about this move on to the hard way)
If you're still here, just download the attached mvdalvik-update.zip, copy it to your /sdcard, and flash like any update .zip. Last, be sure to wipe Dalvik and cache before you reboot.
2. The Hard Way
1. Download the attached mvdalvik-howto.zip and unzip it. From here on I'll assume it's unzipped into your home directory (and will refer to ~/mvdalvik-howto/filename) but you can put it anywhere. It contains:
- flash_image: this is an ARM binary for your phone in case you don't already have
- init.rc.diff: this is a patch you will be applying to your init.rc
- mkbootfs: this is a Linux x86 binary I compiled from the froyo branch of Android
- mkbootimg: "
- mvdalvik.sh: this is a shell script you will be putting in /system/etc/ on your phone
- split_bootimg.pl: script to unpack the boot partition image
2. OK, first let's put mvdalvik.sh into /system/etc.
3. Now you will dump /boot to boot.img, unpack it, patch init.rc, and repack. (Read for background.)Code:adb shell "mount -o remount,rw /dev/block/mtdblock5 /system" adb push ~/mvdalvik-howto/mvdalvik.sh /system/etc/ adb shell "chmod 700 /system/etc/mvdalvik.sh" adb shell "mount -o remount,ro /dev/block/mtdblock5 /system"
4. (possibly optional) If your ROM doesn't already have a flash_image command, you can add the included binary:Code:adb shell "cat /dev/mtd/mtd0 > /sdcard/boot-old.img" adb pull /sdcard/boot-old.img mkdir ramdisk && cd ramdisk gzip -dc ../boot-old.img-ramdisk.gz | cpio -i patch init.rc < ~/mvdalvik-howto/init.rc.diff cd .. ~/mvdalvik-howto/mkbootfs ramdisk | gzip -9 > ramdisk.gz ~/mvdalvik-howto/mkbootimg --kernel boot-old.img-kernel --ramdisk ramdisk.gz --cmdline 'mem=477M console=ttyMSM2,115200n8 androidboot.hardware=thunderc' --base 0x12200000 -o boot-new.img
5. Now push boot-new.img to /sdcard, flash, clean up and reboot to recovery:Code:adb shell "mount -o remount,rw /dev/block/mtdblock5 /system" adb push ~/mvdalvik-howto/flash_image /system/bin/ adb shell "chmod 755 /system/bin/flash_image" adb shell "mount -o remount,ro /dev/block/mtdblock5 /system"
6. Wipe Dalvik and cache, and reboot. You're done!Code:adb push boot-new.img /sdcard/ adb shell "cat /dev/zero > /dev/mtd/mtd0" # don't worry, "No space left on device" is normal adb shell "flash_image boot /sdcard/boot-new.img" adb shell "rm /sdcard/boot-new.img /sdcard/boot-old.img" adb reboot recovery
Thanked by: - 05-13-2011, 11:03 PM #2
Yeah Link2sd lets u move the dalvik cache also to sd.
- 05-13-2011, 11:10 PM #3
- 05-14-2011, 12:35 AM
Thread Author #4
I haven't tested that but you shouldn't have to.
Link2SD sets up a system of symlinking the apk and dex files of an individual app to copies on another location. This just bind mounts the entire dalvik cache (/data/dalvik) to the cache partition (mtdblock1).
The system just sees /data/dalvik and uses it as normal. - 05-14-2011, 12:44 AM #5
I ask because it symlinked the dalvik cache too with it. I'm guessing the dalvik will be moved symlinks and all?
Thank you for your time and contribution
Sent from my VM670 using Tapatalk - 05-14-2011, 02:10 AM
Thread Author #6
You're welcome!
Yes, that's what I think will happen. When you do this mod, you will want to wipe dalvik and cache in recovery. Then, on boot, dalvik is mounted to a different disk partition. Then the system rebuilds the dalvik cache. Finally, Link2SD will start once the full system is up, and do whatever magic it normally does (which I think is to look for .dex files in /data/dalvik, move them to sd partition, and symlink in /data/dalvik to the sd versions).
If you are using Link2SD, this won't free up as much space as if you weren't, because these .dex are living on SD. But, there's still the dalvik cache for all your system/apps, and now that will be on cache instead of data, so you should still gain some space. - 05-14-2011, 02:54 AM #7
- 05-14-2011, 03:33 AM
Thread Author #8
- 05-14-2011, 04:01 AM #9
- 05-14-2011, 04:14 AM #10
- 05-14-2011, 04:22 AM #11Thanked by:
- 05-14-2011, 04:58 AM #12
Thanks, I got it working, my recovery was just acting wonky I guess, i deleted the file, redownloaded it, deleted a few old useless zips on my sd card, and there it was! Trying it out right now, funny, I just posted on the bumblebee rom thread about doing this! Great timing Pikasticks
- 05-22-2011, 02:50 PM #13
I was asking about this earlier and was directed to this post. I'm just curious if there is an easier way, because this seems like it may be more complex than it needs to be. On my old Samsung Moment I moved the dalvik cache to the cache directory and just linked it back to the data directory. Is there a reason this wouldn't work on the Optimus?
- 05-22-2011, 07:01 PM #14
And on another note...
needs to be:adb pull /sdcard/boot-old.img
mkdir ramdisk && cd ramdisk
gzip -dc ../boot-old.img-ramdisk.gz | cpio -i
adb pull /sdcard/boot-old.img
./split_bootimg.pl boot-old.img
mkdir ramdisk && cd ramdisk
gzip -dc ../boot-old.img-ramdisk.gz | cpio -i - 05-22-2011, 07:03 PM #15
Can this be used with Data2ext or would it be pointless?
I was hoping to run the Dalvik cache on the phones memory instead of the SD will this be the case with this mod? - 05-22-2011, 08:19 PM #16
Harmonia Developer for Optimus V, Optimus Elite, One V, Evo V, Evo Shift, Evo V
Donate here if you feel inclined to brighten my day. - 05-23-2011, 05:13 PM #17
I'm not looking for easy, just "works". I like the ROM that's on the phone already just fine. The reason I asked about sym-linking is it seems so logical that I was curious why it wasn't being used.
I'm quite alright with doing any necessary work (I started with the manual steps for this mod, obviously). - 05-24-2011, 11:41 PM #18
- 05-30-2011, 07:34 PM #19
- 10-10-2012, 07:36 PM #20
Re: [MOD] Move Dalvik to /cache to free up 40-60 M on /data
Thanks Picasticks for making this mod avaliable to us. Unfortunately when I flashed mvdalvik-update.zip to my android it now won't start up. When I turn it on it just says "fastboot mode" in small letters up in the top left corner and does nothing. At that point it doesn't respond to the power button either, so I just have take out the battery to turn my phone off. I did not wipe the dalvik and cache in recovery, because I didn't know what that meant exactly, so could that be why my phone is not starting up now? In the recovery mode on my phone where I flashed the mvdalvik-update.zip from, it didn't apear to have an option to wipe the davik or cache. (By the way, in my limited understanding I thought that you were refering to the folder data\davikcache, which I have deleted from time to time to remove any useless left over files from uninstalled apps, but I didn't bother to delete this time before shutting down the OS, because it starts rebuilding it as soon as you've deleted it. I just presumed that there would be an option to wipe it in recovery mode.)
So the main problem is, I can't boot my phone now and don't know how to fix it - either revert it back to the way it was, or just make it boot up. Unfortunately I didn't do a nandroid backup first. I need to get my phone back up and running. Is anyone able to help??
My phone is a rooted Acer Liquid MT S120 and is running stock ROM Gingerbread 2.3.6 and use Link2SD with partitioned SD card. - 10-10-2012, 07:47 PM #21
Re: [MOD] Move Dalvik to /cache to free up 40-60 M on /data
You are posting in an LG optimus v forum, and this looks like a very old mod for optimus v roms
I would suggest trying to post in your phones forum
Then I would try to get to your recovery menu and hopefully restore your backup
And I hope you haven't ruined your phone
Sent from my VM670 using Android Central Forums - 10-10-2012, 07:48 PM #22
Re: [MOD] Move Dalvik to /cache to free up 40-60 M on /data
This mod has a boot.img which is phone specific, and made for the LG VM670. So hopefully you didn't brick yours. You might be able to flash in recovery a rom that is made for your phone. Or see if there's a stock rom you can flash.
- 10-10-2012, 07:48 PM #23
- 10-10-2012, 08:23 PM #24
Re: [MOD] Move Dalvik to /cache to free up 40-60 M on /data
Oh no... I didn't see that above the thread name it said "Forum> LG Android Phones> LG Optimus Forums> Virgin Mobile Optimus V> Optimus V Rooting, ROMs, and Hacks>"
That's the problem with coming to thread via a google search! Thanks guys for your quick response. It doesn't sound good, I was hoping I didn't have to reset the phone by flashing a new rom, but it sounds now like that is what I may have to do. Don't have time to do it now though. I'll make sure to back up my SD card first, just incase... - 10-10-2012, 09:56 PM #25


Reply




































