I have rooted my Nexus 5 and installed CyanogenMod (Android 6) a few months ago.
It has always been running fine, but today while scrolling a web page it froze, so I long-pressed the power button to reboot it.
The phone started rebooting, showing the Google logo and unlocked lockpad, then the CyanogenMod robot head, as usual.
It then rebooted by itself, once again the Google logo and robot head, and got stuck there.
After 5 minutes without visible progress I long-pressed the power button again.
Now it does not go further than the Google logo screen. I tried again rebooting it a few times, it is always stuck at that screen.
Starting in recovery mode just turns the screen black (the screen is active but only showing black pixels).
#> fastboot oem device-info ... (bootloader) Device tampered: true (bootloader) Device unlocked: true (bootloader) off-mode-charge: true OKAY [ 0.003s] #> fastboot flash recovery twrp-3.0.2-0-hammerhead.img target reported max download size of 1073741824 bytes sending 'recovery' (14524 KB)... OKAY [ 0.665s] writing 'recovery'... FAILED (remote: flash write failure) finished. total time: 44.721s #> fastboot erase cache ******** Did you mean to fastboot format this partition? erasing 'cache'... FAILED (remote: failed to erase partition) #> fastboot erase cache target reported max download size of 1073741824 bytes erasing 'cache'... [stays like this forever]
fastboot boot twrp-3.0.2-0-hammerhead.img starts TWRP, which shows that Data and System are 0MB:
How to fix it?