Bug#570524: grub-pc installs on first disk instead of boot disk without questions - bricking the computer

Gabor Nagy linux42 at freemail.hu
Fri Feb 19 15:16:24 UTC 2010


Package: grub-pc
Version: 1.98~20100115-1
Severity: normal

I use my linux installation as an external (USB) harddisk. I boot on other computers.
In the past my external harddisk was recognized as sda, the internal disks as sdb.

On this machine that I use now, my disk appears as sdb, internal hdd as sda.

One day I have upgraded some packages, including linux-image.

The next day the owner of the computer told me that she cannot boot anymore,
she only has GRUB, without any menu.

What has happened apparently is that grub has installed itself on the mbr of
sda, and then failed to start the only operating system on the single partition
of that disk.

I don't know what grub does with the install_disk if it only has one partition
with ntfs filesystem and windows installed, but even after replacing the mbr,
this windows still cannot boot. I am not sure this is grub's fault, but I am
suspicious.

I think here is a fundamental problem: I see now, from the configuration that
grub only knows about sda, and thinks that sda is the install_device.  However,
the harddisk sometimes appears as sda, sometimes as sdb, maybe sometimes with
other names. grub should not use sda as the identifier, it should use some
unique identifier instead, like uuid if that exists for a whole disk.

The second problem: if grub knows about sda only, but apparently the
configuration has changed, because now we have sda and sdb, it should at least
give a warning, and ask me if it is OK to install on sda. Also, I think it
would be a better default option to install the boot configuration on the
harddisk that we have used to boot the system (which in my case was sdb).

Third problem: if grub is installed on the harddisk, and there is no grub
configuration to read, I think it should at least try to start the boot block
on the active partition - this way even if it was installed on the wrong disk,
that computer would be able to boot.

Four: it would be nice to be able to undo the last grub installation somehow.
Like I find out that this girl's computer cannot boot anymore, I boot from my
external disk, do grub-undo, and give her computer as it was before grub ran.

-- Package-specific info:

*********************** WARNING grub-setup left core.img in filesystem

*********************** BEGIN /proc/mounts
/dev/disk/by-uuid/b1da3a47-d650-4571-a86a-ea70b2dd2c1c / ext3 rw,relatime,errors=remount-ro,data=ordered 0 0
/dev/mapper/vgSP1-usr /usr ext3 ro,relatime,errors=continue,data=ordered 0 0
/dev/mapper/vgSP1-var /var ext3 rw,relatime,errors=continue,data=ordered 0 0
/dev/mapper/vgSP1-home /home ext3 rw,relatime,errors=continue,data=ordered 0 0
*********************** END /proc/mounts

*********************** BEGIN /boot/grub/device.map
(hd0)	/dev/sda
*********************** END /boot/grub/device.map

*********************** BEGIN /boot/grub/grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by /usr/sbin/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
}
insmod ext2
set root=(/dev/sdb,1)
search --no-floppy --fs-uuid --set b1da3a47-d650-4571-a86a-ea70b2dd2c1c
if loadfont /boot/grub/unicode.pf2 ; then
  set gfxmode=640x480
  insmod gfxterm
  insmod vbe
  if terminal_output gfxterm ; then true ; else
    # For backward compatibility with versions of terminal.mod that don't
    # understand terminal_output
    terminal gfxterm
  fi
fi
set locale_dir=/boot/grub/locale
set lang=en
insmod gettext
set timeout=5
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
insmod ext2
set root=(/dev/sdb,1)
search --no-floppy --fs-uuid --set b1da3a47-d650-4571-a86a-ea70b2dd2c1c
insmod png
if background_image /boot/grub/moreblue-orbit-grub.png ; then
  set color_normal=black/black
  set color_highlight=magenta/black
else
  set menu_color_normal=cyan/blue
  set menu_color_highlight=white/blue
fi
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "Debian GNU/Linux, with Linux 2.6.32-trunk-686" {
	insmod ext2
	set root=(/dev/sdb,1)
	search --no-floppy --fs-uuid --set b1da3a47-d650-4571-a86a-ea70b2dd2c1c
	echo	Loading Linux 2.6.32-trunk-686 ...
	linux	/boot/vmlinuz-2.6.32-trunk-686 root=UUID=b1da3a47-d650-4571-a86a-ea70b2dd2c1c ro  quiet
	echo	Loading initial ramdisk ...
	initrd	/boot/initrd.img-2.6.32-trunk-686
}
menuentry "Debian GNU/Linux, with Linux 2.6.32-trunk-686 (recovery mode)" {
	insmod ext2
	set root=(/dev/sdb,1)
	search --no-floppy --fs-uuid --set b1da3a47-d650-4571-a86a-ea70b2dd2c1c
	echo	Loading Linux 2.6.32-trunk-686 ...
	linux	/boot/vmlinuz-2.6.32-trunk-686 root=UUID=b1da3a47-d650-4571-a86a-ea70b2dd2c1c ro single 
	echo	Loading initial ramdisk ...
	initrd	/boot/initrd.img-2.6.32-trunk-686
}
menuentry "Debian GNU/Linux, with Linux 2.6.30-2-686" {
	insmod ext2
	set root=(/dev/sdb,1)
	search --no-floppy --fs-uuid --set b1da3a47-d650-4571-a86a-ea70b2dd2c1c
	echo	Loading Linux 2.6.30-2-686 ...
	linux	/boot/vmlinuz-2.6.30-2-686 root=UUID=b1da3a47-d650-4571-a86a-ea70b2dd2c1c ro  quiet
	echo	Loading initial ramdisk ...
	initrd	/boot/initrd.img-2.6.30-2-686
}
menuentry "Debian GNU/Linux, with Linux 2.6.30-2-686 (recovery mode)" {
	insmod ext2
	set root=(/dev/sdb,1)
	search --no-floppy --fs-uuid --set b1da3a47-d650-4571-a86a-ea70b2dd2c1c
	echo	Loading Linux 2.6.30-2-686 ...
	linux	/boot/vmlinuz-2.6.30-2-686 root=UUID=b1da3a47-d650-4571-a86a-ea70b2dd2c1c ro single 
	echo	Loading initial ramdisk ...
	initrd	/boot/initrd.img-2.6.30-2-686
}
### END /etc/grub.d/10_linux ###

### 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 ###
*********************** END /boot/grub/grub.cfg

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-trunk-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.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.28          Debian configuration management sy
ii  grub-common              1.98~20100115-1 GRand Unified Bootloader, version 
ii  libc6                    2.10.2-2        GNU C Library: Shared libraries
ii  ucf                      3.0025          Update Configuration File: preserv

grub-pc recommends no packages.

Versions of packages grub-pc suggests:
ii  desktop-base                  5.0.5      common files for the Debian Deskto

-- debconf information:
  grub2/kfreebsd_cmdline:
* grub2/linux_cmdline:
* grub-pc/chainload_from_menu.lst: true
  grub-pc/kopt_extracted: true
* grub-pc/install_devices: /dev/sda
  grub-pc/postrm_purge_boot_grub: false
  grub2/kfreebsd_cmdline_default: quiet
* grub2/linux_cmdline_default: quiet





More information about the Pkg-grub-devel mailing list