

This gets rid of the headroom you left at the end of the (new) partition: growfs. You'd probably want to unmount additional partitions at this step too, especially if you move other partitions around (in fact, in this case you have to unmount these). Unlike before, at this step you choose your exact target size. Overshooting more means more headroom, but usually also means more relocations and thus longer wait time. if you want to go down from a 100GB partition to a 70GB one, resize the FS to about 60-65GB at this step. Make sure that you choose a size less than your new target filesystem size, i.e.

For FreeBSD, this is as easy as issuing growfs with being the partition that you resized.įor shrinking, you have to do these steps in reverse: You'd probably want to unmount all partitions that are not actively needed to run a minimal system, most notably the swap partition.įrom your question, I assume you know how to use gpart to accomplish this.Īfter having made the adjustments, you can safely remount all partitions and re-enable swap. Be very careful with this step, as messing up here can lead to corrupting your entire disk. Growing a filesytem basically boils down to this:Īdjust your partition table. Also remember to check up on your bootloader.

However, changing the partitions around mounted filesystems might lead to data loss or inconsistencies which might be first discovered when the system tries to boot the next time. For UFS (the default for FreeBSD), you can grow online from kernel version 10.0 onward. There's a fairly comprehensive guide to growing a disk under FreeBSD in the handbook.
