🌳 Place an order, we'll plant a tree. Thanks to your orders, we've now planted over 1000 trees! Learn more ›

Adding space to FreeBSD servers formatted with ZFS Print

  • freebsd, zfs
  • 0

If you just have a simple setup with a single zdev that you want to allocate all the space to (which is usually the case), the easiest way is as follows:

  1. Place an upgrade order
  2. Wait for us to confirm the upgrade has been carried out
  3. SSH into your server (or use the VNC console)
  4. Verify you can see the extra space with gpart list (you should see state: CORRUPT near the top which we will sort in a moment, and under Consumers: you should see that da0 has a Mediasize representing your new chosen size -- your ZFS partition da0p3 under Providers: does not yet use all of this space, and we'll sort this in a moment too)
  5. Update the the GPT to match the new disk size with gpart recover /dev/da0 (you should see state: OK near the top now)
  6. Expand the ZFS partition with gpart resize -i 3 /dev/da0 (you should see da0p3 resized)
  7. Verify the ZFS partition expanded correctly with gpart list (you should see your ZFS partition da0p3 under Providers: has expanded to use most of your drive -- minus the amount used by your swap partition, usually da0p2)
  8. Expand your zpool to use the full space of the resized partition with zpool online -e zroot da0p3
  9. Verify your new space is available to your ZFS datasets with zfs list

Was this answer helpful?

« Back
Cyber Essentials Certified Plus
WithSecure Registered Partner
Silver Microsoft Partner
Climate Positive Workforrce
Plesk Partner