You are not logged in.

#1 2014-06-04 01:15:29

sherrellbc
Member
Registered: 2014-05-26
Posts: 112

Cannot boot - fsck: /sbin/fsck.ext4: execute failed: Exec format error

EDIT: see post 12 for updated problem

I had always had problems with my system never restoring from a suspend; it would always reboot from a suspend just as if I had restarted or shutdown the machine. So, I did a bit of research and found there were a few commands from the console that instructed the system to do restarts, hibernation, shutdown, etc.

systemctl hibernation

After issuing this command my machine certainly acted as if it was going to sleep. However, the screen went black but the computer never shutdown. Actually, the screen would periodically appear as if it was about to come back on just before it flickered a few times and then went black again. After a few minutes of this I just manually shut the computer down. Upon restart it got about 50% through the boot process and halted. I sat there for a while waiting for it to recover, but once again there was no choice but to shutdown the machine again.

Now when I try to boot from GRUB I get the error that is the title of this thread:

Loading Linux linux ...
error: Premature end of file /boot/vmlinuz-linux
Loading initial ramdisk ...
error: you need to load the kernel first

Press any key to continue ...

Is there anything I can do to fix this problem?

Last edited by sherrellbc (2014-06-06 03:31:07)

Offline

#2 2014-06-04 01:27:18

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,571
Website

Re: Cannot boot - fsck: /sbin/fsck.ext4: execute failed: Exec format error

First I'd investigate further - but in this case the an investigation and a solution the will share the first several steps: chroot in and look around.

There is a good wiki article on chrooting.  It'll be easiest if you have an archlinux live-usb/cd, but just about any linux bootable media would do.  Boot up to any functional distro, mount your partitions, and start gathering information.

The very first information should be an `ls -l` in the boot partition/directory.  Also a `file vmlinuz-linux` would help.

If you use an archlinux live medium, then the likely solution will be to 'pacstrap' the linux package onto the harddrive to replace the corrupted kernel - but I'd not rush to that, I'd want to learn more about how/why this happened in order to ensure it doesn't happen again, and also to ensure there are not other issues hiding currently symptomless.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2014-06-04 01:32:49

sherrellbc
Member
Registered: 2014-05-26
Posts: 112

Re: Cannot boot - fsck: /sbin/fsck.ext4: execute failed: Exec format error

Must a usb or some external media be used to troubleshoot this problem? I do not currently have access to a live USB, but I could reformat and use my external hard-drive if I must.

What exactly would I look for while chroot'ing?
I dual-boot with Windows, so I do currently have access to the linux partition if that at all helps.

in /boot I find three files.
initramfs-linux.img (size: 3,256K)
initramfs-linux-fallback.img (size: 16,641K)
vmlinuz-linuz (size: 0)

Last edited by sherrellbc (2014-06-04 01:34:47)

Offline

#4 2014-06-04 01:55:53

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,571
Website

Re: Cannot boot - fsck: /sbin/fsck.ext4: execute failed: Exec format error

A live media or other linux system would be easiest by far - but many steps might be able to be done from windows.  I, however, don't know how to do any of the relevant steps from windows, but I'll give a shot at describing the goal.

1) Check if the last kernel package is still in /var/cache/pacman/pkg/linux-3.14*.pkg.tar.gz
2) If that is there, find a windows tool to extract the tar.gz, then copy the resuling /boot/vmllinuz-linux file to the boot directory/partition.
  - if you have the windows tools to access ext filesystems, see if there is a way to also change verify ownership so this file is root:root
3) Cross your fingers and try to reboot to arch.

EDIT: actually this may not work.  I first just saw the vmlinuz-linux being 0 bytes assuming this would be the only problem, but your initramfs files are much smaller than I'd expect.  The size of these can vary based on many factors - but 3K seem far below what I'd expect.  Unless you have done some custom trimming of initramfs, then these seem to be damaged as well - and these can't be extracted from the pkg file.  As far as I know, there'd be no way to regenerate these from windows.  There are ways of booting without the initramfs, but I'm not qualified to advise on that.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2014-06-04 02:00:42

sherrellbc
Member
Registered: 2014-05-26
Posts: 112

Re: Cannot boot - fsck: /sbin/fsck.ext4: execute failed: Exec format error

Alternatively, while using chroot, would the same process be undertaken? That is, simply un-tar the package into the root directory?

I see. So, assuming I chroot into the system what are my options?

Last edited by sherrellbc (2014-06-04 02:01:35)

Offline

#6 2014-06-04 02:03:44

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,571
Website

Re: Cannot boot - fsck: /sbin/fsck.ext4: execute failed: Exec format error

With a chroot, this would be much easier.

In fact, if you have a archlinux bootable media, you wouldn't even need to chroot.  Just boot, then mount all your partitions appropriately under /mnt, then `pacstrap -i /mnt linux` and that would fix all the problems that are apparent so far.

