I've manage to find two sites with your question related, not gonna type all in here cause there's a lot of steps to be taken, take a look at these two and see if it is of any help for you.
https://digiex.net/threads/how-to-fix-xbox-360-hard-drive-after-connecting-to-pc.13626/
https://forums.xbox.com/pt-BR/thread/543C8C8F-9108-4BE7-8D23-84EB427EFCAF - In this, the person who created the thread is facing the same issue as yours.
You could also try cleaning the contact points of your HDD just to check..
Hope that helps.