From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1XDEzJ-00048l-81 for mharc-grub-devel@gnu.org; Fri, 01 Aug 2014 11:43:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45498) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XDEzC-00043v-Vs for grub-devel@gnu.org; Fri, 01 Aug 2014 11:43:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XDEz7-00024p-BM for grub-devel@gnu.org; Fri, 01 Aug 2014 11:43:14 -0400 Received: from mail-wi0-x22c.google.com ([2a00:1450:400c:c05::22c]:49744) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XDEz6-00024j-W8 for grub-devel@gnu.org; Fri, 01 Aug 2014 11:43:09 -0400 Received: by mail-wi0-f172.google.com with SMTP id n3so1611905wiv.5 for ; Fri, 01 Aug 2014 08:43:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=8pI5avUnc+aT8cxh6D2NlJMpvCBKNcSc0cmW+rgq/+c=; b=XGk01gxvBmZQ6sE2zOEJfziVAnTFuuuMK8g4Ej/PHCfD3UicNhO3t23FM8PUVZHDLN dz5aSpqXfhxQAW9+UCAcot3jj4PJNq+uXtvs1kW7j5BtDHlsljiZwoBN1MHGF5jB8iyo Ag69I7i9X80n1ihefbazcsxp0s3Jo70Nt8YI5+BYTerQ6x/MdEqsR4WmfNFikHiT/Dgl exnCuQBnfXJdBbwKn7gh2unr8NPOmN2Q7UOGf58XrxmLlaugOs6IcOw6MNzjJGpnC428 RtrUjEStb4KSdG0jcaAF3BxNGTId8X7DT3GY2AdYdJlNBjkiwL2bglyqENFPtf0W8YRG j3ew== X-Received: by 10.180.212.113 with SMTP id nj17mr8050029wic.46.1406907788072; Fri, 01 Aug 2014 08:43:08 -0700 (PDT) Received: from [192.168.42.61] (167-224.197-178.cust.bluewin.ch. [178.197.224.167]) by mx.google.com with ESMTPSA id p3sm21735025wjw.13.2014.08.01.08.43.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Aug 2014 08:43:06 -0700 (PDT) Message-ID: <53DBB587.6030400@gmail.com> Date: Fri, 01 Aug 2014 17:43:03 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.0 MIME-Version: 1.0 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 References: <20140510185334.5756.69796.reportbug@merkaba.lichtvoll> <20140602193922.18d3a188@opensuse.site> <2778652.fHLsI35Otd@merkaba> In-Reply-To: <2778652.fHLsI35Otd@merkaba> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="ifvGrqOGiAM5DXiMmIFnlOxOiGpIfqRaw" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22c 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 15:43:19 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ifvGrqOGiAM5DXiMmIFnlOxOiGpIfqRaw Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 logica= l >>> 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 a= n >>> 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=3D= fs_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? > 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 --ifvGrqOGiAM5DXiMmIFnlOxOiGpIfqRaw Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iF4EAREKAAYFAlPbtYcACgkQmBXlbbo5nOvOGAD+Jwq+5kYAwbEeW9HyL4HV5bye 2FDsbE9a40F3ha1H8VoA/AhJMdI+2kLl2pM3Gic2xvsrXEFQMpj2+u2LoNqmwOMh =68oO -----END PGP SIGNATURE----- --ifvGrqOGiAM5DXiMmIFnlOxOiGpIfqRaw--