I had a similar issue, I used the built in partition checker by powering up the device then holding down the X key.
The system will then check the partitions.
I believe the issue occurs when something goes wrong and the system treats the SD card as read-only.
Issue for me was it kept happening, so I ended up making an image of the SDcard on my machine, reformatted the SD card using the SD card formatter, then i re-imaged the SD card from the backup and all was 100% after that.