Artix Linux Forum

Artix Linux => Installation / Migration / Configuration => Topic started by: Everyone on 01 September 2018, 15:34:50

Title: chroot: Failed to run command. Exec format error.
Post by: Everyone on 01 September 2018, 15:34:50
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 (https://wiki.gentoo.org/wiki/Knowledge_Base:Chrooting_returns_exec_format_error) 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 ?
Title: Re: chroot: Failed to run command. Exec format error.
Post by: fungalnet on 02 September 2018, 01:03:24
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
Title: Re: chroot: Failed to run command. Exec format error.
Post by: Everyone on 02 September 2018, 21:02:37
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.
Title: Re: chroot: Failed to run command. Exec format error.
Post by: nous on 04 September 2018, 14:48:39
I had the exact same error when the chrooted destination had a missing lib bash was linked against.