Is there a way to edit partitions and resize in cli? I have a 100% full /root and it’s causing issues. I rebooted and it’s still full. I want to increase it from 70GB to 200GB?
Almalinux 8.10
Control Web Panel (aka CentOS Web Panel or CWP)
Contabo VPS
More Info…
[root@viking ~]# df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/almalinux-root 70G 70G 20K 100% /
[root@viking ~]# fdisk -l
Disk /dev/sda: 1.6 TiB, 1717986918400 bytes, 3355443200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x064e8d9a
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 2099199 2097152 1G 83 Linux
/dev/sda2 2099200 3355443199 3353344000 1.6T 8e Linux LVM
Disk /dev/mapper/almalinux-root: 70 GiB, 75161927680 bytes, 146800640 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/almalinux-swap: 23.6 GiB, 25375539200 bytes, 49561600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/almalinux-home: 1.5 TiB, 1616371515392 bytes, 3156975616 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
[root@viking ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
devtmpfs 24564712 0 24564712 0% /dev
tmpfs 24583732 0 24583732 0% /dev/shm
tmpfs 24583732 305664 24278068 2% /run
tmpfs 24583732 0 24583732 0% /sys/fs/cgroup
/dev/mapper/almalinux-root 73364480 73364460 20 100% /
/dev/sda1 1038336 347532 690804 34% /boot
/dev/mapper/almalinux-home 1577717064 50447700 1527269364 4% /home
tmpfs 4916744 0 4916744 0% /run/user/1002
tmpfs 4916744 0 4916744 0% /run/user/0
A tut I found but I dfon’t have sda and such names or numbers for partitions like it says in the tut…
[TUT]…
To increase the size of the root partition from the command line (CLI), you typically need to use the fdisk command to modify the partition size, then use resize2fs to resize the filesystem within that partition, ensuring your system is using Logical Volume Management (LVM) if applicable to simplify the process.
Key steps:
Check current partition size:
Use df -h / to see the current size of your root partition.
Access disk partition editor:
Without LVM: Run sudo fdisk /dev/sda (replace “sda” with your disk identifier from fdisk -l).
With LVM: Identify the logical volume associated with your root partition using vgdisplay and lvdisplaycommands.
Modify partition size:
In fdisk:1
Press ‘p’ to view partitions.
Select the partition you want to resize using the partition number.
Use the ‘n’ command to create a new partition or extend the existing one.
Press ‘w’ to write changes and exit.
Resize filesystem:
Run sudo resize2fs /dev/sdX(replace “sdX” with the device name of your root partition).
Important considerations:
Backup data: Always back up your system before making significant partition changes.
LVM usage: If your system uses LVM, use commands like lvextend to expand the logical volume associated with your root partition.
Reboot: Depending on your system configuration, you might need to reboot after resizing the partition.