Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: Ouch! ibdata files deleted. Why no catastrophe?

From: Joerg Bruehe <joerg(at)mysql.com>
Date: Fri Sep 28 2007 - 07:46:16 EDT


Hi !

Jerry Schwartz wrote:
> I don't know Linux that well, but I know that HP-UX lets you do most
> anything to an open file, including deleting it. The file will continue to
> exist as long as it is open by at least one process.

Yes - that is standard Unix semantics; it should be that way on any variety of Unix including Linux, BSD, and the commercial ones.

You can use this for any file system object (including FIFOs) to get an automatic cleanup if your process(es) crash(es):

- Create the object (file, FIFO, ...),
- open it (from all processes that need it),
- delete it.

It will continue to exist as long as at least one process has it open, but cannot be accessed by its name any longer (so no additional "open()" call is possible).
It will still occupy space on disk, but will not be included in any "du" output (because it is not accessible from any directory). If "du" on the root directory of some file system (done by the root user) reports less blocks than "df" on that file system, typically the difference are the blocks of such deleted but still open files.

> If I remember
> correctly, this is all about the inode use count vs. the directory entry, or
> something like that. The file will actually be safe so long as it is not
> closed by the last user.
>
> Those files will go away as soon as they are closed, so the database should
> be dumped before shutting down mysqld.

Right on both items.

Regards,
Joerg

-- 
Joerg Bruehe, Senior Production Engineer
MySQL AB, www.mysql.com


-- 
MySQL General Mailing List
For list archives: 
http://lists.mysql.com/mysql
To unsubscribe:    
http://lists.mysql.com/mysql?unsub=lists@pantek.com
Received on Fri Sep 28 07:48:23 2007

This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 10:12:37 EDT

Do you need help?X

Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library