ext4 with journaling - restores (unwanted) old versions of files
Linux - Embedded & Single-board computerThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.