If the primary master is set to Auto and then changes when you power it off, then you have something else going on.
Try replacing the CMOS (that'd be a quick and inexpensive test). But you might be experiencing erratic problems with the hdd controller (either directly on the hdd if the cable connects directly to the system board) and it's beginning to flake out on you.
Generally, the CMOS battery tends to lose date/time information first... or time slows down considerably when it's solely a battery problem.
If the computer is constantly not recognizing the hdd, I'd open the computer, reseat the hdd cable on both ends, and verify that it's all tight and secure.
If the problem persists thereafter, then I'd test test the hdd/controller by moving it to another computer and seeing if the problem follows the equipment. Or I'd place a new hdd/controller and see if the problem persists.