resizing a netbsd vm's disk
#author_luna #sysadmin-notes #netbsd
this took me a little while to learn but here is the process
- resize the disk (with
qemu-img
) - boot into netbsd installer, exit the installer
- use
dmesg
to find out which disk is it mapped to- i'm sure there's a better way to actually find out... i don't know how. an
lsblk
-type tool would help immensely - for example,
/dev/wd0
is the disk, but the partitions arewd0a
/dk0
andwd0b
/dk1
(root and swap respectively)
- i'm sure there's a better way to actually find out... i don't know how. an
- use
gpt show wd0
and keep the manpages for gpt(8) close to you. for my case- delete swap partition
- resize root partition up to my desired space
- create swap partition with the remaining space
- then tell ffs that it got new space to expand to
resize_ffs /dev/dk0
- reboot. profit