LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - Installation
User Name
Password
Slackware - Installation This forum is for the discussion of installation issues with Slackware.

Notices


Reply
  Search this Thread
Old 02-01-2021, 04:53 PM   #1
fredmyra
Member
 
Registered: Dec 2019
Location: Sweden
Posts: 295

Rep: Reputation: Disabled
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.


Searching the forums site I found a reference by Richard Cranium @ https://www.linuxquestions.org/quest...ab-4175583059/ :

"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?

Maybe both?
Attached Thumbnails
Click image for larger version

Name:	sLAK_eRROR.jpeg
Views:	30
Size:	180.2 KB
ID:	35455  
 
Old 02-01-2021, 07:55 PM   #2
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,399

Rep: Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595
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.
 
1 members found this post helpful.
Old 02-02-2021, 08:15 AM   #3
fredmyra
Member
 
Registered: Dec 2019
Location: Sweden
Posts: 295

Original Poster
Rep: Reputation: Disabled
Thanks for your answer colorpurple21859.

grub-mkconfig has placed several entries in grub.cfg, with respective following linux lines:

linux /boot/vmlinuz-huge-4.4.14 root=UUID=10515910-9616-437b-8629-90b56c474c6d ro

linux /boot/vmlinuz-huge-4.4.14 root=UUID=10515910-9616-437b-8629-90b56c474c6d ro single

linux /boot/vmlinuz-huge root=UUID=10515910-9616-437b-8629-90b56c474c6d ro

linux /boot/vmlinuz-huge root=UUID=10515910-9616-437b-8629-90b56c474c6d ro single

linux /boot/vmlinuz-generic-4.4.14 root=UUID=10515910-9616-437b-8629-90b56c474c6d ro

linux /boot/vmlinuz-generic-4.4.14 root=UUID=10515910-9616-437b-8629-90b56c474c6d ro single

linux /boot/vmlinuz-generic root=UUID=10515910-9616-437b-8629-90b56c474c6d ro

linux /boot/vmlinuz-generic root=UUID=10515910-9616-437b-8629-90b56c474c6d ro single

I tried all of them with the same error as result.

Then I thought of what you wrote and tried the first one without the initrd line and then got a panic screen of which I enclose a picture.
Attached Thumbnails
Click image for larger version

Name:	panic_screen.jpg
Views:	22
Size:	176.6 KB
ID:	35465  
 
Old 02-02-2021, 08:24 AM   #4
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,399

Rep: Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595
Is the /etc/fstab using /dev/??? or uuids?
 
1 members found this post helpful.
Old 02-02-2021, 08:26 AM   #5
alekow
Member
 
Registered: Sep 2009
Distribution: Slackware
Posts: 230

Rep: Reputation: 75
Hi,

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.

Regards,
Alex
 
1 members found this post helpful.
Old 02-02-2021, 01:45 PM   #6
fredmyra
Member
 
Registered: Dec 2019
Location: Sweden
Posts: 295

Original Poster
Rep: Reputation: Disabled
thanks again colorpurple21859 !

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 ?
 
Old 02-02-2021, 02:03 PM   #7
fredmyra
Member
 
Registered: Dec 2019
Location: Sweden
Posts: 295

Original Poster
Rep: Reputation: Disabled
Thanks alekow for very interesting info!

Quote:
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?
 
Old 02-02-2021, 02:39 PM   #8
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,399

Rep: Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595
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.
 
Old 02-02-2021, 03:06 PM   #9
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,399

Rep: Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595
add these modules to your initrd if the rootdelay doesn't work
Code:
mkinitrd -c -k 4.4.14 -m ext4:usbcore:sd_mod:ehci_hcd:uhci_hcd:ohci_hcd:usb_storage:scsi_mod -f ext4 -r /dev/sdb3
 
Old 02-02-2021, 03:40 PM   #10
alekow
Member
 
Registered: Sep 2009
Distribution: Slackware
Posts: 230

Rep: Reputation: 75
Quote:
Originally Posted by fredmyra View Post
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:

Quote:
Code:
mkinitrd -c -k 4.4.14 -m ext4:usbcore:sd_mod:ehci_hcd:uhci_hcd:ohci_hcd:usb_storage:scsi_mod -f ext4 -r /dev/sdb3
and set /etc/fstab to UUID or LABEL.
Hopefully it will all work after that.

------------------------------------------
EDIT:

And rootwait parameter will be needed too of course.

Last edited by alekow; 02-02-2021 at 03:44 PM.
 
Old 02-02-2021, 04:44 PM   #11
fredmyra
Member
 
Registered: Dec 2019
Location: Sweden
Posts: 295

Original Poster
Rep: Reputation: Disabled
here is (attached) the fstab on the usb.

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.


I'ĺl need a couple days before I can try out your suggestions, which sound great.
Attached Files
File Type: txt fstab.txt (571 Bytes, 22 views)
 
Old 02-02-2021, 04:56 PM   #12
fredmyra
Member
 
Registered: Dec 2019
Location: Sweden
Posts: 295

Original Poster
Rep: Reputation: Disabled
@ alekow

Quote:
How are you checking that? After chrooting to your installation?
Booted from Manjaro on HD, did:
mount /dev/sdb3 /mnt
ls /mnt/dev
lsblk

nothing else, i.e. no chroot nor any bind mounting.
 
Old 02-02-2021, 05:10 PM   #13
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,399

Rep: Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595Reputation: 1595
In the fstab change the /dev/sdb? to UUID=<uuid of partition>
delete the /dev/sda9 swap line. The system may boot by just editing the fstab.

to chroot into the system to rerun mkinitrd, reinstall grub other things

Code:
mount /dev/sdb3 /mnt
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
mount -o bind /run /mnt/run
chroot /mnt
This is the two liner version:
Code:
mount /dev/sdb3 /mnt
for i in sys run proc dev ; do mount --bind /$i /mnt/$i; done

Last edited by colorpurple21859; 02-02-2021 at 05:23 PM.
 
1 members found this post helpful.
Old 02-02-2021, 05:20 PM   #14
alekow
Member
 
Registered: Sep 2009
Distribution: Slackware
Posts: 230

Rep: Reputation: 75
Quote:
Originally Posted by fredmyra View Post
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:
Code:
ls -l /dev/disk/by-uuid
 
1 members found this post helpful.
Old 02-03-2021, 08:04 AM   #15
fredmyra
Member
 
Registered: Dec 2019
Location: Sweden
Posts: 295

Original Poster
Rep: Reputation: Disabled
I just couldn't wait, so I did:

1 - Booted from DvD

2 - mount /dev/sdb3 /mnt

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.

Many thanks for AMAZING support !
Attached Thumbnails
Click image for larger version

Name:	new_error.jpg
Views:	26
Size:	122.2 KB
ID:	35477  
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Exec format error upon boot on fresh install fredmyra Linux - Newbie 6 02-01-2021 03:58 PM
Vodafone USB stick internet service does not always start upon boot in Linux Mint 18 Johnny_Metal Linux - Hardware 3 12-12-2016 04:31 PM
ERROR: could not insert 'aufs': Exec format error vinayak099 Linux - Software 1 02-05-2014 03:55 AM
qemu: run gust images face error > Exec format error Sefid par Linux - Virtualization and Cloud 3 07-30-2013 02:40 PM
MDK 9.1 Fatal Error in Stage 1: Exec Format Error Beano Mandriva 5 09-12-2004 03:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - Installation

All times are GMT -5. The time now is 11:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration