Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Unable to mount root fs
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
7Jean7
n00b
n00b


Joined: 07 Jan 2020
Posts: 7

PostPosted: Tue Jan 07, 2020 6:55 am    Post subject: [SOLVED] Unable to mount root fs Reply with quote

I get kernel panic from my freshly compiled linux kernel booting from USB key (like here Unable to mount root fs)


    error : unable to mount root fs on unknown-block(0,0)
    kernel version : 5.5-rc5
    bootloader : none (EFI stub)
    built-in kernel command line : root=PARTUUID=xx1-xx1-xx1-1xx
    kernel supports the root file system : f2fs
    kernel is moduleless

Solutions tried/tested

    checked PARTUUID of the root device 3 times
    kernel do load my sata ssd with proper PARTUUID
    kernel doesn't mount other USB drive
    BLK_DEV=y, BLK_DEV_SD=y, USB_STORAGE=y, ...
    tried with UUID and /dev/sda2 same result


It seems to be a USB problem something wrong in kernel configuration ?


Last edited by 7Jean7 on Wed Jan 08, 2020 6:16 am; edited 1 time in total
Back to top
View user's profile Send private message
lefsha
Veteran
Veteran


Joined: 30 Aug 2004
Posts: 1088
Location: Burgas, Bulgaria

PostPosted: Tue Jan 07, 2020 9:16 pm    Post subject: Reply with quote

Quite obvious kernel USB drivers are missed.

Just enable (not as module) all possible USB drivers, then check
by lspci/lsusb what has been used.

Enable CONFIG_USB_STORAGE

May be the better advice is to use binary kernel from other
working distro. Most common is Ubuntu/Deb

That would solve your problem temporally till you make
a working kernel yourself.

On a rare case, where USB drive need a firmware either provide
it within kernel or use drivers as modules and therefore enable initramfs.

Previously I was also running a module free kernel.
Now I can't, due to the firmware and special drivers.
I believe a module free kernel is a history. It won't be possible
to use in the future with any hardware.

P.S. On a place of Gentoo Devs I would put a binary kernel
into portage to allow people don't hang at the stage of not working
kernel, cause if you are picky it might take weeks or months till
you get one.
_________________
Lefsha
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Tue Jan 07, 2020 9:36 pm    Post subject: Reply with quote

7Jean7,

In normal operation the USB subsystem is not started until after root is mounted.
That makes root on USB tricky.

For testing only, add
Code:
rootdelay=30
to the kernel command line. USB will start while the kernel waits for 30 seconds for root to appear.
It will then panic in the normal way if root is not available.

30 seconds is a long very safe time and you won't like it.
Once booting works, remove
Code:
rootdelay=30
and replace it with
Code:
rootwait

rootwait will wait for the root filesystem forever, so you won't get the useful panic message if root does not appear.
Conversely, it will not wait any longer than it needs to.

As lefsha says, the USB stack and everything needed to mount root must be built into the kernel.
_________________
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
7Jean7
n00b
n00b


Joined: 07 Jan 2020
Posts: 7

PostPosted: Wed Jan 08, 2020 3:56 am    Post subject: Reply with quote

Thanks all for your help

Special thanks to NeddySeagoon you are right
slow USB subsystem was the problem (I did not expect that :))

Just to complete the answer
All USB drivers were installed even useless ones
and when SSD was mounted as root from USB kernel i see all USB devices

A bit off-topic but
I think that a module less kernel is a better solution
not only it pushes the companies from closed sourced firmware and drivers to openness
but also it is more secure (cause opensource) and more fast&efficient (cause tightly integrated)

Regarding kernel compiling i can say that
it can go painful sometimes but it is always rewarding
and you learn a lot of things doing that ( like today :))

P.S. It will be nice to add this to Unable to mount root fs as a part of Analysis


Last edited by 7Jean7 on Thu Jan 09, 2020 7:03 am; edited 3 times in total
Back to top
View user's profile Send private message
skiwarz
Apprentice
Apprentice


Joined: 23 Feb 2014
Posts: 151

PostPosted: Wed Jan 08, 2020 5:14 am    Post subject: Reply with quote

7Jean7 wrote:

P.S. how i mark this topic as solved ?


Edit your first post and add "[solved]" to the subject line.
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