G
G
German Malinovsky2015-12-03 12:49:08
linux
German Malinovsky, 2015-12-03 12:49:08

Out of disk space. How to determine exactly where the cause is?

I execute df -h

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        48G   48G     0 100% /
udev             10M     0   10M   0% /dev
tmpfs           792M   33M  759M   5% /run
tmpfs           2.0G   92K  2.0G   1% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
tmpfs           396M   24K  396M   1% /run/user/1000

48G out of 48G is busy. Apparently there is no space.
Execute du -kxh | egrep -v "\./.+/" | sort -n on root folder /
3.4G    ./usr
4.0K    ./lib64
4.0K    ./mnt
4.0K    ./opt
4.0K    ./srv
4.3G    .
5.1M    ./tmp
7.7M    ./etc
8.0K    ./media
8.5M    ./sbin
9.6M    ./home
12M     ./bin
16K     ./lost+found
31M     ./boot
38M     ./root
207M    ./lib
620M    ./var

That is, only 4.3G is occupied by all the folders? Where did the place 48G-4.3G Ran
ncdu on the root folder
3.3GiB [##########] /usr
  616.0MiB [#         ] /var
  206.2MiB [          ] /lib
   37.8MiB [          ] /root
.  32.7MiB [          ] /run
   30.0MiB [          ] /boot
   11.7MiB [          ] /bin
    9.5MiB [          ] /home
    8.5MiB [          ] /sbin
    7.7MiB [          ] /etc
   92.0KiB [          ] /dev
   64.0KiB [          ] /tmp
e  16.0KiB [          ] /lost+found
    8.0KiB [          ] /media
    4.0KiB [          ] /lib64
e   4.0KiB [          ] /srv
e   4.0KiB [          ] /opt
e   4.0KiB [          ] /mnt
.   0.0  B [          ] /proc
    0.0  B [          ] /sys
@   0.0  B [          ]  initrd.img
@   0.0  B [          ]  vmlinuz
 Total disk usage:   4.2GiB  Apparent size:   4.2GiB  Items: 266400

Again, almost 4.3G
Why such differences in numbers? Where are the rest of the gigabytes?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
L
ldv, 2015-12-03
@ldvldv

see the size of deleted but used files

sudo lsof | awk '/deleted/ {sum+=$7} END {print sum}'

V
Vlad Zhivotnev, 2015-12-03
@inkvizitor68sl

https://debian.pro/1654

M
Max, 2015-12-03
@MaxDukov

try to startdu -hs /*

S
Softer, 2015-12-03
@Softer

Maybe something "holds" the deleted file? For example log. Look:
sudo lsof | grep -i delete

A
Alexander Vorobyov, 2015-12-03
@AlexVor

maybe the disk was not properly marked when installing Linux'a? Didn't think about it

V
Vladimir, 2015-12-03
@rostel

take a look at the output
mount
root mounted in read-only mode?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question