From owner-freebsd-stable@FreeBSD.ORG Sun Jun 13 14:25:04 2010 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 C68B61065672 for ; Sun, 13 Jun 2010 14:25:04 +0000 (UTC) (envelope-from ronald-freebsd8@klop.yi.org) Received: from fep27.mx.upcmail.net (fep27.mx.upcmail.net [62.179.121.47]) by mx1.freebsd.org (Postfix) with ESMTP id 3EC718FC0C for ; Sun, 13 Jun 2010 14:25:03 +0000 (UTC) Received: from edge02.upcmail.net ([192.168.13.237]) by viefep16-int.chello.at (InterMail vM.8.01.02.02 201-2260-120-106-20100312) with ESMTP id <20100613140933.UFIU26979.viefep16-int.chello.at@edge02.upcmail.net>; Sun, 13 Jun 2010 16:09:33 +0200 Received: from pinky ([212.83.93.41]) by edge02.upcmail.net with edge id VS9W1e0220tYspQ02S9YH6; Sun, 13 Jun 2010 16:09:33 +0200 X-SourceIP: 212.83.93.41 Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes To: freebsd-stable@freebsd.org, "Stephane Dupille" References: Date: Sun, 13 Jun 2010 16:09:28 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Ronald Klop" Message-ID: In-Reply-To: User-Agent: Opera Mail/10.53 (Win32) X-Cloudmark-Analysis: v=1.1 cv=KBHyIoyMIRH440NzHl6uMYpbxJngTLC2P1JzLC/QbPg= c=1 sm=0 a=wbKXeunVgZ0A:10 a=-e8MBd7zOhoA:10 a=kj9zAlcOel0A:10 a=nGB_3jjSAAAA:8 a=JKhYAVrd4HcP4Nm4W90A:9 a=jitEuP6NHeju55t2l-YA:7 a=tJ8t6kfekm-bxo5oERUFLJbleYIA:4 a=CjuIK1q_8ugA:10 a=2ldGmInd0scA:10 a=K6V_dgleeIz1-81w:21 a=NWxcwVl6_9QGD6bU:21 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Cc: Subject: Re: Resizing GPT partitions 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: Sun, 13 Jun 2010 14:25:04 -0000 On Tue, 08 Jun 2010 18:58:50 +0200, Stephane Dupille wrote: > Hello, > > I installed a FreeBSD 8.0-RELEASE into a virtual machine (with virtual > box), using a GTP partitioning scheme, and zfs. The virtual disk disk > is 10 Go. > > I dumped this disk image to a real machine, which has a 160 Go disk. > The system works fine, but I can only use 10 Go of disk space. How can > I gain more space ? > > How can I enlarge the last partition of the disk to use the whole disk ? > > I tried to create a new partition on the disk, and planned to add it > in the zfs pool, but that didn't work : > # gpart add -t freebsd-zfs -l disk0f ad0 > gpart: autofill: No space left on device > > That's odd, because it seems that gpart is aware of the new geometry. > > What's the problem ? > > > Some info : > > # gpart list > Geom name: ad0 > fwheads: 16 > fwsectors: 63 > last: 20971486 ^^^^^^^^^^^^^^ > first: 34 ^^^^^^^^^ > entries: 128 > scheme: GPT > Providers: > 1. Name: ad0p1 > Mediasize: 65536 (64K) > Sectorsize: 512 > Mode: r0w0e0 > rawtype: 83bd6b9d-7f41-11dc-be0b-001560b84f0f > label: (null) > length: 65536 > offset: 17408 > type: freebsd-boot > index: 1 > end: 161 > start: 34 > 2. Name: ad0p2 > Mediasize: 4294967296 (4.0G) > Sectorsize: 512 > Mode: r1w1e1 > rawtype: 516e7cb5-6ecf-11d6-8ff8-00022d09712b > label: swap0 > length: 4294967296 > offset: 82944 > type: freebsd-swap > index: 2 > end: 8388769 > start: 162 > 3. Name: ad0p3 > Mediasize: 6442351104 (6.0G) > Sectorsize: 512 > Mode: r1w1e2 > rawtype: 516e7cba-6ecf-11d6-8ff8-00022d09712b > label: disk0 > length: 6442351104 > offset: 4295050240 > type: freebsd-zfs > index: 3 > end: 20971486 ^^^^^^^^^^^^^ > start: 8388770 > Consumers: > 1. Name: ad0 > Mediasize: 160041885696 (149G) > Sectorsize: 512 > > > # fdisk ad0 > ******* Working on device /dev/ad0 ******* > parameters extracted from in-core disklabel are: > cylinders=310101 heads=16 sectors/track=63 (1008 blks/cyl) > > Figures below won't work with BIOS for partitions not in cyl 1 > parameters to be used for BIOS calculations are: > cylinders=310101 heads=16 sectors/track=63 (1008 blks/cyl) > > Media sector size is 512 > Warning: BIOS sector numbering starts with sector 1 > Information from DOS bootblock is: > The data for partition 1 is: > sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD) > start 20971487, size 291610321 (142387 Meg), flag 80 (active) > beg: cyl 1023/ head 255/ sector 63; > end: cyl 1023/ head 80/ sector 63 > The data for partition 2 is: > sysid 0 (0000),(unused) > start 162, size 8388608 (4096 Meg), flag 0 > beg: cyl 0/ head 2/ sector 37; > end: cyl 522/ head 45/ sector 5 > The data for partition 3 is: > sysid 0 (0000),(unused) > start 8388770, size 12582717 (6143 Meg), flag 0 > beg: cyl 522/ head 45/ sector 6; > end: cyl 1023/ head 105/ sector 47 > The data for partition 4 is: > As far as I see in you 'gpart list' gpart doesn't see the new geometry. See the ^^^^^^ lines above. Ronald.