growfs on a large disk

Josh Paetzel josh at tcbug.org
Fri Sep 24 17:06:59 UTC 2010


On Friday, September 24, 2010 05:23:46 am Dean Hamstead wrote:
> Evening,
> 
> Im trying to growfs a very large filesystem and not having a lot of luck.
> 
> To give some background, im running the filesystem on a raid array
> running on an areca raid card. I have an existing filesytem which was
> formatting /dev/da0 and mounting it. (I understand that this is the
> preferred alternative to the deprecated 'dangerously dedicated' mode).
> 
> I have expanded the disk array and the volume at the raid card level.
> Then rebooted my machine. It was 4x2tb, and is now 5x2tb. Expanding on
> areca is non-destructive.
> 
> Here is the current filesystem size when mounted, da0 is the
> 
> -----
> 
> [root at batou /home/dean]# df -h
> Filesystem    Size    Used   Avail Capacity  Mounted on
> /dev/ad4a     496M    280M    176M    61%    /
> devfs         1.0K    1.0K      0B   100%    /dev
> /dev/ad4e     496M    155M    301M    34%    /tmp
> /dev/ad4f      68G    8.0G     54G    13%    /usr
> /dev/ad4d     1.9G    529M    1.2G    30%    /var
> /dev/da1      4.4T    4.4T     28G    99%    /volumes/store2
> /dev/da0      5.3T    3.9T    1.4T    74%    /volumes/store1
> 
> -----
> 
>  From dmesg you can see that freebsd knows its now bigger (7.6 rather
> than 5.3tb)
> 
> -----
> 
> da0 at arcmsr0 bus 0 scbus0 target 0 lun 0
> da0: <Areca ARC-1261-VOL#00 R001> Fixed Direct Access SCSI-5 device
> da0: 166.666MB/s transfers (83.333MHz, offset 32, 16bit)
> da0: Command Queueing enabled
> da0: 7629394MB (15624998912 512 byte sectors: 255H 63S/T 972611C)
> da1 at arcmsr0 bus 0 scbus0 target 0 lun 1
> da1: <Areca ARC-1261-VOL#01 R001> Fixed Direct Access SCSI-5 device
> da1: 166.666MB/s transfers (83.333MHz, offset 32, 16bit)
> da1: Command Queueing enabled
> da1: 4768371MB (9765624320 512 byte sectors: 255H 63S/T 607881C)
> SMP: AP CPU #1 Launched!
> 
> -----
> 
> if we consult diskinfo, it agrees
> 
> -----
> 
> [root at batou /home/dean]# diskinfo -v /dev/da0
> /dev/da0
> 	512         	# sectorsize
> 	7999999442944	# mediasize in bytes (7.3T)
> 	15624998912 	# mediasize in sectors
> 	0           	# stripesize
> 	0           	# stripeoffset
> 	972611      	# Cylinders according to firmware.
> 	255         	# Heads according to firmware.
> 	63          	# Sectors according to firmware.
> 	0000001379342420	# Disk ident.
> 
> 
> -----
> 
> fdisk shows us...
> 
> -----
> 
> [root at batou /home/dean]# fdisk /dev/da0
> ******* Working on device /dev/da0 *******
> parameters extracted from in-core disklabel are:
> cylinders=972611 heads=255 sectors/track=63 (16065 blks/cyl)
> 
> Figures below won't work with BIOS for partitions not in cyl 1
> parameters to be used for BIOS calculations are:
> cylinders=972611 heads=255 sectors/track=63 (16065 blks/cyl)
> 
> fdisk: invalid fdisk partition table found
> 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 63, size 2740094532 (1337936 Meg), flag 80 (active)
> 	beg: cyl 0/ head 1/ sector 1;
> 	end: cyl 578/ head 254/ sector 63
> The data for partition 2 is:
> <UNUSED>
> The data for partition 3 is:
> <UNUSED>
> The data for partition 4 is:
> <UNUSED>
> 
> -----
> 
> now if i unmount /dev/da0 and run growfs /dev/da0 i get the following
> 
> -----
> 
> [root at batou /home/dean]# growfs /dev/da0
> growfs: we are not growing (2929687296->685024256)
> 
> 
> -----
> 
> with lots of googling, i have found that there is much talk in various
> freebsd forums about the need to use disklabel. however it seems unable
> to fathom such a large disk...
> 
> -----
> 
> [root at batou /home/dean]# disklabel /dev/da0
> disklabel: disks with more than 2^32-1 sectors are not supported
> 
> 
> ----
> 
> freebsd version is 8.0 64bit
> 
> -----
> 
> [root at batou /home/dean]# uname -a
> FreeBSD batou.fragfest.net.au 8.0-STABLE FreeBSD 8.0-STABLE #7: Sun Jan
> 24 17:13:52 EST 2010
> dean at batou.fragfest.net.au:/usr/obj/usr/src/sys/GENERIC  amd64
> 
> -----
> 
> hopefully i am doing something wrong, or there is a patch set for growfs?
> 
> 
> 
> Dean


I've run growfs on raw partitions, it's the easiest way to use growfs, as you 
don't need to worrk about expanding partitions or slices.

Sadly the last time I ran it was expanding a RAID array of 4 320 gig disks 
from RAID 10 to RAID 5, so from ~ 640 gigs to 960 gigs.

Not sure if you are running into a growfs limitation, you're certainly running 
into the limits of UFS with those sizes.  Have you considered ZFS?

At this point you can't put a bsdlabel on, as your filesystem probably 
encroaches on the area the label would need anyways.  Similarly the fdisk 
output is fairly meaningless, as you aren't using a fdisk partition.  To 
verify ls /dev/da0* should only show /dev/da0, if it shows slices that would 
be bad.

The man page for growfs mentions that some free space is needed in the first 
cylinder group to resize.  Perhaps that is the problem you are running in to.

-- 
Thanks,

Josh Paetzel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part.
Url : http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20100924/c413f94f/attachment.pgp


More information about the freebsd-fs mailing list