I got this very problem too but after trying everything I read online without success, I tried this and it worked. But with this method, you'll lose all your games unless you have it saved to cloud. The easiest way is to buy a new hard drive and change it with that which you have on your Ps4. If not, simply follow the steps below.
First, depending on what Ps4 console you have, try taking out the hard drive from the Ps4. Once done, get an external hard drive reader and connect your hard drive to it.
Secondly, connect your hard drive with a USB cable to your computer and try locating it while using the repair disc and deleting all sectors until you're left with one sector.
Thirdly, format the hard drive. Once completed, reconnect the hard drive to your Ps4.
Fourthly, download the installation file from the PlayStation website. It should be over 900MB. Make sure to follow all steps on the PlayStation website and save it to a USB flash drive.
Lastly, connect the USB flash drive to the Ps4, press and hold the power button until you hear a second beep and connect to Safe Mode. Select option 7 and let it install after which your Ps4 is ready and running once again. I hope it helps someone. Please if it does, kindly visit this page and help me with the little you can.
Thanks guys. All the best.