LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-14-2012, 01:45 AM   #1
deepak_message
Member
 
Registered: Oct 2007
Posts: 175

Rep: Reputation: 17
wrong space usied by /opt


One of redhat server using hide space. unabel to find which space.
/opt has 10gb space, it has using only 500mb. when I do run df -h, it shows 90% use.
please help to find out.
 
Old 08-14-2012, 02:05 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Quote:
Originally Posted by deepak_message View Post
One of redhat server using hide space.
I don't understand what you mean by this.

Did you use `du -s /opt' to get the 500 MB number?

Is /opt on it's own partition. df will report on the free space and usage of the entire filesystem, not just of a directory.
Another possibility is a sparse file which uses less actual physical space then its size indicates.

A deleted file can still be open by a process, resulting in less free space available. This will be found in /var/run/, /var/tmp/ and /tmp/. Processes do this to prevent accidental temporary file name collisions, and to delete the file automatically if the process crashes. But du won't count it because it isn't in the directory listing.
 
Old 08-14-2012, 02:56 AM   #3
deepak_message
Member
 
Registered: Oct 2007
Posts: 175

Original Poster
Rep: Reputation: 17
yes, when I do du -s /opt' it shows one file whose size is 500MB. nothing else.
but when dun df -h, showing used 90% used /opt.
 
Old 08-14-2012, 04:58 AM   #4
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
Can you paste output of these commands (du and df) here. And "ls -la /opt".
 
Old 08-14-2012, 05:20 AM   #5
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
Processes can keep files open although they are no longer on the system (e.g. deleted). df will include the size of those files while du does not see them.
The easiest is to reboot the system as that will clear it. The alternative is to use lsof and see which processes have files open and restart those processes.

Code:
lsof |grep deleted
 
Old 08-14-2012, 05:48 AM   #6
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
Code:
wim@webserver:~$ df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/cciss/c0d0p4     29577108   3773700  24300948  14% /
/dev/cciss/c0d0p1       489942     27225    437422   6% /boot
/dev/cciss/c0d0p3      3939548    133028   3606396   4% /var
/dev/cciss/c0d1p1    282236376  32795092 235104480  13% /home
wim@webserver:~$ du -k --max-depth 1
170304  ./databases
52      ./forums
31108720        ./backup
20      ./.ssh
540     ./vsftpd-upgrade
1076    ./jannie_assetregister
1101660 ./websites
32382612        .
After opening a file with vim, a temporary file is created by vim
Code:
wim@webserver:~$ df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/cciss/c0d0p4     29577108   3773700  24300948  14% /
/dev/cciss/c0d0p1       489942     27225    437422   6% /boot
/dev/cciss/c0d0p3      3939548    133028   3606396   4% /var
/dev/cciss/c0d1p1    282236376  32795096 235104476  13% /home
wim@webserver:~$ du -k --max-depth 1
170304  ./databases
52      ./forums
31108720        ./backup
20      ./.ssh
540     ./vsftpd-upgrade
1076    ./jannie_assetregister
1101660 ./websites
32382628        .
After deleting the temporary file

Code:
wim@webserver:~$ df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/cciss/c0d0p4     29577108   3773700  24300948  14% /
/dev/cciss/c0d0p1       489942     27225    437422   6% /boot
/dev/cciss/c0d0p3      3939548    133032   3606392   4% /var
/dev/cciss/c0d1p1    282236376  32795108 235104464  13% /home
wim@webserver:~$ du -k --max-depth 1
170304  ./databases
52      ./forums
31108720        ./backup
20      ./.ssh
540     ./vsftpd-upgrade
1076    ./jannie_assetregister
1101660 ./websites
32382612        .
wim@webserver:~$ lsof |grep deleted
vim       16744        wim    4u      REG 104,17   16384 12304625 /home/wim/.goodthingaboutwindows.jpg.swp (deleted)
And after quitting vim, everything is normal again.
 
Old 08-16-2012, 01:42 AM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You haven't indicated if /opt is a mount point for a partition or if it is a directory on the root file system. If it is a directory, then df is reporting on the disk usage of /.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
shell getopts: opt w/ optional parameter is taking next opt as its parameter! GrapefruiTgirl Programming 22 10-27-2010 06:00 AM
convert dos2unix /opt/SV DC/*.* using system command.Here path is having space. nagendrar Linux - Newbie 1 08-06-2009 05:27 AM
Wrong disk free space (VERY wrong) macrojd Linux - Server 12 05-17-2009 02:14 AM
Regarding # /opt/CTEact/bin/act & /opt/SUNWexplo/bin/explorer not available for x86 rajaniyer123 Solaris / OpenSolaris 6 04-24-2008 09:09 AM
What is wrong with reiserfs? wrong free space mesh2005 Linux - General 1 05-03-2007 07:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration