In CWM Recovery:
Wipe data/factory reset - Reports successful but when reboot I am greeted by my old wallpaper and apps followed by the crash within 1 minute.
Restore from backup - crashes during restore
Advance Restore - all partitions restore successfully except /data, phone crashes during recovery of /data
I tried using CM Installer by connecting to my laptop in Recovery mode and running the Windows CM Installer software. This looked promising, the install process appeared to be working with both the phone screen and laptop showing that the install was proceeding. The CM installer on the laptop reported that CM had successfully been installed however on re-booting the phone I was greeted again with my own wallpaper and apps followed by the inevitable crash.
I used Wugfresh to try to flash the stock ROM. I did this from Bootloader using the Flash stock/unroot with bricked phone option and even went into advanced options to enable force flash mode and I have not checked the option to keep userdata. This also appeared to work according to Wugfresh however when I re-booted nothing had changed and all my userdata remains with the crash following shortly after boot.
I have also tried flashboot and ADB commands to erase and/or format /data, all report success but when rebooting clearly haven't worked.
I've come to the conclusion that something is wrong with /data. The crash is being caused when the phone tries to access something in that partition. It seems that when flashing a new ROM by any method, the installer successfully writes all other partitions and that while it thinks that /data has been re-written, it actually doesn't.
Further info from Wugfresh log regarding "userdata" when flashing:
formatting 'userdata' partition
Creating filesystem with parameters:
Size: 14539534336 (etc etc)
Creating filessytem with 11/887696 inodes and 97200/3549691 blocks
sending 'userdata' (137559 KB)...
writing 'userdata' ...
OKAY [259.512s]I have tried many ways to erase or format /data or userdata and somehow it still remains. Can anyone please help?