Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] USB boot without initramfs results in kernel panic
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
qsmodo
Tux's lil' helper
Tux's lil' helper


Joined: 20 Jun 2021
Posts: 82

PostPosted: Sat May 21, 2022 6:20 pm    Post subject: [Solved] USB boot without initramfs results in kernel panic Reply with quote

I'm trying to boot Gentoo (no initramfs) from a USB connected hard disk, since my internal hard disk is for work only.

The issue is that, although I can make GRUB boot the right kernel, I always end up with a kernel panic, which says

Quote:
Please append a correct boot option, here are the available partitions: sda1 sda2 sda3


Those sda are for the internal hard disk. Interestingly, some lines above that quoted message I can see that the USB drive was detected (usb 1-7: new USB device found, idVendor=...), but at no point there I see an explicit mention to sdb.

I already tried:

1. to run "linux (hd0,gpt1)/vmlinuz-gentoo-... root=/dev/sdb5" and "boot"
2. the previous one with root=PARTUUID={partuuid of /dev/sdb5} (as suggested by https://forums.gentoo.org/viewtopic-t-1045010-start-0.html)
3. to run "configfile (hd0,gpt1)/grub/grub.cfg" from GRUB. The usual GRUB screen does loads and I select "Gentoo" (if I select Ubuntu instead, which lives in sdb2 and has initramfs, it boots fine, so I guess lack of initramfs is really biting me here.)
4. adding "rootdelay=10" as a kernel parameter.

but in all instances I end up with the same kernel panic.

Is there something else I can try? Am I possibly missing a kernel module? The suggestion in item 2 seems to have worked to its original reporter in the link provided.


Last edited by qsmodo on Sat May 21, 2022 10:35 pm; edited 1 time in total
Back to top
View user's profile Send private message
pingtoo
l33t
l33t


Joined: 10 Sep 2021
Posts: 925
Location: Richmond Hill, Canada

PostPosted: Sat May 21, 2022 6:45 pm    Post subject: Reply with quote

Usually USB device will not ready before kernel want to use rootfs, so you can try kernel command line argument rootwait or rootdelay=X

Code:
rootwait        [KNL] Wait (indefinitely) for root device to show up.
                Useful for devices that are detected asynchronously
                (e.g. USB and MMC devices).

Code:
rootdelay=      [KNL] Delay (in seconds) to pause before attempting to
                mount the root filesystem


Above is assume you have right kernel modules builtin. You at least will need scsi, sd and usb with storage support.
Back to top
View user's profile Send private message
qsmodo
Tux's lil' helper
Tux's lil' helper


Joined: 20 Jun 2021
Posts: 82

PostPosted: Sat May 21, 2022 6:55 pm    Post subject: Reply with quote

Tried rootdelay already. But I see from .config:

CONFIG_USB_STORAGE=m

So I guess I'll have to recompile that with Y, thanks
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54232
Location: 56N 3W

PostPosted: Sat May 21, 2022 6:57 pm    Post subject: Reply with quote

qsmodo,

... and the USB support.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
qsmodo
Tux's lil' helper
Tux's lil' helper


Joined: 20 Jun 2021
Posts: 82

PostPosted: Sat May 21, 2022 7:01 pm    Post subject: Reply with quote

Since the Udev message already seems to beckon the USB device, I guess I should already have USB support builtin?

I'm asking because `grep USB .config | grep '^[^#].*[^y]$'| wc -l` gives me 320 and I'm uncertain what exactly to look for xD
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54232
Location: 56N 3W

PostPosted: Sat May 21, 2022 7:36 pm    Post subject: Reply with quote

qsmodo,

The root hub drivers you want to use.
Code:
grep -i hcd /usr/src/linux/.config


CONFIG_USB_XHCI_HCD=y for USB3
# CONFIG_USB_EHCI_HCD is not set for USB2
one of for USB1
# CONFIG_USB_OHCI_HCD is not set
# CONFIG_USB_UHCI_HCD is not set

USB_EHCI_HCD also has some transaction translation options so it can drive USB 1 peripherals.
That requires hardware support too, but the kernel options are harmless if your USB2 does not have that hardware.

More recently, the PCI backends for those USB root hub drivers have bees split out.
e.g.
CONFIG_USB_PCI=y for all
and CONFIG_USB_XHCI_PCI=y for USB3 on the PCI bus.
There are similar options for USB2 and USB1 but they are hidden in my kernel as I have the root hub options off.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
qsmodo
Tux's lil' helper
Tux's lil' helper


Joined: 20 Jun 2021
Posts: 82

PostPosted: Sat May 21, 2022 10:35 pm    Post subject: Reply with quote

Thanks Neddy, I had problems compiling (maybe I didn't mount all the things correctly prior to the chroot) and so simply installed the binary kernel. I will never underestimate Initramfs again!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum