Bug#632048: grub-pc: segfault with /boot on a LVM volume, using PV on mdadm RAID-1

Damyan Ivanov dmn at debian.org
Wed Jun 29 10:38:03 UTC 2011


Package: grub-pc
Version: 1.99-6 1.99-8
Severity: important

I want to migrate a system to LVM over mdadm RAID-1. The RAID-1 uses metadata version
1.2 (I tried also with 0.9 before that, with gtub-pc 1.99-6, but then grub-probe wasn't able to detect the
filesystem used).
I have created /dev/md1 with /dev/sdc and /dev/sdd (whole disk). Then /dev/md1 is
made a LVM physical volume, and then some logical volumes are populated and the data
from the running system rsync-ed. Mount-points, fstab, etc adjusted, /proc and /sys
mounted, /dev bind-mounted.

Installing grub in the chroot fails with:

# grub-install --recheck /dev/md1
Segmentation fault

More diagnostics:

grub-probe seems to work OK (with mdadm metadata 1.2):

# grub-probe -t fs /boot/grub 2>&1 | tail
/usr/sbin/grub-probe: info: the size of hd2 is 321672960.
/usr/sbin/grub-probe: info: no LVM signature found.
/usr/sbin/grub-probe: info: the size of hd2 is 321672960.
/usr/sbin/grub-probe: info: scanning hd3 for LVM.
/usr/sbin/grub-probe: info: the size of hd3 is 321672960.
/usr/sbin/grub-probe: info: no LVM signature found.
/usr/sbin/grub-probe: info: the size of hd3 is 321672960.
/usr/sbin/grub-probe: info: changing current directory to /dev/mapper.
/usr/sbin/grub-probe: info: opening vg0-boot.
ext2

Everything is right, except the filesystem is really ext3:

