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.
I'm have a JFFS2 root filesystem running on a large NAND device. Every once in a while, when I restart the computer, I get error messages about invalid ELF headers when /sbin/init or /bin/login try to load shared libraries like /lib/libpam.so.0
The errors cause a kernel panic and I'm stuck reflashing the NAND to get the computer up and running again.
Does anyone have any idea what might be causing this? Is the NAND being corrupted when it's running and then unable to restart? Is JFFS2 unreliable?
You're right, the library files are getting corrupted.
I tested it out by corrupting a couple myself using dd and the behaviour was identical to what I have been observing.
Now I've got to figure out the cause of the corruption. Dynamic library files in the /lib folder are there to be used by the kernel during startup. I can't imagine that they ever get written to during runtime. Which I guess exonerates JFFS2 failing a write.
So what is left as a cause? Either JFFS2 has a terrible bug that causes it to ruin innocent bystander files? Or the NAND itself is becoming corrupt?
Just to throw a bit at the wall...
What if the error messages about invalid ELF headers is caused by corruption in the filesystem itself? If the filesystem results in a read that contains data that isn't actually a file, or data belonging to some other file, then that could account for the corruption, since the filesystem in general is a read/write system. Is there any way you can run fsck against the borked flash? Maybe create a separate partition that can be restored in isolation in order to get a bootable system, but still usable for diagnostics?
this week at work i had a problem with my xen server, the problem was on my filesystem, what i had to do is to restart xen and start a scanning to my filesystem. you might try to use fsck -A -v, try also fsck --help command.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.