My troublesome root partition issue
Last night I detected that my / partion on OpenBSD was full. I found out that my two devices sd0
(the SSD with RAID) and sd1
(The encrypted disk used under sd0
) took up more space then it supposed to, they where 811MB each and filling up my 1G root partition and thus my system was almost unusable. Of course I have 9 partitions in total, plus swap. The root partition is default to 1G during the install but when the dev-nodes take up so much space for a reason unknown to me, I had trouble.
So what I did was booting into to bsd.rd kernel during boot:
> boot bsd.rd
Entered the shell after boot.
# cd /dev
# sh MAKEDEV sd0 sd1
I use GPT initialize the drives:
# fdisk -iy -g -b 960 sd0
# fdisk -iy -g -b 960 sd1
Then I used disklabel
# disklabel -E sd1
> Label editor (enter '?' for help at any prompt)
sd1> d b
This deletes the swap. Assuming swap is the b-partition.
sd1*> m a
This modifies the a-partition.
offset: [1024]
Leave as is.
size: [10489408] 2G
Decide new new size for the root partition.
FS type: [4.2BSD]
Leave as is.
Now let's recreate the swap space.
sd1*> a b
offset: [10490432]
At the end of partition a
.
size: [8646336]
The rest for swap.
FS type: [swap]
Leave as is.
sd1> q
To quit and save changes.
Now it's time to grow the partition via the command growfs(8)
# growfs sd1a
And run fsck.
# fsck /dev/sd1a
now reboot and hopefully your /
is now usable and bigger :–)