FreeBSD 9.0 BETA2 gpart resize -s uses whole disk on first resize

Andrey V. Elsukov ae at FreeBSD.org
Wed Sep 7 15:41:14 UTC 2011


On 07.09.2011 04:21, Mikael Fridh wrote:
> Hi gurus,
> 
> FreeBSD freebsd9.mg8.tmtowtdi.se 9.0-BETA2 FreeBSD 9.0-BETA2 #0: Wed
> Aug 31 18:07:44 UTC 2011
> root at 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 can't reproduce.

# dd if=/dev/zero of=./disk count=1 seek=3907029167
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
=>        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
=>        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)
===================================================

So, can you enable G_F_CTLDUMP flag and try it again, and show what you
will get?
Just use:
# sysctl kern.geom.debugflags=0x80
# gpart resize -i 2 -s 33554432 md0

On the console (and in the log files) will be printed some info.

-- 
WBR, Andrey V. Elsukov

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20110907/6ec40c13/signature.pgp


More information about the freebsd-current mailing list