From owner-freebsd-current@FreeBSD.ORG Wed Sep 7 00:44:54 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6768D106566C; Wed, 7 Sep 2011 00:44:54 +0000 (UTC) (envelope-from frimik@gmail.com) Received: from mail-vw0-f44.google.com (mail-vw0-f44.google.com [209.85.212.44]) by mx1.freebsd.org (Postfix) with ESMTP id 09AA58FC14; Wed, 7 Sep 2011 00:44:53 +0000 (UTC) Received: by vws12 with SMTP id 12so8362939vws.17 for ; Tue, 06 Sep 2011 17:44:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=Xr9CbFvmbI5xsSzHhDURotWCemKFd3X4jQG9M0IyGzo=; b=dQMQyxjJeEKw+bKy+2Z/NbytCLyviWOgfDlaXMRoLrNgKEZUDF3+FANTEZ808P5IcG 4FnecDb1Y7i9Ws341ID3ZuD04ZS9K/jIbY6mxgiAKee1HbPr+09CKOs1FypbRNE0CDII qK7vmZ65Uz+a0c72Xmqh39m2jILQ5t/JgWHRY= MIME-Version: 1.0 Received: by 10.52.115.199 with SMTP id jq7mr5923675vdb.232.1315354886306; Tue, 06 Sep 2011 17:21:26 -0700 (PDT) Received: by 10.52.160.166 with HTTP; Tue, 6 Sep 2011 17:21:26 -0700 (PDT) Date: Wed, 7 Sep 2011 02:21:26 +0200 Message-ID: From: Mikael Fridh To: freebsd-current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: marcel@freebsd.org Subject: FreeBSD 9.0 BETA2 gpart resize -s uses whole disk on first resize X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Sep 2011 00:44:54 -0000 Hi gurus, FreeBSD freebsd9.mg8.tmtowtdi.se 9.0-BETA2 FreeBSD 9.0-BETA2 #0: Wed Aug 31 18:07:44 UTC 2011 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 When resizing a partition, on first attempt it uses up the whole disk. Only on second attempt it resizes to the correct target size. Resizing from any smaller size to a larger size initially uses up the whole disk, like if -s was not used at all even if it's as little as one logical disk block. I'm wondering if anyone else can reproduce. I just tried to perform the same on an old 8.2-STABLE machine and it did not behave the same. Growing a partition worked fine on initial attempts. See excerpt from session below: freebsd9# gpart show ada0 => 34 3907029101 ada0 GPT (1.8T) 34 30 - free - (15k) 64 128 1 freebsd-boot (64k) 192 8388608 2 freebsd-swap (4.0G) 8388800 3898640335 - free - (1.8T) freebsd9# expr 8388608 \* 4 33554432 freebsd9# gpart resize -i 2 -s 33554432 ada0 ada0p2 resized freebsd9# gpart show ada0 => 34 3907029101 ada0 GPT (1.8T) 34 30 - free - (15k) 64 128 1 freebsd-boot (64k) 192 3907028936 2 freebsd-swap (1.8T) 3907029128 7 - free - (3.5k) freebsd9# gpart resize -i 2 -s 33554432 ada0 ada0p2 resized freebsd9# gpart show ada0 => 34 3907029101 ada0 GPT (1.8T) 34 30 - free - (15k) 64 128 1 freebsd-boot (64k) 192 33554432 2 freebsd-swap (16G) 33554624 3873474511 - free - (1.8T)