# file -s /dev/mapper/vg0-boot
/dev/mapper/vg0-boot: symbolic link to `../dm-0'
# file -s /dev/dm-0
/dev/dm-0: Linux rev 1.0 ext3 filesystem data, UUID=ad4ab74f-ff58-49e5-8283-27d4f962374e (needs journal recovery)

(OK, since the filesystem is mounted)

The system is not going to production any time soon, so I am able to experiment
with patches or try whatever you need me to.


Thanks,
	dam

-- Package-specific info:

(the first two entries are from outside the chroot)
*********************** BEGIN /proc/mounts
/dev/disk/by-uuid/c6132650-c1d3-44ff-8969-f67bf3c7de53 / ext3 rw,relatime,errors=remount-ro,data=ordered 0 0
/dev/sda1 /boot ext3 rw,relatime,errors=continue,data=ordered 0 0
/dev/mapper/vg0-root / ext4 rw,relatime,barrier=1,data=ordered 0 0
/dev/mapper/vg0-var /var ext4 rw,relatime,barrier=1,data=ordered 0 0
/dev/mapper/vg0-boot /boot ext3 rw,relatime,errors=continue,data=ordered 0 0
*********************** END /proc/mounts

*********************** BEGIN /boot/grub/device.map
(hd0)	/dev/disk/by-id/ata-HDS722580VLSA80_VNRB3EC2DUVNXL
(hd1)	/dev/disk/by-id/ata-HDS722580VLSA80_VNRB3EC2DUX2DL
(hd2)	/dev/disk/by-id/ata-HDS722516VLSA80_VN6DTECDEPDNLA
(hd3)	/dev/disk/by-id/ata-HDS722516VLSA80_VN6DTECDF54WKH
*********************** END /boot/grub/device.map

*********************** BEGIN /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
  load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
}

set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=cyan/blue
set menu_color_highlight=white/blue
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-amd64' --class debian --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set 4e3df929-8720-4d97-8115-02ff3db4e66c
	echo	'Loading Linux 2.6.32-5-amd64 ...'
	linux	/vmlinuz-2.6.32-5-amd64 root=UUID=c6132650-c1d3-44ff-8969-f67bf3c7de53 ro  quiet
	echo	'Loading initial ramdisk ...'
	initrd	/initrd.img-2.6.32-5-amd64
}
menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set 4e3df929-8720-4d97-8115-02ff3db4e66c
	echo	'Loading Linux 2.6.32-5-amd64 ...'
	linux	/vmlinuz-2.6.32-5-amd64 root=UUID=c6132650-c1d3-44ff-8969-f67bf3c7de53 ro single 
	echo	'Loading initial ramdisk ...'
	initrd	/initrd.img-2.6.32-5-amd64
}
menuentry 'Debian GNU/Linux, with Linux 2.6.26-2-amd64' --class debian --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set 4e3df929-8720-4d97-8115-02ff3db4e66c
	echo	'Loading Linux 2.6.26-2-amd64 ...'
	linux	/vmlinuz-2.6.26-2-amd64 root=UUID=c6132650-c1d3-44ff-8969-f67bf3c7de53 ro  quiet
	echo	'Loading initial ramdisk ...'
	initrd	/initrd.img-2.6.26-2-amd64
}
menuentry 'Debian GNU/Linux, with Linux 2.6.26-2-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os {
	insmod part_msdos
	insmod ext2
	set root='(hd0,msdos1)'
	search --no-floppy --fs-uuid --set 4e3df929-8720-4d97-8115-02ff3db4e66c
	echo	'Loading Linux 2.6.26-2-amd64 ...'
	linux	/vmlinuz-2.6.26-2-amd64 root=UUID=c6132650-c1d3-44ff-8969-f67bf3c7de53 ro single 
	echo	'Loading initial ramdisk ...'
	initrd	/initrd.img-2.6.26-2-amd64
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
*********************** END /boot/grub/grub.cfg

*********************** BEGIN /proc/mdstat
Personalities : [raid1] 
md1 : active raid1 sdd[1] sdc[0]
      160835384 blocks super 1.2 [2/2] [UU]
      
md0 : active raid1 sda6[0] sdb6[1]
      76212224 blocks [2/2] [UU]
      
unused devices: <none>
*********************** END /proc/mdstat

*********************** BEGIN LVM
  --- Volume group ---
  VG Name               vg0
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  5
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                4
  Open LV               3
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               153.38 GiB
  PE Size               4.00 MiB
  Total PE              39266
  Alloc PE / Size       39266 / 153.38 GiB
  Free  PE / Size       0 / 0   
  VG UUID               7BIq4Y-eaIb-1RKW-3grl-HBSq-y8gJ-zhjTdM
   
  --- Physical volume ---
  PV Name               /dev/md1
  VG Name               vg0
  PV Size               153.38 GiB / not usable 1.80 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              39266
  Free PE               0
  Allocated PE          39266
  PV UUID               e5H6LH-JVcj-O3uR-Jco9-tEBo-kp8u-Yt1AjB
   
  --- Logical volume ---
  LV Name                /dev/vg0/boot
  VG Name                vg0
  LV UUID                gmLwNq-kV9D-SBGG-W0M0-3TfD-mQB2-ZyWU5L
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                500.00 MiB
  Current LE             125
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0
   
  --- Logical volume ---
  LV Name                /dev/vg0/root
  VG Name                vg0
  LV UUID                kw0uNK-oPuD-fRNI-N5MU-yeFE-0w3m-nDcULB
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                10.00 GiB
  Current LE             2560
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:1
   
  --- Logical volume ---
  LV Name                /dev/vg0/swap
  VG Name                vg0
  LV UUID                0vMFS3-9FAx-ji4j-mEyi-Nl0e-2nZn-TCtnmx
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                2.00 GiB
  Current LE             512
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:2
   
  --- Logical volume ---
  LV Name                /dev/vg0/var
  VG Name                vg0
  LV UUID                HMTihW-j4mM-hoxs-7zj3-a3Al-jMAJ-EjKjBV
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                140.89 GiB
  Current LE             36069
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:3
   
*********************** END LVM

*********************** BEGIN /dev/disk/by-id
total 0
lrwxrwxrwx 1 root root  9 Jun 29 11:11 ata-HDS722516VLSA80_VN6DTECDEPDNLA -> ../../sdc
lrwxrwxrwx 1 root root  9 Jun 29 11:11 ata-HDS722516VLSA80_VN6DTECDF54WKH -> ../../sdd
lrwxrwxrwx 1 root root  9 Jun  9 16:29 ata-HDS722580VLSA80_VNRB3EC2DUVNXL -> ../../sda
lrwxrwxrwx 1 root root 10 Jun 29 11:11 ata-HDS722580VLSA80_VNRB3EC2DUVNXL-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Jun  9 16:29 ata-HDS722580VLSA80_VNRB3EC2DUVNXL-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Jun 29 11:11 ata-HDS722580VLSA80_VNRB3EC2DUVNXL-part5 -> ../../sda5
lrwxrwxrwx 1 root root 10 Jun 29 11:11 ata-HDS722580VLSA80_VNRB3EC2DUVNXL-part6 -> ../../sda6
lrwxrwxrwx 1 root root  9 Jun  9 16:29 ata-HDS722580VLSA80_VNRB3EC2DUX2DL -> ../../sdb
lrwxrwxrwx 1 root root 10 Jun 29 11:11 ata-HDS722580VLSA80_VNRB3EC2DUX2DL-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Jun  9 16:29 ata-HDS722580VLSA80_VNRB3EC2DUX2DL-part2 -> ../../sdb2
lrwxrwxrwx 1 root root 10 Jun 29 11:11 ata-HDS722580VLSA80_VNRB3EC2DUX2DL-part5 -> ../../sdb5
lrwxrwxrwx 1 root root 10 Jun 29 11:11 ata-HDS722580VLSA80_VNRB3EC2DUX2DL-part6 -> ../../sdb6
lrwxrwxrwx 1 root root 10 Jun 29 11:10 dm-name-vg0-boot -> ../../dm-0
lrwxrwxrwx 1 root root 10 Jun 29 11:11 dm-name-vg0-root -> ../../dm-1
lrwxrwxrwx 1 root root 10 Jun 29 11:11 dm-name-vg0-swap -> ../../dm-2
lrwxrwxrwx 1 root root 10 Jun 29 11:11 dm-name-vg0-var -> ../../dm-3
lrwxrwxrwx 1 root root 10 Jun 29 11:11 dm-uuid-LVM-7BIq4YeaIb1RKW3grlHBSqy8gJzhjTdM0vMFS39FAxji4jmEyiNl0e2nZnTCtnmx -> ../../dm-2
lrwxrwxrwx 1 root root 10 Jun 29 11:11 dm-uuid-LVM-7BIq4YeaIb1RKW3grlHBSqy8gJzhjTdMHMTihWj4mMhoxs7zj3a3AljMAJEjKjBV -> ../../dm-3
lrwxrwxrwx 1 root root 10 Jun 29 11:10 dm-uuid-LVM-7BIq4YeaIb1RKW3grlHBSqy8gJzhjTdMgmLwNqkV9DSBGGW0M03TfDmQB2ZyWU5L -> ../../dm-0
lrwxrwxrwx 1 root root 10 Jun 29 11:11 dm-uuid-LVM-7BIq4YeaIb1RKW3grlHBSqy8gJzhjTdMkw0uNKoPuDfRNIN5MUyeFE0w3mnDcULB -> ../../dm-1
lrwxrwxrwx 1 root root  9 Jun 29 11:09 md-name-tata:md1 -> ../../md1
lrwxrwxrwx 1 root root  9 Jun 29 11:09 md-uuid-94991a6f:2424e7d7:69d1480c:985130df -> ../../md1
lrwxrwxrwx 1 root root  9 Jun  9 16:29 md-uuid-a44e5c95:1405f870:e6772566:5d2e268d -> ../../md0
lrwxrwxrwx 1 root root  9 Jun 29 11:11 scsi-SATA_HDS722516VLSA80_VN6DTECDEPDNLA -> ../../sdc
lrwxrwxrwx 1 root root  9 Jun 29 11:11 scsi-SATA_HDS722516VLSA80_VN6DTECDF54WKH -> ../../sdd
lrwxrwxrwx 1 root root  9 Jun  9 16:29 scsi-SATA_HDS722580VLSA80_VNRB3EC2DUVNXL -> ../../sda
lrwxrwxrwx 1 root root 10 Jun 29 11:11 scsi-SATA_HDS722580VLSA80_VNRB3EC2DUVNXL-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 Jun  9 16:29 scsi-SATA_HDS722580VLSA80_VNRB3EC2DUVNXL-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 Jun 29 11:11 scsi-SATA_HDS722580VLSA80_VNRB3EC2DUVNXL-part5 -> ../../sda5
lrwxrwxrwx 1 root root 10 Jun 29 11:11 scsi-SATA_HDS722580VLSA80_VNRB3EC2DUVNXL-part6 -> ../../sda6
lrwxrwxrwx 1 root root  9 Jun  9 16:29 scsi-SATA_HDS722580VLSA80_VNRB3EC2DUX2DL -> ../../sdb
lrwxrwxrwx 1 root root 10 Jun 29 11:11 scsi-SATA_HDS722580VLSA80_VNRB3EC2DUX2DL-part1 -> ../../sdb1
lrwxrwxrwx 1 root root 10 Jun  9 16:29 scsi-SATA_HDS722580VLSA80_VNRB3EC2DUX2DL-part2 -> ../../sdb2
lrwxrwxrwx 1 root root 10 Jun 29 11:11 scsi-SATA_HDS722580VLSA80_VNRB3EC2DUX2DL-part5 -> ../../sdb5
lrwxrwxrwx 1 root root 10 Jun 29 11:11 scsi-SATA_HDS722580VLSA80_VNRB3EC2DUX2DL-part6 -> ../../sdb6
*********************** END /dev/disk/by-id

*********************** BEGIN /dev/disk/by-uuid
total 0
lrwxrwxrwx 1 root root 10 Jun 29 11:11 4e3df929-8720-4d97-8115-02ff3db4e66c -> ../../sda1
lrwxrwxrwx 1 root root 10 Jun 29 11:11 9b8ffd9e-268b-4f08-b2bd-94e840a249dc -> ../../sdb1
lrwxrwxrwx 1 root root 10 Jun 29 11:11 9e20e4a1-95ae-4562-b6d4-73e668986d3c -> ../../sdb5
lrwxrwxrwx 1 root root  9 Jun  9 16:29 c6132650-c1d3-44ff-8969-f67bf3c7de53 -> ../../md0
lrwxrwxrwx 1 root root 10 Jun 29 11:11 d708db77-78f9-4384-97be-4f74b8278d32 -> ../../sda5
*********************** END /dev/disk/by-uuid

-- System Information:
Debian Release: 6.0.1
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/4 CPU cores)
Locale: LANG=bg_BG.UTF-8, LC_CTYPE=bg_BG.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages grub-pc depends on:
ii  debconf [debconf-2.0]        1.5.36.1    Debian configuration management sy
ii  grub-common                  1.99-8      GRand Unified Bootloader (common f
ii  grub-pc-bin                  1.99-8      GRand Unified Bootloader, version 
ii  grub2-common                 1.99-8      GRand Unified Bootloader (common f
ii  ucf                          3.0025+nmu1 Update Configuration File: preserv

grub-pc recommends no packages.

grub-pc suggests no packages.

-- debconf information:
  grub2/kfreebsd_cmdline:
  grub2/device_map_regenerated:
* grub2/linux_cmdline:
  grub-pc/install_devices_empty: false
  grub-pc/install_devices_failed: false
* grub-pc/chainload_from_menu.lst: false
  grub-pc/kopt_extracted: true
* grub-pc/install_devices: /dev/disk/by-id/ata-HDS722580VLSA80_VNRB3EC2DUVNXL, /dev/disk/by-id/ata-HDS722580VLSA80_VNRB3EC2DUX2DL
  grub-pc/postrm_purge_boot_grub: false
  grub-pc/install_devices_failed_upgrade: true
  grub-pc/disk_description:
  grub2/kfreebsd_cmdline_default: quiet
  grub-pc/partition_description:
  grub-pc/install_devices_disks_changed:
* grub2/linux_cmdline_default: quiet
* grub-pc/mixed_legacy_and_grub2: true





More information about the Pkg-grub-devel mailing list