Bug#460177: update-grub updates menu.lst with incorrect boot device

Thomas Bushnell BSG tb at becket.net
Fri Jan 11 04:12:17 UTC 2008


Package: grub
Version: 0.97-27
Severity: serious

update-grub mutates the boot device incorrectly in producing menu.lst.
This bug, btw, caused a remote server to fail to reboot automatically
and cost me actual expense in remote debugging assistance.

Attached is menu.lst-before (which I hand-edited to be correct) and
menu.lst-after showing the effect of running update-grub.  See the
following diff below.  update-grub is giving a root argument for hde6
when sda6 is correct.  

mount and df report the correct information:

# mount
/dev/sda6 on / type ext3 (rw,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
/dev/sda7 on /var/cache/openafs type ext3 (rw)
/dev/sda8 on /vicepa type ext3 (rw)
/dev/sdb2 on /vicepb type ext3 (rw)
/dev/sdb3 on /vicepc type ext3 (rw)
AFS on /afs type afs (rw)

# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda6            123039704  10407332 106382292   9% /
tmpfs                   517768         0    517768   0% /lib/init/rw
udev                     10240        76     10164   1% /dev
tmpfs                   517768         0    517768   0% /dev/shm
/dev/sda7             48062440   4276200  41344764
10% /var/cache/openafs
/dev/sda8            307695928 134587736 157478156  47% /vicepa
/dev/sdb2            239399140  12608524 214629816   6% /vicepb
/dev/sdb3            239399168  14599972 212638396   7% /vicepc
AFS                    9000000         0   9000000   0% /afs



118c118
< kernel		/boot/vmlinuz-2.6.18-5-k7 root=/dev/sda6 ro 
---
> kernel		/boot/vmlinuz-2.6.18-5-k7 root=/dev/hde6 ro 
124c124
< kernel		/boot/vmlinuz-2.6.18-5-k7 root=/dev/sda6 ro single
---
> kernel		/boot/vmlinuz-2.6.18-5-k7 root=/dev/hde6 ro single
130c130
< kernel		/boot/vmlinuz-2.6.18-4-k7 root=/dev/sda6 ro 
---
> kernel		/boot/vmlinuz-2.6.18-4-k7 root=/dev/hde6 ro 
136c136
< kernel		/boot/vmlinuz-2.6.18-4-k7 root=/dev/sda6 ro single
---
> kernel		/boot/vmlinuz-2.6.18-4-k7 root=/dev/hde6 ro single



-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-5-k7
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages grub depends on:
ii  libc6                  2.3.6.ds1-13etch4 GNU C Library: Shared libraries
ii  libncurses5            5.5-5             Shared libraries for terminal hand

grub recommends no packages.


-------------- next part --------------
# menu.lst - See: grub(8), info grub, update-grub(8)
#            grub-install(8), grub-floppy(8),
#            grub-md5-crypt, /usr/share/doc/grub
#            and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.           
default		0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout		5

# Pretty colours
color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line)  and entries protected by the
# command 'lock'
# e.g. password topsecret
#      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title		Windows 95/98/NT/2000
# root		(hd0,0)
# makeactive
# chainloader	+1
#
# title		Linux
# root		(hd0,1)
# kernel	/vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=/dev/hde6 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,5)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=

## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(single-user) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## ## End Default Options ##

title		Debian GNU/Linux, kernel 2.6.18-5-k7
root		(hd0,5)
kernel		/boot/vmlinuz-2.6.18-5-k7 root=/dev/hde6 ro 
initrd		/boot/initrd.img-2.6.18-5-k7
savedefault

title		Debian GNU/Linux, kernel 2.6.18-5-k7 (recovery mode)
root		(hd0,5)
kernel		/boot/vmlinuz-2.6.18-5-k7 root=/dev/hde6 ro single
initrd		/boot/initrd.img-2.6.18-5-k7
savedefault

title		Debian GNU/Linux, kernel 2.6.18-4-k7
root		(hd0,5)
kernel		/boot/vmlinuz-2.6.18-4-k7 root=/dev/hde6 ro 
initrd		/boot/initrd.img-2.6.18-4-k7
savedefault

title		Debian GNU/Linux, kernel 2.6.18-4-k7 (recovery mode)
root		(hd0,5)
kernel		/boot/vmlinuz-2.6.18-4-k7 root=/dev/hde6 ro single
initrd		/boot/initrd.img-2.6.18-4-k7
savedefault

title		Debian GNU/Linux, kernel 2.4.27-2-386
root		(hd0,5)
kernel		/boot/vmlinuz-2.4.27-2-386 root=/dev/hde6 ro 
initrd		/boot/initrd.img-2.4.27-2-386
savedefault

title		Debian GNU/Linux, kernel 2.4.27-2-386 (recovery mode)
root		(hd0,5)
kernel		/boot/vmlinuz-2.4.27-2-386 root=/dev/hde6 ro single
initrd		/boot/initrd.img-2.4.27-2-386
savedefault

### END DEBIAN AUTOMAGIC KERNELS LIST
-------------- next part --------------
# menu.lst - See: grub(8), info grub, update-grub(8)
#            grub-install(8), grub-floppy(8),
#            grub-md5-crypt, /usr/share/doc/grub
#            and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.           
default		0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout		5

# Pretty colours
color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line)  and entries protected by the
# command 'lock'
# e.g. password topsecret
#      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title		Windows 95/98/NT/2000
# root		(hd0,0)
# makeactive
# chainloader	+1
#
# title		Linux
# root		(hd0,1)
# kernel	/vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=/dev/hde6 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,5)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=

## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(single-user) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## ## End Default Options ##

title		Debian GNU/Linux, kernel 2.6.18-5-k7
root		(hd0,5)
kernel		/boot/vmlinuz-2.6.18-5-k7 root=/dev/sda6 ro 
initrd		/boot/initrd.img-2.6.18-5-k7
savedefault

title		Debian GNU/Linux, kernel 2.6.18-5-k7 (recovery mode)
root		(hd0,5)
kernel		/boot/vmlinuz-2.6.18-5-k7 root=/dev/sda6 ro single
initrd		/boot/initrd.img-2.6.18-5-k7
savedefault

title		Debian GNU/Linux, kernel 2.6.18-4-k7
root		(hd0,5)
kernel		/boot/vmlinuz-2.6.18-4-k7 root=/dev/sda6 ro 
initrd		/boot/initrd.img-2.6.18-4-k7
savedefault

title		Debian GNU/Linux, kernel 2.6.18-4-k7 (recovery mode)
root		(hd0,5)
kernel		/boot/vmlinuz-2.6.18-4-k7 root=/dev/sda6 ro single
initrd		/boot/initrd.img-2.6.18-4-k7
savedefault

title		Debian GNU/Linux, kernel 2.4.27-2-386
root		(hd0,5)
kernel		/boot/vmlinuz-2.4.27-2-386 root=/dev/hde6 ro 
initrd		/boot/initrd.img-2.4.27-2-386
savedefault

title		Debian GNU/Linux, kernel 2.4.27-2-386 (recovery mode)
root		(hd0,5)
kernel		/boot/vmlinuz-2.4.27-2-386 root=/dev/hde6 ro single
initrd		/boot/initrd.img-2.4.27-2-386
savedefault

### END DEBIAN AUTOMAGIC KERNELS LIST


More information about the Pkg-grub-devel mailing list