From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1XDG6L-0006tj-Rr for mharc-grub-devel@gnu.org; Fri, 01 Aug 2014 12:54:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45759) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XDG6F-0006s9-Sf for grub-devel@gnu.org; Fri, 01 Aug 2014 12:54:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XDG6A-0006xm-UD for grub-devel@gnu.org; Fri, 01 Aug 2014 12:54:35 -0400 Received: from mail-lb0-x232.google.com ([2a00:1450:4010:c04::232]:60220) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XDG6A-0006xd-FH for grub-devel@gnu.org; Fri, 01 Aug 2014 12:54:30 -0400 Received: by mail-lb0-f178.google.com with SMTP id c11so3461904lbj.9 for ; Fri, 01 Aug 2014 09:54:29 -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; bh=bdpOGFt/otH37YYTjGd8zfunYkVVmE2mzAJpoEVJrnU=; b=ydcCaY62PNnCwqJpsNzrHoShOAr3vmr174QlAY3rYfhslgdHuiDiAMDrN8LVKkV2MR a7CqThr7nmZb/57nTVi3WeC1PTKlXtki6BqLE2gYk1xIGbjGwb3it0f5jSkh0pyvup8N qq4eEfrT/hSLhJG5hBQsCC91S85Mqrs8EcMfmYrKXDY8IGvwuhHNSkwsLqf3PYKMZOu0 EBZknswitgf/Lqycv+ZhHqB+sSJt8yMbWrrPLGsvQs21ZtQsTJJfdfNEqm1btJE8V5pK eJCeeJnMMmsdYndE5yXAKvgGjkfQE9bpBz9lhO+r1UZOqkPlTZpONOa1zQwAGtzRzlv4 aqhQ== X-Received: by 10.152.37.228 with SMTP id b4mr7602276lak.95.1406912069077; Fri, 01 Aug 2014 09:54:29 -0700 (PDT) Received: from opensuse.site (ppp94-29-76-101.pppoe.spdop.ru. [94.29.76.101]) by mx.google.com with ESMTPSA id yg3sm13939286lbb.13.2014.08.01.09.54.28 for (version=SSLv3 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 01 Aug 2014 09:54:28 -0700 (PDT) Date: Fri, 1 Aug 2014 20:54:26 +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: <20140801205426.766816b7@opensuse.site> In-Reply-To: <53DBB587.6030400@gmail.com> References: <20140510185334.5756.69796.reportbug@merkaba.lichtvoll> <20140602193922.18d3a188@opensuse.site> <2778652.fHLsI35Otd@merkaba> <53DBB587.6030400@gmail.com> X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.22; x86_64-suse-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/W.sktJTTi+qJzbTq7x=/h.m"; protocol="application/pgp-signature" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::232 Cc: phcoder@gmail.com 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: Fri, 01 Aug 2014 16:54:40 -0000 --Sig_/W.sktJTTi+qJzbTq7x=/h.m Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =D0=92 Fri, 01 Aug 2014 17:43:03 +0200 Vladimir '=CF=86-coder/phcoder' Serbinenko =D0=BF=D0=B8= =D1=88=D0=B5=D1=82: > On 29.07.2014 15:12, Martin Steigerwald wrote: > > Am Montag, 2. Juni 2014, 19:39:22 schrieb Andrey Borzenkov: > >> =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 > >>> > >>> Dear Maintainer, > >>> > >>> 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. > >>> > >>> After running update-grub I am getting this in /boot/grub/grub.cfg: > >>> 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 > >>> =20 > >>> /dev/mapper/msata-debian ro rootflags=3Dsubvol=3Ddebian=20 > >>> 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 > >>> > >>> 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 ou= t of > >>> the box on my last tests[1]. > >>> > >>> This behaviour is due to grub-probe which is called by grub-mkconfig > >>> at line 139 > >>> > >>> 138 # Device containing our userland. Typically used for root=3D par= ameter. > >>> 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 > >>> > >>> which is called by update-grub returns both devices with a > >>> linefeed: > >>> > >>> merkaba:~> grub-probe --target=3Ddevice / > >>> /dev/mapper/sata-debian > >>> /dev/mapper/msata-debian > >>> > >>> grub-probe is an ELF binary. > >>> > >>> The following little change workarounds the issue for me: > >>> > >>> merkaba:~> diff -u /usr/sbin/grub-mkconfig.dist /usr/sbin/grub-mkconf= ig > >>> --- /usr/sbin/grub-mkconfig.dist 2014-05-08 14:35:25.000000000 > >>> +0200 > >>> +++ /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 parame= ter. > >>> > >>> -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_DEVICE. > >>> > >>> But I suppose the real fix is to be made in the binary grub-probe. > >> > >> 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 > > Any oppinions here on how to take this forward? > >=20 > While changing grub-probe isn't agood idea: it's GRUB internal tool, we > could filter and leave only one device but I don't think it makes any > sense as multidevice btrfs needs uuid uniqueness in any case. Why didn't > UUID code path kick in? Most likely due to ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" Currently GRUB_(BOOT)_DEVICE is used as a) argument for various property probing, where we must know all individual devices for multi-device file systems b) as fallback to pass to kernel may be it makes sense to export both in grub-mkconfig, as GRUB_KERNEL_DEVICE (which will simply use first in the list; any better name?) GRUB_DEVICES (same as GRUB_DEVICE now) and audit all scripts for usage. Although I was a bit unsure in some cases, especially for non-Linux. > > I just applied my patch from above again after a GRUB update. > >=20 > > Colin? > >=20 > > Andrey, what new kind of worms have you in mind? :) > >=20 > > Ciao, > >=20 >=20 >=20 --Sig_/W.sktJTTi+qJzbTq7x=/h.m Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iEYEARECAAYFAlPbxkIACgkQR6LMutpd94yeegCcDN5l15fY7FksICuqMKykf4ZF EUUAoKFH9qD9Tm1Ic+7a5AA2pBHGGBF7 =lGM5 -----END PGP SIGNATURE----- --Sig_/W.sktJTTi+qJzbTq7x=/h.m--