1834157 Members
2364 Online
110064 Solutions
New Discussion

Re: Filesystem issue

 
Jacob D Levin
Frequent Advisor

Filesystem issue

Hi All, I'm having a problem with a usage amount discprepency. when I do a bdf it tells me the filesystem is using 1.77G, but when I do a du -sk it comes back at only 1.07G used. any idea why this would occur?
just hit enter, what could it hurt?
11 REPLIES 11
A. Clay Stephenson
Acclaimed Contributor

Re: Filesystem issue


This is not at all unusual. A file may have been unlinked (rm'ed) but not yet closed by a process. Sparse files will also do this. Imagine writing 1 byte at offset 0 and then seeking to offset 1,000,000 and writing 1 byte. You now have a two-byte file that occupies 1MB - a sparse fiile. Bdf and du report different aspects of the filesystem.
If it ain't broke, I can fix that.
Ken Hubnik_2
Honored Contributor

Re: Filesystem issue

Jeff Schussele
Honored Contributor

Re: Filesystem issue

Hi Jacob,

Suspect someone deleted a file that's still in use by a process. When that process ends or is terminated the space will truly be freed.
Use lsof on that FS to determine the process in question.

Rgds,
Jeff

PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Rizwan Mohammed
Frequent Advisor

Re: Filesystem issue

Hi

There may be some parent process which has died leaving child process in defunct state ,user fuser to check the process and kill if not nessary ,the space would return to normal .

Rizwan
Know ?Urself before judging others
Anil C. Sedha
Trusted Contributor

Re: Filesystem issue

Jacob,

Might be related to a deleted file which might still have not got closed.

So you don't see the file however see no difference in filesystem size.

I find it strange however, that it shows your bdf and du -sk outputs different.

Pls run a fuser -kc /dirname
from another directory. It would kill all links associated with that filesystem thus freeing up your space.

Let me know if this helps.

Regards,
Anil
If you need to learn, now is the best opportunity
monasingh_1
Trusted Contributor

Re: Filesystem issue

If you can nmount that filesystem, then try unmounting and mounting it back.You may not be able to unmount the filesystem if any process has the file open which seem sto be the issue.

Use fuser -ku and fuser -ck and then try unmounting and mounting it back.

This should resolve the problem. Otherwise unmount and fsck the filessytem.
Jacob D Levin
Frequent Advisor

Re: Filesystem issue

the filesystem it is occuring on is /usr . Not easy to kill processes as there are quite a few and this is a production box that users are not real happy about being without for a reboot
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol7 1843200 1783823 56717 97% /usr

wau009:/usr> du -sk .
1074460 .
just hit enter, what could it hurt?
Robert-Jan Goossens
Honored Contributor

Re: Filesystem issue

Hi,

download and install lsof,

http://hpux.cs.utah.edu/hppd/hpux/Sysadmin/lsof-4.64/

hope it helps,

Robert-Jan.
Jacob D Levin
Frequent Advisor

Re: Filesystem issue

ugh! It's compiled for 32 bit and I'm running 64 bit on this system!! It's always something
just hit enter, what could it hurt?
Robert-Jan Goossens
Honored Contributor

Re: Filesystem issue

Hi,

ftp://vic.cc.purdue.edu/pub/tools/unix/lsof/

all you have to do is say the name :-)

Robert-Jan.
Jacob D Levin
Frequent Advisor

Re: Filesystem issue

Ok I've gotten it running and here is one over about 500 pages of output. Should I kill the processes?
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NLINK NODE NAME
oraclePBR 2796 oracle 9w VREG 64,0x7 10956211 0 28648 /usr (/dev/vg00/lvol7)
oraclePBR 2796 oracle 10w VREG 64,0x7 10847762 0 29677 /usr (/dev/vg00/lvol7)
oraclePBR 2796 oracle 11w VREG 64,0x7 606105 0 30053 /usr (/dev/vg00/lvol7)
oraclePBR 2796 oracle 12w VREG 64,0x7 538843 0 24251 /usr (/dev/vg00/lvol7)
oraclePBR 2796 oracle 13w VREG 64,0x7 10813995 0 24282 /usr (/dev/vg00/lvol7)
oraclePBR 2796 oracle 14w VREG 64,0x7 11059174 0 25091 /usr (/dev/vg00/lvol7)
oraclePBR 2796 oracle 15w VREG 64,0x7 10723377 0 24287 /usr (/dev/vg00/lvol7)
oraclePBR 2796 oracle 16w VREG 64,0x7 10824955 0 29085 /usr (/dev/vg00/lvol7)
oraclePBR 2796 oracle 17w VREG 64,0x7 10654592 0 30141 /usr (/dev/vg00/lvol7)
oraclePBR 2796 oracle 18w VREG 64,0x7 693123 0 30549 /usr (/dev/vg00/lvol7)
oraclePBR 2796 oracle 19w VREG 64,0x7 605286 0 30645 /usr (/dev/vg00/lvol7)
just hit enter, what could it hurt?