0

I am running a web server, which is running a LAMP stack with an email server.

It is Debian 8 Jessie and Kernel 3.16

My server is setup in RAID 1 with two 4TB drives, so I have a maximum of around 4TB. The server is not in production use yet and is only used for development work right now.

My question is, is has used 191.10GB of space so far, is this normal?

UPDATE:

I ran: `sudo du -h / | grep -P '^[0-9.]+G'

and get back:

du: cannot access '/proc/30136/task/30136/fd/4': No such file or directory
du: cannot access '/proc/30136/task/30136/fdinfo/4': No such file or directory
du: cannot access '/proc/30136/fd/4': No such file or directory
du: cannot access '/proc/30136/fdinfo/4': No such file or directory
1.4G    /usr
2.9G    /

or I run: du -h / | grep '[0-9\.]\+G'

and get back:

8.0K    /usr/share/locale/zh_CN.GB2312/LC_MESSAGES
12K /usr/share/locale/zh_CN.GB2312
8.0K    /usr/lib/jvm/java-8-oracle/jre/lib/locale/zh.GBK/LC_MESSAGES
12K /usr/lib/jvm/java-8-oracle/jre/lib/locale/zh.GBK
1.4G    /usr
2.8G    /

Output of df -h

Filesystem      Size  Used Avail Use% Mounted on
/dev/md2        3.6T  2.9G  3.4T   1% /
udev             10M     0   10M   0% /dev
tmpfs           6.3G   17M  6.3G   1% /run
tmpfs            16G     0   16G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs            16G     0   16G   0% /sys/fs/cgroup
/dev/md1        771M   34M  698M   5% /boot

Output of du -x --max-depth=1 -h /

16K /lost+found
12M /sbin
8.0K    /media
36K /tmp
1.2G    /var
4.0K    /lib64
12K /srv
8.8M    /bin
4.0K    /mnt
46M /home
8.0M    /etc
208M    /lib
112K    /root
46M /opt
1.4G    /usr
2.9G    /
Erdss4
  • 103
  • 1
    You should investigate what is actually taking up the space, for how to investigate see question: Tracking down where disk space has gone on Linux?. After figuring that out, if you still have a question on what is taking the space, [edit] your question to include relevant details. – sebasth Oct 11 '17 at 21:48
  • no, it's not normal, Debian should take around 1-2 gigabytes for the OS/Kernel/Servers. Max. 191 gB must be data, about 190 gB of it anyway, unless you did something odd like install the full gnome+kde desktop, at which point, it's not a server, it's a desktop running some daemons, but even that should be no more than 4 or 5 gigabytes max. https://superuser.com/questions/162749/how-to-get-the-summarized-sizes-of-directories-and-their-subdirectories for more on locating the biggest directories. – Lizardx Oct 11 '17 at 21:51
  • I've updated my answer with more info – Erdss4 Oct 11 '17 at 21:56
  • Also I found out I have 'used' 191GB from webmin... – Erdss4 Oct 11 '17 at 21:57
  • 4gb is enough for a LAMP set up, with Bind9 running for your DNS, and postfix+dovecot w/ a mysql back end. If that 191gb is accurate, something is VERY wrong, or someone is hosting content on your server (movies, etc). How about the output of df -h ? – ivanivan Oct 11 '17 at 21:57
  • @ivanivan updated. – Erdss4 Oct 11 '17 at 22:02
  • You haven't shown that you have only a root filesystem. (If you have created a single filesystem for your entire 4TB I would opine that it's been poorly set up.) Instead of fudging the output of du why not start with a straightforward df -h, which will add substance to your description of an unexplained 191GB. – Chris Davies Oct 11 '17 at 22:02
  • The display in webmin: https://i.imgur.com/FNwC2ik.png – Erdss4 Oct 11 '17 at 22:03
  • 1
    Where do you get that 191GB from, it does not match what the system reports. In df -h output the used disk space for / is 2.9G of total 3.6T, nowhere near 191GB. – sebasth Oct 11 '17 at 22:03
  • The output of du -x --max-depth=1 -h / would probably be more useful. It would give you a hint to where the usage is located. – Zoredache Oct 11 '17 at 22:03
  • It is now at 189 because I deleted some files in my home area I did not need no more... – Erdss4 Oct 11 '17 at 22:05
  • @Zoredache updated – Erdss4 Oct 11 '17 at 22:14
  • @Zoredache This has been like this for a while now and I have restarted a couple of times in the last 5 days... – Erdss4 Oct 11 '17 at 22:16
  • Sorry about that last comment I looked at the wrong number. du reports ~2.9G used on the root, and the df shows ~2.9GB used on root. It all looks perfectly good to me. – Zoredache Oct 11 '17 at 22:18
  • I would trust the numbers from df to be accurate more than the value reported by webmin. Sounds like an issue with how webmin determines disk usage. – sebasth Oct 11 '17 at 22:19
  • @sebasth Thats what I was thinking, but why would Webmin do this? – Erdss4 Oct 11 '17 at 22:22
  • @Erdss4 It might be a bug. You probably need to investigate how webmin determines disk usage (or ask developers) to know the exact reason. – sebasth Oct 11 '17 at 22:26

1 Answers1

1

4TB drives

First thing to understand is that hard drive vendors sell drives using sizes that are in powers of 10. Where as most software will be in powers of 2 (see binary prefixes). At smaller values that doesn't make much a difference but it is huge on a 4TB drive.

So 4 * 10^12 (size in TB) / 2^30 (1GiB) = 3725 GiB of storage. Ext2/3/4 will also reserve 5% (default) of your space for root by default so about 186 GiB. The df command doesn't consider that 'reserved' space as available, so after that you have ~3538.75 GiB which is relatively close to the 3.4T that df is reporting in what you posted.

Since you drive is almost certainly not exactly 4*10^12 bytes, and there is a bit of overhead from the filesystem, and some rounding when you use the -h human readable options everything looks more or less correct.

Zoredache
  • 3,640
  • Arrh I see now, how come Ext does this then? – Erdss4 Oct 11 '17 at 22:24
  • Found the reason I guess: https://unix.stackexchange.com/questions/7950/reserved-space-for-root-on-a-filesystem-why#7965 – Erdss4 Oct 11 '17 at 22:27
  • ext does this partly because of issues related to fragmentation when the filesystem becomes full, and to protect you from non-root services completely filling your drive and crashing the system. You can adjust the reserve percentage if you like. - https://unix.stackexchange.com/a/11630/1209 – Zoredache Oct 11 '17 at 22:28