[Bug 1265402] Re: Unity calls mapdevfs with wrong number of args on btrfs raid1

Huygens huygens_25 at yahoo.fr
Sun Feb 9 14:42:07 UTC 2014


"My bug" is related to that one, so I am adding the information as
comment rather than creating a new one. However, if you think it is
"enough different" let me know and I will create a separate bug.

I wanted to install Ubuntu Server on a system with 3 disks using Btrfs in RAID5. My first attempt was with Ubuntu 12.04.4 LTS but the btrfs tools shipped with it do not support RAID5. So I decided to go with Ubuntu Trusty Thar Alpha 2 (build from the 2014-02-08) and try my luck with it. This release of Ubuntu Server supports Btrfs in RAID5 although the installer does not. So during the "partitionning" phase I switched to another terminal to create the Btrfs filesystem in RAID5.
All was set-up correctly and the rest of the installation process was successfully done (in the log and as far as I can tell on the FS itself, all required files and configuration have been created). The problem is that the step to install Grub failed miserably with the same error as reported initially in this bug report.

I can provide some insight why this fails. Lines 295-314 from grub-
installer (not grub-install, but the one used during installation). This
script tries to find the root and boot mount point and the filesystem
type of /boot. The problem of the functions findfs and findfstype in the
case of RAID (in redundant mode, so RAID1,5,6,10 at least for Btrfs) is
that they will find on all my 3 devices (sda, sdb and sdc) a /boot
partition! So when a few lines later the script calls mapdevfs and use
the $rootfs and $bootfs parameters, instead of showing /dev/sda2 (in my
case) it has /dev/sda2 /dev/sdb2 /dev/sdc3, and obviously mapdevfs
complains to support the 3 devices given as parameters.

When debuging the script grub-installer (using the "set +x" option), I have found out that the following command returns:
# chroot /target grub-probe -t device /boot
/dev/sda2
/dev/sdb2
/dev/sdc2

Which is then not foreseen for the rest of the scripts. I wrote an ugly patch which works for me, I changed the lines 295-296 to
rootfs=$(findfs / | head -n1)
bootfs=$(findfs /boot | head -n1)

I then ran the following command:
grub-installer /target/ /dev/sda

So given the current script, it is not possible to install Ubuntu with a /boot partition using Btrfs configured with a redundant "RAID"disk (aka as of today RAID1,5,6,10).
Note: this was only tested with RAID5, but obviously the other RAID configuration will be affected the same.

Note: However, the script was too complex to be read in a text console
to be able to correct it so that I could install on each HDD grub.
Because now only /dev/sda has grub, but if it fails my system is unable
to boot in degraded mode because I do not have a bootloader on sdb or
sdc. I was thinking that grub-installer second parameter was the
destination device. But when trying to patch the rootfs and bootfs to
get sdb2, and use sdb instead of sda for grub-installer, I saw in the
log that it still installed Grub in sda :-(

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to ubiquity in Ubuntu.
https://bugs.launchpad.net/bugs/1265402

Title:
  Unity calls mapdevfs with wrong number of args on btrfs raid1

Status in “ubiquity” package in Ubuntu:
  Triaged

Bug description:
  Trying to install Saucy on a KVM vm. The filesystem is /vda1 mounted
  on /boot, vda2 and vdb1 ate btrfs raid1 swap is on vda. Installer
  always says it can't install bootloader on vda, pick another device.
  But no device works. I'v tried many time with different configurations
  of the virtual disks, always ends the same.

  Thanks,
  Barry

  ProblemType: Bug
  DistroRelease: Ubuntu 13.10
  Package: ubiquity 2.15.26
  ProcVersionSignature: Ubuntu 3.11.0-12.19-generic 3.11.3
  Uname: Linux 3.11.0-12-generic x86_64
  ApportVersion: 2.12.5-0ubuntu2
  Architecture: amd64
  CasperVersion: 1.336ubuntu1
  Date: Wed Jan  1 19:19:46 2014
  InstallCmdLine: file=/cdrom/preseed/ubuntu.seed boot=casper initrd=/casper/initrd.lz quiet splash -- maybe-ubiquity
  LiveMediaBuild: Ubuntu 13.10 "Saucy Salamander" - Release amd64 (20131016.1)
  MarkForUpload: True
  ProcEnviron:
   TERM=linux
   PATH=(custom, no user)
   XDG_RUNTIME_DIR=<set>
   LANG=en_US.UTF-8
  SourcePackage: grub-installer
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1265402/+subscriptions



More information about the foundations-bugs mailing list