Failed to install GRUB on a separate '/boot' partition on a fake RAID 0 (12.04LTS)

Posted by gerben on Ask Ubuntu See other posts from Ask Ubuntu or by gerben
Published on 2014-05-30T20:07:39Z Indexed on 2014/05/30 22:04 UTC
Read the original article Hit count: 304

Filed under:
|
|

I'm having some problems getting GRUB configured for Ubuntu 12.04LTS on a fake RAID 0. I can either get the GRUB rescue prompt at startup, or just a GRUB prompt but I cannot boot to Ubuntu manually. How can I configure the GRUB to actually use the Ubuntu install?

The steps taken:

Installing Ubuntu on fake raid

The Ubuntu installer cannot install Ubuntu on the drive. After defining the partitions to use it fails with "Error: ???", pressing OK terminates the installer.

Therefore, I used GParted to configure the partitions:

  • /dev/mapper/sil_agadaccfacbg : (the RAID configuration, created partition):
  • /dev/mapper/sil_agadaccfacbg1:ext2, 200MiB, (with 'boot' flag)
  • /dev/mapper/sil_agadaccfacbg3:ext2, 67.75GiB, (which will contain Ubuntu)
  • /dev/mapper/sil_agadaccfacbg2:extended, 1.00GiB, (for swap) Contains:
    • /dev/mapper/sil_agadaccfacbg5: unknown

Because of the fake-RAID, I already mounted the destination partitions before running the Ubuntu installer:

> mkdir /mnt/boot  
> sudo mount /dev/mapper/sil_agadaccfacbg1 /mnt/boot  
> mkdir /mnt/ubuntu  
> sudo mount /dev/mapper/sil_agadaccfacbg3 /mnt/ubuntu  

In the installer I chose the following partition usage:

  • /dev/mapper/sil_agadaccfacbg1 ext2, mount at /boot (209MB)
  • /dev/mapper/sil_agadaccfacbg3 ext2, mount at / (72751MB)
  • /dev/mapper/sil_agadaccfacbg5 swap

Device for boot loader installation:

  • /dev/mapper/sil_agadaccfacbg, linux device-mapper (striped) (74.0GB)

This will install Ubuntu, but will fail to install GRUB (it seems to use /dev/sda no matter which one I choose)

Installing GRUB with dpkg-reconfigure

I followed this guide, but adapted it for two partitions:

sudo mount /dev/mapper/sil_agadaccfacbg3 /mnt/ubuntu
sudo mount --bind /dev /mnt/ubuntu/dev
sudo mount --bind /proc /mnt/ubuntu/proc
sudo mount --bind /sys /mnt/ubuntu/sys
sudo mount /dev/mapper/sil_agadaccfacbg1 /mnt/boot
sudo mount --bind /boot /mnt/boot
sudo chroot /mnt/ubuntu
dpkg-reconfigure grub-pc

However, it does not ask where to install GRUB (I should choose /dev/mapper/sil_agadaccfacbg somewhere..)

After reboot I get the GRUB rescue prompt with message no such device

Installing GRUB with grub-install

After the same mount commands as above, I continued with:

> sudo grub-install --root-directory=/mnt/boot /dev/mapper/sil_agadaccfacbg  

This gives the following message:

/usr/sbin/grub-probe: error: cannot find a device for /mnt/boot/boot/grub (is /dev mounted?)

It does succeed when mounting just the boot partition :

sudo mount /dev/mapper/sil_agadaccfacbg1 /mnt
sudo grub-install --root-directory=/mnt/ /dev/mapper/sil_agadaccfacbg

This finishes with:

Installation finished. No error reported.

After reboot I get the GRUB console, with welcome text.

Attempting to manually start Ubuntu:

ls

  • (hd0) (hd0,msdos3) : (Ubuntu install partition)
  • (hd0,msdos1) : (Ubuntu boot partition)
  • (hd1) (hd1,msdos1) : (Ubuntu live USB)

ls (hd0,msdos3)/

contains:

- vmlinuz      - lib/        - tmp/
- initrd.img   - mnt/
- var/         - proc/
- boot/        - root/
- etc/         - run/
- media/       - sbin/
- bin/         - selinux/
- dev/         - srv/
- home/        - sys/ 

ls (hd0,msdos1)/

contains:

-grub/
-boot/
-initrd.img-3.8.0-29-generic
-vmlinuz-3.8.0.29-generic
-config-3.8

linux (hd0,msdos3)/vmlinuz

This returns "error: out of disk"

Installing GRUB on Ubuntu partition with grub-install

> sudo mount /dev/mapper/sil_agadaccfacbg3 /mnt  
> sudo grub-install --root-directory=/mnt/ /dev/mapper/sil_agadaccfacbg  

This finishes with message:

> Installation finished. No error reported.

After reboot get the message "error: out of disk" and the GRUB rescue prompt.

Configuring GRUB with grub-mkconfig

Attempting to run grub-mkconfig with different destinations results in the same message:

/usr/sbin/grub-probe: error: cannot find a device for / (is /dev mounted?).

Remarks:

Initially I didn't use a separate /boot partition, but the GRUB install then also failed. Because some mention that a small partition at the beginning of the drive is necessary on old machines, I retried with a /boot partition

This is a single boot (no other OS's installed/used)

© Ask Ubuntu or respective owner

Related posts about grub2

Related posts about raid