Hi, i am using a compaq laptop. It is a core2duo with 2gb ram. 2ghz.
Now my problem is that sometime ago my hard disk stopped detecting. I was out of my warranty and also out of cash so didn't know wat to do.

I knew about the ubuntu live cd and so to check if it was something wrong with the laptop, i used it. it is working perfectly.

Then, by some trial and error, i also found out that if i give my laptop a real good punch or a hit when shut down and then boot into the live cd, the hard drive gets detected.

So now my process is.
1.boot.. find out that hard disk is not detected
2.boot using ubuntu live cd. still harddisk not detected
3.shut down. give laptop a real hard hit or punch.
4.Boot again using ubuntu live cd.
5.mid way through this hard disk is detected.
6.reboot... now hard disk is detected and boot into windows.
7.work like this for a day. here the hard disk works perfectly.
8.shut down.
9.try to boot next day. hard disk not detected.
10.start again from step 2

(these steps can also really help people whose data is lost. or hard disk not detecting, try it.)

p.s.i also tested the hard disk using the wd hard disk s.m.a.r.t. test and the hard disk sentinel program. It is fine. i am completely lost.

please help me. thank you.

Dani AI

Generated

— the fact the drive sometimes vanishes at boot and then reappears after a physical shock, while basic S.M.A.R.T. looked OK, points strongly to an intermittent hardware/connection fault rather than a purely software problem. is correct: hitting the machine is risky and will likely make a fragile connection or failing component fail for good.

Most probable causes (in order of likelihood): a loose or damaged SATA/power connector or drive caddy, a cracked solder joint or flex‑cable on the laptop motherboard, or failing drive electronics that make contact intermittently. S.M.A.R.T. can miss intermittent electrical faults or early PCB failures, so a “clean” S.M.A.R.T. result doesn’t rule out hardware trouble.

Practical diagnostic and recovery plan (ordered, prioritize data safety):

  • Avoid further shocks. Back up immediately while the drive is visible — do not rely on the workaround.
  • Capture logs and device state from a Live CD: BIOS detection, lsblk, and kernel messages showing SATA link activity. Look for ATA link up/down or CRC errors.
  • Try the drive in another machine or in a USB‑SATA adapter. If it fails there too, the drive is suspect; if it works reliably elsewhere, the laptop/cable/caddy is the problem.
  • Reseat the drive and inspect the caddy/cable for bent pins or damaged ribbon. Replace the cable/caddy if available.
  • If data is critical and the drive is flaky, image it immediately with GNU ddrescue to an external disk rather than working on the original longer than necessary.

Useful commands to run from a Live environment:

lsblk -o NAME,SIZE,MODEL,MOUNTPOINT
sudo dmesg -wH | egrep --line-buffered 'ata|sata|sd[a-z]|error|fail'
sudo smartctl -a /dev/sda
sudo smartctl -t long /dev/sda
# ddrescue example (adjust paths):
sudo apt-get install gddrescue
sudo ddrescue -f -n /dev/sda /mnt/external/hdd-image.img /mnt/external/ddrescue.log

If the drive repeatedly fails or shows UDMA CRC / pending sector counts, replace the drive (or cable/caddy) rather than continuing to use the “hit it” workaround. For valuable data beyond confident DIY imaging, use a professional recovery service.

Punch that machine enough times and it'll go south on you permanently. It's probable that there's an intermittent power connection to the drives. A repair is a big maybe. Harder on the pocket but still easier is another board.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.