Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
It's from trying to execute a file that has a magic number that the kernel doesn't know how to handle. Typical examples are a 64-bit binary on a 32-bit kernel, a file intended for a different OS (Windows, Mac OS, etc.). Also, interpreter scripts that lack the "#!/bin/whatever" header will cause that response from the kernel, but a shell that sees that error may try a fallback of trying the file as a script in its own language, sometimes with bizarre results if it is not.
Beginning with kernel 3.10 the fsck.ext4 in my distribution's package returns that error at boot time when /etc/rc.d/rc.S tries to run it, but it works afterwards, even during the maintenance session linux lets me run on that boot; if I create /etc/fastboot (which prevents file-system-checking) I can boot and run fsck.ext4. I build my own e2fsprogs with the same version and it works at boot. How can I figure out the difference?
What does the "file" command report for each executable (e.g., "file /sbin/fsck.ext4")? What distribution are you running? What is the output from "uname -rm"?
/sbin/fsck.ext4: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), not stripped
fsck.ext4 from the package is script that calls e2fsck, a 'file' of which returns the same thing. I just noticed that the fsck.ext4 I build is identical to e2fsck I build; I suspect that means that the problem is the script.
That script looks fine. I presume this is Slackware.
Does the error message mention the name of the file that caused the error? The only thing that comes to mind is that e2fsck might depend on some kernel modules that are not loaded until later in the /etc/rc.d/rc.S script, but I don't think that would cause an ENOEXEC error. Beyond that, I have no idea.
My identifying information in the left column reveals this.
Quote:
Originally Posted by rknichols
Does the error message mention the name of the file that caused the error?
fsck.ext4
Quote:
Originally Posted by rknichols
The only thing that comes to mind is that e2fsck might depend on some kernel modules that are not loaded until later in the /etc/rc.d/rc.S script, but I don't think that would cause an ENOEXEC error.
Absent libraries have always returned a different error for me. I suppose a library e2fsck called could be unexecutable. The package version has more dependencies.
Quote:
Originally Posted by rknichols
Beyond that, I have no idea.
I'm puzzled too. Especially since no one else seems to have the same problem. And it's been going on for more than a year.
My identifying information in the left column reveals this.
I've learned not to put total trust in that. People change distros without updating their profile info, or try distros other than the one they are currently running.
Quote:
Absent libraries have always returned a different error for me.
Not libraries, kernel modules. If you look at rc.S you'll see that modprobe is run after the file system checks. Is this problem just with the "generic" kernel, or do you see it with "huge" also? (The generic kernel can't even find the root filesystem on my hardware, so I can't test that without building an initrd.)
If you have CONF_BINFMT_SCRIPT as a module and don't load it in an initramfs, then the exec() of that fsck.ext4 script will fail with ENOEXEC. Once the modules have been loaded (near the end of /etc/rc.d/rc.S), it will work fine.
If you have CONF_BINFMT_SCRIPT as a module and don't load it in an initramfs, then the exec() of that fsck.ext4 script will fail with ENOEXEC. Once the modules have been loaded (near the end of /etc/rc.d/rc.S), it will work fine.
Hooray! You found it. CONFIG_BINFMT_SCRIPT (note different spelling) appeared for the first time in kernel 3.10, the point at which this problem started to happen. So the 'cure' is to replace trying to run the script with executing e2fsck directly. This parameter is poorly-documented.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.