Reinstalling system software issues

I recently bought a ps4 slim special edition and on booting into safe mode (it won’t start normally), all options are grayed out except for option 7 (reinstall system software), so I put the system software onto a usb drive and hooked it up and had two issues. The first issue was that both the usb drive and the controller I had hooked up would randomly stop being connected, and would take me several times unplugging and plugging them back in for them to stay connected. Not sure if that’s normal for safe mode or if its a bad sign. The ports didn’t seem very dirty. Anyway the second issue I had was when I was finally able to get the ps4 to try to initialize, it would get halfway through the process very quickly and then give me the error “cannot access system storage” I think CE-34335-8 if I remember correctly. Does that mean the hard drive is simply dead, or do I have an issue with the motherboard, since my USB ports seem bad also?