Received: from list by lists.gnu.org with archive (Exim 4.71) id 1grot9-0000fT-BT for mharc-grub-devel@gnu.org; Thu, 07 Feb 2019 13:59:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46424) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1grot6-0000dH-Td for grub-devel@gnu.org; Thu, 07 Feb 2019 13:59:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1grot5-0006sI-Pb for grub-devel@gnu.org; Thu, 07 Feb 2019 13:59:04 -0500 Received: from smtp1.wiktel.com ([2600:2600::151]:39138) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1grot5-0006iv-D5 for grub-devel@gnu.org; Thu, 07 Feb 2019 13:59:03 -0500 Received: from [172.16.0.114] (thief-pool2-122-35.mncable.net [24.225.122.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp1.wiktel.com (Postfix) with ESMTPSA id 43wSJm4xzVzxRW for ; Thu, 7 Feb 2019 12:58:48 -0600 (CST) Subject: Re: [PATCH] ZFS: Ignore replacing-* devices To: grub-devel@gnu.org References: <20190206113928.ivp4yrdhtq7i6cdq@tomti.i.net-space.pl> From: Richard Laager Openpgp: preference=signencrypt Autocrypt: addr=rlaager@wiktel.com; prefer-encrypt=mutual; keydata= xsBNBFRQXTYBCADZlVeXs6zJj+rFMWC6cq1wj3W0ggjG+r2rIU7f3vtW4MjAMFczey4Y/2zb EbFBDIWKEXhTpKvW/PRe2l2Hprq/3QoZP239a49SkANgwNknBqtObBRRcOm6Y+8iFdt4Ftw+ ox3ouT//rbYXEeYJeyXDkFYIykN0G+fHl//OmyRHoS+n07g4vt9hTN4w1oDayHkduamkV5kL DIKIERJr/3f+CBeRC3Hh1m2lVGkIqE91w8IAyV9xLyNou6w/ZPnGXZ6QkIMa3Z6DiMvGOL6d GMLMBp2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1Qyj/25kic2Dk8cXy4xmSuvSIYfGGPNA1hpwyupehdT/5q5jAyXxFyTCZcInuTNTKAZm1m05 cg4k9MRkNiCdSrcUUu1ijqPhVNGPjoAZ6zyDqxd6kTlOjqlM5mrAjFVzw7GT5L09ZqM49PYp tSwgh4YqSJrVd9Y0J4w5ABEBAAHCwGUEGAEIAA8FAlRQX4ICGwwFCQm7swAACgkQD/0yx1UX 4lJ1Xgf9FF+IkQkr5CdBleDJLgpjD7mEAmGSq1k4VWu1Kkdy0Jl7AZK5vR+PG9GMkxOJTGv5 wLoJC+wUPwskoZsWRo1NPrzExsM3WDxLr+sfEO+lhzdQ3XoXfdGn/5qDXz73XkI0w04V5DNN ftE69iK3cQXLuJT2iIkBpOuVSIjvzrSzuzudFHlbi8Nk7lHZqP/nZtG0/uF9AEMCr90kzTPr Chrw812eEt6yUzzFVf2qYbM2mT+jubPe/hRSQc79FeCr5V7Kl9qy04FTL6y6RhK1TuZlTO+P H+VfyYxdD6SDIf4EMwlL6hXBQvecmHzS5GDpfSsbVGX3hnuUl6cCH38HzmlKvg== Message-ID: Date: Thu, 7 Feb 2019 12:58:48 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190206113928.ivp4yrdhtq7i6cdq@tomti.i.net-space.pl> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-bounce-key: wiktel.com-1; rlaager@wiktel.com; 1549565928; /qABGo1YwipaV8h7VNK1Fw1soiI; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=wiktel.com; h=subject:to :references:from:message-id:date:mime-version:in-reply-to :content-type:content-transfer-encoding; s=wiktel1; bh=z6GPsk7v6 3vpYYVJ4am6ZI3PQ3yt/YpXLpxOHI9LfBM=; b=w91a3LU7XOvIKTdNrbI4rD2Zo 8mqKaK6S1JWeOH3GnU3m5Ye/Lv4FvwvOsy74HrKnubih67wieKFIdY+baj2OClO6 W8rgOUpGmCou48UuaUXO7Ps7Nj6UpIHL+nfcJZnvqo+KhBxb9NBHQFG3qE4dsmJF WemjKEo21cb1YqwB7xsdl6rFFUdmHm45MHIqs2FSSmIZ1tg8B0iDrnBMsssX909O BWuMJE/y58X2pKVtJRh5KuQdnU9L8v/oF29nRNDhua9jvHov/qzB9WQI0NIFbR0y Qxf0wPGGp37V7mpAyQx/aGECZX9U46IrZk/YQs+8/U9yk0Ola8UeHJY5rEUfA== X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2600:2600::151 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2019 18:59:06 -0000 On 2/6/19 5:39 AM, Daniel Kiper wrote: > On Sat, Feb 02, 2019 at 05:06:39PM -0600, Richard Laager wrote: >> I submitted this patch to Ubuntu some time ago, but apparently never >> submitted it directly to the GRUB project. >> >> I have copied the information from my Ubuntu bug report (including >> attachments) into this email. If you wish to see the original bug >> report, it is available here: >> https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1639209: >> >> Replace a drive in a pool. >> zpool replace grape1 sdg1 sdf1 >> >> Note that this creates a replacing-0 line in the zpool status output: >> >> root@grape:~# zpool status >> pool: grape1 >> state: ONLINE >> status: One or more devices is currently being resilvered. The pool will >> continue to function, possibly in a degraded state. >> action: Wait for the resilver to complete. >> scan: resilver in progress since Fri Nov 4 04:58:55 2016 >> 37.4G scanned out of 4.06T at 17.6M/s, 66h42m to go >> 5.26G resilvered, 0.90% done >> config: >> >> NAME STATE READ WRITE CKSUM >> grape1 ONLINE 0 0 0 >> raidz3-0 ONLINE 0 0 0 >> replacing-0 ONLINE 0 0 0 >> sdg1 ONLINE 0 0 0 >> sdf1 ONLINE 0 0 0 (resilvering) >> sdd1 ONLINE 0 0 0 >> sdc1 ONLINE 0 0 0 >> sdb1 ONLINE 0 0 0 >> sdh1 ONLINE 0 0 0 >> sde1 ONLINE 0 0 0 >> sda1 ONLINE 0 0 0 >> >> errors: No known data errors >> >> Then try to install GRUB to that drive: >> >> root@grape:~# grub-install /dev/sdf >> Installing for i386-pc platform. >> grub-install: error: failed to get canonical path of `/dev/replacing-0'. >> >> The attached patch fixes this. >> >> Unfortunately, then I get this: >> >> root@grape:~# grub-install /dev/sdf >> Installing for i386-pc platform. >> grub-install: error: unknown filesystem. > > So, AIUI this patch does not solve the problem or just does it partially. > Should not we update the docs instead and say that grub-install should > be called when resilvering is finished? In any event, the replacing-0 line is not a block device (just as raidz lines are not a block device) and needs to be excluded, so the patch is fully correct in that sense. How much more is necessary is another question. I haven't re-tested this recently, as it would require me to setup a pool and get it into a resilvering state. One option would be to exclude devices that are involved in the replacement operation. That would be those devices indented under it: sdg1 and sdf1 in my example. In the case where the pool has redundancy, this is a great option. It skips both the disk that has failed / is failing and the new disk. However, if you have a single-disk pool, that's not going to be a good thing. However, my notes in the Ubuntu bug report say that the grub-install still failed even with this patch. The extended debug logs say, "zfs detection failed", but it's not at all clear why. It certainly would be safer and easier to simply declare that you should not grub-install while the pool is rebuilding. That's not great if the pool takes a non-trivial amount of time to rebuild. That said, for the separate reason that GRUB's ZFS support does not support the latest ZFS feature flags in ZFS-on-Linux, I expect I'm going to start suggesting (in the Ubuntu & Debian root-on-ZFS HOWTOs) that users make a separate, small pool for /boot. That would make rebuild times for that pool trivial. -- Richard