Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: chroot: Failed to run command. Exec format error. (Read 2607 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

chroot: Failed to run command. Exec format error.

I switched disks in my home server. dd was used to make backup of partitions on old disk and restore them on new disk. Everything seemed to be ok, however there was no boot information on new disk, so I wanted to chroot from liveCD to correct this, however when I try to
Code: [Select]
artools-chroot /mnt
I get
Code: [Select]
chroot: Failed to run command '/bin/sh' : Exec format error

Now I've read in many places, including here that this may happen when liveCD and chrooted environment aren't compatible (i.e. x86 vs x86-64), but I can't see this case here, as both environments are Artix x64.

I ran out of options. Will basestrapping new installation on top of the old one overwrite my config files in /etc ?

Re: chroot: Failed to run command. Exec format error.

Reply #1
Any chance the partition you are mounting has the same uuid with another?

Also, what happens if you try
Code: [Select]
#artools-chroot /mnt /usr/bin/sh

Re: chroot: Failed to run command. Exec format error.

Reply #2
What happens is exactly the same error. I don't know what the problem was, but I decided to take a few steps back and make a dd backup of the whole old disk, not just the partitions. Then I dd'ed the image to the new disk. All worked as if nothing happend, except the size of the new disk wasn't reported corretly, but a check with cfdisk fixed that. I guess the problem itself wasn't solved, but avoided entirely instead.

 

Re: chroot: Failed to run command. Exec format error.

Reply #3
I had the exact same error when the chrooted destination had a missing lib bash was linked against.