Expand root partition in Ubuntu

Tech Tips - By Vincent Chan

Expanding the root partition always a challenge without any proper knowledge and skills. Tools available in Server Edition like parted and Desktop Edition like gparted. There also a very great tools to used when you are using the Desktop Edition. What about Server Edition. It cannot be a easy way to expand it without unmount the root partition. By default, you cannot unmount root partition. It become the challenging area how you can expand the root partition without any unmount and reboot server to maintenance mode (DVD ISO Boot).

I have done a search on the internet, there have another great tool can solved the issues. It normally uses at Cloud Servers. Many people ask is it working on own premise Ubuntu 18.04 LTS Server? The answer is Yes, you can used this Cloud Utilities Tool. Below is the simple step to expand root partition.

sudo apt -y install cloud-guest-utils



this command is to install the Cloud Utilities Tool into your Ubuntu 18.04 LTS. Before you begin expand your root partition. You need to extend your storage at the virtualize server storage.

lsblk



this command is to show your physical storage size and partition. This show my primary storage (/dev/sda) has 100GB Disk allocation. The root partition has allocated in the primary partition (sda1) of the primary storage (/dev/sda). It has 20GB disk space haven been allocated. We now used this tool to expand the root partition.

sudo growpart /dev/sda 1



this execute the “Growpart” tool in the Cloud utilities Tools. It show you will extend the primary storage (/dev/sda) with the primary patition (1)

sudo resize2fs /dev/sda1



this execute “resize2fs” tool to expand the primary storage in primary storage (/dev/sda1). Once to done you will see the root partition been expanded without unmount the root partition drive. You can simply run lsblk or df -h to verified your root partition successfully expanded.

Meet the Author

Vincent Chan has 22 years of experience in IT operations, consulting, and system integration solutions. He is passionate about solving challenges and constantly seeks to learn new technologies. His hobbies include photography. You can connect with him at vinc.chanmc@yahoo.com.

My AI Action Figure Toy

Tech Tips - By Vincent Chan

Scuderia Ferrari SF-24 Lego Set

Tech Lifestyles - By Vincent Chan

Virtual vs Physical Server Landscape

Tech Tips - By Vincent Chan

Different Between iOS and Android

Tech Tips - By Vincent Chan

The Era of the Data Center

Tech Tips - By Vincent Chan

The Lantern Festival Chap Goh Mei

Tech Lifestyles - By Vincent Chan

Back to Business and Work

Tech Lifestyles - By Vincent Chan

Year of the Wood Snake

Tech Lifestyles - By Vincent Chan

Cleaning Ubuntu Linux Module

Tech Tips - By Vincent Chan

Wishing Everyone a Happy 2025 New Year

Tech Lifestyles - By Vincent Chan

Subscribe to our newsletter

Subscribe to our newsletter and stay up-to-date with our VincLAB News!”