I have a 115GB partition on my hard disk (output of cgdisk /dev/sda is below):
Part. # Size Partition Type Partition Name
----------------------------------------------------------------
1007.0 KiB free space
1 499.0 MiB Windows RE Basi
2 100.0 MiB EFI System EFI
3 16.0 MiB Microsoft reserved Micr
5 43.9 GiB Linux filesystem ubuntu-root
6 43.9 GiB Linux filesystem ubuntu-home
4 114.9 GiB Linux filesystem data <--- this partition
7 29.5 GiB Linux filesystem
And I have mounted that partition on /data in my /etc/fstab:
UUID=<drive-uuid> /data ext4 defaults 0 0
When I do df -h /data, I have the following output:
Filesystem Size Used Avail Use% Mounted on
/dev/sda4 113G 96G 11G 90% /data
And when I use du like this: du /data -h --max-depth=1 | sort -hr, I see this:
51G /data
40G /data/virtual-box
4.4G /data/temp
4.1G /data/manjaro-minikube
1.9G /data/.nuget
764M /data/OneDrive
62M /data/manjaro-lxd
40K /data/.minikube
16K /data/lost+found
which, if I'm not mistaken, is showing that /data is taking 51G and then I have the virtual-box, temp, manjaro-minikube, and .nuget directories taking space (the other ones don't take significant space)
If I do a long listing of my directory (ls -alh /data):
total 68K
drwxr-xr-x 10 farzad farzad 4.0K Aug 13 21:47 .
drwxr-xr-x 19 root root 4.0K Jul 13 10:32 ..
drwx------ 2 farzad farzad 16K Mar 22 18:22 lost+found
drwx--x--x 15 root root 4.0K Aug 20 17:47 manjaro-lxd
drwxr-xr-x 3 farzad farzad 4.0K Jul 3 18:16 manjaro-minikube
drwxrwxr-x 9 farzad farzad 4.0K Jul 30 17:38 .minikube
drwxr-xr-x 202 farzad farzad 16K Aug 17 10:00 .nuget
drwxr-xr-x 3 farzad farzad 4.0K Aug 13 21:47 OneDrive
drwxrwxr-x 16 farzad farzad 4.0K Jun 3 21:45 temp
drwxr-xr-x 6 farzad farzad 4.0K Aug 20 20:21 virtual-box
I don't see any file or something contributing to that 51G reported for /data, so I expect my drive to have almost 65G empty space, but for some reason, the /data parent directory is taking 51G by itself!
I tried researching the Internet, but I couldn't find anything. Can someone please let me know what's happening?
UPDATE
As suggested in the answers, I ran lsof /data | grep deleted (as root), but I don't have any result, although I see a warning, which I'm not sure is relevant:
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
Output information may be incomplete.
e2fsck -f /dev/sda4after unmounting; or schedule the check withtune2fs(e.g. this answer) so it happens during reboot. After you confirm the filesystem is healthy and in a consistent state, rundfandduagain. Please report if the discrepancy is still there, edit the question if needed. – Kamil Maciorowski Aug 22 '19 at 11:41/etc/fstabto addfsckto the file system, and I'm somehow "shocked" by how much more available space it reports now :). I didn't want to take credit for what you suggested, so I didn't "answer" my question. Please let me know what we can do for the answer. – Farzad Aug 23 '19 at 19:220in the sixth field in thefstabentry. If your answer is going to be like "0is bad, it makesfscknot run; seeman 5 fstaband change accordingly (to2in this case); after I did this…" (post new output ofdf,du) – then yes!, add your own answer, because this is new and useful, brings attention tofstabwhere the primary culprit was; it's not an ad-hoc fix, it will prevent similar situations in the future. In your answer you may admit you misinterpreteddu(I think you did). Accept your answer and I will gladly upvote it. – Kamil Maciorowski Aug 23 '19 at 20:03