NAME
sbeyer.net

OPTIONS

CONTENT
Rescaling FreeBSD on VPS (2025-07-28):

I saw today that the VPS provider that I use has updated their available plans and I could 'rescale' my current setup to benefit from one more core, more RAM and more disk spacae (at the same cost). So why not?!

For CPU and RAM it only required clicking YES in the web interface, but for the increase in disk space I had to make my system aware of that change:

This is how my zfs pool looked after the update (it's the same as before the update):

root@nap:/home/sebi # zpool list
NAME    SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
zroot    17G  14.5G  2.53G        -         -    42%    85%  1.00x    ONLINE  -

First step was to update the partition table, but gpart status showed CORRUPT for all partitions...

So, let's first backup the current table

gpart backup da0 > /root/gpt-backup.txt

and then try to recover

gpart recover da0

which thankfully worked!

Now the partitions look like this, with the new free space visible at the end:

root@nap:/home/sebi # gpart show
=>      40  80002992  da0  GPT  (38G)
        40      1024    1  freebsd-boot  (512K)
      1064       984       - free -  (492K)
      2048   4194304    2  freebsd-swap  (2.0G)
   4196352  35803136    3  freebsd-zfs  (17G)
  39999488  40003544       - free -  (19G)

Let's resize the zfs partition:

root@nap:/home/sebi # gpart resize -i 3 da0

And we have this:

root@nap:/home/sebi # gpart show
=>      40  80002992  da0  GPT  (38G)
        40      1024    1  freebsd-boot  (512K)
      1064       984       - free -  (492K)
      2048   4194304    2  freebsd-swap  (2.0G)
   4196352  75806680    3  freebsd-zfs  (36G)

But we still need to make zfs aware of the change:

root@nap:/home/sebi # zpool online -e zroot da0

And check:

root@nap:/home/sebi # zpool status
  pool: zroot
 state: ONLINE
config:

        NAME        STATE     READ WRITE CKSUM
        zroot       ONLINE       0     0     0
          da0p3     ONLINE       0     0     0

errors: No known data errors
root@nap:/home/sebi # zpool list
NAME    SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
zroot    36G  14.5G  21.5G        -         -    20%    40%  1.00x    ONLINE  -

Looks good to me!