Cannot format SSD to OS X Extended (Journaled) in order to restore yesterday my computer stayed awake during all night, when I woke up it stopped working. I got many errors, one that says for example that I don't have enough space in my computer even though that when I checked it said I have more than 75 GB available.
So  after everything failed I booted in Recovery Mode (Cmd+R) and started playing with it. Currently my state is that my SSD is formatted to exFat because I can format to any kind of filesystem except OS X Extended (Journaled). Also, I can only boot up in Recovery Mode, no OS at the moment.
Every time I try to to erase and format to OS X Extended (Journaled) with GUID Partition Map I get this error:

input/output error:
newfs_hfs: write (sector 149512): Invalid Argument

Mounting Disk:
Could not mount disk0s2 with name(null) after erase.
File system formatter failed.
Operation failed.


Technical info

MacBook Pro 13" Mid 2010 with SSD 240GB Kingston (SATA).
If trying one more time to format HFS non journaled fails, you may want to use the erase and install steps from:


https://support.apple.com/en-us/HT204904


Hopefully it's not a hardware error and you can just fix this with a clean erase. Installing to an external dive may also help you determine if it's an issue with procedure or your installer vs the ssd.