You are not logged in.

#1 2022-01-17 21:25:34

mintsoup
Member
Registered: 2020-09-06
Posts: 5

Disk usage doubled for no reason, du can't find the biggest files

I have a 75G root partition, and until a few hours ago the disk usage was less than 30 gigabytes. Now, however, when I run

df -h

, it shows 46 gigabytes of disk usage. I do not remember doing anything that would create this much disk usage, and not even du can find the offending files.
Here's the relevant line:

Filesystem      Size  Used Avail Use% Mounted on
dev/nvme0n1p4   74G   46G   25G  66% /

and here's the output of

du -h --max-depth=1 / -x 2>&1 | grep -v -i "permission denied" | sort -hr

:

26G     /
19G     /usr
5.3G    /home
1.1G    /opt
328M    /var
11M     /etc
16K     /lost+found
12K     /srv
4.0K    /root
4.0K    /mnt

As you can see, according to du, the root partition has only 26 gb of files. What's going on here? My inodes seem fine:

df -h -i
Filesystem     Inodes IUsed IFree IUse% Mounted on
/dev/nvme0n1p4   4.7M  584K  4.2M   13% /

What's going on here?

Last edited by mintsoup (2022-01-17 21:25:48)

Offline

#2 2022-01-17 22:44:58

mpan
Member
Registered: 2012-08-01
Posts: 1,625
Website

Re: Disk usage doubled for no reason, du can't find the biggest files

You are ignoring the “permission denied” warnings, which suggests the command is not run as root and therefore it skips everything it can’t access and is not counting that towards the total size. In particular it will skip log directories and some service-specific data directories. Re-run the command as root.

For identifying specific sources of disk usage, see community/ncdu.

Last edited by mpan (2022-01-17 22:45:44)

Online

#3 2022-01-18 08:08:48

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,096

Re: Disk usage doubled for no reason, du can't find the biggest files

Disk usage doubled

was less than 30 gigabytes. Now … 46 gigabytes

This incident has been reported to your math teacher.

The insufficient permissions aside (maybe you added a swap file?), disk usage can be stashed in a mount point, eg. /boot being ignored by du for being a different partition, but if you'd unmount that, you'd find a bunch of files flying around there.

Offline

Board footer

Powered by FluxBB