'how to increase disk size on centos

My disk on virtual box was to small, so I made it bigger with VBoxManage and assigned the new, free space to the main partition afterwards using gparted. But working with the system I still get errors kind of 'no disk space available' What is missing?

fdisk -l shows that disk /dev/sda has 14 GB. That's new size.

[root@office data]# fdisk -l

Disk /dev/sda: 14.0 GB, 13991149568 bytes, 27326464 sectors
Units = Sektoren of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x000a2e1f

   Gerät  boot.     Anfang        Ende     Blöcke   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048    27326463    13150208   8e  Linux LVM

Disk /dev/mapper/centos-root: 7159 MB, 7159676928 bytes, 13983744 sectors
Units = Sektoren 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/centos-swap: 859 MB, 859832320 bytes, 1679360 sectors
Units = Sektoren of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

but df -h does not show the new size on /centos-root. Instead there are some tmpfs entries that I don't understand. How can I assign the new diskspace to my "working" partition?

[root@office data]# df -h
Dateisystem             Größe Benutzt Verf. Verw% Eingehängt auf
/dev/mapper/centos-root  6,7G    6,7G   16K  100% /
devtmpfs                 1,9G       0  1,9G    0% /dev
tmpfs                    1,9G       0  1,9G    0% /dev/shm
tmpfs                    1,9G    8,6M  1,9G    1% /run
tmpfs                    1,9G       0  1,9G    0% /sys/fs/cgroup
/dev/sda1                497M    206M  292M   42% /boot
tmpfs                    379M       0  379M    0% /run/user/0


Solution 1:[1]

I found the answer myself, explained here:

So the Steps to enlarge your virtualbox disk for a centos guest are:

  1. Use VBoxManage utility to resize the disk
  2. Use GParted to assign the new unallocated space
  3. And the Step I was missing: Use the description from the link to manage the disk within centos

Solution 2:[2]

Your disks are using logical volume mapping (LVM) because "mapper" is in the dev names. The best way can doesn't require gparted or messing with your files. Refer here: https://unix.stackexchange.com/a/659099/352647

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 tobi
Solution 2