From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ZLuja-0005xW-Eo for mharc-grub-devel@gnu.org; Sun, 02 Aug 2015 10:59:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59196) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLujY-0005tQ-4l for grub-devel@gnu.org; Sun, 02 Aug 2015 10:59:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZLujW-0000nx-U5 for grub-devel@gnu.org; Sun, 02 Aug 2015 10:59:28 -0400 Received: from mail-la0-x236.google.com ([2a00:1450:4010:c03::236]:35955) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZLujS-0000n0-4R; Sun, 02 Aug 2015 10:59:22 -0400 Received: by labgo9 with SMTP id go9so13063773lab.3; Sun, 02 Aug 2015 07:59:20 -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=YMfi4oyOlB/UqmUF9zF7lpw3+bBkapCREk5VFw9eTwE=; b=V20zlqvlOpQ7d9TyFSpRbv85HrF8sM1a+IeJqCNeDnmnC/MtjuHGcMsQVCS4F0Fm3O JzMN0O7+aPKkwYiMV6U2qXMDDOy7dOlHiu6QE666XZa20QYIqbJ2/15AQ05aiFHQUjdp 5go0neW6OMxR0lIa8t6f4Uu+NMVXFtX9kxnUKnBJg79tZGR9ws+Eha9Os0k/zPlOD7yb WfRpZT2C0exmSEo1RjmsUhrcxWrTEpkz5j4REXU5E5rt0iNhhvVvw3sL6uO4jOOjZAfr MpjnsIS8ybOYo4VkOBfYEtrLwnxWbXVAQkW01J1Jz7iUYFwj7yodceHqeoZgKq4krcc1 1kLg== X-Received: by 10.152.179.42 with SMTP id dd10mr12724890lac.89.1438527560398; Sun, 02 Aug 2015 07:59:20 -0700 (PDT) Received: from opensuse.site (ppp91-76-6-204.pppoe.mtu-net.ru. [91.76.6.204]) by smtp.gmail.com with ESMTPSA id kv1sm2349310lbb.48.2015.08.02.07.59.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Aug 2015 07:59:19 -0700 (PDT) Date: Sun, 2 Aug 2015 17:59:16 +0300 From: Andrei Borzenkov To: Konstantin Svist Subject: Re: [bug #39591] grub-mkconfig fails on btrfs raid Message-ID: <20150802175916.6ef7f878@opensuse.site> In-Reply-To: <55BCE759.2050207@gmail.com> References: <20130728-152953.sv92027.21099@savannah.gnu.org> <20131014-163059.sv72589.4120@savannah.gnu.org> <20150731-000132.sv100554.82503@savannah.gnu.org> <20150731-070052.sv89796.59457@savannah.gnu.org> <20150731-071303.sv100554.6851@savannah.gnu.org> <20150801091252.1fe0b2bc@opensuse.site> <55BC6A28.8070908@gmail.com> <20150801110123.7108d9ce@opensuse.site> <55BCE759.2050207@gmail.com> X-Mailer: Claws Mail 3.11.0 (GTK+ 2.24.28; 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::236 Cc: Vladimir Serbinenko , grub-devel@gnu.org, Florian Scandella , bug-grub@gnu.org 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: Sun, 02 Aug 2015 14:59:29 -0000 =D0=92 Sat, 1 Aug 2015 08:35:53 -0700 Konstantin Svist =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > On 08/01/2015 01:01 AM, Andrei Borzenkov wrote: > > =D0=92 Fri, 31 Jul 2015 23:41:44 -0700 > > Konstantin Svist =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > > > >> On 07/31/2015 11:12 PM, Andrei Borzenkov wrote: > >>> [Adding grub-devel for wider discussion] > >>> > >>> =D0=92 Fri, 31 Jul 2015 07:13:03 +0000 > >>> Konstantin Svist =D0=BF=D0=B8=D1=88=D0=B5= =D1=82: > >>> > >>>> Follow-up Comment #3, bug #39591 (project grub): > >>>> > >>>> GRUB_DISABLE_LINUX_UUID=3Dtrue > >>>> > >>>> For some reason I preferred not using UUIDs when setting it up, can'= t remember > >>>> why exactly.. > >>>> > >>> Is it really possible to mount btrfs if only a single device is given= ? As I understand how multi-device btrfs works, to mount it you need to inf= orm kernel about all (or at least enough) components. Today this is normall= y done by scanning each device during boot, feeding it to kernel and asking= kernel "are there enough devices to attempt mount". This works only with U= UID due to the way it is implemented in user space (udev+systemd+dracut). > >>> > >>> Passing single individual device as root=3D will defeat this logic - = as soon as device is present user space will believe everything is OK and w= ill try to mount it and likely fails. > >>> > >>> IOW - multi-device btrfs must use UUID, at least until something is c= hanged in Linux boot device detection logic. > >>> > >>> So the only question for me is - should we fail grub-mkconfig in your= case or ignore GRUB_DISABLE_LINUX_UUID and continue? I tend to fail it wit= h clear message. > >>> > >> > >> Excerpt from > >> https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devi= ces: > >> > >> Once you create a multi-device filesystem, you can use any device in t= he > >> FS for the mount command: > >> > >> mkfs.btrfs /dev/sdb /dev/sdc /dev/sde > > At which point kernel of course knows all devices that are part of new > > filesystem. > > > >> mount /dev/sde /mnt > >> > > bor@opensuse:~/src/systemd> sudo ln -sf /dev/null /run/udev/rules.d/64-= btrfs.rules > > bor@opensuse:~/src/systemd> sudo rmmod btrfs > > rmmod: ERROR: Module btrfs is not currently loaded > > bor@opensuse:~/src/systemd> sudo losetup --show -f /tmp/loop0 > > /dev/loop0 > > bor@opensuse:~/src/systemd> sudo losetup --show -f /tmp/loop1 > > /dev/loop1 > > bor@opensuse:~/src/systemd> sudo blkid > > ... > > /dev/loop0: UUID=3D"9e0de080-b2a0-47a8-b9a0-5a3e12fedee2" UUID_SUB=3D"d= 6f072bb-ce32-4d7b-8cc3-31ef4d15a3d8" TYPE=3D"btrfs"=20 > > /dev/loop1: UUID=3D"9e0de080-b2a0-47a8-b9a0-5a3e12fedee2" UUID_SUB=3D"e= 2fb510e-56ed-4a2f-bce4-e53c1387c8b8" TYPE=3D"btrfs"=20 > > bor@opensuse:~/src/systemd> sudo mount -t btrfs /dev/loop0 /mnt > > mount: wrong fs type, bad option, bad superblock on /dev/loop0, > > missing codepage or helper program, or other error > > > > In some cases useful info is found in syslog - try > > dmesg | tail or so. > > bor@opensuse:~/src/systemd> sudo mount -t btrfs /dev/loop1 /mnt > > bor@opensuse:~/src/systemd>=20 > > > >> IOW, this is normal operation for Btrfs. Maybe not for other RAIDs... > >> > > Mounting multi-device btrfs requires explicit cooperation from user > > space. There is no magic kernel can use to know all other devices. > > >=20 >=20 > What about > https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices= #Device_scanning > ? What about it? You told initrd to wait for one device only; as soon as this device is present systemd will attempt to mount. If you are lucky and other devices had been scanned at this point, mount succeeds; if not, mount fails. This is inherent race condition. If using UUID, mount will be attempted only after enough devices have been seen. It all depends on initrd implementation, but we have no idea about it. So we should use conservative defaults.