3

I have several drives on my server mounted separately. They are getting close to full. When I ssh to my server, motd reports disk usage, for example:

=> /home is using 89.3% of 916.89GB

But if I run df -h, it reports:

/dev/sdd1       917G  826G   45G  95% /home

This happens for all my drives; motd consistently reports lower numbers. It looks likes motd runs landscape-sysinfo to report this information.

Why are they different and which is correct?

2
  • Is /home mounted on it's own partition? You are correct, landscape-sysinfo is used for the MOTD but it usually only reports disk usage for / unless there are separate partitions.
    – kingmilo
    May 30, 2013 at 9:28
  • Yes, /home is a separate partition on its own disk. May 30, 2013 at 12:38

2 Answers 2

4

Having a look at the landscape-sysinfo script which lives in /etc/update-motd.d/ it is clear that the calculation of the disk space is being done with cat /proc/partitions rather than the df command.

Performing the same test on my machine but using / as an example I get the same results, cat /proc/partitions shows less disk space being used while df shows a bit more disk usage. The method used to calculate the partition size is different hence the different results:

cat /proc/partitions 
major minor  #blocks  name
   8        5  606765056 sda5

df
Filesystem            1K-blocks     Used Available Use% Mounted on
/dev/sda5             597111968 53985732 512787984  10% /

Both are correct in their own calculations, I would rely on df to get a better indiciation of disk usage for your /home partition.

1
  • 2
    Thanks. I would still be interested to know exactly why they calculate the partition size differently. If /proc/partitions is the unformatted size, for example, then this would make MOTD misleadingly optimistic. May 30, 2013 at 13:05
2

I filed a bug to track this:

https://bugs.launchpad.net/landscape-client/+bug/1186154

I believe landscape-sysinfo should be changed to match df.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .