A bit late with this response, but I have just had the same problem with my old nexus 5.
In desperation, I simply tried repeatedly doing a factory reset and on about the third attempt it successfully formatted all three mounts (/system, /data and /cache)!