How to extend disk in AlmaLinux

STEP 1: SSH to your Almalinux Server
Download and install Putty from HereĀ 
Once installed, open Putty and enter your server login credentials to access your server.

STEP 2: Detect New Disk Size in AlmaLinux
Check current disk:
command: lsblk

You may still see the old size, so rescan the disk:
command: echo 1 | sudo tee /sys/class/block/sda/device/rescan
(Replace sda with your actual disk (e.g., vda, sda, or nvme0n1) based on lsblk)

Then confirm size:
command: lsblk

STEP 3: Extend the Partition
Install the cloud-utils package:
command:sudo dnf install cloud-utils-growpart -y

Then grow the main partition:
command: sudo growpart /dev/sda 1
(Replace sda 1 with your actual partition)

You can confirm partition is extended using:
command: lsblk

STEP 4: Resize Filesystem
Now, resize the filesystem to fill the partition:

For xfs (default in AlmaLinux):
command: sudo xfs_growfs /

For ext4:
command: sudo resize2fs /dev/sda1

STEP 5 DONE!
Now verify:
command: df -Th


Was this article helpful?

mood_bad Dislike 0
mood Like 0
visibility Views: 10