• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

link2sd not re-linking dalvik-cache at boot

divinebovine

Android Expert
Aug 30, 2012
990
273
allofftopic.com
My Venture, with its puny /data internal storage, benefits greatly from using link2sd. However, when I reboot, the dalvik cache is full of real files, not symlinks, and link2sd doesn't automatically re-link the files. I'm not sure if it's wiping and re-creating the dalvik cache or just doing something with those files. It takes a long time to boot and I can repeatedly use df in an ADB shell and watch as /data fills up.

Once booted, I have to open link2sd, go to its menu, and choose "Link dalvik-cache files".

Not only does this mean that my /data is full after rebooting, but it also means that if I have too many apps to fit in /data then some will end up broken (presumably the ones it attempts to cache after /data is already full).

So, my questions are...

1. Is it normal behavior for the system to un-link dalvik cache on boot (either the individual files, or wiping/re-creating the whole thing)? Could this be happening because of some setting I dumbly changed/utility app I monkeyed with?

2. Is it reasonable to expect link2sd to automatically re-link dalvik-cache files on boot? I do have "Relink dex files at boot" enabled.

I'm thinking I could chmod the symlinks in /data/dalvik-cache so they're not writable and that might prevent those from being wiped and re-created or whatever, but I don't know if that would break anything (other than having to fix file permissions before uninstalling apps). I guess it couldn't hurt to try on some non-essential apps...could it?
 
If you can read my previous posts here, you'd find that I too experience the same with my Link2SD, but it's the lib file that keeps on unlinking each time I reboot. In the end, I have to get used to manually relinking the lib files while dodging app crashes at the same time.

As for the dalvik, you can try getting Titanium Backup Pro so you can integrate dalvik files into your ROM, which might greatly reduce space. Someone correct me if I'm wrong, though.
 
Upvote 0
Should be as simple as chmod 0555 filename I think.

Negatory. In all my years as a part-time linux administrator I don't think I've ever had reason to chmod a symlink, so that'd be why I didn't realize that chmod doesn't work on symlinks.

Is there a way to prevent a symlink from being deleted/overwritten? It appears that the answer is a qualified no:
Can you make a symbolic link read only?
One can prevent symlinks being deleted/overwritten by changing permissions on the directory, but that would have serious consequences in this case...you probably wouldn't be able to install or uninstall ANY software.

However, maybe there's hope...
The ex-sysadmin: Performing a chmod on a symbolic link
If you delete the symlink, change your umask, then create the symlink, you may get the results you desire. {a few minutes pass} Nope...tried it, symlink still has lrwxrwxrwx.

Drat.

Cliff's notes: Anybody have any idea how we can prevent symlinks from being removed/overwritten without changing permissions for the directory?
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones