LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 01-31-2011, 08:46 AM   #1
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: No more Linux. Done with it.
Posts: 1,238

Rep: Reputation: Disabled
Question ext4 journalling mode and data losing


Can any data be lost on ext4 with full journalling mode when electricity crashes? I know it's possible on filesystems like JFS and XFS because they don't journal data (only metadata). When ext4 in "journal" mode journalles both - data and metadata. Does it give 100% guarantee that no data can ever be lost in case of problems with electricity?
 
Old 01-31-2011, 09:58 AM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Quote:
Does it give 100% guarantee that no data can ever be lost in case of problems with electricity?
There is no guarantee; there can't be a guarantee. There are too many variables.

Example:
1) is the computer plugged into a wall socket without surge protection, or is it plugged into a surge protector.
2) when power is interrupted, is it simply a loss of power or is there a power spike along with the loss of power.
3) if there is a spike without surge protector, how many (if any) components of the computer are damaged?
4) if there is a spike with surge protector, did the surge protector provide full protection, or did a portion of the spike reach the computer and cause damage?
And so on.

I live in a rural location. I have frequent power interruptions and occasional spikes. Most interruptions are short (one or more seconds) to a few hours (as during winter ice storms and power lines down). I have a surge protector plugged into the wall, and another on top of my desk plugged into the first protector. The one on my desk has plugins on the back for my peripherals. When storms move through the area, I shutdown and turn off the switches on the surge protector.

I have had to replace the first surge protector twice due to power spikes, but I have yet to have damage to the computer. Nor have I had data loss or apps suddenly becoming disfunctional.

I've used ext3 since shortly after it was introduced. If my understanding of ext4 is correct, journaling for ext3 and ext4 is the same.

So, the bottom line: can any data be lost using ext4? The answer is yes, with qualifications. See 1 - 4 above.
 
1 members found this post helpful.
Old 01-31-2011, 10:00 AM   #3
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,923
Blog Entries: 44

Rep: Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158
Hi,

Do a search and you will find loads of debates for this issue. Power fail for data consistency is more dependent on the applications and not just the filesystem. That is one of the reasons to have a GOOD UPS.
 
Old 01-31-2011, 10:38 AM   #4
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: No more Linux. Done with it.
Posts: 1,238

Original Poster
Rep: Reputation: Disabled
But what about journaling data along with metadata in ext4? I mean - does it do its job (to prevent file loss)?
 
Old 01-31-2011, 10:58 AM   #5
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
What makes you assume that the write of data and meta-data to a
journal will always complete before the power failure? Ext4
isn't clairvoyant either ... "ooh, power will fail in 15ms; I
better flush all journal writes!"
 
Old 01-31-2011, 12:52 PM   #6
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,923
Blog Entries: 44

Rep: Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158
Hi,

@bigrigdriver

By switching off the bar will only interrupt the power.
More machines are damaged because of arc over from the strike. Passive Surge protection is fine but do not rely on it solely. It would be better to remove the power plug during a storm.

I personally use UPS, EMF/RFI circuit filters along with active surge on branch circuits that have Electronics. Even those are test periodically. Your protection devices are most likely passive and probably have Go-No-Go indicator. Good for one time protection for a passive device when the device ratings are exceeded. Most likely MOV devices in a Pi filter configuration. You have to be sure to have a good earth ground or these will only work in common mode. Too many people place too much on a bar surge protector. You can get a single outlet protector that is active and throw away if damaged. Then again costs.

Unplug the devices, it would give better protection during storms or power fluctuations.
 
Old 02-02-2011, 06:05 AM   #7
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: No more Linux. Done with it.
Posts: 1,238

Original Poster
Rep: Reputation: Disabled
What if power crashes 5 seconds later after you do "$ sync"? Will all the data be alright?
 
Old 02-02-2011, 06:57 AM   #8
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,923
Blog Entries: 44

Rep: Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158
Hi,

Quote:
Originally Posted by Mr. Alex View Post
What if power crashes 5 seconds later after you do "$ sync"? Will all the data be alright?
Arbitrarily depends on the local hardware. How much was in the buffer or cache that was to be written. Modern storage systems for a desktop would probably move the data to the container before the power loss. But your asking about 'sync' and will the process complete in five seconds. System & data dependent!

Always rely on timed saving of your work or have the means to keep power beyond loss of local source to insure integrity.

Hopefully recovery methods will provide the means for a system to present data after such incidents.
 
  


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
moving data between ext3 and ext4 wadesmart Ubuntu 3 08-31-2010 09:21 PM
EXT4 data recovery micemicerabies Linux - General 5 08-26-2010 01:28 PM
[SOLVED] Format external hdd as ext4 without losing data? devnull10 Linux - Hardware 14 01-18-2010 07:31 AM
LXer: Possible data loss in Ext4 LXer Syndicated Linux News 1 03-12-2009 10:56 AM
upgrade system with lvm on software raid-1 data volume w/o losing data BinWondrin Linux - General 1 01-13-2009 03:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:21 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