Title : Create a new OpenBSD partition from unused space
Author: Solène
Date : 20 September 2018
Tags : openbsd highlight
The default OpenBSD partition layout uses a pre-defined template. If
you have a disk more than 356 GB you will have unused space with the
default layout (346 GB before 6.4).
It's possible to create a new partition to use that space if you did
not modify the default layout at installation. You only need to start
**disklabel** with flag *-E** and type **a** to add a partition,
default will use all remaining space for the partition.
# disklabel -E sd0
Label editor (enter '?' for help at any prompt)
> a
partition: [m]
offset: [741349952]
size: [258863586]
FS type: [4.2BSD]
> w
> q
No label changes.
The new partition here is **m**. We can format it with:
# newfs /dev/rsd0m
Then, you should add it to your **/etc/fstab**, for that, use the same
uuid as for other partitions, it would look something like
52fdd1ce48744600
52fdd1ce48744600.e /data ffs rw,nodev,nosuid 1 2
It will be auto mounted at boot, you only need to create the folder
/data. Now you can do
# mkdir /data
# mount /data
and **/data** is usable right now.
You can read [disklabel(8)](https://man.openbsd.org/disklabel.8) and
[newfs](https://man.openbsd.org/newfs.8) for more informations.