1

Topic: After resize, df does not indicate increased size.

Hello.

I am running VirtualBox on Windows.  I created a GParted VM so that I could expand an 8GB partition to 10GB on a Red Hat Enterprise Linux (RHEL, developer server, self-support subscription) VM server, also on VirtualBox.  Everything seems to have gone well.  In the GParted graph, you can see that the unallocated space (white) of /dev/sda2 was added to the allocated space (yellow).  However, when I booted the Linux VM, "df -h" shows the same space used as before the expansion.

"pvs" had a value for PFree.  After running "lvextend -L +2G /dev/mapper/rhel-root", the value for PFree changed to 0, as expected.  Maybe I should have used lvresize?  When I try lvresize now (same arguments), it says there is not enough space.  Maybe undo lvextend? Just making some guesses.

The size of /dev/mapper/rhel-root did not change as expected:

[sbrown@localhost ~]$ df -h
Filesystem                   Size  Used Avail Use% Mounted on
/dev/mapper/rhel-root  6.2G  5.3G  937M  86% /
devtmpfs                    481M     0  481M   0% /dev
tmpfs                         497M     0  497M   0% /dev/shm
tmpfs                         497M  7.0M  490M   2% /run
tmpfs                         497M     0  497M   0% /sys/fs/cgroup
/dev/sda1                 1014M  160M  855M  16% /boot
tmpfs                         100M  4.0K  100M   1% /run/user/42
tmpfs                         100M   48K  100M   1% /run/user/1000

Any help would be truly appreciated.

Steve

2

Re: After resize, df does not indicate increased size.

I just found the answer to my own question.  After lvextend, I should have used:

xfs_growfs /dev/mapper/rhel-root

After doing so, "df -h" gives different results:

[root@localhost sbrown]# df -h
Filesystem             Size  Used Avail Use% Mounted on
/dev/mapper/rhel-root  8.2G  5.3G  3.0G  65% /
devtmpfs               481M     0  481M   0% /dev
tmpfs                  497M   24M  473M   5% /dev/shm
tmpfs                  497M  7.1M  490M   2% /run
tmpfs                  497M     0  497M   0% /sys/fs/cgroup
/dev/sda1             1014M  160M  855M  16% /boot
tmpfs                  100M  4.0K  100M   1% /run/user/42
tmpfs                  100M   48K  100M   1% /run/user/1000
tmpfs                  100M     0  100M   0% /run/user/0

I hope this helps others.

sbrown wrote:

Hello.

I am running VirtualBox on Windows.  I created a GParted VM so that I could expand an 8GB partition to 10GB on a Red Hat Enterprise Linux (RHEL, developer server, self-support subscription) VM server, also on VirtualBox.  Everything seems to have gone well.  In the GParted graph, you can see that the unallocated space (white) of /dev/sda2 was added to the allocated space (yellow).  However, when I booted the Linux VM, "df -h" shows the same space used as before the expansion.

"pvs" had a value for PFree.  After running "lvextend -L +2G /dev/mapper/rhel-root", the value for PFree changed to 0, as expected.  Maybe I should have used lvresize?  When I try lvresize now (same arguments), it says there is not enough space.  Maybe undo lvextend? Just making some guesses.

The size of /dev/mapper/rhel-root did not change as expected:

[sbrown@localhost ~]$ df -h
Filesystem                   Size  Used Avail Use% Mounted on
/dev/mapper/rhel-root  6.2G  5.3G  937M  86% /
devtmpfs                    481M     0  481M   0% /dev
tmpfs                         497M     0  497M   0% /dev/shm
tmpfs                         497M  7.0M  490M   2% /run
tmpfs                         497M     0  497M   0% /sys/fs/cgroup
/dev/sda1                 1014M  160M  855M  16% /boot
tmpfs                         100M  4.0K  100M   1% /run/user/42
tmpfs                         100M   48K  100M   1% /run/user/1000

Any help would be truly appreciated.

Steve

3

Re: After resize, df does not indicate increased size.

Thank you for the tip.
I hope this can help people looking how to solve similar problems.
smile

*** It is highly recommended to backup any important files before doing resize/move operations. ***