Hello,
The hard disk partion / is 99% full on the server which is of 2 GB.
However when we use du -h --max-depth 1 it does not show which file is occouping so much of disk space on /
How can we find out what is cause of 99% disk usges full?
Please advise.
I would suggest using lsof and look for files marked as (deleted) . It is possible that a process still has a file open that has been deleted from the filesystem. In this case, the space will not be reclaimed until the process closes the file. You can force this to happen by killing the process, but this should be a last resort option.
For a start, get into the 'unmounted' directories under / and check their sizes using du -sh
Unmounted directories are directories OTHER THAN your already mounted directories like /usr,/home,/var etc.
Code:
for i in `find / -maxdepth 6 -type d`; do num=`du -s $i | awk '{print $1}'`; echo "$num $i"; done | sort -n
Run this script. At the end of the result, you will get a listing of files/directories that uses max disk space
Hi!
Tried your command but it gives disk size for all i.e /home .usr etc..
Also how to see which folder is un mounted ?
root@srv [~]# du -csh *
8.0K anaconda-ks.cfg
12K cpanel3-skel
2.3M csf
12K install.log.syslog
4.0K public_ftp
8.0K public_html
4.0K tmp
2.4M total
However df -m says this:-
root@srv [~]# df -m
Filesystem 1M-blocks Used Available Use%...
The result of that command will show you which file/directory is taking maximum disk space. Its sorted in ascending order, so the required directories will be at the end of the list.
First - reboot the server
Then go under each directory under /, like /var is a good start and run "du - sh ./" command. You may see abnormalities. Check the size of the log file /etc/httpd/logs
see /var/log files (ls -lh)
see files under /var/www/html
these are the places where usually files are growing. Otherwise you server may be hacked and somebody is putting files anywhere they want.
tulix View Beta Profile Web Hosting Master replied 1 month, 1 week ago
First - reboot the server
Then go under each directory under /, like /var is a good start and run "du - sh ./" command. You may see abnormalities. Check the size of the log file /etc/httpd/logs
see /var/log files (ls -lh)
see files under /var/www/html
these are the places where usually files are growing. Otherwise you server may be hacked and somebody is putting files anywhere they want.
Hi! Tried your command but it gives disk size for all i.e /home .usr etc.. Also how to see which folder is un mounted ? root@srv [~]# du -csh * 8.0K anaconda-ks.cfg 12K cpanel3-skel 2.3M csf 12K install.log.syslog 4.0K public_ftp 8.0K public_html 4.0K tmp 2.4M total However df -m says this:- root@srv [~]# df -m Filesystem 1M-blocks Used Available Use% Mounted on /dev/sda6 1984 1846 36 99% / Any idea? Thanks
The result of that command will show you which file/directory is taking maximum disk space. Its sorted in ascending order, so the required directories will be at the end of the list.
I would suggest using lsof and look for files marked as (deleted) . It is possible that a process still has a file open that has been deleted from the filesystem. In this case, the space will not be reclaimed until the process closes the file. You can force this to happen by killing the process, but this should be a last resort option.
For a start, get into the 'unmounted' directories under / and check their sizes using du -sh Unmounted directories are directories OTHER THAN your already mounted directories like /usr,/home,/var etc.
First - reboot the server Then go under each directory under /, like /var is a good start and run "du - sh ./" command. You may see abnormalities. Check the size of the log file /etc/httpd/logs see /var/log files (ls -lh) see files under /var/www/html these are the places where usually files are growing. Otherwise you server may be hacked and somebody is putting files anywhere they want.
First - reboot the server Then go under each directory under /, like /var is a good start and run "du - sh ./" command. You may see abnormalities. Check the size of the log file /etc/httpd/logs see /var/log files (ls -lh) see files under /var/www/html these are the places where usually files are growing. Otherwise you server may be hacked and somebody is putting files anywhere they want.
Related threads on "WebHostingTalk Forums - Web Hosting Discussion":
Thread profile page for "HDD / issue" on http://www.webhostingtalk.com.
This report page is a snippet summary view from a single thread "HDD / issue", located on the Message Board at http://www.webhostingtalk.com.
This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity