Score:0

Wrong ext4 filesystem free space

ph flag

We have a linux server with LVM. Looking the space availability with df -h the difference between filesystem size and used space is not zero but the available space is zero. This is the output of the df -h

Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_oraclelinux6a-lv_root 91G   86G     0 100% /
tmpfs                 7.8G  296K  7.8G   1% /dev/shm
/dev/sda1             477M  162M  286M  37% /boot

Then we resised the filesystem:

[root@server ~]# lvresize --resizefs --size +1GB /dev/vg_oraclelinux6a/lv_root
  Size of logical volume vg_oraclelinux6a/lv_root changed from 105.65 GiB (27046 extents) to 106.65 GiB (27302 extents).
  Logical volume lv_root successfully resized.
resize2fs 1.43-WIP (20-Jun-2013)
Filesystem at /dev/mapper/vg_oraclelinux6a-lv_root is mounted on /; on-line resizing required
old_desc_blocks = 6, new_desc_blocks = 7
The filesystem on /dev/mapper/vg_oraclelinux6a-lv_root is now 27957248 blocks long.

Finally, the output of df -h is:

[root@server ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_oraclelinux6a-lv_root    105G   86G   15G  86% /
tmpfs                 7.8G  296K  7.8G   1% /dev/shm
/dev/sda1             477M  162M  286M  37% /boot

Summing up, adding 1GB to a filesystem of 91GB we have obtained a size of 105GB and, another strange thing, the available space should be 19GB and not 15GB. Anyone have had the same problem? Thank you.

Score:1
cn flag
Bob

No mystery here

All information is already present in what you posted.

This is the relevant line here:

Size of  vg_oraclelinux6a/lv_root changed from 105.65 GiB (27046 extents) to 106.65 GiB

The LVM had already been resized before and was already 105 GB. You only grew it by 1 GB.

But either you or your colleague did not include the --resizefs switch and/or forgot to resize/grow the file system after expanding the volume the time before this.

So all that extra space in the LVM was unavailable to the file system until you grew the filesystem to make use of the full LVM volume.


available space should be 19GB and not 15GB.

I suspect that when the filesystem become 100% full some of the EXT reserved block count was consumed. Growing the filesystem first replenished the reserved blocks and only the remainder became available as free space.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.