For those having this issue, this is what I found that helps:
- Computer Management
- Device Manager
- IDE ATA/ATAPI controllers
- Properties
- Driver
- Update
- Browse
- Pick from a list of available drivers
- Standart SATA AHCI Controller
- Next, Close and Restart
For some reason, my HDD stopped getting disconnected, although it's still kind of slow.
EDIT: It was too slow so I had to buy a HDD rack and use it as an external hard drive. I really suggest this approach for everyone having this issue, since the rack is way cheaper than other solutions.