Expand partition size after a raid array increase

Dan Nelson dnelson at allantgroup.com
Wed Nov 13 18:20:28 UTC 2013

In the last episode (Nov 13), Joseph Mays said:
> I have a freebsd box with an LSI Raid controller in it. It had 4
> 3-terabyte drives configured in an 8TB array.  I added a 5th drive and
> built that into the array.  Of course, the amount of drive space that
> shows in operation in FreeBSD did not change, presumably because I need to
> resize the partition.
> I was trying to follow the partition resizing instructions shown here ---
> http://www.unibia.com/unibianet/freebsd/resize-your-existing-freebsd-root-partitionslice-safely-without-re-installing
> but when I do the "gpart show" I don't see the free space. What I do see
> is a change in the apparent overall size of the disk and a set of
> parititions that don't add up to the new size of the disk.
> How should I be going about increasing the size of the partition?
> root at warehouse:/root # gpart show mfid0
> =>         34  17578327997  mfid0  GPT  (10T) [CORRUPT]
>            34          128      1  freebsd-boot  (64k)
>           162   1048576000      2  freebsd-ufs  (500G)
>    1048576162  16521363328      4  freebsd-ufs  (7.7T)
>   17569939490      8388540      3  freebsd-swap  (4G)
>   17578328030            1         - free -  (512B)

Your GPT partition table is showing up as corrupt.  Is there anything in
dmesg about that?  Maybe your device has grown, and you just need to repair
the GPT partition (gpart recover mfid0) to reflect the larger size.  Also,
try running "diskinfo -v mfid0" and see whether that shows the new size.

Note that the instructions you linked to use MBR and BSD disklabels instead
of GPT; neither MBR or BSD store the device size or store metadata at the
end of the device, so if their provider grows, they can immediately take
advantage of the new space.  GPT stores a backup copy on the last sector,
and refers to that location in the primary copy, so you always have to fixup
your GPT every time you resize a device.

	Dan Nelson
	dnelson at allantgroup.com

More information about the freebsd-questions mailing list