From owner-freebsd-fs@FreeBSD.ORG Sat Apr 25 10:53:04 2015 Return-Path: Delivered-To: fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 932DC26F for ; Sat, 25 Apr 2015 10:53:04 +0000 (UTC) Received: from smtp.digiware.nl (unknown [IPv6:2001:4cb8:90:ffff::3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5675111BD for ; Sat, 25 Apr 2015 10:53:04 +0000 (UTC) Received: from rack1.digiware.nl (unknown [127.0.0.1]) by smtp.digiware.nl (Postfix) with ESMTP id B16F916A47A; Sat, 25 Apr 2015 12:52:59 +0200 (CEST) X-Virus-Scanned: amavisd-new at digiware.nl Received: from smtp.digiware.nl ([127.0.0.1]) by rack1.digiware.nl (rack1.digiware.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hNHjnX47Hs5T; Sat, 25 Apr 2015 12:52:50 +0200 (CEST) Received: from [IPv6:2001:4cb8:3:1:9d5b:6fac:30b6:fba1] (unknown [IPv6:2001:4cb8:3:1:9d5b:6fac:30b6:fba1]) by smtp.digiware.nl (Postfix) with ESMTPA id 0FB2B16A46F; Sat, 25 Apr 2015 12:52:50 +0200 (CEST) Message-ID: <553B7200.7090002@digiware.nl> Date: Sat, 25 Apr 2015 12:52:48 +0200 From: Willem Jan Withagen User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: "Andrey V. Elsukov" , fs@freebsd.org Subject: Re: resampeling of a ZVOL that has been resized References: <55381127.4090603@digiware.nl> <5539B0C4.6070000@yandex.ru> In-Reply-To: <5539B0C4.6070000@yandex.ru> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Apr 2015 10:53:04 -0000 On 24/04/2015 04:56, Andrey V. Elsukov wrote: > On 23.04.2015 00:22, Willem Jan Withagen wrote: >> Now the question: >> How can I get GEOM to resample the zvol, and have it really detect that >> the disk has changed.... It sort of does, but not enough to actually >> allow it to grow to the new size. > > You need to read dmesg, where you will find the message: > GEOM_PART: zvol/zfsdata/vol was automatically resized. > Use `gpart commit zvol/zfsdata/vol` to save changes or > `gpart undo zvol/zfsdata/vol` to revert them. > This does not really resolve the issue. after growing the volume in ZFS, the new size is reported in ' gpart show': freetest# gpart show zvol/zfsdata/vol => 40 209715120 zvol/zfsdata/vol GPT (200G) 40 8 - free - (4.0K) 48 209715104 1 freebsd-ufs (100G) 209715152 8 - free - (4.0K) However the free space at the end stays at a mere 4.0K, not allowing gpart resize to take any value other than less than 100G, effectively shrinking the partition. And there is no incantation of any of commit, recover, etc... to get gpart to actually do "the right thing" When I did this on a VMware VM, gpart show reported the volume as [CORRUPTED] and gpart recover fixed that. Supposedly the backup blocks were at the wrong place in the grown disk and recover again placed them at the end. But the ZFS case does not go into the [CORRUPTED] state. Perhaps that is due to also missing the message that you suggest that can be found in dmesg after resizing the ZVOL. And thus a recover is not needed, nor dies issueing it fix anything. Now after a reboot the bootup log tells: GEOM: zvol/zfsdata/vol: the secondary GPT header is not in the last LBA. And now gpart report as expected: => 40 209715120 zvol/zfsdata/vol GPT (200G) [CORRUPT] 40 8 - free - (4.0K) 48 209715104 1 freebsd-ufs (100G) 209715152 8 - free - (4.0K) gpart recover sets the free space to 100G: => 40 419430320 zvol/zfsdata/vol GPT (200G) 40 8 - free - (4.0K) 48 209715104 1 freebsd-ufs (100G) 209715152 209715208 - free - (100G) And from now on I can resize the partition 1 to 200G... So it seems that although gpart understands that the ZVOL volume has grown, it does not take it far enough and set it to CORRUPTED and then let the user correct/grow it. --WjW