Jump to content
Read the Funtoo Newsletter: Summer 2023 ×
  • 1

sh: bad number


cafaia

Question

Hello, everyone!

In all installations made of Funtoo, I have this message:

Using mount -t ext4 -o ro
sh: bad number

This message always appears before starting the openrc program.

I believe it is harmless, but someone would know how to fix it?

I thank you in advance for your help!

Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 0

Where do you have this message? Before starting what openrc program? Do you mean script or before OpenRC starts?

Can you just give more details. What is in your fstab, how do you start your kernel, what is the kernel command line. Do you use your own kernel or debian-sources .......?

There are thousands of possible reasons why you see this message.

Thanks for providing more details and thanks for reading this post:

 

Link to comment
Share on other sites

  • 0

Hi, Palica!

Thank you for your attention and for the tip!

I have this message about three lines before starting openrc, in the boot process before openrc starts.

My fstab:

/dev/md1                        /boot                   ext2    defaults,noatime                                        1 2
/dev/mapper/swsyho-swap         none                    swap    sw                                                      0 0
/dev/mapper/swsyho-system       /                       ext4    noatime                                                 0 1
/dev/mapper/swsyho-home         /home                   ext4    defaults,noatime                                        0 2
tmpfs                           /var/tmp/portage        tmpfs   uid=portage,gid=portage,mode=775,size=16384M,noatime    0 0

/dev/sdc1                       /hd                     ext4    defaults,noatime                                        0 2

I start the kernel with the following command line (from dmesg):

Command line: BOOT_IMAGE=/vmlinuz-4.15.17-1 root=/dev/mapper/swsyho-system ro domdadm dolvm rootfstype=ext4 scandelay resume=/dev/mapper/swsyho-swap

I start the kernel with the grub2 program and I have debian-sources but wihtout USE 'binary'.

Link to comment
Share on other sites

  • 0

Hi cafaia,

Hmm, this is an example of what I use, I have a modified initramfs ...

linux /kernel-genkernel-x86_64-4.8.7-hardened consoleblank=300 crypt_root=/dev/disk/by-uuid/87f271ea dolvm doluks root=/dev/250.1/root-1 real_root=/dev/250.1/root-1 rootfstype=squashfs scandelay=2 memory tmpfs_size=4G
initrd /initramfs-genkernel-x86_64-4.8.7-hardened

 

If you modified your initramfs, please share.  If not, please also confirm.

It is odd to be getting that message if you haven't modified the initramfs and before openrc starts.  In my case, I've gotten a variation before in shell scripts when I'm expecting a variable to be set, but it is not.

Link to comment
Share on other sites

  • 0

Hi, Walterw!

I did not modify my initramfs, I created it with the genkernel command. And I have this in my grub.cfg file:

linux   /vmlinuz-4.15.17-1 root=/dev/mapper/swsyho-system ro domdadm dolvm rootfstype=ext4 scandelay resume=/dev/mapper/swsyho-swap
initrd  /initramfs-genkernel-x86_64-4.15.17-1

Best regards!

Link to comment
Share on other sites

  • 0

Hi cafaia,

If you don't mind, can you post your initramfs?  That is the only way I see to troubleshoot this.  The other alternative is to look at the source files in /usr/share/genkernel to try and backtrack what is going on there.

BTW, I checked my linuxrc (/usr/share/genkernel/defaults/linuxrc), and I don't see an ro option, is that a kernel command-line option?  Just for giggles, can you remove that argument?

Link to comment
Share on other sites

  • 0

Hi cafaia,

File received, I see it is compressed with gzip.

  1. I see that scandelay actually supports no args, it waits 3 seconds by default (when passed as an argument with no parameters)
  2. I didn't see anything that stood out, can you try editing /usr/share/genkernel/defaults/linuxrc and adding echo statements throughout to see where it might be occurring, followed by rebuilding the initramfs (and booting up with the modified init)?  Then, we can narrow down exactly.

Don't forget to backup your original ... Also, share the updated initramfs just so I can see it was updated as expected.

Link to comment
Share on other sites

  • 0

On linux-debian-sources-5.10.28_p1 I get this error also, but it comes before initramfs. Output says:

...

Hint: Use parameter scandelay...

Determining boot device...

Detected real_root=/dev/sda3

Mounting /dev/sda3 as root...

Using mount -t ext4 -o ro

sh: bad number

Booting (initramfs)..

INIT: version 2.95 booting

etc.

 

Link to comment
Share on other sites

  • 0

While you are there, go ahead and fix

/usr/share/genkernel/defaults/config.sh
/usr/share/genkernel/arch/x86/config.sh

KERNEL_BINARY="arch/x86/boot/bzImage"
DEFAULT_MAKEOPTS="-j5"

Also in
/usr/share/genkernel/gen_bootloader.sh
change
grub2-mkconfig -o "${GRUB_CONF}"
to
 

ego boot update

 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...