As you've a HDD, you need first to check the disk health before going further into troubleshooting;

check this post for more details.

Also the command line that pops up, can be an auto-start...