Tag Archives: GRUB

Grub Boot Error

Update 20150419: This OCZ SSD Drive is now entirely broken.

My desktop computer (it is still an ASUS Barebone V3-M3N8200) sometimes gives me the following error when I turn it on:

error: attempt to read or write outside of disk 'hd0'.
Entering rescue mode...
grub rescue> _

gruberror

My observations:

  • This has happened now and then for a while
  • It seems to happen more often when the computer have been off for a longer period of time (sounds unlikely, I know)
  • Ctrl-Alt-Del: It always boots properly the second time

I have three SATA drives. BIOS boots the first harddrive, where GRUB is installed on the mbr, and where / is the first and only partition, and /boot lives on the / partition.

The drive in question is (from dmesg):

[    1.339215] ata3.00: ATA-8: OCZ-VERTEX PLUS R2, 1.2, max UDMA/133
[    1.339217] ata3.00: 120817072 sectors, multi 1: LBA48 NCQ (depth 31/32)
[    1.339323] ata3.00: configured for UDMA/133
[    1.339466] scsi 2:0:0:0: Direct-Access     ATA      OCZ-VERTEX PLUS  1.2  PQ: 0 ANSI: 5
[    1.339623] sd 2:0:0:0: Attached scsi generic sg1 type 0
[    1.339715] sd 2:0:0:0: [sda] 120817072 512-byte logical blocks: (61.8 GB/57.6 GiB)

That is, a 60GB SSD drive from OCZ (yes, I had another OCZ SSD drive that died).

I can not explain my occational boot errors, but I have some theories:

  • The SSD drive is broken/corrupted (but no signs within Ubuntu of anything like it)
  • All drive is somehow not initialized when GRUB executes (?)
  • Somehow, more than one hard drive is involved in the boot process, and they are not all initialized at the same time (but this does not seem to be the case)

GSmartControl gives me some suspicious output about my drive… but I do not know how to interpret it:

Error in ATA Error Log structure: checksum error
Error in Self-Test Log structure: checksum error

The (Short) self test completes without errors.

Any ideas or suggestions are welcome! I will update this post if I learn anything new.

Problems upgrading to Ubuntu 12.10

Innocently I decided to just upgrade my desktop Ubuntu PC to 12.10 (from 12.04). I say innocently, because nowadays I just expect Ubuntu to work – better so than Windows which often causes weird problems.

I was a bit disappointed though. I upgraded using the GUI tools, just pretending I knew nothing and cared nothing about the process and just wanted it complete.

When the computer restarted I was met by

error: file not found.
grub resque>

Haha! Not. I mean, what would normal people do now? Consider files lost and go shop a new computer? This disappoints me, because my computer has updated kernel/reinstalled GRUB several times since I installed 12.04. And I dont edit grub config files just to mess with Ubuntu (I only do that when it refuses to boot).

I am not going to tell you about all my failed attempts to fix the problem, but I will tell you what worked. I have two hard drives in my computer, like this:

sda1: boot
sda2: home
sdb1: root
sdb2: (big backup data partition)

Naturally, BIOS boots sda (where boot is). Now, after Ubuntu upgraded, it obviously put GRUB on sdb, and telling BIOS to boot sdb instead of sda fixed the problem. My /boot on sda is still in use. What assumption is it, to assume that GRUB should be installed on the drive where / is, regardless where /boot is, and regardless where GRUB used to be installed? I am not going to investigate this further now, my computer boots and I have more problems to solve 😉

Next problem… Ubuntu starts and the display just turns black… CTRL-ALT-F1 works and gives me a console. Obviously something fishy with the X-server. Well, my computer has an onboard Nvidia 8200 and in the past I have been struggling a little with it. However, with 12.04 it worked out of the box. I tried

$ sudo apt-get install nvidia-experimental-310

No success. Turns out, however that:

$ sudo apt-get purge nvidia-current

(and/or whatever nvidia drivers you have installed) makes Ubuntu fall back to the Nouveau drivers, and those seem to work very fine. I dont expect (or need) much 3D acceleration, but 2D performance seems good so far.

Changing default OS in Ubuntu (GRUB)

I have a little Eee-PC that dual-boots Windows 7 and Ubuntu. GRUB takes care of dual booting nicely out of the box. Just one little thing. I want it to boot Windows 7 by default. Coming from a LILO background, I feel confused and not in control. Anyway, this is how to do it:

  $ grep menuentry /boot/grub/grub.cfg
  (some linux lines here...)
  menuentry "Windows 7 (loader) (on /dev/sda2)" {

That is the menuentry that we want to default to.

Now replace a 0 with the above menuentry in grub default file:

  /etc/default/grub:
  # GRUB_DEFAULT=0
  GRUB_DEFAULT="Windows 7 (loader) (on /dev/sda2)"

Finally, run update-grub (as suggested in the above file):

  $ sudo update-grub

If everything went fine your Windows system will now boot as default. Also, when Ubuntu upgrades its kernel (and reconfigures grub), Windows should still be default.