[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#666974: marked as done (installs to /dev/sda when grub-installer/bootdev = /dev/sdb)



Your message dated Fri, 28 Feb 2014 15:19:53 +0000
with message-id <E1WJPE9-0006ez-Ho@franck.debian.org>
and subject line Bug#666974: fixed in grub-installer 1.93
has caused the Debian Bug report #666974,
regarding installs to /dev/sda when grub-installer/bootdev = /dev/sdb
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
666974: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=666974
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: grub-installer
Version: 1.60+squeeze3
Severity: important

*** Please type your report below this line ***

When I specify in my preseeding file:
  d-i partman-auto/disk                  string  /dev/sdb
  d-i grub-installer/bootdev             string  /dev/sdb

grub-installer ignores me and installs to /dev/sda.
partman-auto does the right thing.

In some cases this can result in an unbootable system.

Attached is a syslog excerpt for the execution of grub-installer,
with DEBCONF_DEBUG=5 set in the boot line. You can see that it
reads in the right disk name from the preseeding file, but somewhere
in the step_os_probe .. step_bootdev .. step_install_loader sequence it
changes $bootdev to /dev/sda.

I have also observed (on other installations, using software RAID-1) that
  d-i grub-installer/bootdev             string  /dev/sda /dev/sdb
is read in but also ultimately ignored and grub-installer only installs to
/dev/sda.



This installation was on a machine with two hard disks of identical size,
but only one was intended to be used in the installation.
The partioning was one ext3 partition for /, and one LVM for everything else.
No separate /boot partition. No software raid is specified.

I was able to stop the installer at the end and ran grub-installer again
on one of the installer consoles:

  sh -vx /usr/bin/grub-installer /target 1>/target/var/log/gi 2>&1

This shows the problem comes when parsing the grub-mkdevicemap output.

+ os-prober
+ db_settitle debian-installer/grub-installer/title
+ _db_cmd SETTITLE debian-installer/grub-installer/title
+ IFS=  printf %s\n SETTITLE debian-installer/grub-installer/title
+ IFS=
 read -r _db_internal_line
+ RET=OK
+ return 0
+ tmpfile=/tmp/menu.lst.extras
+ [ -s /tmp/os-probed ]
+ q=grub-installer/only_debian
+ state=1
+ [  ]
+ chroot /target grub-mkdevicemap --no-floppy -m+  -head -n1
+ cut -f2
+ default_bootdev_os=/dev/disk/by-id/scsi-35000c50017a6040b
+ [ /dev/disk/by-id/scsi-35000c50017a6040b ]
+ chroot /target readlink -f /dev/disk/by-id/scsi-35000c50017a6040b
+ default_bootdev=/dev/sda

when I run that grub-mkdevicemap on the host after installation, I get:

# grub-mkdevicemap --no-floppy -m -
(hd0)   /dev/disk/by-id/scsi-35000c50017a6040b
(hd1)   /dev/disk/by-id/scsi-35000c50017a7843b

so it seems that there is a disconnect here from the specification
of $bootdev and the attempt to guess $default_bootdev_os.

The consequences are as follows.

A little further down the script there is this, er, dense if statement:

case $ARCH:$grub_package in
    *:grub|*:grub-pc|sparc:grub-ieee1275)
	if [ "$(device_to_disk "$cdsrc")" = "$default_bootdev" ] || \
	   ([ -n "$hdsrc" ] && [ "$(device_to_disk "$hdsrc")" = "$default_bootdev" ]) || \
	   ([ "$default_bootdev" = '(hd0)' ] && \
	    (([ -n "$cdfs" ] && [ "$cdfs" != "iso9660" ]) || \
	     [ "$hybrid" = true ])) || \
	   ([ "$default_bootdev" != '(hd0)' ] && \
	    ! partmap "$default_bootdev" >/dev/null && \
	    ! grub_probe -t fs -d "$default_bootdev" >/dev/null); then
		db_fget grub-installer/bootdev seen
		if [ "$RET" != true ]; then
			bootfs=$(findfs /boot)
			[ "$bootfs" ] || bootfs="$(findfs /)"
			disk=$(device_to_disk "$bootfs")
			db_set grub-installer/bootdev "$disk"
			state=2
		fi
	fi
	;;
...

This fails out at the "$default_bootdev" = '(hd0)' comparison.
+ device_to_disk
+ echo
+ sed s:\(/dev/\(cciss\|ida\|rs\)/c[0-9]d[0-9][0-9]*\|/dev/mmcblk[0-9]\|/dev/\(ad\|da\)[0-9]\+\|/dev/[a-z]\+\).*:\1:
+ [  = /dev/sda ]
+ [ -n  ]
+ [ /dev/sda = (hd0) ]

Then we come to step_bootdev, a loop that continues until we have a suitable
value of $state. There $default_bootdev supercedes what I set $bootdev to.
$state is already set to 1 and $q to grub-installer/only_debian (see above).

