Expand disk partition through terminal in linux Print

  • 0


First, you need to install growpart utility that will help you expant or manage the partition.

Use the following command to install growpart utility for Fedora, CentOS, RHEL, Oracle Linux, Alma Linux, Rocky Linux;

dnf -y install cloud-utils-growpart

Now the utility has been installed, so, as the next step, run below command:

mount | grep ' / '

This should result in an output similar to below:


[root@name ~]#

/dev/sda3 on / type ext4 (rw,noatime,jqfmt=vfsv1,usrjquota=quota.user)

Remember the higlighted string - which is name of your primary partition where the new blocks will be merged into.

Now run this command:

sudo growpart /dev/sda3

followed by this command:

sudo resize2fs /dev/sda3


You're all set now and do not need a restart.



Was this answer helpful?

« Back