SUMMARY: Resetting a UFS that thinks it's full.

From: Rick von Richter (
Date: Wed Apr 23 1997 - 15:59:12 CDT

Thanks to all who responded... The itchy reply finger award goes to Bruce
Rossiter for getting the fastest response back. 8-)

Original Question:

We have various machines (Sparc 4,5,20,1000,2000,Ultra 2) all running Solaris
2.5.1. Once in a while a filesystem will fill up to capacity usually from some
runaway process that those lovely developers like to run. After we find the
culprit and delete the massive offending file (not to mention beating the
offending user liberally about the head and shoulders), the filesystem will not
reset itself. When I type in 'df -lk', the filesystem (/home) still thinks it's
at 100%. But a 'du -sk /home' shows that it is definitely not full. The only
way I have found to reset the filesystem is to umount then mount the filesystem.
 Unfortunately, this is the user's home dirs and the only way to umount the
filesystem is to do an 'fuser -cuk /home' which kills all the processes
associated with the /home partition. Then I can umount/mount /home. Is there
any way I can reset the UFS so that I don't have to kick everyone off?


Everyone who responded had the same answer: Just deleting the file isn't
enough. The process that has that file open must also be killed to free the
space it has allocated. The best program I have found for this is lsof
( I use lsof all the
time and forgot to mention it in my post. There are at least three scenarios;

1) You know the name of the file that is growing huge. This is the easiest one.
Just run 'lsof <path-to-huge-file>' e.g. lsof /tmp/hugefile This will show
you the process and the PID that has this file open. You can then kill the
process and delete the file.

2) You DON'T know the name of the file but DO know the name of the user. Do an
'lsof -u<username|userid>' This will show you the users processes and the open
files associated with them. This can be a lot of info you have to wade thru
hopefully you can pick out the offending process. If not you can kill that
users sessions, then do an lsof -u<user> to see if anything is left.

3) You don't know squat about the culprit. All you know is what filesystem is
full. This was my case a couple of times. There are no large files and none of
the users will fess up to anything (typical). You're basically left with doing
an 'lsof <filesystem>' e.g. lsof /home Alas, if there are 50 people logged in
you can see the immediate the heck do you know which one is
causing the problem. That's when I resort to 'fuser -cuk /home' then
umount/mount /home. If anybody has a better way please let us know.

Thanks to all the reponders;

"Bruce Rossiter" <>
Tom Mornini <>
Ric Anderson <>
Rich Kulawiec <>
Glenn Satchell <>
White Gary <>
Casper Dik <casper@holland.Sun.COM> (Ray Trzaska)
Douglas Weigold <>
"Iskander, Tim" <>
Per Boussard <>
"K.Ravi" <> (Sean Ward)

  Rick von Richter | Phone: 619-552-6222
  Systems/Network Admin | Fax: 619-552-6221
  Maintenance Warehouse | Email:
     Science is true. Don't be misled by facts.

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:11:51 CDT