db_progress STEP 1
db_progress INFO grub-installer/progress/step_bootdev

while : ; do
	if [ "$state" = 1 ]; then
		db_input high $q || true
		if ! db_go; then
			# back up to menu
			db_progress STOP
			exit 10
		fi
		db_get $q
		if [ "$RET" = true ]; then
			bootdev="$default_bootdev"
			break
		else
			# Exit to menu if /boot is on SATA RAID/multipath; we
			# don't support device selection in that case
			if [ "$frdev" ]; then
				db_progress STOP
				exit 10
			fi
			state=2
		fi
...

+ db_progress STEP 1
+ _db_cmd PROGRESS STEP 1
+ IFS=  printf %s\n PROGRESS STEP 1
+ IFS=
 read -r _db_internal_line
	   RET=OK
+ return 0
+ db_progress INFO grub-installer/progress/step_bootdev
+ _db_cmd PROGRESS INFO grub-installer/progress/step_bootdev
+ IFS=  printf %s\n PROGRESS INFO grub-installer/progress/step_bootdev
+ IFS=
 read -r _db_internal_line
	Determining GRUB boot device...       RET=OK
+ return 0
+ :
+ [ 1 = 1 ]
+ db_input high grub-installer/only_debian
+ _db_cmd INPUT high grub-installer/only_debian
+ IFS=  printf %s\n INPUT high grub-installer/only_debian
+ IFS=
 read -r _db_internal_line
+ RET=30 question skipped
+ return 30
+ true
+ db_go
+ _db_cmd GO
+ IFS=
 read -r _db_internal_line
+ RET=ok
+ return 0
+ db_get grub-installer/only_debian
+ _db_cmd GET grub-installer/only_debian
+ IFS=  printf %s\n GET grub-installer/only_debian
+ IFS=
 read -r _db_internal_line
+ RET=true
+ return 0
+ [ true = true ]
+ bootdev=/dev/sda
+ break
+ db_progress STEP 1
+ _db_cmd PROGRESS STEP 1
+ IFS=  printf %s\n PROGRESS STEP 1
+ IFS=
 read -r _db_internal_line
	5	 RET=OK
+ return 0
+ db_subst grub-installer/progress/step_install_loader BOOTDEV /dev/sda
+ _db_cmd SUBST grub-installer/progress/step_install_loader BOOTDEV /dev/sda
+ IFS=  printf %s\n SUBST grub-installer/progress/step_install_loader BOOTDEV /dev/sda
+ IFS=
 read -r _db_internal_line
+ RET=0
+ return 0
+ db_progress INFO grub-installer/progress/step_install_loader
+ _db_cmd PROGRESS INFO grub-installer/progress/step_install_loader
+ IFS=  printf %s\n PROGRESS INFO grub-installer/progress/step_install_loader
+ IFS=
 read -r _db_internal_line
	Running "grub-install /dev/sda"...	 RET=OK
+ return 0
+ info Installing grub on '/dev/sda'
+ log info: Installing grub on '/dev/sda'
+ logger -t grub-installer info: Installing grub on '/dev/sda'


preseeding details:

d-i partman-auto/method                string  lvm
d-i partman-auto/disk                  string  /dev/sdb
d-i grub-installer/bootdev             string  /dev/sdb

d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i grub-installer/grub2_instead_of_grub_legacy boolean true

d-i partman-auto-lvm/no_boot           boolean true

d-i partman-md/device_remove_md        boolean true
d-i partman-md/confirm boolean true

d-i partman-lvm/device_remove_lvm      boolean true
d-i partman-lvm/confirm                boolean true

d-i partman/choose_partition           select  finish
d-i partman/confirm                    boolean true

d-i partman/mount_style select uuid

d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/confirm_nooverwrite boolean true

d-i partman-auto/expert_recipe         string  my_server : \
    2048 2000 2048 ext3        \
        $primary{ }            \
        $bootable{ }           \
        method{ format }       \
        format{ }              \
        use_filesystem{ }      \
        filesystem{ ext3 }     \
        label{ root }          \
        mountpoint{ / }        \
    .                          \
    100% 2000 200% linux-swap  \
        $defaultignore{ }      \
        $lvmok{ }              \
        method{ swap }         \
        format{ }              \
    .                          \
    10240 1000 10240 ext3      \
        $defaultignore{ }      \
        $lvmok{ }              \
        method{ format }       \
        format{ }              \
        use_filesystem{ }      \
        filesystem{ ext3 }     \
        mountpoint{ /usr }     \
    .                          \
.. etc...

It happens that /dev/sda has a software raid signature, but from the
discussion above I think it is not causing the bug.

# fdisk -l /dev/sda

Disk /dev/sda: 300.0 GB, 300000000000 bytes
255 heads, 63 sectors/track, 36472 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0002eb77

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         125      999424   fd  Linux raid autodetect
Partition 1 does not end on cylinder boundary.
/dev/sda2             125       36473   291968000   fd  Linux raid autodetect

