💾 Archived View for perso.pw › blog › articles › openbsd-disklabel.gmi captured on 2023-05-24 at 18:26:19. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-01-29)

➡️ Next capture (2024-03-21)

🚧 View Differences

-=-=-=-=-=-=-

Create a new OpenBSD partition from unused space

on Mastodon

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

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.