I've used df -h to show me my disk usage:

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2       558G  249G  308G  45% /
udev             10M     0   10M   0% /dev
tmpfs           6.3G  8.8M  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
tmpfs            16G   20K   16G   1% /tmp
/dev/sda1       511M  180K  511M   1% /boot/efi
tmpfs           3.2G     0  3.2G   0% /run/user/0

I've then used ncduand found some large files in root's home directory, /root/. I've deleted the files and rebooted the machine to remove any open file handles, but the disk space did not clear up.

Why is df not updating/why is the root home directory not considered here? Are there any other directories that are not considered?

Thank you for your help.

Edit: The machine is using btrfs and I unfortunately don't know the setup details, maybe that's important as well.

I've tried the following to reproduce the issue: 1. df -h to check the usage on / 2. du -sh /root to see the folder size 3. create big file in /root 4. du -sh /root shows a bigger folder size 5. df -h does not

I don't understand what's going on :(

Kind regards

  • Could you add to the question the actual output for each command, when you reproduce the issue? And ls -ld /root would help too. – Eduardo Trápani Oct 30 '19 at 16:44

A possibility is that the files under /root that you deleted where actually hard links to files somewhere else on the filesystem. Thus you deleted the inode, but maybe the files still have active inodes somewhere else on the filesystem.

| improve this answer | |
  • Thanks for the suggestion, but I checked using ls -l before deleting and there was just one link. So that cannot be the case :/ (and also ncdu doesn't show the large file anymore) – Maxbit Oct 30 '19 at 12:58
  • A hard link just looks like a file. It is not shown like a symlink. – Gerald Schneider Oct 30 '19 at 13:37
  • From what I know, ls -lshows the number of inode references, which was 1. – Maxbit Oct 30 '19 at 14:30

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.