7

I am running 12.04 64-bit and am dual booting with Win7, for full disclosure, although I suspect that has nothing to do with my problem.

The boot-loader(GRUB) fails to load often and I will be presented with a black screen with a single blinking line. This has happened to me eight out of ten power cycles now and I can fix it consistently, however, I have no idea why it happens.

My current fix is to boot a live CD (I've tried both KNOPPIX and Ubuntu with the same result) and that's it. Somehow booting with the live CD is enough to "wake-up" my hard drive. I then reboot and GRUB magically appears again.

So what is going on? Is it possible that a program is corrupting my MBR and the live CD is restoring it? How can I narrow down the possibilities? Thanks.

Additional

This is still a problem. I'm convinced now that it is not hardware related as I've spent the last month and several boot cycles on Windows without a hiccup. Recently when I started using Ubuntu again the problem started again.

I am more interested in figuring out what is going on rather than actually fixing the problem. Are there any tools, logs, etc. I can use to unravel this mystery?

Update

I can now consistently recreate the issue. It seems that if the computer is put into suspend mode at any point prior to restarting, the problem comes up. The computer goes into and out of suspend mode just fine but when I restart the system it fails to boot. I've tried this command before and after suspending the computer:

sudo hdparm -I /dev/sda > hdsettings.txt

Then I ran a diff on the two files and found that one thing changed: under security settings frozen changed to not frozen. I have no idea what that means but it's a difference anyhow.

Usagi
  • 141
  • 6
  • 2
    No live CD doesn't do that. Probably your hard disk has some error. Maybe it started to spin after a small heatup/ some loose end in hard disk connector. – Web-E Aug 16 '12 at 09:15
  • Have you checked you BIOS to see if there is anything about Hard Drive delayed Boot? – Mitch Aug 17 '12 at 01:25
  • @Web-E - The problem does not occur after several suspend and hibernate cycles. It only presents itself after rebooting the system. – Usagi Sep 05 '12 at 06:51
  • @Mitch - What is delayed boot? – Usagi Sep 05 '12 at 06:51
  • I'm still having this problem and I am still able to repair it by simply booting a live CD. I don't think it's hardware just because of how reproducible the fix is. Is there a log file I can print out from the live boot CD? – Usagi Sep 05 '12 at 06:53
  • Its a option in the BIOS that delays the HD a number of seconds. What brand and model is your system? – Mitch Sep 05 '12 at 07:14
  • @Mitch - It's a Toshiba Satellite with an AMD chip. – Usagi Sep 05 '12 at 07:20
  • What model Satellite is it? – Mitch Sep 05 '12 at 07:38
  • @Mitch - A665D-S5178 – Usagi Sep 05 '12 at 07:41
  • It doesn't look like it an option in the BIOS, but I've noticed that there is a new BIOS available. Try updating, and see if it helps. – Mitch Sep 05 '12 at 07:57
  • See my answer - you can get more boot details by following the steps – whiskers75 Dec 19 '12 at 17:43
  • After you successfully boot from the hard drive, can you reboot repeatedly after that without using a cd? In other words, is it just after a cold boot you have the problem, and warm booting is ok? – psusi Dec 19 '12 at 18:20
  • @psusi - Cold as in motherboard temperature? After I fix the problem I can reboot many times and not encounter the problem. I have also shut-down the computer for several hours and booted up without any problems. The only factor that seems to create the issue is the length of time I have been using Linux. This leads me to believe that there is some program on Linux that is causing the issue but it must not be a boot-up process or else the problem would happen each time. – Usagi Dec 21 '12 at 00:56

3 Answers3

2

EDIT: It seems like there is no error with Grub so this answer is not applicable. Sorry. @Web-E seems to be on the right track.

Boot from the live CD. Open the terminal

sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update

Press Enter - Then type:

sudo apt-get install -y boot-repair && boot-repair

Then open boot repair. Perform recommended repairs. If that does not fix it then paste the link here for the boot summary.

Varun Venkatesh
  • 7,419
  • 4
  • 19
  • 23
2

I had a similar problem not long ago. I was using a hard drive I took from a DVR I wasn't using. These drives use a custom firmware with a feature called Power-up in Standby mode which prevents the drive from drawing too much current at boot time; the custom firmware then sends a special command to the drive to get it spinning. This can be prevented by restarting the computer or you can disable the feature from the drive completely using hdparm. The drive will then be in active mode.

Note: Read the man page for hdparm (-s option).

  1. Boot from any linux live cd (Linux >= 2.6.22)
  2. Enter this in a terminal as root:

    hdparm -s0 /dev/sdX (your drive letter)

  3. Shutdown the computer completely and re-open it again

Hope this helps!

francismb
  • 66
  • 1
  • Is there a way to tell if this option is turned on? – Usagi Dec 24 '12 at 08:31
  • I tried your terminal command and got this "/dev/sda: spin-up: setting power-up in standby to 0 (off) HDIO_DRIVE_CMD(powerup_in_standby) failed: Input/output error" – Usagi Dec 24 '12 at 10:49
  • I don't know if my hard-drive has this feature but I've been reading the manual now for hdparm and It's pretty useful :D Also, in trying all of this out I found out that the problem is suspend related. I haven't fixed the problem but I'm one step closer! – Usagi Dec 24 '12 at 10:54
  • According to other people who got this error, it was solved by changing the jumper configuration of the drive. Does your drive have any jumpers? If so, what is the setting? – francismb Dec 24 '12 at 15:47
  • It does. I just tried all of the positions to no avail. I'm thinking that my drive doesn't have this option. Are there other power management features I can change either on the drive or through Linux? – Usagi Dec 25 '12 at 03:45
  • What about no jumpers? What's the model of your drive? – francismb Dec 25 '12 at 16:32
  • Well, no jumpers was how my drive came by default. The model is a Toshiba MK5065GSXN HDD2J12 B UL01 T – Usagi Dec 25 '12 at 22:09
0

Two things can be causing this problem: GRUB malfunction or MBR corrupted.

Correcting GRUB malfunction

Type the following in the terminal:

sudo apt-get --reinstall install grub-gfxpayload-lists grub-pc grub2-common
sudo apt-get intall grub2

Fixing MBR

Install Grub Customizer:

sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt-get update
sudo apt-get install grub-customizer

Start Grub Customizer and go to File > Install to MBR... and select OK.


All this should solve your problem, although if it does not, maybe the partition where Ubuntu is installed has badblocks and this is affecting GRUB loading.

Rodrigo Oliveira
  • 6,152
  • 9
  • 40
  • 72