From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1WrUKm-0003Mh-RR for mharc-grub-devel@gnu.org; Mon, 02 Jun 2014 11:39:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrUKg-0003Lx-Bt for grub-devel@gnu.org; Mon, 02 Jun 2014 11:39:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WrUKb-0006zd-F5 for grub-devel@gnu.org; Mon, 02 Jun 2014 11:39:30 -0400 Received: from mail-la0-x22b.google.com ([2a00:1450:4010:c03::22b]:56519) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrUKb-0006x5-4T for grub-devel@gnu.org; Mon, 02 Jun 2014 11:39:25 -0400 Received: by mail-la0-f43.google.com with SMTP id mc6so2733355lab.30 for ; Mon, 02 Jun 2014 08:39:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=vfMPqT3E10AcxygyhRzMZ4I2Lo4u6k11TbVdDYbx8C0=; b=SmvhKuYIMjTtqE9ae+aDVf1y+hqxTJreu2aTXaHVE9nClvY80urLtyoQSUeDjs3cww 86GkyBKnzXaT0IkMTnH25pZzBzjpojowBRlcbZkx0QsbUc3ufrdsWDozoStNfp/yyMHh Anfmn9Eq/RhoUW2z5h0Bx9AKKNfdNWLzpVBwX8epqBzoK0ZQ3i5SICcYLg+Iaw47VBHx ZAwUZ6VamF7tvppbPmJWcftDWlbDVc46N9lkzUjYf2MLezUHlSVdVw5z4fI/i3Qk1qmQ XurvUN6nKi39kvJmJDfo6ZdTkTutrNiqCRsIW7G6ByyBe/SwS0LCHlv/ELKITHtSeuRO kIrQ== X-Received: by 10.152.87.20 with SMTP id t20mr2366723laz.79.1401723563970; Mon, 02 Jun 2014 08:39:23 -0700 (PDT) Received: from opensuse.site (ppp37-190-15-130.pppoe.spdop.ru. [37.190.15.130]) by mx.google.com with ESMTPSA id o1sm13200285lbw.27.2014.06.02.08.39.23 for (version=SSLv3 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 02 Jun 2014 08:39:23 -0700 (PDT) Date: Mon, 2 Jun 2014 19:39:22 +0400 From: Andrey Borzenkov To: The development of GNU GRUB Subject: Re: Bug#747653: grub2-common: update-grub adds both devices and a line feed for BTRFS RAID 1 setup Message-ID: <20140602193922.18d3a188@opensuse.site> In-Reply-To: <20140510185334.5756.69796.reportbug@merkaba.lichtvoll> References: <20140510185334.5756.69796.reportbug@merkaba.lichtvoll> X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.22; x86_64-suse-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::22b Cc: Martin@Lichtvoll.de, Debian Bug Tracking System X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jun 2014 15:39:35 -0000 =D0=92 Sat, 10 May 2014 20:53:34 +0200 Martin Steigerwald =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > Package: grub2-common > Version: 2.02~beta2-10 > Severity: normal >=20 > Dear Maintainer, >=20 > I am booting my Debian system via a BTRFS RAID 1 which spans a logical > volume on a Crucial MSATA and Intel SATA SSD each. >=20 > After running update-grub I am getting this in /boot/grub/grub.cfg: >=20 > echo 'Linux 3.15.0-rc5-tp520 wird geladen =E2=80=A6' > linux /vmlinuz-3.15.0-rc5-tp520 root=3D/dev/mapper/sata= -debian > /dev/mapper/msata-debian ro rootflags=3Dsubvol=3Ddebian init=3D/= bin/systemd resume=3D/dev/mapper/sata-swap=20 > echo 'Initiale Ramdisk wird geladen =E2=80=A6' > initrd /initrd.img-3.15.0-rc5-tp520 >=20 > update-grub basically adds both devices of the BTRFS RAID 1 device > separated by a line feed. For mounting BTRFS RAID 1 tough one of them > is enough, once btrfs device scan is run, for which I currently use an > script for initramfs-tools as a work-around as it didn=C2=B4t work out of > the box on my last tests[1]. >=20 > This behaviour is due to grub-probe which is called by grub-mkconfig > at line 139 >=20 > 138 # Device containing our userland. Typically used for root=3D paramet= er. > 139 GRUB_DEVICE=3D"`${grub_probe} --target=3Ddevice /`" > 140 GRUB_DEVICE_UUID=3D"`${grub_probe} --device ${GRUB_DEVICE} --target= =3Dfs_uuid 2> /dev/null`" || true >=20 > which is called by update-grub returns both devices with a > linefeed: >=20 > merkaba:~> grub-probe --target=3Ddevice / > /dev/mapper/sata-debian > /dev/mapper/msata-debian >=20 > grub-probe is an ELF binary. >=20 > The following little change workarounds the issue for me: >=20 > merkaba:~> diff -u /usr/sbin/grub-mkconfig.dist /usr/sbin/grub-mkconfig = =20 > --- /usr/sbin/grub-mkconfig.dist 2014-05-08 14:35:25.000000000 +02= 00 > +++ /usr/sbin/grub-mkconfig 2014-05-10 20:46:00.380096263 +0200 > @@ -136,7 +136,7 @@ > fi > =20 > # Device containing our userland. Typically used for root=3D parameter. > -GRUB_DEVICE=3D"`${grub_probe} --target=3Ddevice /`" > +GRUB_DEVICE=3D"`${grub_probe} --target=3Ddevice / | head -1`" > GRUB_DEVICE_UUID=3D"`${grub_probe} --device ${GRUB_DEVICE} --target=3Dfs= _uuid 2> /dev/null`" || true > =20 > # Device containing our /boot partition. Usually the same as GRUB_DEVIC= E. >=20 >=20 > But I suppose the real fix is to be made in the binary grub-probe. >=20 No, grub-probe is correct; grub needs to know all devices so it can have full information which drivers it requires to access them. See also https://lists.gnu.org/archive/html/grub-devel/2014-05/msg00005.html I suggest you discuss it with Colin, but for now I tend to think, fix should go into 10_linux. May be always use UUID for btrfs. But this sounds like new can of worms :(=20