I am trying to extend the disk space on an AlmaLinux server (running on a VM). The goal is to add unallocated 10.00 GiB to the root partition (dev/sda2). What is the best way to do this without losing any data?
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 310G 0 disk
├─sda1 8:1 0 512M 0 part /boot
├─sda2 8:2 0 4G 0 part /
├─sda3 8:3 0 1G 0 part /tmp
├─sda4 8:4 0 1K 0 part
└─sda5 8:5 0 294.5G 0 part /var/lib/mysql
sdb 8:16 0 127G 0 disk
sr0 11:0 1 1024M 0 from
Model: Msft Virtual Disk (scsi)
Disk /dev/sda: 333GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 538MB 537MB primary ext4 boot
2 538MB 4833MB 4295MB primary xfs
3 4833MB 5907MB 1074MB primary xfs
4 5907MB 322GB 316GB extended
5 5908MB 322GB 316GB logical xfs
Number Start End Size Type File system Flags 32.3kB 1049kB 1016kB Free Space 1 1049kB 538MB 537MB primary ext4 boot 2 538MB 4833MB 4295MB primary xfs 3 4833MB 5907MB 1074MB primary xfs 4 5907MB 322GB 316GB extended 5 5908MB 322GB 316GB logical xfs 322GB 333GB 10.7GB Free Space
