From owner-freebsd-current@FreeBSD.ORG Wed Sep 7 15:41:14 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 2CCE61065670 for ; Wed, 7 Sep 2011 15:41:14 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from [127.0.0.1] (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 666ED151C15 for ; Wed, 7 Sep 2011 15:41:11 +0000 (UTC) Message-ID: <4E679063.5020700@FreeBSD.org> Date: Wed, 07 Sep 2011 19:40:19 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.17) Gecko/20110429 Thunderbird/3.1.10 MIME-Version: 1.0 To: freebsd-current@freebsd.org References: In-Reply-To: X-Enigmail-Version: 1.1.2 OpenPGP: id=10C8A17A Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig89732A4E1B6E2BF9D3644066" Subject: Re: 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 15:41:14 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig89732A4E1B6E2BF9D3644066 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On 07.09.2011 04:21, Mikael Fridh wrote: > Hi gurus, >=20 > 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 >=20 > When resizing a partition, on first attempt it uses up the whole disk. > Only on second attempt it resizes to the correct target size. >=20 > 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. >=20 > I'm wondering if anyone else can reproduce. I can't reproduce. # dd if=3D/dev/zero of=3D./disk count=3D1 seek=3D3907029167 1+0 records in 1+0 records out 512 bytes transferred in 0.000116 secs (4409617 bytes/sec) # mdconfig -f disk md0 # gpart create -s gpt md0 md0 created # gpart add -t freebsd-boot -b 64 -s 128 md0 md0p1 added # gpart add -t freebsd-swap -s 8388608 md0 md0p2 added # gpart show md0 =3D> 34 3907029101 md0 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) # gpart resize -i 2 -s 33554432 md0 md0p2 resized # gpart show md0 =3D> 34 3907029101 md0 GPT (1.8T) 34 30 - free - (15k) 64 128 1 freebsd-boot (64k) 192 33554432 2 freebsd-swap (16G) 33554624 3873474511 - free - (1.8T) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D So, can you enable G_F_CTLDUMP flag and try it again, and show what you will get? Just use: # sysctl kern.geom.debugflags=3D0x80 # gpart resize -i 2 -s 33554432 md0 On the console (and in the log files) will be printed some info. --=20 WBR, Andrey V. Elsukov --------------enig89732A4E1B6E2BF9D3644066 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iQEcBAEBAgAGBQJOZ5BqAAoJEAHF6gQQyKF6JLUH/if444OQFc9a1Gr+FwLjAPan 5PAFxQ5qe4ufgmIMLbpBehl8SxNmHCWVEMv/FukHXcQCZvJDzoASCGb83oOAXqCb YaWBMKUyg4lE03zsUGTpB4wT7JTgJOfmEwCOnBUvQvohevjZ8Qi9hjOTNffrvBr7 LWHIoeti1Na0kCVi6HCsHSso2l1mqPrq4a81OEaFu+ttgtdXFJon5O2L9ixu94Sv f0NjN0ChF4DzG6fUo2KDw2hsQ+epuozRBxv8AZIHl20gukqNrgLFtZUNo7FzyE5r Sn39dxUwypRAXe1rCdqgfangUmCepzIua2XcQZbQS0cEofvbwQN15IGPtryQsqc= =/JWh -----END PGP SIGNATURE----- --------------enig89732A4E1B6E2BF9D3644066--