Installation of GRUB boot loader to hard disk fails

53,732

Solution 1

I had a similar problem. Pressing Alt+F4 to switch to the installer output, I could see Attempting to install GRUB to a partitionless disk or to a partition. This is a BAD idea.

It would appear that my USB disk was detected as /dev/sda, and my target hard disk was detected as /dev/sdb, based on the output from cat /proc/partitions.

So I fixed it by activating a shell in the Alt+F2 session and ran the following:

chroot /target grub-install /dev/sdb

Then I switched back to the installer (Alt+F1) and hit "Continue without bootloader".

Once installation had finished (I unplugged the USB stick), I was presented with a grub> prompt, so I followed the instructions here, as follows (this assumes that your boot disk is /dev/sda:

grub> ls
(hd0) (hd0,msdos5) (hd0,msdos1)
grub> set root=(hd0,msdos1)
grub> ls /
lost+found/ etc/ ...
grub> ls /boot
config-3.11.0-26-generic ...
grub> linux /boot/vmlinuz-   # press Tab
                             # then add the following
          root=/dev/sda1
grub> initrd /boot/initrd    # press Tab
grub> boot    

Once the system is booted, log in and then:

sudo update-grub
sudo grub-install /dev/sda

Reboot to check it's working:

sudo shutdown -r now

Solution 2

Please provide more information about why the GRUB install failed.

It is hard to suggest possible solutions when no information is available about why GRUB failed to install. Would you please try the following:

  1. boot an Ubuntu Live CD or USB
  2. mount your LVM partition (/dev/sda2)
  3. run the command cat syslog | grep grub
    (where syslog is the log file in /var/syslog on /dev/sda2)
  4. add the output from the command to your question by editing it

Is the GRUB install problem related to UEFI?

My understanding is that the IBM 3650 M2 uses a UEFI BIOS. Is your problem installing GRUB possibly related to this? If so, perhaps one of the following links may be helpful.

Share:
53,732

Related videos on Youtube

William
Author by

William

Updated on September 18, 2022

Comments

  • William
    William over 1 year

    I am installing Ubuntu Server 12.04 LTS on an IBM 3650 M2 with a hardware raid5 with three partitions:

    sda1 /boot - 1 GB, ext3
    sda2 lvm - 1 TB, ext4
    sda3 swap - 24GB
    

    During the GRUB installation, I get a message that the installer failed to load GRUB on a hard disk and get sent back to the installer menu.

    • irrational John
      irrational John almost 12 years
      Were the three partitions you list created on your RAID 5 array? Is your RAID 5 implemented in hardware or software? (In other words, is GRUB aware of the separate disks of the RAID 5 or would this be transparent to GRUB?) Why do you have a separate /boot partition??
    • William
      William almost 12 years
      hardware raid. the separate /boot partition is because I don't want to put grub or the MBR on an LVM.