LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-09-2014, 04:13 AM   #1
mangolzy
LQ Newbie
 
Registered: Jun 2014
Posts: 3

Rep: Reputation: Disabled
Question Problem in the memory occupied by mysql


Hello, everybody!

I have a problem in the memory of mysql, there is a file name ibdata1 that takes a lot of space, i have moved it to another place for backup.

But then i realized it's a very important file, so i want to get it back in its original folder.

Here comes the problem,

with the command df -h,

I got

/dev/cciss/c1d1p1 92G 92G 0 100% /var

while with the command du -sh /var,

the result is 55G,

knowing that my file ibdata1 is 37G, I am always unable to copy it into the folder /var/lib/mysql from /proc/2060/fd/3 (where the "ibdata1" being marked as deleted)...

Anybody can explain the information behind the two commands and tell me what can I do to get back to the state before I moved the file of ibdata1?

Thank you very much!

Last edited by mangolzy; 06-09-2014 at 05:42 AM. Reason: it seems that the title is not attractive but i cant edit it ....
 
Old 06-09-2014, 05:43 AM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
I think you are out of luck. /proc/<pid>/fd only contain symbolic links to the file. So the "/proc/2060/fd/3" is only a symbolic link to the file already deleted, and you can't access that file directly.

Now if the fd still points only the the kernel data inode then maybe. But you will have to copy the file to a different partition. This is because the data of the file has not been released (thus there is no space available).

On ext3/4 there is an undelete utility - unfortunately, the hard part is finding the "on disk" inode related to the file... and the process requires the disk to be dismounted.
(http://extundelete.sourceforge.net/)

The only other way is by either testdisk or photorec which can recover files... unfortunately both appear to require knowledge of the contents first.

Last edited by jpollard; 06-09-2014 at 06:02 AM.
 
Old 06-09-2014, 06:14 AM   #3
mangolzy
LQ Newbie
 
Registered: Jun 2014
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jpollard View Post
I think you are out of luck. /proc/<pid>/fd only contain symbolic links to the file. So the "/proc/2060/fd/3" is only a symbolic link to the file already deleted, and you can't access that file directly.

Now if the fd still points only the the kernel data inode then maybe. But you will have to copy the file to a different partition. This is because the data of the file has not been released (thus there is no space available).

On ext3/4 there is an undelete utility - unfortunately, the hard part is finding the "on disk" inode related to the file... and the process requires the disk to be dismounted.
(http://extundelete.sourceforge.net/)

The only other way is by either testdisk or photorec which can recover files... unfortunately both appear to require knowledge of the contents first.


First of all, thanks a lot for your reply!!

Actually, I think I didn't lost my file because I have moved it to another folder before I deleted it ...

the problem is just that when I want to get it in its original place,

I find that it its original folder, there is no place>< which implys that it's not deleted propably......................

Why?

BTW, what's the difference between the two commands I used to get the occupied memory information??

thx!! :-)
 
Old 06-09-2014, 08:30 AM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
The file is open, thus it isn't deleted, and the space is not deallocated.

The df command is showing what is in use. And since the file is not deleted, it isn't deallocated and is in use.
 
Old 06-09-2014, 08:48 AM   #5
mangolzy
LQ Newbie
 
Registered: Jun 2014
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by jpollard View Post
The file is open, thus it isn't deleted, and the space is not deallocated.

The df command is showing what is in use. And since the file is not deleted, it isn't deallocated and is in use.

d'accord, but how can i recover? i have saved the binary file ibdata1 (version juin 3)

i am just not sure whether mysql continue to write in since juin 3 given that i didn't close it but have modified serveral times the files in /var/lib/mysql............

thankyou,jpollard!
 
Old 06-09-2014, 09:26 AM   #6
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,604

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Mysql will continue updating the file until it exits, at which time the file will be deallocated.
 
  


Reply


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
Deleting VM and HDD space is still occupied litzel Linux - Software 10 07-04-2013 03:11 AM
[SOLVED] chrome occupied much of CPU in slackware14.0 flyer103 Slackware 8 10-03-2012 12:38 AM
[SOLVED] Total space occupied by all files above 1G sysmicuser Linux - Newbie 7 10-15-2011 08:25 PM
Size occupied by a dir (with sub-dirs) chipotphe Linux - Newbie 3 11-15-2008 10:03 AM
memory occupied by a program rajesh_b Programming 3 11-15-2006 11:07 AM


All times are GMT -5. The time now is 08:32 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration