df report

der.hans PLUGd@LuftHans.com
Sun, 10 Dec 2000 23:11:24 -0700 (MST)


Am 09. Dec, 2000 schwäzte Mike Starke so:

> After deleteing a very large file which grew out
> of control in one of users home directories, the
> command 'df' still shows that partition with the same
> amount of disk usage. How can I reclaim that space?

The fastest way to regain space from a big file is to null it out, e.g.

'>/the/file'

After that remove it. This also works if you have w perm on a file, but
not on the dir it's in.

> For instance; before the file was deleted,
> df reported 36% of /home was used. After the file
> was deleted, df still reports 36%.
> df -i will report 0% IUse.
> 
> a normal df command on that partition will report
> roughly 3-5%.

Use du to narrow down where the large file is.

For space probs df and du are like bishops in chess. One controls one set
of squares, the other the other set. find (with grep) is the queen on
serious steroids :).

In later posts you said you tried finding what's using the space via find,
but didn't succeed. du will help you narrow down where in the tree the
space is being used.

find /home -name \.[^.]* | less

That finds dotfiles and dirs, but ignores '..'. You could better narrow it
down to look for dotdirs in one instance and dotfiles above a certain size
in another.

Check space under mounts, e.g. if /home is a mount point, unmount /home
and make sure you don't have stuff in /home on the root partition. This is
unlikely to be what you have since you're missing space in /home not in /,
but it's one of the basic things to check, so I threw it in :).

Check for .. files that don't point to a parent dir. Someone else
mentioned looking for ... files. My find above won't find those.

Is /home the same size it was before? Takes some skill to shrink a
filesystem, but it isn't impossible, especially if you've been cracked.

Check for dirs that are large, e.g. probably anything greater than 4096,
as they are a probable indication of a bunch of little files.

Check that there weren't any hard links to the file. Your find queries
should've found those, though.

ciao,

der.hans
-- 
#  der.hans@LuftHans.com   home.pages.de/~lufthans/   www.Opnix.com
#  A t-shirt a day keeps the noose (tie) away. - der.hans