From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1XC7D3-0002Rr-An for mharc-grub-devel@gnu.org; Tue, 29 Jul 2014 09:12:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49304) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XC7Cv-0002Rc-UF for grub-devel@gnu.org; Tue, 29 Jul 2014 09:12:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XC7Cq-0003bG-I5 for grub-devel@gnu.org; Tue, 29 Jul 2014 09:12:45 -0400 Received: from mondschein.lichtvoll.de ([194.150.191.11]:37930 helo=mail.lichtvoll.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XC7Cq-0003ap-A0 for grub-devel@gnu.org; Tue, 29 Jul 2014 09:12:40 -0400 Received: from merkaba.localnet (ppp-88-217-104-114.dynamic.mnet-online.de [88.217.104.114]) by mail.lichtvoll.de (Postfix) with ESMTPSA id 2B882789; Tue, 29 Jul 2014 15:12:38 +0200 (CEST) From: Martin Steigerwald To: Andrey Borzenkov Subject: Re: Bug#747653: grub2-common: update-grub adds both devices and a line feed for BTRFS RAID 1 setup Date: Tue, 29 Jul 2014 15:12:37 +0200 Message-ID: <2778652.fHLsI35Otd@merkaba> User-Agent: KMail/4.15 pre (Linux/3.16.0-rc7-tp520-fixcompwrite+; KDE/4.13.3; x86_64; git-78f9db0; 2014-07-26) In-Reply-To: <20140602193922.18d3a188@opensuse.site> References: <20140510185334.5756.69796.reportbug@merkaba.lichtvoll> <20140602193922.18d3a188@opensuse.site> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 194.150.191.11 Cc: Debian Bug Tracking System , The development of GNU GRUB 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: Tue, 29 Jul 2014 13:12:51 -0000 Am Montag, 2. Juni 2014, 19:39:22 schrieb Andrey Borzenkov: > =D0=92 Sat, 10 May 2014 20:53:34 +0200 >=20 > 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 logi= cal > > volume on a Crucial MSATA and Intel SATA SSD each. > >=20 > > 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 > >=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 th= em > > 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-mkconfi= g > > at line 139 > >=20 > > 138 # Device containing our userland. Typically used for root=3D p= arameter. > > 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-mkco= nfig > > --- /usr/sbin/grub-mkconfig.dist 2014-05-08 14:35:25.0000000= 00 > > +0200 > > +++ /usr/sbin/grub-mkconfig 2014-05-10 20:46:00.380096263 +0200= > > @@ -136,7 +136,7 @@ > >=20 > > fi > > =20 > > # Device containing our userland. Typically used for root=3D para= meter. > >=20 > > -GRUB_DEVICE=3D"`${grub_probe} --target=3Ddevice /`" > > +GRUB_DEVICE=3D"`${grub_probe} --target=3Ddevice / | head -1`" > >=20 > > GRUB_DEVICE_UUID=3D"`${grub_probe} --device ${GRUB_DEVICE} --targe= t=3Dfs_uuid > > 2> /dev/null`" || true > > =20 > > # Device containing our /boot partition. Usually the same as > > GRUB_DEVICE. > >=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. >=20 > See also > https://lists.gnu.org/archive/html/grub-devel/2014-05/msg00005.html >=20 > 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. >=20 > But this sounds like new can of worms :( Any oppinions here on how to take this forward? I just applied my patch from above again after a GRUB update. Colin? Andrey, what new kind of worms have you in mind? :) Ciao, --=20 Martin 'Helios' Steigerwald - http://www.Lichtvoll.de GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7