landscape-sysinfo reports incorrect disk usage

Bug #1994044 reported by Seb Bonnard
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
landscape-client (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Hi,

The "landscape-sysinfo" tool from the "landscape-common" package reports incorrect disk usage percentile on both Ubuntu 20.04 :
```bash
$ lsb_release -sr
20.04
$ landscape-sysinfo --sysinfo-plugins=Disk
  Usage of /: 89.0% of 87.48GB

  => / is using 89.0% of 87.48GB
$ df -BG /
Filesystem 1G-blocks Used Available Use% Mounted on
/dev/mapper/ubuntu--vg-ubuntu--lv 88G 78G 6G 93% /
```
 and 22.04 :
```bash
$ lsb_release -sr
22.04
~$ landscape-sysinfo --sysinfo-plugins=Disk
  Usage of /: 11.9% of 43.06GB
$ df -BG /
Filesystem 1G-blocks Used Available Use% Mounted on
/dev/mapper/vg_OS-lv_root 44G 6G 36G 13% /
```

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: landscape-common 19.12-0ubuntu4.3
ProcVersionSignature: Ubuntu 5.4.0-124.140-generic 5.4.195
Uname: Linux 5.4.0-124-generic x86_64
NonfreeKernelModules: bmhook tmhook dsa_filter dsa_filter_hook
ApportVersion: 2.20.11-0ubuntu27.24
Architecture: amd64
CasperMD5CheckResult: skip
Date: Mon Oct 24 17:14:04 2022
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=C.UTF-8
 SHELL=/bin/bash
SourcePackage: landscape-client
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Seb Bonnard (sebma) wrote :
summary: - landscape-sysinfo report incorrect disk usage
+ landscape-sysinfo reports incorrect disk usage
Revision history for this message
Simon Poirier (simpoir) wrote (last edit ):

The small discrepancy seems like it could be the facts that
- filesystems allow reserving blocks for root,
- df returns the unprivileged users free space
- and landscape returns the actual free space

Assuming you are using an EXT2/3/4 filesystem, could you check if you have some disk space reserved?

tune2fs -l /dev/mapper/ubuntu--vg-ubuntu--lv | grep Reserved

Changed in landscape-client (Ubuntu):
status: New → Incomplete
Revision history for this message
Seb Bonnard (sebma) wrote (last edit ):

I'm using ext4 :
On Ubuntu 20.04 :

$ sudo tune2fs -l /dev/mapper/ubuntu--vg-ubuntu--lv | grep Reserved
Reserved block count: 972274
Reserved GDT blocks: 1014
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
$
On Ubuntu 22.04 :
$ sudo tune2fs -l /dev/mapper/vg_OS-lv_root | grep Reserved
Reserved block count: 576716
Reserved GDT blocks: 1024
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
$

My question is the following, why does "landscape-sysinfo" report the "reserved-blocks" as free ? :

$ man tune2fs | sed -n '/^ *-m reserved-blocks-percentage/,/^$/ p'
       -m reserved-blocks-percentage
              Set the percentage of the file system which may only be allocated by privileged processes. Reserving some number of file system blocks for use by privileged processes is
              done to avoid file system fragmentation, and to allow system daemons, such as syslogd(8), to continue to function correctly after non-privileged processes are prevented
              from writing to the file system. Normally, the default percentage of reserved blocks is 5%.

Is it possible for "landscape-sysinfo" to report "unprivileged free space" instead ?

Seb Bonnard (sebma)
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for landscape-client (Ubuntu) because there has been no activity for 60 days.]

Changed in landscape-client (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.