Bug#681993: dpkg-reconfigure grub-pc does not detect replaced drives or build new device map after hotswap
Kris Coward
debianbugs at melon.org
Wed Jul 18 14:58:51 UTC 2012
Package: grub-pc
Version: 1.98+20100804-14+squeeze1
Severity: normal
Between reboots, I managed to replace all the (hotswap) drives in my RAID array
(/dev/md0, consisting of /dev/sd[abc]2), and preserve the data in /boot and
/spare-boot (/dev/sda1 and /dev/sdc1 respectively) by copying the data between
partitions when one of the relevant drives was affected.
After replacing each drive, dpkg-reconfigure grub-pc was run, in order to ensure
that both /dev/sda and /dev/sdc had bootloader data in their MBR and were bootable,
and exited reporting success.
When physically moving the machine on which this bug was discovered, the machine
failed to boot properly, and the problem was eventually discovered to be an
out-of-date /boot/grub/device.map. After manually running grub-mkdevicemap in a
suitably chrooted shell and re-running dpkg-reconfigure grub-pc, the machine was
once again able to boot.
The setup/reconfiguration scripts for the grub-pc package should re-run
grub-mkdevicemap (possibly after prompting the user) whenever new disks are
detected (or at least warn when the disk containing /boot is not listed in
the device map).
-- Package-specific info:
*********************** WARNING grub-setup left core.img in filesystem
*********************** BEGIN /proc/mounts
/dev/disk/by-uuid/b00128d1-c2a0-4180-8143-ea9cf73459d2 / ext4 rw,relatime,errors=remount-ro,barrier=1,stripe=256,data=ordered 0 0
/dev/sda1 /boot ext2 rw,relatime,errors=continue 0 0
/dev/sdc1 /spare-boot ext2 rw,relatime,errors=continue 0 0
*********************** END /proc/mounts
*********************** BEGIN /boot/grub/device.map
(hd0) /dev/disk/by-id/ata-WDC_WD20EARS-00S8B1_WD-WCAVY2367811
(hd1) /dev/disk/by-id/ata-SAMSUNG_HD204UI_S2HFJ1BZ903345
(hd2) /dev/disk/by-id/ata-WDC_WD20EARX-00PASB0_WD-WMAZA7684097
*********************** 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 {
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
}
insmod raid
insmod raid5rec
insmod mdraid
insmod part_gpt
insmod part_gpt
insmod part_gpt
insmod ext2
set root='(md/0)'
search --no-floppy --fs-uuid --set b00128d1-c2a0-4180-8143-ea9cf73459d2
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
load_video
insmod gfxterm
fi
terminal_output gfxterm
insmod part_gpt
insmod ext2
set root='(hd0,gpt1)'
search --no-floppy --fs-uuid --set 6bd6f542-7501-47aa-bf9f-29b5602c443a
set locale_dir=($root)/grub/locale
set lang=en
insmod gettext
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-xen-amd64' --class debian --class gnu-linux --class gnu --class os {
insmod part_gpt
insmod ext2
set root='(hd0,gpt1)'
search --no-floppy --fs-uuid --set 6bd6f542-7501-47aa-bf9f-29b5602c443a
echo 'Loading Linux 2.6.32-5-xen-amd64 ...'
linux /vmlinuz-2.6.32-5-xen-amd64 root=UUID=b00128d1-c2a0-4180-8143-ea9cf73459d2 ro
echo 'Loading initial ramdisk ...'
initrd /initrd.img-2.6.32-5-xen-amd64
}
menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-xen-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os {
insmod part_gpt
insmod ext2
set root='(hd0,gpt1)'
search --no-floppy --fs-uuid --set 6bd6f542-7501-47aa-bf9f-29b5602c443a
echo 'Loading Linux 2.6.32-5-xen-amd64 ...'
linux /vmlinuz-2.6.32-5-xen-amd64 root=UUID=b00128d1-c2a0-4180-8143-ea9cf73459d2 ro single
echo 'Loading initial ramdisk ...'
initrd /initrd.img-2.6.32-5-xen-amd64
}
menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-amd64' --class debian --class gnu-linux --class gnu --class os {
insmod part_gpt
insmod ext2
set root='(hd0,gpt1)'
search --no-floppy --fs-uuid --set 6bd6f542-7501-47aa-bf9f-29b5602c443a
echo 'Loading Linux 2.6.32-5-amd64 ...'
linux /vmlinuz-2.6.32-5-amd64 root=UUID=b00128d1-c2a0-4180-8143-ea9cf73459d2 ro
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_gpt
insmod ext2
set root='(hd0,gpt1)'
search --no-floppy --fs-uuid --set 6bd6f542-7501-47aa-bf9f-29b5602c443a
echo 'Loading Linux 2.6.32-5-amd64 ...'
linux /vmlinuz-2.6.32-5-amd64 root=UUID=b00128d1-c2a0-4180-8143-ea9cf73459d2 ro single
echo 'Loading initial ramdisk ...'
initrd /initrd.img-2.6.32-5-amd64
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-xen-amd64 and XEN 4.0-amd64' --class debian --class gnu-linux --class gnu --class os --class xen {
insmod part_gpt
insmod ext2
set root='(hd0,gpt1)'
search --no-floppy --fs-uuid --set 6bd6f542-7501-47aa-bf9f-29b5602c443a
echo 'Loading Linux 2.6.32-5-xen-amd64 ...'
multiboot /xen-4.0-amd64.gz placeholder
module /vmlinuz-2.6.32-5-xen-amd64 placeholder root=UUID=b00128d1-c2a0-4180-8143-ea9cf73459d2 ro
echo 'Loading initial ramdisk ...'
module /initrd.img-2.6.32-5-xen-amd64
}
menuentry 'Debian GNU/Linux, with Linux 2.6.32-5-xen-amd64 and XEN 4.0-amd64 (recovery mode)' --class debian --class gnu-linux --class gnu --class os --class xen {
insmod part_gpt
insmod ext2
set root='(hd0,gpt1)'
search --no-floppy --fs-uuid --set 6bd6f542-7501-47aa-bf9f-29b5602c443a
echo 'Loading Linux 2.6.32-5-xen-amd64 ...'
multiboot /xen-4.0-amd64.gz placeholder
module /vmlinuz-2.6.32-5-xen-amd64 placeholder root=UUID=b00128d1-c2a0-4180-8143-ea9cf73459d2 ro single
echo 'Loading initial ramdisk ...'
module /initrd.img-2.6.32-5-xen-amd64
}
### 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
-- System Information:
Debian Release: 6.0.5
APT prefers stable
APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.32-5-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages grub-pc depends on:
ii debconf [debco 1.5.36.1 Debian configuration management sy
ii grub-common 1.98+20100804-14+squeeze1 GRand Unified Bootloader, version
ii libc6 2.11.3-3 Embedded GNU C Library: Shared lib
ii libdevmapper1. 2:1.02.48-5 The Linux Kernel Device Mapper use
ii ucf 3.0025+nmu1 Update Configuration File: preserv
grub-pc recommends no packages.
Versions of packages grub-pc suggests:
pn desktop-base <none> (no description available)
-- debconf information:
grub-pc/kopt_extracted: false
grub2/kfreebsd_cmdline:
grub2/device_map_regenerated:
* grub-pc/install_devices: /dev/disk/by-id/ata-WDC_WD20EARS-00S8B1_WD-WCAVY2367811, /dev/disk/by-id/ata-WDC_WD20EARX-00PASB0_WD-WMAZA7684097
grub-pc/postrm_purge_boot_grub: false
grub-pc/install_devices_failed_upgrade: true
grub-pc/disk_description:
* grub2/linux_cmdline:
grub-pc/install_devices_empty: false
grub2/kfreebsd_cmdline_default: quiet
grub-pc/partition_description:
* grub-pc/install_devices_failed: true
* grub-pc/install_devices_disks_changed: /dev/disk/by-id/ata-WDC_WD20EARS-00S8B1_WD-WCAVY2367811, /dev/disk/by-id/ata-WDC_WD20EARX-00PASB0_WD-WMAZA7684097
* grub2/linux_cmdline_default:
grub-pc/chainload_from_menu.lst: true
grub-pc/mixed_legacy_and_grub2: true
More information about the Pkg-grub-devel
mailing list