From owner-freebsd-questions@FreeBSD.ORG Sat Nov 8 14:06:48 2014 Return-Path: Delivered-To: freebsd-questions@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 AFA1728D for ; Sat, 8 Nov 2014 14:06:48 +0000 (UTC) Received: from blue.qeng-ho.org (blue.qeng-ho.org [217.155.128.241]) (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 49BDC30A for ; Sat, 8 Nov 2014 14:06:47 +0000 (UTC) Received: from arthur.home.qeng-ho.org (arthur.home.qeng-ho.org [172.23.1.2]) by fileserver.home.qeng-ho.org (8.14.7/8.14.5) with ESMTP id sA8E6hZq010657; Sat, 8 Nov 2014 14:06:44 GMT (envelope-from freebsd@qeng-ho.org) Message-ID: <545E2373.8060807@qeng-ho.org> Date: Sat, 08 Nov 2014 14:06:43 +0000 From: Arthur Chance User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Coert , freeBSD Subject: Re: shrinking of FreeBSD root partition on GPT References: <1478337.iqUxg28tON@penguin> In-Reply-To: <1478337.iqUxg28tON@penguin> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 14:06:48 -0000 On 08/11/2014 10:58, Coert wrote: > Hello all! > > Just installed FreeBSD on my home server, (used to be linux) > > When I did the installation, I used the installer defaults, and it gave me the > following: > gpart show ada0 > => 34 488397101 ada0 GPT (233G) > 34 128 1 freebsd-boot (64K) > 162 480247680 2 freebsd-ufs (229G) > 480247842 8149292 3 freebsd-swap (3.9G) > 488397134 1 - free - (512B) > > I would like to shrink my root partition, (GPT partition 2). > After reading through the handbook, I can adapt to shrinking instead of > growing, > > What I am going to try is: > 1. Boot from LiveCD > 2. do a dump -0 of the current root partition > 3. delete the root GPT partition, and create a new smaller GPT partition. > 4.do a newfs on the new slice, and restore the dump. > > Do I need to restore any bootcode after this? I read about bsdlabel, but that > seems to be only for MBR scheme? > > Will this work? or did i miss a step? The two levels of bootcode are in the PMBR and partition 1, so resizing partition 2 shouldn't affect it. You can always use gpart bootcode to reinstall if you're worried. > When that is done, I will create a freebsd-zfs partition in the freed space on > the disk. (Will rather still keep freebsd root on UFS) If you don't delete the swap partition and recreate it immediately after the shrunken root partition you're going to be creating a GPT table that's out of order with respect to partition locations. I have absolutely no idea whether this is legitimate, but even if it is I wouldn't personally risk it as you can't guarantee all software will allow for it. On a slightly different subject, are you using GPT partition labels? If not, it might be worth reading Warren Block's excellent article about them here http://www.wonkity.com/~wblock/docs/html/labels.html