If it's not an archlinux media, then you'd need to chroot, then run `pacman -S linux`.

EDIT: just to cover a couple other bases first: can you descript your partitioning scheme and how you boot?  Any EFI/UEFI?  What are all the partitions and what do they contain?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#7 2014-06-04 02:16:45

sherrellbc
Member
Registered: 2014-05-26
Posts: 112

Re: Cannot boot - fsck: /sbin/fsck.ext4: execute failed: Exec format error

Excuse my ignorance, but I am still quite new to this.

I have grub installed with a simple dual-boot with my Windows 7 partition. The partitions available are NTFS (Win7), a Win7 recovery partition, and an EXT3 Arch Linux partition.
As far as EFI or UEFI, I am quite unsure. I searched around the net and found this link in effort to determine which I use. The results appear to point towards EFI (so-called legacy), but the results of each of those tests was inconclusive as my system did not exactly parallel what was shown. However, I am admittedly ignorant to what this actually means beyond basic information gathered from the wiki page.

Last edited by sherrellbc (2014-06-04 02:17:16)

Offline

#8 2014-06-04 02:30:36

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,571
Website

Re: Cannot boot - fsck: /sbin/fsck.ext4: execute failed: Exec format error

If you're archlinux install is all on one partition and you don't remember specifically setting it up, then arch is not using efi - windows I don't know about, but arch was what I wanted to check on.  This is not relevant for the current issue (it *might* have been if arch used efi, that what I wanted to check).


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#9 2014-06-06 00:31:27

sherrellbc
Member
Registered: 2014-05-26
Posts: 112

Re: Cannot boot - fsck: /sbin/fsck.ext4: execute failed: Exec format error

So I created a live usb and was able to boot from it. However, when trying to

pacstrap -I /mnt linux

I get these errors:

Creating install root at /mnt
Installing packages to /mnt
error: GPGME error: No data
error: GPGME error: No data
: : Synchronizing package databases ...
core is up to date
extra is up to date
community is up to date
error: database 'core' is not valid (invalid or corrupted database PGP signature))
error: database 'extra' is not valid (invalid or corrupted database PGP signature))
ERROR: Failed to install packages to new root

Any ideas? Can I chroot and just re-extract the kernel package that is currently installed on the actual system? What would the command be to do such a thing?

Offline

#10 2014-06-06 00:42:24

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,571
Website

Re: Cannot boot - fsck: /sbin/fsck.ext4: execute failed: Exec format error

I don't know (off the top of my head) why you'd get those errors, but for your question, yes if you can chroot you can extract the package from the existing cache.  After chrooting:

pacman -U /var/cache/pacman/pkg/linux...

where the "..." is the version numbers and remainder of the filename (tab completion should get it).


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#11 2014-06-06 01:31:02

sherrellbc
Member
Registered: 2014-05-26
Posts: 112

Re: Cannot boot - fsck: /sbin/fsck.ext4: execute failed: Exec format error

After trying that I get

error while loading shared libraries: /usr/lib/libgpgme.so.11: file too short

EDIT: so I manually copied over the shared libraries that were causing problems. There ended up being two: the one listed above and then libcom_err.so.2

After doing that I now get similar errors to that which I had earlier.

error: GPGME error: No data
error: GPGME error: No data
error: database 'core' is not valid (invalid or corrupted database PGP signature))
error: database 'extra' is not valid (invalid or corrupted database PGP signature))
Loading packages ...
ERROR: linux-3.14.5-1 is up to date -- reinstalling
error: failed to prepare transaction (invalid or corrupt database)

EDIT: I did a database sync while using chroot and apparently that fixed the first set of errors. However, now when I try to either pacstrap or upgrade using pacman I get a whole heap of 'filexxx.xx exists in filesystem' during the "checking for file conflicts" stage of the installation process.

The whole things ends in:

Errors occurred, no packages were upgraded.
ERROR: failed to install packages to new root

Last edited by sherrellbc (2014-06-06 02:14:40)

Offline

#12 2014-06-06 03:14:13

sherrellbc
Member
Registered: 2014-05-26
Posts: 112

Re: Cannot boot - fsck: /sbin/fsck.ext4: execute failed: Exec format error

What I ended up doing to circumvent this problem was simply rename the directory that was having file conflict issues. After doing so the installation appeared to go through just fine. However, now on boot I get:

fsck: /sbin/fsck.ext4: execute failed: Exec format error

This same error also comes up if I try and

fsck -a

From the live-usb home directory or after chroot'ing.

fsck from util-linux 2.24.2
fsck: /sbin/fsck.ext4: execute failed: Exec format error

And my display manager fails to load, if booting normally and not through live-usb portal. Actually, the whole process appears to freeze somewhat towards the end of what would otherwise appear as a normal boot-cycle.
Any ideas with this one now?

Last edited by sherrellbc (2014-06-06 03:41:06)

Offline

Board footer

Powered by FluxBB