-1

I hope you and your dears are very well.

I'm facing a issue which I cannot understand the root cause.

I have a VM with CentOS 7 64 bits. This VM has the following partitions:

Filesystem           Size  Used Avail Use% Mounted on
/dev/mapper/cl-root  1.1T  1.1T  3.1G 100% /
devtmpfs             126G     0  126G   0% /dev
tmpfs                126G     0  126G   0% /dev/shm
tmpfs                126G  4.1G  122G   4% /run
tmpfs                126G     0  126G   0% /sys/fs/cgroup
/dev/sda3            239M  147M   76M  66% /boot
/dev/mapper/cl-tmp   190M  1.6M  175M   1% /tmp
tmpfs                 26G     0   26G   0% /run/user/0

In the mount point / (root), as you can see I have just 3.1 GB available of a volume total size 1.1 TB.

I tried to identify if there is some delete file locked by some process, but this is not the case:

# ls -l /proc/*/fd/* | grep deleted
ls: cannot access /proc/20484/fd/255: No such file or directory
ls: cannot access /proc/20484/fd/3: No such file or directory
ls: cannot access /proc/self/fd/255: No such file or directory
ls: cannot access /proc/self/fd/3: No such file or directory

Using parted, I find that this partition has the following size:

#parted /dev/cl/root
GNU Parted 3.1
Using /dev/dm-0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print free
Model: Linux device-mapper (linear) (dm)
Disk /dev/dm-0: 1197GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:

Number Start End Size File system Flags 1 0.00B 1197GB 1197GB ext4

Using lvdisplay to check the logical volume, I have:

# lvdisplay /dev/mapper/cl-root
  --- Logical volume ---
  LV Path                /dev/cl/root
  LV Name                root
  VG Name                cl
  LV UUID                hwPnR8-7VX2-DNjb-HUjU-Cbai-Rl37-txslGH
  LV Write Access        read/write
  LV Creation host, time computer-node-07, 2018-10-17 13:59:48 -0300
  LV Status              available
  #open                  1
  LV Size                1.09 TiB
  Current LE             285364
  Segments               10
  Allocation             inherit
  Read ahead sectors     auto
  -currently set to     256
  Block device           253:0

Now, when I get the volume size using du, I had the following output:

du -csh --block-size=1G /Mb
du: cannot access ‘/proc/173159/task/173159/fd/3’: No such file or directory
du: cannot access ‘/proc/173159/task/173159/fdinfo/3’: No such file or directory
du: cannot access ‘/proc/173159/fd/4’: No such file or directory
du: cannot access ‘/proc/173159/fdinfo/4’: No such file or directory
1049
1049    total

I also tried to find whether there is a available space in the Volume Group, but I don't have:

# vgdisplay -v cl|grep Free
  Free  PE / Size       0 / 0
  Total PE / Free PE    285414 / 0

Could you help me to understand this situation?

Thanks. Cardoso

1 Answers1

0

The reported size from the tools seems to be the same. You have a 1.09 TiB root logical volume, df output is rounded and parted shows 1197 GB which is 1.09 TiB.

The "missing" free space is the filesystem reserved space. It's by default 5 % on ext4. You can check number of reserved blocks in dumpe2fs. You can change the reserve size using tune2fs -m <size> <device>, see this question for more details about reserved space on ext4.

  • Hi, thanks for your response. Regarding the reserverd blocks (5% on ext4), in this case I should be available 1137GB and the file system root (/) has only 1052GB a deficit of 88GB.Regarding the tool dumpe2fs, I had the following output: # dumpe2fs -h /dev/sda5 dumpe2fs 1.42.9 (28-Dec-2013) dumpe2fs: Bad magic number in super-block while trying to open /dev/sda5 Couldn't find valid filesystem superblock.I tried to use other options, like -b, but I received the same output. – Rodrigo Cardoso de Oliveira Dec 09 '20 at 18:50
  • 95 % of 1.09 TiB is 1060.35 GiB so with 3.1 GiB free and du reporting 1049 GiB you are missing only 8.25 GiB (lvdisplay, df and du report sizes in binary units not decimal) which is less than 1 % and is probably used by journal and other metadata. You need to use dumpe2fs /dev/mapper/cl-root, /dev/sda5 is the LVM partition, not the ext4 root logical volume. – Vojtech Trefny Dec 09 '20 at 19:04