So if you've installed a custom rom, and you have a ton of apps, you may have noticed market errors when downloading new apps or updating existing ones. These can say either insufficient space on device or invalid package file. The reason for this is because although you may have plenty of extra space in your /data/ partition for all the apps you have, your /cache/ partition is likely full. Most custom roms have also moved the dalvik-cache from /data/ over into /cache/ to make more room for apps. The problem with this is that the /cache/ partition will most likely fill up before your /data/ partition does, which is what causes the market download/install errors. The easiest way to fix this is to just uninstall a bunch of apps, then wipe your cache to rebuild the list, and that will likely get you the space you need. But if you want a more long-term solution, this mod is for you.
I have completed this successfully and tested to be working flawlessly on Drew's latest CM7 build, but it should work for all other CM7 builds. I can't say for sure about froyo roms, but if you want to try, then by all means go for it. Standard disclaimer: I am not responsible for any damages that may occur to your phone as a result of you attempting the following procedure. As always, make a nandroid backup and backup your entire sd card, in case anything does go wrong.
Before you start, you NEED an sd card of the VERY least class 4 or above. I'd recommend even higher - have a class 10 4 gb card that works perfectly. The stock card that comes with the Optimus S will not work - it's pretty much junk. Invest in a better one - you won't be sorry.
At this point, you should have everything working flawlessly, and never see that damned market error again (assuming you don't fill up your new sd-ext partition... My performance since doing this is rock solid, maybe even better than before. Flashing rom updates will break this, though, so make sure it's an update you really want, otherwise you'll just have to run through this again.
I have completed this successfully and tested to be working flawlessly on Drew's latest CM7 build, but it should work for all other CM7 builds. I can't say for sure about froyo roms, but if you want to try, then by all means go for it. Standard disclaimer: I am not responsible for any damages that may occur to your phone as a result of you attempting the following procedure. As always, make a nandroid backup and backup your entire sd card, in case anything does go wrong.
Before you start, you NEED an sd card of the VERY least class 4 or above. I'd recommend even higher - have a class 10 4 gb card that works perfectly. The stock card that comes with the Optimus S will not work - it's pretty much junk. Invest in a better one - you won't be sorry.
- Your phone should be rooted, which is a moot point since you're already running a custom rom.
- Backup all your apps using titanium or similar.
- (Optional) Start off by rebooting into recovery. To verify that you need this, plug your phone into your computer and fire up a command prompt or terminal window. Go into mounts and go ahead and see that all partitions are mounted. Then enter the following:
Code:adb shell df
- Assuming everything is backed up, boot back up and remove all user apps. I used titanium to do this. This may not actually be necessary, but I wasn't able to boot up and complete this mod without doing it - probably too much for it to handle... So I recommend it.
- At this point, you need to reboot into recovery. We need to create the partition on the sd card for things to be moved to. DO A NANDROID BACKUP FIRST BEFORE ANYTHING!!! With xionia clockwork, go through the prompts to partition sd card (under mounts and storage? Sorry, I can't remember right now, lol). I got by fine with a 512mb partition, and the default swap size. You could also do this with any other partition program on your computer, but this is just easier.
- While in recovery, go to mounts, and make sure /system/ and /cache/ are mounted. In a command prompt or terminal window, type:
Code:adb shell rm /system/etc/init.d/01mvdalvik rm -r /cache/dalvik-cache/
- Boot back up and make sure everything is okay. It might take a bit longer to boot, since dalvik-cache has to be rebuilt in the default /data/ location. Once back up, go to market and install Simple2ext (S2E). This gives us a GUI for installing a new script so we don't have to do as much adb trickery. Since partitioning the sd card in recovery only makes an ext-3 partition, we need to go into the settings for this app and check the box for 'mount as ext-4' since this is how CM7 reads ext partitions. It should still work fine, don't worry just yet. Once that is checked, go back to the main app, and check the box to move dalvik-cache. You might as well check the box to move app data and download cache as well, since I did that and with all my apps have less than half of the partition filled. Trust me, there's enough space.
- At this point, you'll have to reboot to apply the changes. This is why we got rid of all user apps at the beginning, since the script will now move the dalvik-cache from /data/ to /sd-ext/. It will take a little bit longer, but it should do it's thing. Once back up,fire up S2E and go to menu>information. You don't necessarily have to download the app it tells you about, but it is nice to have (now that you have the space for it). You'll see that there's still some space being filled in /cache/ but that's due to some apps like browser and email still using it - no big deal. You will, however, notice that /sd-ext/ has some of its space filled up. It'll be small at this point, since there aren't any user apps restored back onto the phone. When it looks like everything is all set, go ahead and restore all your apps. When you do this, change the option to restore to internal memory instead of sd card, since the link has already been made for this to really go to sd card. All new apps will also follow this precedent.
At this point, you should have everything working flawlessly, and never see that damned market error again (assuming you don't fill up your new sd-ext partition... My performance since doing this is rock solid, maybe even better than before. Flashing rom updates will break this, though, so make sure it's an update you really want, otherwise you'll just have to run through this again.
Last edited: