Preseeded 12.04 grub-install failed: Wrong number of args: mapdevfs <path>

Bug #912431 reported by Adam Gandelman
34
This bug affects 4 people
Affects Status Importance Assigned to Milestone
debian-installer-utils (Ubuntu)
Fix Released
High
Colin Watson
grub-installer (Ubuntu)
Invalid
High
Unassigned

Bug Description

Using the latest precise amd64 mini.iso, grub-install has recently started to fail on preseeded installations. The preseeds have remained pretty static relative to mini.iso updates. I"m not sure this is directly related to grub-installer as there hasn't been an upload in ~12 weeks, but I am unsure where else to file this.

After failure, grub-install reports the following in syslog (also attached):

Jan 5 18:19:21 in-target: grub-common is already the newest version.
Jan 5 18:19:21 in-target: 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Jan 5 18:19:21 main-menu[494]: (process:27699): Wrong number of args: mapdevfs <path>
Jan 5 18:19:21 main-menu[494]: WARNING **: Configuring 'grub-installer' failed with error code 1
Jan 5 18:19:21 main-menu[494]: WARNING **: Menu item 'grub-installer' failed.

Revision history for this message
Adam Gandelman (gandelman-a) wrote :
Revision history for this message
Adam Gandelman (gandelman-a) wrote :
Revision history for this message
Adam Gandelman (gandelman-a) wrote :
Revision history for this message
Adam Gandelman (gandelman-a) wrote :
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Same here, both with and without pre-seeds. Marking confirmed.

rebooting from the cd in rescue mode and doing 'apt-get install grub2' lets me proceed.

Changed in grub-installer (Ubuntu):
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Attaching syslog with debconf debug output

Changed in grub-installer (Ubuntu):
assignee: nobody → Canonical Foundations Team (canonical-foundations)
Revision history for this message
Thomas Bushnell, BSG (tbushnell) wrote :

We have this problem too. The fix is in grub-installer in the udeb.

The problem is the grub_probe function in that script. It does an apt-install and then calls grub-probe in the chroot. The apt-install prints output, however, and the callers of grub_probe expect to see only the output from grub-probe itself. As a result, output from apt-install is slammed into the variables which later become the arguments to mapdevfs.

If you do 2>&1 > /dev/null after the apt-install in that function, the install proceeds without a problem.

Revision history for this message
Scott Moser (smoser) wrote :

It seems to me that this is a regression caused by most recent update of debian-installer-utils that started using dpkg-divert rather than mv to manage start-stop-daemon.

So I would guess the simplist fix here is to just make dpkg-divert quiet.

I've submitted merge proposal at https://code.launchpad.net/~smoser/debian-installer-utils/lp912431/+merge/87709 .

Scott Moser (smoser)
Changed in debian-installer-utils (Ubuntu):
importance: Undecided → High
status: New → Confirmed
Colin Watson (cjwatson)
Changed in grub-installer (Ubuntu):
status: Confirmed → Invalid
assignee: Canonical Foundations Team (canonical-foundations) → nobody
Changed in debian-installer-utils (Ubuntu):
assignee: nobody → Colin Watson (cjwatson)
status: Confirmed → Triaged
Revision history for this message
Colin Watson (cjwatson) wrote :

Agreed - chroot_setup must be silent. Thanks, Scott!

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package debian-installer-utils - 1.88ubuntu2

---------------
debian-installer-utils (1.88ubuntu2) precise; urgency=low

  [ Scott Moser ]
  * Add --quiet to dpkg-divert calls in chroot_setup (LP: #912431).
 -- Colin Watson <email address hidden> Fri, 06 Jan 2012 12:19:21 +0000

Changed in debian-installer-utils (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Thomas Bushnell, BSG (tbushnell) wrote :

I'm confused about why chroot_setup is the issue here. It's the apt-install command inside the grub_probe command which is spitting out output, and the output it spits out looks like typical apt-get output.

Revision history for this message
Colin Watson (cjwatson) wrote : Re: [Bug 912431] Re: Preseeded 12.04 grub-install failed: Wrong number of args: mapdevfs <path>

On Fri, Jan 06, 2012 at 05:44:28PM -0000, Thomas Bushnell, BSG wrote:
> I'm confused about why chroot_setup is the issue here. It's the apt-
> install command inside the grub_probe command which is spitting out
> output, and the output it spits out looks like typical apt-get output.

apt-install uses chroot_setup, via in-target. The apt-get output goes
to stderr (due to 'debconf-apt-progress --logstderr') and thence to
syslog and doesn't interfere with grub_probe. By contrast, the
dpkg-divert output went to stdout.

Besides, chroot_setup is the only thing anywhere around here that
changed recently; I'd have guessed at that myself if Scott hadn't beaten
me to it!

Revision history for this message
Roger Binns (ubuntu-rogerbinns) wrote :

Just did a fresh text install (twice) of 14.04 and the install grub step failed with exactly the same symptoms. Trying to do things manually results in a boot where I get dumped into initramfs

Revision history for this message
Colin Watson (cjwatson) wrote :

I need fresh installer logs and a copy of the preseed file, please,
preferably in a fresh bug report; it can often be the case that quite
different underlying causes present with the same symptoms. Feel free
to explicitly subscribe me to the new bug so that I see it.

Revision history for this message
TJ (tj) wrote :

@Roger Binns: your issue may (have) been caused by bug #1354730

Changed in grub-installer (Ubuntu):
status: Invalid → Incomplete
Colin Watson (cjwatson)
Changed in grub-installer (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.