LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 12-23-2008, 03:39 PM   #1
exceed1
Member
 
Registered: Mar 2008
Location: oslo
Distribution: debian,redhat
Posts: 199

Rep: Reputation: 31
Is there any backup journals like there is backup superblocks ?


Hi all

I was wondering, when you get an invalid or bad superblock you can replace it with a backup superblock. But, what happens when you have an invalid ext3 journal, does ext3 have backup journals as well so you can replace the bad journal with a backup journal, if so then how do you find out where the backup journals are ?

I have been googling for this but couldnt find anything like "backup ext3 journals".. so if there isnt anything like that, what do you do if you get an invalid ext3 journal on your filesystem ?
 
Old 12-23-2008, 04:24 PM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
You really need to understand how ext3 which is a journaled ext2 filesystem works. The most common way to recover from a bad journal or corrupt journal is using the commands e2fsck, debugfs and tune2fs.

In some cases, simply removing the journal can fix the issue. You would run something like this:

tune2fs -f -O ^has_journal /dev/hda1

If that usually results in error, you could try using the debugfs command. If that fails, it might result in cloning the drive and maybe using something like ddrescue

Always try to repair a filesystem first with e2fsck. I've been using ext3 since it's basically been introduced as the default in Linux and have never had any problems. I had to run fsck's way more often on just ext2 filesystems without the journal. I don't miss those days..
 
Old 12-23-2008, 07:01 PM   #3
exceed1
Member
 
Registered: Mar 2008
Location: oslo
Distribution: debian,redhat
Posts: 199

Original Poster
Rep: Reputation: 31
Thanks for an interesting answer trickykid.

I have read about the ext filesystem family and a little about how they are different. If you remove the journal you would still have a fully functional filesystem, the journal in ext3 would then be there just to pretty much have a lot more reliability. So, in theory (and practice), you could remove the invalid journal and just create a new journal with the tune2fs command' -j option ? That would make it an ext3 filesystem again given that it also has the other features of the ext3 filesystem... but what about the information that was written to the previous journal about data written to the disk, what if the filesystem gets corrupt and then tries to recover using its journal which now only contains a limited log of the data written to the disk.. isnt that going to fail ?
 
Old 12-24-2008, 08:57 AM   #4
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
Quote:
Originally Posted by exceed1 View Post
So, in theory (and practice), you could remove the invalid journal and just create a new journal with the tune2fs command' -j option ?
Correct to my knowledge.

Quote:
Originally Posted by exceed1 View Post
what if the filesystem gets corrupt and then tries to recover using its journal which now only contains a limited log of the data written to the disk.. isnt that going to fail ?
Well if the journal is corrupt or missing data and the filesystem is also corrupt, this I think is where you should rely on backups hopefully. Unless you catch it in time to turn off the journal or wipe it, then repair the ext2 filesystem in hopes it can correct the issue, if not, you really couldn't rely on either and would need to pull from backups. I've never encountered where both are corrupt at any given time on the same file or block. I guess it's like a RAID 1 setup, what's the chances of both drives failing at exactly the same time? Probably not likely. There's a good chance that if the file itself is corrupt, the journal will recover it. If the journal is corrupt, it won't overwrite the good file. That's at least to my understanding.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to create backup MYSQL Script to backup my database for every 1hour RMLinux Linux - Newbie 3 11-20-2008 10:13 AM
LXer: Automatic backup for sporadically connected clients with Box Backup LXer Syndicated Linux News 0 08-29-2008 08:40 PM
Backup system ala rdiff-backup, but without mirror and with dst encryption dr_dex Linux - Software 0 08-04-2008 03:39 AM
Using RSync to backup a secondary off-site backup server pezdspencer Linux - Software 4 06-29-2007 03:40 PM
Using rsync to backup data. Best way to backup folders? Micro420 Linux - General 2 11-23-2006 01:13 AM


All times are GMT -5. The time now is 08:14 AM.

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