LinuxQuestions.org
Help answer threads with 0 replies.
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 11-24-2009, 04:11 AM   #1
grant-skywalker
Member
 
Registered: Jul 2005
Location: Jakarta / Kuala Lumpur
Distribution: Slackware, Debian, Ubuntu, Centos
Posts: 40

Rep: Reputation: 15
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
 
Old 11-24-2009, 05:27 AM   #2
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,230

Rep: Reputation: 132Reputation: 132
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/

Last edited by kirukan; 11-24-2009 at 05:35 AM.
 
1 members found this post helpful.
Old 11-29-2009, 06:08 PM   #3
grant-skywalker
Member
 
Registered: Jul 2005
Location: Jakarta / Kuala Lumpur
Distribution: Slackware, Debian, Ubuntu, Centos
Posts: 40

Original Poster
Rep: Reputation: 15
Dear kirukan,

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


Reply

Tags
crash, df, mysql


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
partition space and disk space usage and free don't match nsic Linux - Newbie 3 02-22-2013 12:57 PM
correct usage of grep to search a disk Completely Clueless Linux - Newbie 13 02-10-2011 01:41 AM
Disk Usage Analyzer reports too much disk space? ler0nldb2 Linux - Newbie 1 09-12-2009 10:27 AM
Correct Disk Usage lwsivad Linux - General 2 11-21-2003 02:01 PM


All times are GMT -5. The time now is 09:39 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration