From owner-freebsd-stable@FreeBSD.ORG Tue Jun 8 17:14:17 2010 Return-Path: Delivered-To: stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 802791065670 for ; Tue, 8 Jun 2010 17:14:17 +0000 (UTC) (envelope-from sdupille@nospam.fr.eu.org) Received: from mail.nospam.fr.eu.org (galadriel.nospam.fr.eu.org [88.191.16.109]) by mx1.freebsd.org (Postfix) with ESMTP id 498848FC0A for ; Tue, 8 Jun 2010 17:14:16 +0000 (UTC) Received: from galadriel.nospam.fr.eu.org (localhost [127.0.0.1]) (Authenticated sender: dust) by mail.nospam.fr.eu.org (Postfix) with ESMTP id 0EB1A440815 for ; Tue, 8 Jun 2010 18:58:50 +0200 (CEST) From: Stephane Dupille To: stable@freebsd.org Organization: Home Mail-copies-to: never Date: Tue, 08 Jun 2010 18:58:50 +0200 Message-ID: User-Agent: Gnus/5.090024 (Oort Gnus v0.24) Emacs/22.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Subject: 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: Tue, 08 Jun 2010 17:14:17 -0000 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: