12.2 GRUB2 install fails when / is on RAID /dev/md0: Fixed

Summary: 12.2 GRUB2 install fails when / is on RAID /dev/md0, needs
extra space in front of /dev/sda1 /dev/sdb1. Fix made difficult by bugs in
YaST2 and gparted.

I tried to install 12.2 in a RAID1 partition previously occupied by 12.1
and legacy Grub. The box has 4 raid arrays of which the first, /dev/md0
(/dev/sda1 + /dev/sdb1) will be used for / and /dev/md3 for /mnt/home.

Grub2 fails to install: "Error during creation of initrd" with message
Perl-Bootloader: 2012-09-17 18:16:44 ERROR: Command 
   '/usr/sbin/grub2-install --force --skip-fs-probe /dev/sda 
   > /var/log/YaST2/y2log-bootloader 2>&1'
   failed with code 256 and output: /usr/sbin/grub2-bios-setup : 
   attention : la zone d'embarquage est exceptionnellement petite, 
   core.img n'y tiendra pas..

I suppose the text in french means “Your embedding area is unusually
small. core.img won’t fit in it…”, but even this message, despite
its literary charm doesn’t say how much space core.img needs, how
little is available, and where the space is needed.

The fix is to resize the /dev/sda1 and /dev/sdb1 partitions which make
up /dev/md0, but alas and alack the net install CD does not include
gparted. Surely you didn’t think that SuSE would make this easy for

Download the gparted iso and burn a CD. Boot this CD, and
use fdisk to set the types of the partitions which make up /dev/md0
back to 83. Starting gparted will tell you that it can’t find
/dev/md/0 … /dev/md/3 but it finds /dev/sda and /dev/sdb.

For both /dev/sda and /dev/sdb, delete partition 1, and then recreate
it with 16 MiB of free space in front of the partition. For all of
these operations gparted reports errors: “unable to perform
operation”. Ignore these error messages.

Reboot the installation CD/DVD and for the disk partitions use
option “Create the partition configuration” → “custom partition for
experts” to re-specify /dev/md0 using /dev/sda1 and /dev/sdb1, mounted
as /.

YaST2 makes a mess of the device names /dev/md1, /dev/md2 and /dev/md3
calling them /dev/md125, /dev/md126 and /dev/md127. Accept these
names for the moment - the problem will be fixed after first boot of
the new OS. (This bug is an old friend, it was in 12.1 and since it
survived bug-fixing in 12.2 it will probably be in 12.3.)

If you don’t use vi, then when the selected configuration is
displayed, select “Software” and add emacs-nox (and emacs-x11 while
you’re at it).

During the installation the following error message appears:

Perl-Bootloader: 2012-09-18 10:01:25 ERROR: 
The command "dmsetup" is not available.  
   Is the package "device-mapper" installed?
Command '/usr/sbin/grub2-install --force --skip-fs-probe /dev/sda 
   > /var/log/YaST2/y2log-bootloader 2>&1'
   failed with code 32512 and output: sh: /usr/sbin/grub2-install
   No such file or directory.

Ignore this message.

When the box reboots, the newly installed OS will stop when it can’t
mount /mnt/home and present you with a rescue shell. Login as root
and use emacs to fix up /etc/fstab, replacing /dev/md127 by whatever
you use, for example /dev/md3. Use command “mount -a ; cat /etc/mtab”
to test that the mounts work.

Command “cat /proc/mdstat” displays a summary of the RAID array status.

Have a lot of fun! Roger

(This bug is an old friend, it was in 12.1 and since it
survived bug-fixing in 12.2 it will probably be in 12.3.)

Is there a bug report, e.g. made by you or at least suupported by you?
When there isn’t, pure magic will not help.