Koozali.org: home of the SME Server

[SOLVED] wrong disk space by "du"

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
[SOLVED] wrong disk space by "du"
« on: March 06, 2017, 11:27:06 PM »
I'm sure this is a dumb question, but have found no answer to it after a day searching (maybe with wrong terms!), so here is the problem""
See this:

Code: [Select]
[root@rinoceronte tmp]# df -kh
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/main-root
                      455G  434G     0 100% /
tmpfs                 1.9G     0  1.9G   0% /dev/shm
/dev/md0              239M   77M  150M  34% /boot

Why those USED and SIZE number are different (11GB) and USE% column show as 100% ??

The disk appears to be full, because this command show an error:
Code: [Select]
[root@rinoceronte tmp]# mail -s "na CLI do Rinoceronte@`date`" someemail@somewhere.com</dev/null
Null message body; hope that's ok
[root@rinoceronte tmp]# qmail-inject: fatal: qq write error or disk full (#4.3.0)
« Last Edit: March 07, 2017, 11:32:48 PM by Jáder »
...

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: wrong disk space by "du"
« Reply #1 on: March 06, 2017, 11:46:37 PM »
that's because of the reserved space to root, which is (default) set at 5%

Code: [Select]
tune2fs -m 1 /dev/mapper/main-root

will set it at 1%
you can do it safely on a mounted running fs
in your case, I'd reboot the server after the edit to restart all the services
HTH

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
Re: wrong disk space by "du"
« Reply #2 on: March 07, 2017, 12:43:55 AM »
That's a great info... will verify it later
THANKS... BUT, after a while, I returned to same console screen (still opened) and now?
Code: [Select]
[root@rinoceronte tmp]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/main-root
                      455G  414G   18G  96% /
tmpfs                 1.9G     0  1.9G   0% /dev/shm
/dev/md0              239M   77M  150M  34% /boot
[root@rinoceronte tmp]# !mail
mail -s "na CLI do Rinoceronte@`date`" someemail@smewhere.com</dev/null
Null message body; hope that's ok
[root@rinoceronte tmp]#

So it fixed it by himself!!!WOW!

PS: 5% of 455GB = 22.75GB ...I was missing just 11GB!
« Last Edit: March 07, 2017, 12:46:39 AM by Jáder »
...

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: wrong disk space by "du"
« Reply #3 on: March 07, 2017, 06:44:51 AM »
1) were you doing a backup?
2) 455-434=21 ;-)

Offline Jáder

  • *
  • 1,099
  • +0/-0
    • LinuxFacil
[SOLVED]Re: wrong disk space by "du"
« Reply #4 on: March 07, 2017, 11:32:31 PM »
Stefano,

Thanks by the math class! It's official now: I'm a moron! hehehe
I'm not sure if it was doing a backup, I'm sure I tryed to reboot server BEFORE post, just to be sure it would release all locked files, but not sure if it not started a backup again.

Anyways I tune2fs to 1% and got a few GB back .
Hope it not mess anything else in future!
It's a backup only server...hope do not use it NEVER EVER!

Regards

Jáder
...

Offline Jean-Philippe Pialasse

  • *
  • 2,766
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: [SOLVED] wrong disk space by "du"
« Reply #5 on: March 08, 2017, 09:19:42 PM »
maybe time to get him two more bigger drives and use raid to change them one after the other and grow your partitions.