Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello,
I'm using Centos 6.x, and I just detected today that mysql cannot start up due to critical disk quota.
The server is not hardly charged, indeed it's just runing asterisk in realtime, so all it's stored in mysql db.
When i went into the log directory to try to remove some of apache logs, i made a mistake and delete all over the log directory, so then I had to restor it with:
Quote:
find -type f -exec cat /dev/null > {} \;
But, even after deleting all over the /var/log directory, I still having my disk space in 88%, when I do:
That's a bit confusing but I'll try to go to what I think your basic issue is: You have space tied up in a filesystem as shown by df -h but NOT show by du -h?
This is commonly caused when a file that is being held "open" by some process is "deleted". What actually happens is that only the file "name" is deleted in such a case. The filesystem holds "inodes" for each file and when you delete the "name" the "inode" is left intact due to the "open". You can try to find what file is "open" by using lsof and looking for a large sized regular file with no name. You can then examine the process ID shown for that file and see if it is safe to stop (kill). If so killing the PID will free the "open" and the "inode" deletion will complete.
You can also simply reboot the server as that will kill all processes which will free the "open" file.
Thank you for your promt MensaWater, but I already have rebooted the server after deleting the log directory and recover it, I reboot to re-locate the logs and correct everything, but the disk space still the same...
Doing lsof, I get really huge list, but as I see there's nothing as no name...
Odd layout you have there. All of your /dev/root entries are talking about the same filesystem so I'm assuming you're doing the bind mounts for the /var/named stuff but not sure why.
It shows root (/) which is mounted from /dev/root is 88% full.
It shows /home is only 1% full so you have plenty of free space there.
Since you've done the reboot the open file issue I spoke of wouldn't be the problem.
Common things to look for when trying to free space:
/tmp - Files here are "temporary" so can typically be deleted if not in use by running processes. (Running lsof against a file there will tell you if it is currently open.)
/var/tmp - Same thing - often this is a link back to /tmp.
/var/log - System log files such as /var/log/messages, /var/log/maillog etc... are there. Sometimes these can get quite big if something is going on.
Other things in /var as well - depends on setup. For example on RHEL/CentOS/Fedora /var/cache/yum can get quite big and can be cleaned with yum commands.
What kind of logs do you have under /var/named/chroot and its subdirectories. If you've enabled full BIND logging the logs here could get very large.
A good way to narrow down by directory level that I like to do is:
du -sk / |sort -n
That will show you the largest items under / in reverse order so the largest are at the bottom of the list. If for example this then displayed that /var was the largest you could do:
du -sk /var |sort -n
to see what is largest under var. If that showed you log was the largest you could do:
du -sk /var/log |sort -n
and so on... until you found what files to clean.
Another thing to look for is "core" dump files. Doing
find / -name core
will list core files. Run "file" command against each file found and if it shows it to be a core dump it is typically safe to delete. (Be sure to do the "file" command though - some applications these days create directories or files named core that are not simple core dumps and should not be deleted [Oracle e.g.])
Mail files (especially root's) can often become quite large if you're not reading the mail regularly and deleting messages so that would be another thing to check.
It shows /home is only 1% full so you have plenty of free space there.
Because the home directory it's empty, i don't use it, as the server is running asterisk&a2billing in real time, data are stored in database, and I have a small webs one in magento and other wordpress, so there's nothing to store in home for me...
Quote:
Common things to look for when trying to free space:
/tmp - Files here are "temporary" so can typically be deleted if not in use by running processes. (Running lsof against a file there will tell you if it is currently open.)
Sure, this was first what I did, as the server was stacked, and could do nothing, so first I delete the tmp to go ahead and see what's going there...
Quote:
/var/tmp - Same thing - often this is a link back to /tmp.
/var/log - System log files such as /var/log/messages, /var/log/maillog etc... are there. Sometimes these can get quite big if something is going on.
Done, thanks.
Quote:
Other things in /var as well - depends on setup. For example on RHEL/CentOS/Fedora /var/cache/yum can get quite big and can be cleaned with yum commands.
I have run yum clean-all etc... and as i said, lastly by error, i have deleted all over the /var/log directory with rm -rf *...
Quote:
What kind of logs do you have under /var/named/chroot and its subdirectories. If you've enabled full BIND logging the logs here could get very large.
I have
Quote:
ls -la /var/named/chroot
total 24
drwxr-x--- 6 root named 4096 ene 10 10:13 .
drwxr-x--- 6 root named 4096 ene 10 10:13 ..
drwxr-x--- 2 root named 4096 ene 10 10:13 dev
drwxr-x--- 4 root named 4096 mar 21 19:23 etc
drwxr-xr-x 3 root root 4096 jul 8 2011 usr
drwxr-x--- 6 root named 4096 ene 10 10:13 var
Quote:
A good way to narrow down by directory level that I like to do is:
du -sk / |sort -n
When I do this, I get an error strange message, it's in spanish, no idea why, and strange contain:
Quote:
du -sk / |sort -n
du: ATENCIÓN: Estructura de directorios circular.
Esto quiere decir seguramente que el sistema de ficheros está corrupto.
COMUNÍQUELO AL ADMINISTRADOR DEL SISTEMA.
El siguiente directorio es parte del ciclo:
«/var/named/chroot/var/named»
du: no se puede acceder a «/proc/4408/task/4408/fd/4»: No existe el fichero o el directorio
du: no se puede acceder a «/proc/4408/task/4408/fdinfo/4»: No existe el fichero o el directorio
du: no se puede acceder a «/proc/4408/fd/4»: No existe el fichero o el directorio
du: no se puede acceder a «/proc/4408/fdinfo/4»: No existe el fichero o el directorio
8514804
Quote:
That will show you the largest items under / in reverse order so the largest are at the bottom of the list. If for example this then displayed that /var was the largest you could do:
du -sk /var |sort -n
Here i get similar error:
Quote:
du -sk /var |sort -n
du: ATENCIÓN: Estructura de directorios circular.
Esto quiere decir seguramente que el sistema de ficheros está corrupto.
COMUNÍQUELO AL ADMINISTRADOR DEL SISTEMA.
El siguiente directorio es parte del ciclo:
«/var/named/chroot/var/named»
4947700 /var
Quote:
to see what is largest under var. If that showed you log was the largest you could do:
du -sk /var/log |sort -n
Sorry I left out the asterisk in the du command suggestions.
try du -sk /*, du -sk /var/*, du -sk /var/log/* each piped to the sort -n.
Not sure why you're getting Spanish (or Portuguese maybe?). /proc is a pseudo filesystem so you can ignore stuff about that. The other message about /var/named* would appear to be saying it is a circular reference which makes sense given that it is a bind mount of / - I'd probably ignore that as well.
Your original line where you said you "restored" using find doesn't make any sense to me. You can NOT just go and delete and/or truncate all files in a directory. Part of your foreign language output seems to be indicating corruption of some sort. It might be a good idea to boot to single user and do a full fsck of / to make sure it is OK.
Did /var/log get recreated after the reboot you did earlier?
Disposit. Inicio Comienzo Fin Bloques Id Sistema
/dev/sda1 * 1 1306 10485760+ fd Linux raid autodetect
/dev/sda2 1306 14528 106204160 fd Linux raid autodetect
/dev/sda3 14528 14593 526304 82 Linux swap / Solaris
Disposit. Inicio Comienzo Fin Bloques Id Sistema
/dev/sdb1 * 1 1306 10485760+ fd Linux raid autodetect
/dev/sdb2 1306 14528 106204160 fd Linux raid autodetect
/dev/sdb3 14528 14593 526304 82 Linux swap / Solaris
I'm with MensaWater, it looks really funky (err I mean odd).
You seem to have bind-mounted lots, inc 2 copies of
/dev/root 10G 8,3G 1,2G 88% /var/named/chroot/etc/named
/dev/root 10G 8,3G 1,2G 88% /var/named/chroot/var/named
Code:
cat /etc/mtab
I'd recommend backing everything up, then doing a reboot & fsck, like he said
I'm with MensaWater, it looks really funky (err I mean odd).
You seem to ahve bind-mounted lots, inc 2 copies of
/dev/root 10G 8,3G 1,2G 88% /var/named/chroot/etc/named
/dev/root 10G 8,3G 1,2G 88% /var/named/chroot/var/named
Sorry, I'm not expert in this issues, but this is due to the soft raid, no??
Code:
cat /etc/mtab
When I do this, i have a large list of errors, see below:
The word "errors" in mtab is part of options on the mounts - it is not saying you have actual errors in the cat.
I would strongly suggest doing a backup before proceeding if possible. This is your root filesystem so if it becomes unusable you're going to lose everything.
You should generally NOT try to fsck a mounted filesystem. If you look at my recommendation I didn't say to just run fsck I said:
Quote:
It might be a good idea to boot to single user and do a full fsck of / to make sure it is OK.
In single user mode / is protected from a lot of things but has to be there and it is usually safe to do an fsck of it in that mode. Your other filesystems won't mount automatically in single user so you can run fsck on them. In your layout the only one besides / that you have to worry about doing fsck of is "/dev/md2 101G 188M 96G 1% /home" - as noted previously the other stuff is either pseudo mounts created at boot time or bind remounts of / itself.
Thanks for you all, guys, after several days turning, as this issue cause me sever problems in mysql, i had to remove the mysql log, clean the root mails, and run fsck several times, rebooting the server, lastly, now i got only 50% HD load, which i find reasonable...
Glad you got it fixed. Please go to thread tools and mark this as solved. It helps others with similar problems to find solutions more quickly in web searches.
Hello people,
I had to reopen this thread, as i got the same behaviour again this morning, within another crazy issue...
After that I found my server hd full, I delete the tmp files, then I reboot.. then, when rebooted, I just run fsck, and I accept all the suggested modification, then I got a request to reboot... After rebooting, the server is not reacheable any more, and no way to bring it up again...
I enter in the server in rescue mode, so I found all over my system files in the lost+found directory, and all over the rest empty, I mean, i found the disk empty just with one single directory as lost+found, so for that the server got stacked and cannot reboot anymore...
Please, any of you got such as behaviour, what can do, we're turning all the day, and this is the unique which we conclude, and I'm thinking just in coping the data from there, and reformat the server, but the mysql dbs, would be losed, and it's absolutly full damage in all...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.