1

I have a case like this. One partition 7.7GB, And I cannot where this space was used.

/# df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            488M     0  488M   0% /dev
tmpfs           100M   11M   89M  11% /run
/dev/xvda1      7.7G  7.7G   32M 100% /
tmpfs           496M     0  496M   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           496M     0  496M   0% /sys/fs/cgroup
tmpfs           100M     0  100M   0% /run/user/1000

Then i check all dirs strtging from /

/# ls -c1 |xargs du -sh
120K    tmp
644M    boot
0   initrd.img
0   initrd.img.old
0   vmlinuz
0   vmlinuz.old
0   sys
11M run
5.8M    etc
16M bin
14M sbin
8.0K    snap
36K root
1.3G    lib
4.0K    lib64
268M    home
0   dev
0   proc
884M    var
4.6G    usr
4.0K    srv
4.0K    media
4.0K    mnt
4.0K    opt
16K lost+found

And root directory doesn't contain any big files

/# ls -Shsr
total 96K
   0 sys      0 vmlinuz.old     0 initrd.img.old     0 run  4.0K var  4.0K tmp  4.0K snap  4.0K opt  4.0K media  4.0K lib   4.0K etc   12K sbin   16K lost+found
   0 proc     0 vmlinuz         0 initrd.img         0 dev  4.0K usr  4.0K srv  4.0K root  4.0K mnt  4.0K lib64  4.0K home  4.0K bin   12K boot

Where could be this space use ?

This is ext4 filesystem /dev/xvda1 / ext4 rw,relatime,discard,data=ordered 0 0

2

1 Answer 1

0

Run the following command on each top level directory as root. For example: /usr, /home, and /var. Don't run it /proc or /sys because those will just give errors because they aren't real directories.

du | sort -nr | head -10

This command will give you the top 10 largest sub-directories in each directory. You can change the "-10" to "-25" if you want the top 25 largest directories. When I was a sysadmin, we used this a lot of client servers that were using too many disk space to pinpoint where it was happening.

1
  • I have the same problem as OP and the space is not accounted for using "du" or "ncdu" Dec 13, 2019 at 17:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.