Re: Resizing GPT partitions
There is a good software can solve your problem--Partition Manager. You needn't worry about anything wrong at all; it can help you easily http://www.extend-partition.com/help/how-to-resize-partition.html resize partition without data loss. And I want to tell you, this software is free for use. So, I think this is your best choice. -- View this message in context: http://old.nabble.com/Resizing-GPT-partitions-tp28820639p29488441.html Sent from the freebsd-stable mailing list archive at Nabble.com. ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org
Re: Resizing GPT partitions
On Tue, 08 Jun 2010 18:58:50 +0200, Stephane Dupille steph...@dupille.org 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 (),(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 (),(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: UNUSED As far as I see in you 'gpart list' gpart doesn't see the new geometry. See the ^^ lines above. Ronald. ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org
Re: Resizing GPT partitions
Andrey V. Elsukov bu7c...@yandex.ru écrit : I have plan to add `gpart recover` feature in near future. I've seen that. It seems to me that's a good idea. It needs in kernel support too. You can try to download snapshot of livefs CD of 9.0-CURRENT and use it. http://pub.allbsd.org/FreeBSD-snapshots/ Well, it's becoming too complicated for me. I'll try another approach : installaing the system in the swap partition, boot on that, make the other partition, install the system, boot on the right partition, delete the first one and use it as a real swap. Thanks for your help ! regards, SD ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org
Re: Resizing GPT partitions
Andrey V. Elsukov bu7c...@yandex.ru écrit : Hi, Stephane Dupille wrote: Currently there is no easy way to do it. GPT holds information about first and last usable sectors. You can see them in your output: last: 20971486 first: 34 I had the opportunity to boot that machine from network (a linux), and parted fix GPT tables correctly. Now, I have in FreeBSD the right last usable sector : last: 312581774 first: 34 And dmesg does not say anymore that the secondary GPT table is corrupt or invalid. (yeah, one problem fixed) Unfortunatly, parted does not allow me to resize the last partition because it does not know the type of the partition. You can look at freebsd-geom's mail list archive. There was a topic OCE and GPT with similar problem. Yep, seen it. I applied your patch to resize partition, but I didn't manage to use it correctly. # cd /usr/src # patch /root/patch # cd sbin/geom/class/part/ # make # make install Did I applied the patch correctly ? It seems not working : # gpart resize -i 3 ad0 gpart: param 'size': Invalid argument Thanks for your reply. ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org
Re: Resizing GPT partitions
Stephane Dupille wrote: And dmesg does not say anymore that the secondary GPT table is corrupt or invalid. I have plan to add `gpart recover` feature in near future. Yep, seen it. I applied your patch to resize partition, but I didn't manage to use it correctly. # cd /usr/src # patch /root/patch # cd sbin/geom/class/part/ # make # make install Did I applied the patch correctly ? It seems not working : # gpart resize -i 3 ad0 gpart: param 'size': Invalid argument It needs in kernel support too. You can try to download snapshot of livefs CD of 9.0-CURRENT and use it. http://pub.allbsd.org/FreeBSD-snapshots/ -- WBR, Andrey V. Elsukov signature.asc Description: OpenPGP digital signature
Re: Resizing GPT partitions
Stephane Dupille wrote: 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. Currently there is no easy way to do it. GPT holds information about first and last usable sectors. You can see them in your output: last: 20971486 first: 34 You can look at freebsd-geom's mail list archive. There was a topic OCE and GPT with similar problem. -- WBR, Andrey V. Elsukov signature.asc Description: OpenPGP digital signature