[SOLVED] Exec format error upon boot on fresh install on usb stick
Slackware - InstallationThis forum is for the discussion of installation issues with Slackware.
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.
Exec format error upon boot on fresh install on usb stick
Hi!
I have just installed - for the first time, and after many many mistakes, my first Slackware - 14.2 64 (stable)on a San Disk Cruiser usb stick, through my Fujitsu Esprimo E7935, with a Corel2 Duo E8500 , 8 Gb ram, from a DVD burned from an iso downloaded last week.
I did this after using Slackware LIve (Mate) in 2 of my computers, for most of my everyday needs, for a couple months.
Immediately upon concluding the installation - having chosen not to install lilo - and exiting setup i did:
1 - chroot /mnt
2- ran mkinitrd -c -k 4.4.14 -m ext4 -f ext4 -r /dev/sdb3
got a message that modules jbd2.ko,mbcache.ko and a third one (maybe ext4?) had been added
3- grub-install --target=i386-pc -dev-sdb
got "no errors"
4- added > GRUB_DISABLE_OS_PROBE=true < to /etc/default/grub
5- ran lsblk and checked that none of the partitions in the computer's HD were mounted
6 - ran grub-mkconfig -o /boot/grub/grub.cfg and got a message that confirmed presence of initrd and, surprisingly to me, of some of the OSes installed on my hd, and the error message which I enclose as a .jpeg file.
"You should bind /sys, /dev, and /proc to /mnt/tmp/sys, /mnt/tmp/dev, and /mnt/tmp/proc prior to the chroot, while you're at it."
Which I did not do,as I was following https://mirrors.dotsrc.org/slackware.../README.initrd where there is no mentioning of any binding and so I assumed,maybe wrongly, that chroot would be like arch-chroot in ArchLinux, where one does no explicit binding, if I am not mistaken. Can this be the mistake I must correct ?
Or can it be that I need to add a specific (usb ?) mode to initrd in order to be able to boot from the usb stick into which Slackware was installed?
The exec format error is normal when using an initrd with the huge kernel. What do you have for a root= on the linux line of your grub.cfg? The other thought is you don't have usb modules and/or other modules in your initrd needed to access the file system on the usb.
On a usb install you want to add additional modules to your initrd - usb-storage will be one of them. To check if you need more you could use lsmod on a working installation to see which modules are loaded after plugging in the device.
Also add rootwait kernel parameter to your bootloader - rootwait=5 works for me on an external usb3 M.2 enclosure.
If you are thinking of using your usb drive on multiple machines you need to use persistent partition naming, ie. edit your /etc/fstab to use LABEL= or UUID= rather then device names and change your root parameter in bootloader config file to use one of these as well.
I think you have put a finger on something: lsblk lists no uuid - neither for the usb nor for the multiple partitions in the HD and folder /dev has no folder /disks. I suppose these means the system is on UDEV - I have really no idea as I have never interacted with udev.
Should I edit the grub.cfg (40_custom?) and use root=/dev/sdb3 - which is what lsblk reports ?
On a usb install you want to add additional modules to your initrd - usb-storage will be one of them. To check if you need more you could use lsmod on a working installation to see which modules are loaded after plugging in the device.
Also add rootwait kernel parameter to your bootloader - rootwait=5 works for me on an external usb3 M.2 enclosure.
If you are thinking of using your usb drive on multiple machines you need to use persistent partition naming, ie. edit your /etc/fstab to use LABEL= or UUID= rather then device names and change your root parameter in bootloader config file to use one of these as well.
I have no questions (now, after your answer) on modules and rootwait, but although this usb is mostly a test before I attempt to install on my HD, it would be nice to carry it around in case I want to use it when I am away from my machines. As colorpurple28159 pointed out my system seems to be running on udev, and I have unfortunately not set the partition'ś label.
I suppose i can set its label if I can chroot to the usb stick, but i have seen different instructions on how to chroot. Is it enough to chroot to where I have mounted the partition or must I bind mount some critical folders before, if I may ask it here?
When you first boot the usb at the grub menu, press e to edit and add rootdelay=15 to the end of the linux line
F10 or ctrl-x to boot
post the contents of your /etc/fstab that is on the usb.
Last edited by colorpurple21859; 02-03-2021 at 02:02 PM.
lsblk lists no uuid - neither for the usb nor for the multiple partitions in the HD and folder /dev has no folder /disks.
How are you checking that? After chrooting to your installation? If that is the case that is what binding the /dev directory is for.
Issuing command
Code:
mount -o bind /dev /your/chroot/dir/dev
will give you access to devices.
Quote:
I suppose i can set its label if I can chroot to the usb stick
You could, but you might use UUID as well. No need to set anything. Also you don't need to chroot to get your UUIDs or set LABEL - you could do both from any live CD/USB which you have probably been using to chroot anyway.
Quote:
but i have seen different instructions on how to chroot. Is it enough to chroot to where I have mounted the partition or must I bind mount some critical folders before, if I may ask it here?
If you want to interact with disks you want a working /dev directory. I normally just bind /dev, /sys and /proc to have a full working system just in case.
I think you will find that you need to do what colorpurple21859 said:
I guess I will have to edit it and delete the line for /dev/sda9 if I want to use the stick in other computers.
Sounds about right!
Quote:
Originally Posted by fredmyra
Code:
ls /mnt/dev
Well no wonder you can't see any devices. There is no device tree mounted there. Try listing your devices under Manjaro with the USB attached - same machine, same drives = same UUID's. So:
3 - Edited fstab and replaced /dev/sdb3 with UUID=(uuid number for that partition)
4 - bin-mounted exactly as recommended (with one-liner)
5 - chroot /mnt
6 - ran mkinitrd exactly as prescribed
7 - grub-mkconfig -o /boot/grub/grub.cfg
which again found several OSes in my Hard drive, besides the stuff in the usb, in spite of none of those being mounted and GRUB_DISABLE_OS_PROBE=true in (from chroot) etc/default/grub.
But this time it reported more OSes in the hard drive than the absolute first time i ran grub-mkconfig at the beguining of this thread. Also, this time it reported - for first time - that all those partitions had an unknown file system.
8 - exited, -l-unmounted the bin-mounted stuff and rebooted
And Oh! it went so swift trough booting beyond the format exec error.
I got a new error>
"Mount: can't find /mnt in fstab" - little more detail attached, but still, this feels like GREAT progress to me."
I have used the word "exactly" above because I repeated the whole procedure above, to be sure, and was VERY carefully both times. But knowing myself I know I can never be 100% sure.
Should I close this as solved and eventually take up the new error in another thread?
I am googling on it right now, and maybe I should put some more time of my own now, before I ask for more of yours.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.