LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   df -kh does not update the correct disk space usage (http://www.linuxquestions.org/questions/linux-server-73/df-kh-does-not-update-the-correct-disk-space-usage-771175/)

grant-skywalker 11-24-2009 04:11 AM

df -kh does not update the correct disk space usage
 
Dear All,

I have a problem with 'df' (Disk Free) command.

Yesterday, i was moving a 20GB DB (MySQL - InnodDB) from /var/lib/mysql (which is 90% full - 5GB free space left) to /var3 partition.

After i've successfully moved the DB to /var3 and made a symlink from /var/lib/mysql to the /var3, the DB was tested working fine.

But the problem occurs when i used 'df -kh' to check the free space again where /var/lib/mysql still occupying the same disk space like the DB has NOT been moved to the new partition which is /var3.

I left it for couple of days when my /var/lib/mysql gets critical level again last night to 98% (free space left 2.5GB).

I decided to reboot my server.

Just plainly rebooting my server, and when it comes up, 'df -kh' shows /var/lib/mysql has 20G more free space!!!

The nightmare comes, my DB (MySQL - innodb engine) crashes.

Anyway, we have to restore all data again to the crashed DB. But what surprised me was, why was i 'rebooting' the server to 'free' the disk space but would actually caused a crash to my DB??

Anyone? Any experience on this?

regards,
GS

kirukan 11-24-2009 05:27 AM

Quote:

But the problem occurs when i used 'df -kh' to check the free space again where /var/lib/mysql still occupying the same disk space like the DB has NOT been moved to the new partition which is /var3.
This means even after move the db, some of your db files still open(you can check this lsof | grep mysql) in same path because of that df -h showed same thing, but if you check with du -chs then you can get the actual information.

refer these for further knowledge
http://www.walkernews.net/2007/07/13...ed-disk-space/
http://www.linuxquestions.org/questi...ishing-539185/

grant-skywalker 11-29-2009 06:08 PM

Dear kirukan,

Thanks for your post, it raised my concern about open files on the system and have learned a lesson thought.


All times are GMT -5. The time now is 09:28 AM.