Growing OpenBSD disk
Written by Kirill Filatov, on 01 March 2026.
Tags:
#openbsd
#bsd
How to extend partition on OpenBSD
You will need disklabel and growfs utilitys.
The only nuance here is that partition to be grown must be the last one on disk. So if you need to grow, say, 3rd partition and your disk has four of them, you need to backup your data, remove 3rd partition, create new one of desired size, create file system (newfs) and restore your data on it.
Below is the instruction for growing sd0e partition which is mounted as /usr.
# Check layout
disklabel -h sd0
# Unmount partion
umount -v /usr/
# If it’s busy you can find proccesses that use it with
fstat -f /usr/
# Edit partition interactively
disklabel -E sd0
The syntax of disklabel is very close to fdisk syntax in Linux. Type “c”, set number of partition and desired size. Use “+100M” for adding 100 megabytes. Type “w” for writing changes. No changes will be written to layout otherwise.
# Grow file system
growfs /dev/sd0e
# Run check
fsck -y /dev/sd0e
# Mount extended partition
mount /usr