0

I have 1 TB of space.
I am trying to find disk usage of a folder.
du -sh command output

354M    Arts
2.6M    Digicams
308M    Internet
391M    Location
2.2G    Media
110M    Religion
4.8T    Sports          /*What is T how can it be Terabyte*/

df -h command output

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2       885G  155G  686G  19% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
udev             16G  4.0K   16G   1% /dev
tmpfs           3.2G  1.3M  3.2G   1% /run
none            5.0M     0  5.0M   0% /run/lock
none             16G   70M   16G   1% /run/shm
none            100M   40K  100M   1% /run/user
/dev/sda1       511M  3.4M  508M   1% /boot/efi
Wazzzy
  • 147
  • 1
  • 6

1 Answers1

1

Either your filesystem is somehow corrupted or there's a huge sparse file or multiple sparse files in the Sports directory. Check this out:

jaba@jaba-ubuntu:~$ dd if=/dev/zero of=I_am_a_huge_sparse_file bs=1M count=1000000 conv=sparse
1000000+0 records in
1000000+0 records out
1048576000000 bytes (1,0 TB) copied, 173,006 s, 6,1 GB/s
jaba@jaba-ubuntu:~$ ls -lah I_am_a_huge_sparse_file 
-rw-rw-r-- 1 jaba jaba 977G syys  29 09:06 I_am_a_huge_sparse_file
jaba@jaba-ubuntu:~$ df -h /
Filesystem                   Size  Used Avail Use% Mounted on
/dev/mapper/ubuntu--vg-root   18G  8,8G  7,7G  54% /
Janne Pikkarainen
  • 31,852
  • 4
  • 58
  • 81
  • The thing with sparse files is, `du` shows their *actual* disk usage (`ls` does the same with `-s`: "allocated size"), as opposed to `ls`, which shows their logical size. `stat` probably gives the best overview including both. – ptman Sep 29 '14 at 06:38
  • @ptman Thanks for the answer but what should I do now, deleting the complete Folder will make my filesystem ok. – Wazzzy Sep 29 '14 at 07:56
  • It sounds like filesystem corruption. Run fsck. – ptman Sep 29 '14 at 07:59