LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 10-14-2015, 11:51 AM   #1
maly216
LQ Newbie
 
Registered: Oct 2015
Posts: 2

Rep: Reputation: Disabled
ext4 with journaling - restores (unwanted) old versions of files


Hi,

I'm working on BeagleBone Black, Angstrom system. I have a two partitions:

1. /dev/mmcblk0p2 - rootfs, mounted as read only
2. /dev/mmcblk0p3 - user data, mounter as read-write

Both are mounted with noatime,nodiratime,sync,data=journal,commit=1,barrier=1.

I am doing power failure test since two weeks: power supply is on and off in cycle from 1 s to 55 s (power is on for 1 s and cut off, power is on for 2 s and cut off, power is on for 3 s and cut off... up to 55 s and again from beginning). I have done about 10000 power failure cycles. File system were still consisent and data were not corrupted. Today a have done some modyfications in kernel, recompiled it, copied from host to BeagleBone, and reboot (shutdown -r now). I have run about 10 power failure cycles with new kernel and I noticed that after next boot BeagleBone run on previous version of kernel.

A noticed this occurance before when BeagleBone has changed IP address to previous without any human interference.

I guess that journaling system magically recover old files (or e2fsck running when Angstrom is booting).

Could you explain me is it possible and how to avoid situations like above?

Last edited by maly216; 10-14-2015 at 04:57 PM.
 
Old 10-14-2015, 10:27 PM   #2
Keruskerfuerst
Senior Member
 
Registered: Oct 2005
Location: Horgau, Germany
Distribution: Manjaro KDE, Win 10
Posts: 2,199

Rep: Reputation: 164Reputation: 164
Both are mounted with noatime,nodiratime,sync,data=journal,commit=1,barrier=1.

Should be set to Both are mounted with noatime,sync,data=journal,commit=1,barrier=1.

If the system is not shut down correctly, the journal is restored.
 
Old 10-15-2015, 01:11 AM   #3
maly216
LQ Newbie
 
Registered: Oct 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Should be set to Both are mounted with noatime,sync,data=journal,commit=1,barrier=1.
Of course you are right - nodiratime isn't required (I have checked it in kernel source fs/inode.c, function void touch_atime(struct path *path)).

After kernel update I have shutdown system properly (shutdown -r now) and than began test over again.
Angstrom booted with new kernel about 10 times, so I understand that journal didn't do any recovery.

After ten boot I saw that I have previous version of kernel. So I can't undestand why kernel was restored despite proper system shutdown and journal did it until ten boot time.

As I undestand journal cache should be emptied every 1 second (commit=1). So any recovery should be done after first system boot with new kernel, not after 10-th boot. Am I right?
 
Old 12-03-2015, 02:16 AM   #4
Keruskerfuerst
Senior Member
 
Registered: Oct 2005
Location: Horgau, Germany
Distribution: Manjaro KDE, Win 10
Posts: 2,199

Rep: Reputation: 164Reputation: 164
The cache flush time should be selectable.
1s, 2s, 3s, 4s,...

Depends on how save the power supply is.
 
  


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
use of journaling in ext3 and ext4 vikilinux Linux - Software 2 04-03-2014 05:15 AM
ext4 journaling and speed kox444 Linux - Hardware 4 01-20-2013 09:31 PM
Old file system discovered after disabling ext4 journaling k14 Linux - General 6 05-13-2011 07:36 AM
Improving MetaData Performance of the Ext4 Journaling Device DragonSlayer48DX Linux - News 0 01-06-2010 08:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

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