I wanted to upgrade my Android version from Cyanogen 10 to 11M5 on my old Samsung Galaxy S2. I though it would be an easy task, but not at all.

First of all, I had to be in recovery mod (bottom button + vol up + power). Then I wanted to create a /sdcard but it didn’t want to mount and I didn’t want to format my sdcard. So I mounted a tmpfs onto it:

> adb shell mount -t tmpfs none /sdcard

Then the problem was to find a compatible version of clockworkmod. Because of this issue when I wanted to apply Cyanogen:

set_metadata_recursive: some changes failed

I had to find and send a compatible clockworkmod with kitkat (link1, link2) to the phone:

> adb push recovery-clockwork-4.0.1.5-galaxys2.zip /sdcard/
3388 KB/s (1358054 bytes in 0.391s)

Afterward, apply the zip from the recovery mode from the phone. Then I had to download the M5 version on Cyanogen website and push it on the device:

> adb push cm-11-20140405-SNAPSHOT-M5-i9100.zip /storage/sdcard0/
error: insufficient permissions for device

Bad isn’t it ? When I looked at the connected devices, I got:

> adb devices
List of devices attached
???????????? no permissions

The solution was to restart the server and relaunch it:

> adb kill-server

Better now:

> adb devices
List of devices attached
0019026e78c75e recovery

Finally I could push last cyanogen version :

adb push cm-11-20140405-SNAPSHOT-M5-i9100.zip /storage/sdcard0/
3259 KB/s (199874044 bytes in 59.887s)

And installed the zip with the method I previously did for clockworkmod !