14.04 grub-install failed: Wrong number of args: mapdevfs <path>
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | grub-installer (Ubuntu) |
Critical
|
Unassigned | ||
| | Trusty |
Medium
|
Unassigned | ||
Bug Description
I was previously able to install ubuntu on a root btrfs filesystem in raid1 mode as I described here:
http://
So I used gparted to create btrfs partitions on all the disksand left 1 MB at the beginning of the disks for GRUB. (I also tried 2, and 5)
Then later I made the btrfs filesystem as follows:
mkfs.btrfs -m raid1 -d raid1 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1
And performed:
btrfs dev scan
Then I went back through normal installation.
I am now trying to do this again, using Ubuntu 14.04.
Everything goes fine up to the point that it wants to install grub.
It mentions the error in the title and fails.
Apparently, somebody else also reported an error like this with 14.04.
https:/
I will attach some files later.
Related branches
- Mathieu Trudel-Lapierre: Approve on 2015-02-19
-
Diff: 27 lines (+8/-1)2 files modifieddebian/changelog (+7/-0)
grub-installer (+1/-1)
| Willem Ligtenberg (wligtenberg) wrote : | #1 |
| Willem Ligtenberg (wligtenberg) wrote : | #2 |
preseed file
| description: | updated |
| Changed in grub-installer (Ubuntu): | |
| status: | New → In Progress |
| importance: | Undecided → High |
| assignee: | nobody → TJ (tj) |
The failure is due to grub_probe() returning more than one line when using btrfs. In the case of a 4-device raid1 created with:
make.btrfs -m raid1 -d raid1 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sds1
grub_probe() returns and assigns to $rootfs:
/dev/sda1
/dev/sdb1
/dev/sdc1
/dev/sdd1
which causes calls to mapdevfs to fail since it receives 4 arguments with error code 1 and message "Wrong number of args: mapdevfs <path>".
The fix is to amend the grub-installer script's grub_probe() function:
diff -u grub-installer.orig grub-installer
--- grub-installer.orig 2014-08-10 04:22:23.009006148 +0100
+++ grub-installer 2014-08-10 04:22:38.249815612 +0100
@@ -113,7 +113,7 @@
fi
- $chroot $ROOT grub-probe $@
+ $chroot $ROOT grub-probe $@ | head -1
}
| Changed in grub-installer (Ubuntu): | |
| status: | In Progress → Triaged |
Bug-fix branch linked
| Changed in grub-installer (Ubuntu): | |
| assignee: | TJ (tj) → nobody |
| Willem Ligtenberg (wligtenberg) wrote : | #5 |
Is there a way I can test this patch?
Because I assume that it is more complicated since it has to be on the install media.
| TJ (tj) wrote : Re: [Bug 1354730] Re: 14.04 grub-install failed: Wrong number of args: mapdevfs <path> | #6 |
On 10/08/14 08:02, Willem Ligtenberg wrote:
> Is there a way I can test this patch?
1. Start the installer and pause it at some user prompt
2. Start a terminal shell (switch to an alternative VT or start an xterm or if using -server install use the "Execute a Shell" main-menu option)
3. Execute "sed -i 's/\($chroot $ROOT grub-probe $@\)/\1 | head -1/' /usr/bin/
4. Return to the installer and continue
| Changed in grub-installer (Ubuntu): | |
| assignee: | nobody → TJ (tj) |
| Launchpad Janitor (janitor) wrote : | #7 |
This bug was fixed in the package grub-installer - 1.78ubuntu25
---------------
grub-installer (1.78ubuntu25) vivid; urgency=medium
* grub_probe(): return a single line in BTRFS multi-disk RAID configurations
(LP: #1354730).
-- TJ <email address hidden> Thu, 19 Feb 2015 11:44:43 -0500
| Changed in grub-installer (Ubuntu): | |
| status: | Triaged → Fix Released |
As I recall there is also a branch to bring this to Trusty, but it's not closing the bug.
(fwiw, that's https:/
I'm nominating this for Trusty, so as soon as you have time to update the branch (following the same changes as done in vivid), TJ, we can SRU this... but this bug report will also need an update of it's description for the SRU process (http://
Thanks!
| Changed in grub-installer (Ubuntu Trusty): | |
| importance: | Undecided → Medium |
| status: | New → Triaged |
I'm reverting this, as it's been found that it misbehaves when trying to install the bootloader using Guided - use entire disk with LVM, on recent server images.
Reopening...
| Changed in grub-installer (Ubuntu): | |
| status: | Fix Released → Triaged |
| assignee: | TJ (tj) → nobody |
| Nick Fish (nichfish) wrote : | #10 |
FYI, for anyone that wants to use the original fix as a workaround until an official fix is released, the grub-installer script can be found at /usr/share/
sed -i 's/\($chroot $ROOT grub-probe $@\)/\1 | head -1/' /usr/share/
Changing this (I used nano to edit the file instead of sed) enabled me to install Ubuntu 14.04 LTS Desktop on a BTRFS raid setup without issue.
| Changed in grub-installer (Ubuntu): | |
| importance: | High → Critical |


syslog of the installer