Bug#526615: fails to install to RAID across virtual (kvm/virtio) disks

martin f krafft madduck at debian.org
Sat May 2 09:07:07 UTC 2009


Package: grub-pc
Version: 1.96+20080724-16
Severity: normal

I have kvm configured to make disks available as virtio-blk devices,
and now I am trying to install grub2 onto them.

This works on plain VMs:

  vera:~# ls -l /dev/vda
  brw-rw---- 1 root disk 254, 0 May  2 11:01 /dev/vda
  vera:~# grub-install /dev/vda
  Installation finished. No error reported.
  This is the contents of the device map /boot/grub/device.map.
  Check if this is correct or not. If any of the lines is incorrect,
  fix it and re-run the script `grub-install'.

  (hd0) /dev/vda

However, trying to install to a system with RAID1 across two virtual
disks, I run into two errors, depending on which approach I take:

  mdadm-test:/boot/grub# ls -l /dev/{md0,vd[ab]}
  brw-rw---- 1 root disk   9,  0 May  2 10:07 /dev/md0
  brw-rw---- 1 root disk 254,  0 May  2 10:07 /dev/vda
  brw-rw---- 1 root disk 254, 16 May  2 10:07 /dev/vdb

  mdadm-test:/boot/grub# cat /proc/mdstat
  Personalities : [raid1]
  md0 : active raid1 vda[0] vdb[1]
        1572800 blocks [2/2] [UU]

  unused devices: <none>

  mdadm-test:/boot/grub# grub-install /dev/md0
  grub-setup: error: Unknown device number: 254, 0

  mdadm-test:/boot/grub# grub-install '(hd0)' 
  grub-setup: error: Core image is too big for embedding, but this is required when
  the root device is on a RAID array or LVM volume.

  mdadm-test:/boot/grub# cat device.map 
  (hd0)   /dev/vda
  (hd1)   /dev/vdb
  (hd2)   /dev/vdc
  (hd3)   /dev/vdd
  (hd4)   /dev/vde
  (hd5)   /dev/vdf
  (hd6)   /dev/vdg

It does not matter if I do it manually with grub-mkimage/grub-setup
or let grub-install do it, the result is the same. But since
grub-install does not offer verbose output, here's the manual
rundown with verbose output, in case it helps:

  mdadm-test:/boot/grub# grub-mkimage -v -o core.img biosdisk raid ext2
  grub-mkimage: info: getting the size of /usr/lib/grub/i386-pc/kernel.img
  grub-mkimage: info: getting the size of /usr/lib/grub/i386-pc/biosdisk.mod
  grub-mkimage: info: getting the size of /usr/lib/grub/i386-pc/raid.mod
  grub-mkimage: info: getting the size of /usr/lib/grub/i386-pc/fshelp.mod
  grub-mkimage: info: getting the size of /usr/lib/grub/i386-pc/ext2.mod
  grub-mkimage: info: the total module size is 0x4410
  grub-mkimage: info: reading /usr/lib/grub/i386-pc/kernel.img
  grub-mkimage: info: getting the size of /usr/lib/grub/i386-pc/kernel.img
  grub-mkimage: info: getting the size of /usr/lib/grub/i386-pc/biosdisk.mod
  grub-mkimage: info: reading /usr/lib/grub/i386-pc/biosdisk.mod
  grub-mkimage: info: getting the size of /usr/lib/grub/i386-pc/biosdisk.mod
  grub-mkimage: info: getting the size of /usr/lib/grub/i386-pc/raid.mod
  grub-mkimage: info: reading /usr/lib/grub/i386-pc/raid.mod
  grub-mkimage: info: getting the size of /usr/lib/grub/i386-pc/raid.mod
  grub-mkimage: info: getting the size of /usr/lib/grub/i386-pc/fshelp.mod
  grub-mkimage: info: reading /usr/lib/grub/i386-pc/fshelp.mod
  grub-mkimage: info: getting the size of /usr/lib/grub/i386-pc/fshelp.mod
  grub-mkimage: info: getting the size of /usr/lib/grub/i386-pc/ext2.mod
  grub-mkimage: info: reading /usr/lib/grub/i386-pc/ext2.mod
  grub-mkimage: info: getting the size of /usr/lib/grub/i386-pc/ext2.mod
  grub-mkimage: info: kernel_img=0x23c3a90, kernel_size=0xbd14
  grub-mkimage: info: the core size is 0x6016
  grub-mkimage: info: getting the size of /usr/lib/grub/i386-pc/diskboot.img
  grub-mkimage: info: reading /usr/lib/grub/i386-pc/diskboot.img
  grub-mkimage: info: getting the size of /usr/lib/grub/i386-pc/diskboot.img
  grub-mkimage: info: writing 0x200 bytes
  grub-mkimage: info: the first module address is 0xfb04
  grub-mkimage: info: writing 0x6016 bytes
  mdadm-test:/boot/grub# grub-setup -v /dev/md0
  grub-setup: info: the size of hd0 is 3145728
  grub-setup: info: opening the device `/dev/vda'
  grub-setup: info: the size of hd0 is 3145728
  grub-setup: info: the size of hd0 is 3145728
  grub-setup: info: opening the device `/dev/vda'
  grub-setup: info: the size of hd1 is 3145728
  grub-setup: info: opening the device `/dev/vdb'
  grub-setup: info: the size of hd1 is 3145728
  grub-setup: info: the size of hd1 is 3145728
  grub-setup: info: opening the device `/dev/vdb'
  grub-setup: info: the size of hd2 is 1048576
  grub-setup: info: opening the device `/dev/vdc'
  grub-setup: info: the size of hd2 is 1048576
  grub-setup: info: opening the device `/dev/vdc'
  grub-setup: info: the size of hd3 is 262144
  grub-setup: info: opening the device `/dev/vdd'
  grub-setup: info: the size of hd3 is 262144
  grub-setup: info: opening the device `/dev/vdd'
  grub-setup: info: the size of hd4 is 262144
  grub-setup: info: opening the device `/dev/vde'
  grub-setup: info: the size of hd4 is 262144
  grub-setup: info: opening the device `/dev/vde'
  grub-setup: info: the size of hd5 is 262144
  grub-setup: info: opening the device `/dev/vdf'
  grub-setup: info: the size of hd5 is 262144
  grub-setup: info: opening the device `/dev/vdf'
  grub-setup: info: the size of hd6 is 262144
  grub-setup: info: opening the device `/dev/vdg'
  grub-setup: info: the size of hd6 is 262144
  grub-setup: info: opening the device `/dev/vdg'
  grub-setup: info: the size of hd0 is 3145728
  grub-setup: info: the size of hd0 is 3145728
  grub-setup: info: the size of hd1 is 3145728
  grub-setup: info: the size of hd1 is 3145728
  grub-setup: info: the size of hd2 is 1048576
  grub-setup: info: the size of hd2 is 1048576
  grub-setup: info: the size of hd3 is 262144
  grub-setup: info: the size of hd3 is 262144
  grub-setup: info: the size of hd4 is 262144
  grub-setup: info: the size of hd4 is 262144
  grub-setup: info: the size of hd5 is 262144
  grub-setup: info: the size of hd5 is 262144
  grub-setup: info: the size of hd6 is 262144
  grub-setup: info: the size of hd6 is 262144
  grub-setup: info: changing current directory to /dev
  grub-setup: info: changing current directory to snd
  grub-setup: info: changing current directory to net
  grub-setup: info: changing current directory to shm
  grub-setup: info: changing current directory to pts
  grub-setup: error: Unknown device number: 254, 0
  mdadm-test:/boot/grub# grub-setup -v '(hd0)' 
  grub-setup: info: the size of hd0 is 3145728
  grub-setup: info: opening the device `/dev/vda'
  grub-setup: info: the size of hd0 is 3145728
  grub-setup: info: the size of hd0 is 3145728
  grub-setup: info: opening the device `/dev/vda'
  grub-setup: info: the size of hd1 is 3145728
  grub-setup: info: opening the device `/dev/vdb'
  grub-setup: info: the size of hd1 is 3145728
  grub-setup: info: the size of hd1 is 3145728
  grub-setup: info: opening the device `/dev/vdb'
  grub-setup: info: the size of hd2 is 1048576
  grub-setup: info: opening the device `/dev/vdc'
  grub-setup: info: the size of hd2 is 1048576
  grub-setup: info: opening the device `/dev/vdc'
  grub-setup: info: the size of hd3 is 262144
  grub-setup: info: opening the device `/dev/vdd'
  grub-setup: info: the size of hd3 is 262144
  grub-setup: info: opening the device `/dev/vdd'
  grub-setup: info: the size of hd4 is 262144
  grub-setup: info: opening the device `/dev/vde'
  grub-setup: info: the size of hd4 is 262144
  grub-setup: info: opening the device `/dev/vde'
  grub-setup: info: the size of hd5 is 262144
  grub-setup: info: opening the device `/dev/vdf'
  grub-setup: info: the size of hd5 is 262144
  grub-setup: info: opening the device `/dev/vdf'
  grub-setup: info: the size of hd6 is 262144
  grub-setup: info: opening the device `/dev/vdg'
  grub-setup: info: the size of hd6 is 262144
  grub-setup: info: opening the device `/dev/vdg'
  grub-setup: info: the size of hd0 is 3145728
  grub-setup: info: the size of hd0 is 3145728
  grub-setup: info: the size of hd1 is 3145728
  grub-setup: info: the size of hd1 is 3145728
  grub-setup: info: the size of hd2 is 1048576
  grub-setup: info: the size of hd2 is 1048576
  grub-setup: info: the size of hd3 is 262144
  grub-setup: info: the size of hd3 is 262144
  grub-setup: info: the size of hd4 is 262144
  grub-setup: info: the size of hd4 is 262144
  grub-setup: info: the size of hd5 is 262144
  grub-setup: info: the size of hd5 is 262144
  grub-setup: info: the size of hd6 is 262144
  grub-setup: info: the size of hd6 is 262144
  grub-setup: info: changing current directory to /dev
  grub-setup: info: changing current directory to snd
  grub-setup: info: changing current directory to net
  grub-setup: info: changing current directory to shm
  grub-setup: info: changing current directory to pts
  grub-setup: info: getting the size of /boot/grub/boot.img
  grub-setup: info: reading /boot/grub/boot.img
  grub-setup: info: getting the size of /boot/grub/boot.img
  grub-setup: info: getting the size of /boot/grub/core.img
  grub-setup: info: reading /boot/grub/core.img
  grub-setup: info: getting the size of /boot/grub/core.img
  grub-setup: info: the size of hd0 is 3145728
  grub-setup: info: setting the root device to `md0'
  grub-setup: info: dos partition is -1, bsd partition is -1
  grub-setup: error: Core image is too big for embedding, but this is required when
  the root device is on a RAID array or LVM volume.

I get the same result with grub2 1.96+20090402-1 from sid.

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.29-1-amd64 (SMP w/1 CPU core)
Locale: LANG=en_GB, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash


-- 
 .''`.   martin f. krafft <madduck at d.o>      Related projects:
: :'  :  proud Debian developer               http://debiansystem.info
`. `'`   http://people.debian.org/~madduck    http://vcs-pkg.org
  `-  Debian - when you have better things to do than fixing systems
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature (see http://martin-krafft.net/gpg/)
URL: <http://lists.alioth.debian.org/pipermail/pkg-grub-devel/attachments/20090502/e1f2efb3/attachment.pgp>


More information about the Pkg-grub-devel mailing list