LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-14-2008, 04:09 AM   #1
dimitriw1972
LQ Newbie
 
Registered: Dec 2007
Posts: 5

Rep: Reputation: 0
Accessing the linux file system journal


I would like to access the linux file system journal, a bit like the windows change journal records (described here).

I could monitor the file system using inotify, but that doesn't allow me to know what happened between two runs of the application.

Is there some API into the linux kernel file system, or do I have to dig into the code of ext3, reiserfs, etc.?

Thanks for you help.
 
Old 03-14-2008, 06:11 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by dimitriw1972 View Post
I could monitor the file system using inotify, but that doesn't allow me to know what happened between two runs of the application.
What is it *exactly* you would like to see or monitor and at what level? Is it for testing or production? If testing, isn't 'strace -ewrite' enough?


Quote:
Originally Posted by dimitriw1972 View Post
Is there some API into the linux kernel file system, or do I have to dig into the code of ext3, reiserfs, etc.?
In userland "debugfs" allows you to list journal contents so it's accessable albeit in a condensed form and not linked to transactions as far as I know. In-kernel disk writes are grouped and queued up (at least that's what I get from "Understanding The Linux Kernel"). I think you need to look at kernel code somewhere around the process signalling it needs to flush data to lower layers.
 
Old 03-14-2008, 09:15 AM   #3
dimitriw1972
LQ Newbie
 
Registered: Dec 2007
Posts: 5

Original Poster
Rep: Reputation: 0
Thanks for your reply.

I want to know whether (and if so, which) files or directories have been created or deleted. If my application was stopped and is started later on, I would like to know what happened since it was stopped.

It is for production code, not just testing.
 
Old 03-14-2008, 02:35 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Article is somewhat elderly, but I'm sure it will allow you
to find newer information from the links.

http://www-128.ibm.com/developerwork...l-inotify.html


Or you could use an integrity checker like AIDE, tripwire
or (slightly more complex functionality) samhain.


Cheers,
Tink

Last edited by Tinkster; 03-14-2008 at 02:38 PM.
 
  


Reply



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
accessing ntfs file system drives swarnimsoni Linux - Newbie 7 10-14-2007 06:10 AM
LXer: Accessing Network attached storage from Linux system for file sharing and backup purpose LXer Syndicated Linux News 0 05-20-2006 02:03 AM
Where's the /.journal file? LocoMojo Slackware 4 03-16-2006 08:43 AM
accessing file system of MMC jogurt666 Linux - Hardware 0 05-11-2005 03:07 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

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
Open Source Consulting | Domain Registration