From owner-freebsd-stable@FreeBSD.ORG Thu Mar 15 12:53:46 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE0061065670 for ; Thu, 15 Mar 2012 12:53:46 +0000 (UTC) (envelope-from daniel@digsys.bg) Received: from smtp-sofia.digsys.bg (smtp-sofia.digsys.bg [193.68.3.230]) by mx1.freebsd.org (Postfix) with ESMTP id 5D48D8FC0C for ; Thu, 15 Mar 2012 12:53:45 +0000 (UTC) Received: from dcave.digsys.bg (dcave.digsys.bg [192.92.129.5]) (authenticated bits=0) by smtp-sofia.digsys.bg (8.14.5/8.14.5) with ESMTP id q2FCeSnn064634 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Thu, 15 Mar 2012 14:40:34 +0200 (EET) (envelope-from daniel@digsys.bg) Message-ID: <4F61E33C.1070506@digsys.bg> Date: Thu, 15 Mar 2012 14:40:28 +0200 From: Daniel Kalchev User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:10.0.2) Gecko/20120228 Thunderbird/10.0.2 MIME-Version: 1.0 To: freebsd-stable@freebsd.org References: <4F61D9F0.6000005@eng.auth.gr> In-Reply-To: <4F61D9F0.6000005@eng.auth.gr> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: grow zpool on a mirror setup X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2012 12:53:47 -0000 On 15.03.12 14:00, George Mamalakis wrote: > Hello everybody, > > I have asked the same question in the freebsd forums, but had no luck. > Apart of this, there might be a bug somewhere, so I re-ask the > question to this list. Here how it goes (three posts): > > post 1: > > "I am experimenting with one installation of FreeBSD-9-STABLE/amd64 on > a VirtualBox that is using gptzfsboot on a raid-1 (mirrored) zfs pool. > My problem is that I need to grow the filesystem size of zfs > partitions. I followed this guide > (http://support.freenas.org/ticket/342), > which is for FreeNAS, and encountered a few problems. > You are using FreeBSD 9, while you follow instructions for FreeNAS. The ZFS version support in FreeNAS is way behind that in FreeBSD 9. In particular, ZFS v28, which is in FreeBSD 9 supports the autoexpand property, that does not require export/import of the pool. You mentioned you did use autoexpand, but perhaps didn't really 'expand' the zpool vdevs. > > "Since nobody has an answer that far, let me ask another thing. > Instead of deleting ada0p2 and ada1p2, and then recreating them from > the same starting block but with a grater size, could I have just > created two new filesystems (ada0p3 and ada1p3), and having them added > in the pool as a new mirror? Because if that's the case, then I could > try that out, since it seems to have the same result. > The proper way to expand an zpool is by replacing each underlying storage device with a larger one. Replacing is the key word here. ZFS will not care if the same device suddenly became larger (if I am not mistaken). So, to expand your zpool you have basically two options: 1. Detach one of the mirror members, make sure you clear ZFS metadata from the beginning and the end of the partition, recreate your partitions with larger sizes, then attach to the mirror. After resilvering and possibly verifying with scrub that you are not losing data, repeat with the other mirror member. If you have autoexpand=yes set, your zpool should grow. 2. If you can add more devices, then add a larger size device to the mirror. Or if you can, add two new larger devices to the mirror. After completing this, remove the old, smaller mirror members. As with the other option, your zpool should grow. Do not add another mirror to the zpool, if you want to remove the old devices. Doing so will create second vdev in the zpool and will spread data over both (raid0 or stripe). Current versions of ZFS cannot remove vdevs from an zpool so in order to remove the smaller devices, you will have to backup, recreate the zpool and restore data. Daniel