After installation this is the state of /dev/sdb
# fdisk -l /dev/sdb

Disk /dev/sdb: 300.0 GB, 300000000000 bytes
255 heads, 63 sectors/track, 36472 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000de478

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1         249     1998848   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sdb2             250       36473   290967553    5  Extended
/dev/sdb5             250       36473   290967552   8e  Linux LVM


I would really like to see this fixed in the stable release, how can I help?


-- System Information:
Debian Release: 6.0.4
  APT prefers stable
  APT policy: (990, 'stable')
Architecture: amd64 (x86_64)

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

Attachment: syslog.grub-installer.gz
Description: Binary data


--- End Message ---
--- Begin Message ---
Source: grub-installer
Source-Version: 1.93

We believe that the bug you reported is fixed in the latest version of
grub-installer, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 666974@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Dimitri John Ledkov <xnox@ubuntu.com> (supplier of updated grub-installer package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Fri, 28 Feb 2014 13:41:56 +0000
Source: grub-installer
Binary: grub-installer
Architecture: amd64 source
Version: 1.93
Distribution: unstable
Urgency: medium
Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
Changed-By: Dimitri John Ledkov <xnox@ubuntu.com>
Closes: 666974
Launchpad-Bugs-Fixed: 1012629
Description: 
 grub-installer - Install GRUB on a hard disk (udeb)
Changes: 
 grub-installer (1.93) unstable; urgency=medium
 .
   * Revert 1.92 changes, as unattended installations which do not preseed
     grub-installer/bootdev now fail to install unattended. This thus
     reopens #666974, LP#1012629.
   * Instead check if grub-installer/bootdev was seen, and only then query
     for it's value. Also do so, ahead of the loop that processes
     only_debian and with_other_os, such that grub-installer/bootdev takes
     precedence. Closes: #666974. LP: #1012629.
   * Jenkins which regressed with previous upload, are now back to normal.
Checksums-Sha1: 
 77b77abdc2f23442ea248ac4c1adc4456b043d62 1838 grub-installer_1.93.dsc
 28fdfa3043d7513315a801f2469874792a411f7c 227810 grub-installer_1.93.tar.gz
 52bce3c6e9dcaffb7a7b4c3b31e58e85ac6d1cf2 260798 grub-installer_1.93_amd64.udeb
Checksums-Sha256: 
 5a3253adea15ccc9f226ebaf035971c71abd7501c43ef7049dca9ae76fdd5481 1838 grub-installer_1.93.dsc
 62956e4a1b4fcf2d0d86bd6b585355cacca7fd5b3146c4fb597294e0acf9e7df 227810 grub-installer_1.93.tar.gz
 75ee19b3502ce969c7dc5acc696462e2759350e01ace0a1aac803c7ed065c497 260798 grub-installer_1.93_amd64.udeb
Files: 
 d778b77c3180f6adbd37e3f04c03b33c 1838 debian-installer standard grub-installer_1.93.dsc
 0b4996e9ab85b0388407fafde63b6353 227810 debian-installer standard grub-installer_1.93.tar.gz
 482c7f38d0e20cf37218a900028d0a0b 260798 debian-installer standard grub-installer_1.93_amd64.udeb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJTEJKmAAoJEIh7YGGLPBauj8cP/j2JA2ux+21PYdQP2+uFPnah
jB84Z/Cs5L+UbubobMBA8ycSuhFoSvnME2TC8Jm8cP0jEkhi9y4s1lJJAwyoy/X7
BIUqoAqUVjUnlEwDJKrLzc5eSXhmA+nhI1MB+GBnNyx8xx3s4GDcaG5rxCbwEXOh
AE1BIHx1U9jlRGDZHdq/PXZrS33facma6b9hQNqjkiD6gl8RpyONLjD2mdENFdc1
ea8uUlV1M6uMQml7xw8wfaim053e890kEHY2IHOnWtihv6cRA/RCa5+sUdwJ9sBU
aX9RSvRgkGz0BFi4w7UDTtdxyBP+nLBLUBEKOvqhOODxK/qyZmTgjxDvuxXHPU0a
V9Yf61QZWTDkRCjqj4TgksB/zaNa87ynJx2bVpmgquSfjq1VW04mAU3cX9bCm0aX
WvRjUlpHjA1Hm1ylRe/nP1Lcvjvo5GGxPoloOOCLdnPw2QQxJfxbh/LmDzZfEC+x
pgsmuBHUlE13k7UgwzBeIabEb2e1krmftbXur8lmNAOMF4BNnznmTJ/loZM7w0/9
dZKv+yrAZsNBCbyubKrOwDxHcFuktE728KjY5qjoF/9KtvH4Fpd4rAwc7nKcIxvm
aiSIp5vQaAlZjdm++OdWDOM+VC8dbrcURZkqRXYFq6awwh+4sGeOSVjiMW19kR4p
uZ2wMRPyjOlvZAYTZHBo
=c/3g
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: