PC can't detect the HDD sometimes

Doppelganger_1

Prominent
Jul 5, 2017
46
0
540
PC can't detect the HDD sometimes (there's a question mark next to it) and the only temporary solution is restarting the computer. After I restart it, there isn't a question mark next to it and I can access the files on it.

What's the permanent solution for this?

This is my current build

- Intel Core i5 7600K Kaby Lake CPU
- MSI Pro Series B250 PC Mate Motherboard
- Kingston HyperX FURY 8GB Kit (2x4GB) 2400MHz CL15 DDR4
- EVGA GeForce GTX 1070 SC GAMING ACX 3.0 Black Edition Graphics Card
- Samsung 850 Series 256GB SSD
- Western Digital Black WD1003FZEX 1TB 7200rpm 3.5” HDD
- ASUS SATA DVD RW 24x
- Cooler Master Hyper 212 EVO
- Corsair Carbide Series 100R Mid tower case
- Corsair CS Series 550w Modular PSU (CS550M)
- Dell S2716DGR 27" LED GSync 2560 x 1440 1 ms HD Monitor
- 3 Corsair ML120 PRO LED CO-9050042-WW 120mm 120mm Premium Magnetic Levitation PWM
- Logitech Z623 200 Watt Home Speaker System, 2.1 Speaker System (Black)
- Intel Dual Band Wireless-AC 7260 for Desktop Network Adapter 7260HMWDTX1.R
- Corsair STRAFE Mechanical Gaming Keyboard, Red LED, Cherry MX Red

Thank you for anyone that can help me with this.
 
Solution
Almost every time I experienced this problem, it was a bad SATA cable. The problem has almost completely disappeared from my builds after I switched to SATA cables with clips to hold them into the socket (cost a few cents more).

The few times it wasn't the SATA cable, the problem turned out to be a dying HDD or a flaky SATA controller.
Almost every time I experienced this problem, it was a bad SATA cable. The problem has almost completely disappeared from my builds after I switched to SATA cables with clips to hold them into the socket (cost a few cents more).

The few times it wasn't the SATA cable, the problem turned out to be a dying HDD or a flaky SATA controller.
 
Solution