FreeBSD

From indicium
Jump to navigation Jump to search

Enlarging disk space

For full reference: https://docs.freebsd.org/en/books/handbook/disks/#disks-growing

Shut down your VM, make a backup of it and then resize the hard disk drive. Then boot up FreeBSD again and do:

gpart show

It will show one of your partitions as CORRUPT. Fix it with something like:

gpart recover vtbd0
gpart show

It should now be OK. Note the index number of the partition you want to resize, then do something like:

gpart resize -i 2 vtbd0

Not specifying any size implies growing the partition to fit the physical size.

Now, for the final step to resize the file system, make sure you have a backup in place, check what the partition device name is and then do something like:

sysctl kern.geom.debugflags=16
growfs /dev/vtbd0p2

The first command disables some safety features. This is required to resize a mounted file system "on the fly". Now reboot your system and all should hopefully be OK!