Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Install gentoo on a removable device
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
nexem
n00b
n00b


Joined: 22 Feb 2020
Posts: 5

PostPosted: Tue Mar 16, 2021 3:07 am    Post subject: [SOLVED] Install gentoo on a removable device Reply with quote

I know there is a wiki page related (Install Gentoo on a bootable USB stick), but I don't want any bootloaders but a EFT STUB direct boot and there is nothing about EFI STUB in this page. And it didn't list the neccessary kernel configurations.

But I do use a USB stick (contains a EFI STUB boot kernel) to boot the system (the root partition is in the internal SSD), I thought I could have a root partition on the USB stick, but afte doing that I only got:

Code:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
cpu: 11 PID: 1 Comm: swapper/0 Not tainted 5.4.97-gentoo #2
Hardware name: blah...blah...blah...
Call trace:
dump_stack+0x50/0x63
panic+0xe6/0x270
mount_block_root+0x1f9/0x284
prepare_namespace+0x128/0x15e
? rest_init+0x95/0x95
kernel_init+0x5/0xeb
ret_from_fork+0x1f/0x30
kernel offset: disable
--- [ Kernel panic - not syncing: VFS: Unable to mount root fs on ubknown-block(0,0) ] ---


I checked filesystem support and /etc/fstab, using PARTUUID instead of /dev/sdaX in kernel commandline and /etc/fstab, and they don't help. I also tried adding the scandelay= option I found from the wiki page to kernel commandline and nothing changed.


Last edited by nexem on Tue Mar 16, 2021 11:01 am; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Tue Mar 16, 2021 10:29 am    Post subject: Reply with quote

nexem,

Code:
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
is a kernel message, so the kernel was loaded.

The kernel needs to get the USB subsystem, USB Storage and maybe USB Attached SCSI subsystems running before it goes looking for root.
That's not the default order. Normally, root is mounted before USB is started. That's a bad thing for root on USB and results in the message you see.

For testing, add
Code:
rootdelay=20
to the kernel command line. That allows 20 seconds for USB to start, which will give you time to read the panic message, when it doesn't. :)
Once it works, swap that to rootwait, so it does not delay any longer than it needs to.

As the kernel is going to start USB before mounting root, all the USB modules must be built in.
_________________
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
joanandk
Apprentice
Apprentice


Joined: 12 Feb 2017
Posts: 169

PostPosted: Tue Mar 16, 2021 10:43 am    Post subject: Re: Install gentoo on a removable device Reply with quote

nexem wrote:
And it didn't list the neccessary kernel configurations.


Hi,

You need to compile the necessary drivers into the Kernel. That include SATA/NVME (in your case with the SSD), filesystem drivers and all USB related drivers. Then you need also devtmpfs mounted at boot, otherwise USB is not accessible. USB drivers are a bit too slow that there is a race-condition AFAIK. For my USB-Kernel, I use an initramfs which mounts the USB after a sleep of 5s prior to mounting the USB drive and boot from it.


BR
Back to top
View user's profile Send private message
nexem
n00b
n00b


Joined: 22 Feb 2020
Posts: 5

PostPosted: Tue Mar 16, 2021 11:00 am    Post subject: Reply with quote

Thank NeddySeagoon very much! The solution worked and the explaination is very useful.

And thank joanandk's reply, too. Although I don't like an initramfs, I just build them all into kernel.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4236
Location: Bavaria

PostPosted: Tue Mar 16, 2021 12:55 pm    Post subject: Re: Install gentoo on a removable device Reply with quote

joanandk wrote:
[...] I use an initramfs which mounts the USB after a sleep of 5s prior to mounting the USB drive and boot from it.

For this you dont need an initramfs, just use the kernel parameter "rootwait".

See more here:
https://www.kernel.org/doc/html/latest/admin-guide/kernel-parameters.html
https://pagefault.blog/2016/11/25/the-missing-rootwait/
https://unix.stackexchange.com/questions/67199/whats-the-point-of-rootwait-rootdelay
Back to top
View user's profile Send private message
Goverp
Advocate
Advocate


Joined: 07 Mar 2007
Posts: 2014

PostPosted: Wed Mar 17, 2021 8:54 am    Post subject: Re: Install gentoo on a removable device Reply with quote

joanandk wrote:
,,,the necessary drivers into the Kernel. That include SATA/NVME (in your case with the SSD)...

AFAIK you only need NVMe if you have, err, NVMe. For SSD and USB drives, you need exactly the same as for SATA hard drives connected in the same way, since that's the whole point of SSD. NVMe goes faster 'cos it skips emulating spinning rust
_________________
Greybeard
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo 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