Wenig Speicherplatz unter Linux

Wenig Speicherplatz unter Linux

Ich habe nur noch wenig Speicherplatz (71 % von 10 GB sind belegt)

df -h
Filesystem                                              Size  Used Avail Use% Mounted on
rootfs                                                  9.8G  6.5G  2.8G  71% /
udev                                                     10M     0   10M   0% /dev
tmpfs                                                   3.0G  128K  3.0G   1% /run
/dev/disk/by-uuid/af9b99b8-9f61-4eee-aa51-d5113368814d  9.8G  6.5G  2.8G  71% /
tmpfs                                                   5.0M     0  5.0M   0% /run/lock
tmpfs                                                   6.0G     0  6.0G   0% /run/shm
tmpfs                                                   1.0G  6.1M 1018M   1% /mnt/tmp

Aber wenn ich diesen Befehl zur Überprüfung ausführe, werden nur 1,5 G verwendet

sudo du --all --one-file-system / | awk '{if($1 > 102400) print int($1/1024) "MB" " " $2 }'
117MB /var/cache/apt/archives
164MB /var/cache/apt
168MB /var/cache
132MB /var/lib/apt/lists
132MB /var/lib/apt
148MB /var/lib
416MB /var
115MB /lib/modules/3.16.0-0.bpo.4-amd64/kernel/drivers
159MB /lib/modules/3.16.0-0.bpo.4-amd64/kernel
163MB /lib/modules/3.16.0-0.bpo.4-amd64
163MB /lib/modules
175MB /lib
223MB /usr/lib
146MB /usr/local/lib
106MB /usr/local/share
267MB /usr/local
199MB /usr/share
754MB /usr
1541MB /

Irgendwelche Ideen?

Antwort1

Wenn ein Prozess einen offenen Dateihandle zu einer großen Datei hat, die gelöscht wurde, wird dieser zwar noch in der Datenträgernutzung angezeigt, aber auf die Datei kann nicht zugegriffen werden, und sie wird nicht unter angezeigt du.

# Create large file
$ df .
Filesystem   512-blocks      Used  Available Capacity  iused     ifree %iused  Mounted on
/dev/disk0s2 1951845952 284650968 1666682984    15% 35645369 208335373   15%   /

$ du -s
2604488     .

# Remove the file -note how the du result decreases

$ rm junk

$ df .
Filesystem   512-blocks      Used  Available Capacity  iused     ifree %iused  Mounted on
/dev/disk0s2 1951845952 285526568 1665807384    15% 35754819 208225923   15%   /

$ du -s
61728       .

# Kill the process holding the file - now the df usage decreases

Filesystem   512-blocks      Used  Available Capacity  iused     ifree %iused  Mounted on
/dev/disk0s2 1951845952 282561000 1668772952    15% 35384123 208596619   15%   /
$ du -s
61736       .

verwandte Informationen