• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Saturday, May 10, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System BSD

How to Resize a Disk in FreeBSD

How VPS by How VPS
September 1, 2019
in BSD
0
0
SHARES
24
VIEWS
Share on FacebookShare on Twitter

Contents

  1. 1. Confirm New Disk Space
  2. 2. Recover the Corrupt Partition
  3. 3. Resize the freebsd-ufs Partition
  4. 4. Grow the UFS File System
  5. 5. Confirm the Changes
  6. Want to contribute?


The FreeBSD operating system utilizes UFS (Unix File System) for its root partition’s file system; otherwise known as freebsd-ufs

In the event of an upgraded disk size, we will illustrate how to expand this file system.

Prerequisites

1) To follow this tutorial, deploy one of the following:

  • FreeBSD 11 x64

OR

  • FreeBSD 10 x64

We utilized the following plan to begin our deployment:

CPU:        1 vCore
RAM:        1024 MB
Storage:    25 GB SSD

2) Prior to upgrading your intance, confirm its current disk allocation & partition table:

# df -h  
Filesystem         Size    Used   Avail Capacity  Mounted on
/dev/ufs/rootfs     24G    924M     21G     4%    /
devfs              1.0K    1.0K      0B   100%    /dev

# gpart show
=>      40  52428720  vtbd0  GPT  (25G)
        40      1024      1  freebsd-boot  (512K)
      1064  52427696      2  freebsd-ufs  (25G)

3) Upgrade your instance’s plan:

  1. Visit your Vultr management page
  2. Select the instance that you’d like to upgrade.
  3. Choose the “Settings” link near the top of the page.
  4. Click the “Change Plan” link on the Side to show a dropdown menu of available upgrade choices.

In this case, we upgraded our plan to the following:

CPU:        1 vCore
RAM:        2048 MB
Storage:    40 GB SSD

1. Confirm New Disk Space

Although the disk allocation appears the same at first, gpart illustrates a change::

# df -h
Filesystem         Size    Used   Avail Capacity  Mounted on
/dev/ufs/rootfs     24G    924M     21G     4%    /
devfs              1.0K    1.0K      0B   100%    /dev

# gpart show
=>      40  52428720  vtbd0  GPT  (40G) [CORRUPT]
        40      1024      1  freebsd-boot  (512K)
      1064  52427696      2  freebsd-ufs  (25G)

2. Recover the Corrupt Partition

# gpart recover vtbd0
vtbd0 recovered

# gpart show
=>      40  83886000  vtbd0  GPT  (40G)
        40      1024      1  freebsd-boot  (512K)
      1064  52427696      2  freebsd-ufs  (25G)
  52428760  31457280         - free -  (15G)

3. Resize the freebsd-ufs Partition

WARNING!!!
Per the FreeBSD Handbook:

There is risk of data loss when modifying the partition table of a mounted file system. It is best to perform the following steps on an unmounted file system while running from a live CD-ROM or USB device.

Since this is a recently deployed instance, there is no sensitive data to backup; however, in the event of upgrading an instance currently in production, its best practice to perform an offsite backup prior to making any changes to the partition table.

Once you’re ready to proceed, do the following:

# gpart resize -i 2 vtbd0
vtbd0p2 resized

# gpart show
=>      40  83886000  vtbd0  GPT  (40G)
        40      1024      1  freebsd-boot  (512K)
      1064  83884976      2  freebsd-ufs  (40G)

4. Grow the UFS File System

In order to expand the freebsd-ufs or /dev/vtbd0p2 paritition, start the growfs service:

# service growfs onestart
Growing root partition to fill device
vtbd0 recovering is not needed
vtbd0p2 resized
super-block backups (for fsck_ffs -b #) at:
 53224896, 54248448, 55272000, 56295552, 57319104, 58342656, 59366208, 60389760, 61413312,
 62436864, 63460416, 64483968, 65507520, 66531072, 67554624, 68578176, 69601728, 70625280,
 71648832, 72672384, 73695936, 74719488, 75743040, 76766592, 77790144, 78813696, 79837248,
 80860800, 81884352, 82907904

Alternatively, you can run the following command.

growfs /dev/ufs/rootfs

5. Confirm the Changes

# gpart show
=>      40  83886000  vtbd0  GPT  (40G)
        40      1024      1  freebsd-boot  (512K)
      1064  83884976      2  freebsd-ufs  (40G)

# df -h
Filesystem         Size    Used   Avail Capacity  Mounted on
/dev/ufs/rootfs     39G    924M     35G     3%    /
devfs              1.0K    1.0K      0B   100%    /dev

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article
Previous Post

How to Install Cachet on FreeBSD 11

Next Post

Installing MongoDB on FreeBSD 10

Next Post

Installing MongoDB on FreeBSD 10

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet