Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Gentoo install first boot stuck on job dev-disk-by
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Tue Feb 07, 2023 10:23 pm    Post subject: Reply with quote

I found it.
Most probably you forgot to mount /dev/sda1 on /boot before chrooting.
So when you ran
Code:

(chroot) livecd / # grub-mkconfig -o /boot/grub/grub.cfg


the grub.cfg was generated on / partition and not on /boot partition
Plz do this:
Boot into live cd then
Code:

mount /dev/sda3 /mnt
mount /dev/sda1 /mnt/boot
mount .....
.
.
.
chroot /mnt /bin/bash
dracut --force --kver............
grub-mkconfig -o /boot/grub/grub.cfg
umount /boot
rm -rf /boot/*
exit
reboot

_________________
:)


Last edited by alamahant on Tue Feb 07, 2023 10:30 pm; edited 1 time in total
Back to top
View user's profile Send private message
kish
n00b
n00b


Joined: 06 Feb 2023
Posts: 18

PostPosted: Tue Feb 07, 2023 10:29 pm    Post subject: Reply with quote

I did `mount /dev/sda1 /boot` after chrooting.

Here are my steps:

Code:

livecd ~ # mount /dev/sda3 /mnt/gentoo

livecd ~ # mount --types proc /proc /mnt/gentoo/proc;
livecd ~ # mount --types proc /proc /mnt/gentoo/proc;
livecd ~ # mount --make-rslave /mnt/gentoo/sys;
mount: /mnt/gentoo/sys: not mount point or bad option.
       dmesg(1) may have more information after failed mount system call.
livecd ~ # mount --rbind /dev /mnt/gentoo/dev;
livecd ~ # mount --make-rslave /mnt/gentoo/dev;
livecd ~ # mount --bind /run /mnt/gentoo/run;
livecd ~ # mount --make-slave /mnt/gentoo/run;

livecd ~ # chroot /mnt/gentoo /bin/bash;
livecd / # source /etc/profile;
livecd / # export PS1="(chroot) ${PS1}";

(chroot) livecd / # mount /dev/sda1 /boot


Current state of `/boot`:

Code:

(chroot) livecd / # df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        39G  7.8G   30G  22% /
udev             10M     0   10M   0% /dev
tmpfs            12G     0   12G   0% /dev/shm
none             12G  872K   12G   1% /run
/dev/sda1       253M   58M  195M  23% /boot

(chroot) livecd / # ls -l /boot
total 45752
drwxr-xr-x 3 root root      512 Feb  5 19:27 EFI
-rwxr-xr-x 1 root root  6214567 Feb  5 17:38 System.map-5.15.88-gentoo
-rwxr-xr-x 1 root root   133170 Feb  5 17:38 config-5.15.88-gentoo
drwxr-xr-x 6 root root     1024 Feb  7 13:01 grub
-rwxr-xr-x 1 root root 27754323 Feb  7 13:00 initramfs-5.15.88-gentoo.img
-rwxr-xr-x 1 root root 12745184 Feb  5 17:38 vmlinuz-5.15.88-gentoo


Do you see anything wrong?
Back to top
View user's profile Send private message
pingtoo
l33t
l33t


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

PostPosted: Tue Feb 07, 2023 10:31 pm    Post subject: Reply with quote

kish,

Please try alamahant suggestion first, if it work great, problem solved.

If not or you still want to pursue dracut/systemd, we can try then.

As rdsosreport.txt getting nothing. I am sorry about that, Because I forget about a bunch of setup required for initrd at top. We break into initrd very early some steps need manually execute. If after trying alamahant suggestion we are still in game need to solve this mystery I will provide either a simple script or find a different breakpoint into initrd.
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Tue Feb 07, 2023 10:37 pm    Post subject: Reply with quote

Quote:

livecd ~ # mount --types proc /proc /mnt/gentoo/proc;
livecd ~ # mount --types proc /proc /mnt/gentoo/proc;
livecd ~ # mount --make-rslave /mnt/gentoo/sys;
mount: /mnt/gentoo/sys: not mount point or bad option.
dmesg(1) may have more information after failed mount system call.

You didnt mount /sys
Try instead
Code:

mount --types proc /proc /mnt/proc/
mount --rbind /sys /mnt/sys/
mount --make-rslave /mnt/sys/
mount --rbind /dev /mnt/dev/
mount --make-rslave /mnt/dev/


_________________
:)
Back to top
View user's profile Send private message
kish
n00b
n00b


Joined: 06 Feb 2023
Posts: 18

PostPosted: Tue Feb 07, 2023 10:40 pm    Post subject: Reply with quote

I did mount sys, sorry. It was a copy/paste typo.

Moreover, when we switched from UUID to partition numbers, grub did update. So I believe the correct /boot is mounted.
Back to top
View user's profile Send private message
pingtoo
l33t
l33t


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

PostPosted: Tue Feb 07, 2023 11:03 pm    Post subject: Reply with quote

kish,

Here are few breakpoints in dracut we can test which hopefully well lead to a clear picture what happen during the boot sequence.
  • rd.break=pre-mount
  • rd.break=mount
  • rd.timeout=10
I think pre-mount and mount are mutually exclusive, you can only use one or the other. In you screen dump post, the pre-mount seems to always finish so it may be a safe place to break in.

On the other hand rd.break=mount + rd.timeout=10 can be use together for debug rootfs mounting problem. rd.break=mount is breakpoint right before mount rootfs, and rd.timeout=10 will cause dracut timeout and drop to shell if any device waiting over timeout(10 seconds). so hopefully this is the right combo for break to take a look why systemd is waiting for root device.

To test above just do the same dance, got into grub prompt, replace rdinit=/bin/sh to either rd.break=pre-mount or the rd.timeout+rd.break combo.

If timeout occur and you dropped into shell, the /run/initramfs/rdsosreport.txt should already exist. please share the file. please not the file could be big, usually screen dump is not enough.
Back to top
View user's profile Send private message
kish
n00b
n00b


Joined: 06 Feb 2023
Posts: 18

PostPosted: Thu Feb 09, 2023 2:24 am    Post subject: Reply with quote

Got it!

Booted with `rd.break=mount rd.timeout=10`.
Dropped me into the emergency shell.
Indeed there was a warning about `/run/initramfs/rdsosreport.txt` being created. It even suggested to copy it to a USB stick or /boot.

Emergency shell output

rdsosreport.txt

Does this help?
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1658

PostPosted: Thu Feb 09, 2023 3:31 am    Post subject: Reply with quote

You do not have the disk driver enabled that is in use for the VMWare machine.

Often this can be a Fusion MPT or similar by default. If it can be changed to SATA (with AHCI) or similar, then it will save a kernel recompile.
Back to top
View user's profile Send private message
kish
n00b
n00b


Joined: 06 Feb 2023
Posts: 18

PostPosted: Thu Feb 09, 2023 4:14 am    Post subject: Reply with quote

Ah! So it's due to a lacking kernel driver for the SCSI disk controller used by VMware...
The VM's disk was created by default using a SCSI disk controller, it didn't prompt me to choose a disk controller when creating the VM.

Switched the SCSI controller to a SATA (AHCI) controller and it booted right up to the login prompt!

Also, I assumed because the Live CD was able to access the disk, that the newly compiled kernel would be able to as well. I didn't realize I needed to compile the kernel with the SCSI support explicitly! :oops: Newbie mistake.
The kernel in the Live CD having support for SCSI as both a blessing and a curse: I was able to mount the disk and follow the handbook all the way to the end, but it wouldn't boot at the end due to lack of drivers in the new kernel.
Maybe it's worth adding a note to the Kernel compile section in the handbook to remind users to add kernel support for their disk controllers if not SATA.

What a farce this was, thanks for your time. :D
Back to top
View user's profile Send private message
kish
n00b
n00b


Joined: 06 Feb 2023
Posts: 18

PostPosted: Thu Feb 09, 2023 9:05 am    Post subject: Reply with quote

So one thing I don't understand is, if /dev/sda disk was not accessible by the kernel due to missing SCSI controller driver, how did grub work and the kernel start loading?
Grub and the Linux kernel were installed to /boot, which is on /dev/sda1 partition, which is part of the /dev/sda disk.

Does grub have its own set of built-in drivers to load various disk drive controllers?
And then grub boostrapped the kernel, and then the kernel failed to load the remaining partitions needed to finish booting, /dev/sda2 (swap) and /dev/sda3 (/)?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21619

PostPosted: Thu Feb 09, 2023 12:26 pm    Post subject: Reply with quote

The LiveCD needs to have broad hardware support, because if it does not work on your hardware as-is, you usually have no reasonable way to replace its kernel with a more capable one. In contrast, the kernel you configure and build for yourself can have narrow support for just your hardware, since you can use an older kernel or the LiveCD to add support if you miss something.

Yes, Grub has its own mechanism for accessing the disk, outside the kernel. This is why Grub can be used to boot non-Linux systems, such as Windows, even when no Linux kernel is installed. These mechanisms may be less capable than the Linux-native driver, such as lacking support for features that obtain the maximum performance your hardware can provide. However, since they are only used long enough to load a small number of files and then transfer control to Linux, you do not need optimum performance from them.

The kernel cannot access a partition until it can access the device on which the partition is stored. Since you lacked the relevant driver, you had no /dev/sda, and thus no access to that device or the partitions on it.
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1658

PostPosted: Thu Feb 09, 2023 1:26 pm    Post subject: Reply with quote

kish wrote:
Maybe it's worth adding a note to the Kernel compile section in the handbook to remind users to add kernel support for their disk controllers if not SATA.


This already exists with https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Kernel#Activating_required_options
Quote:
Make sure that every driver that is vital to the booting of the system (such as SCSI controller, etc.) is compiled in the kernel and not as a module, otherwise the system will not be able to boot completely.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Thu Feb 09, 2023 8:22 pm    Post subject: Reply with quote

kish,

You are getting experience.

That's what you get just after you needed it :)

Enjoy your Gentoo.
_________________
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
kish
n00b
n00b


Joined: 06 Feb 2023
Posts: 18

PostPosted: Thu Feb 09, 2023 10:48 pm    Post subject: Reply with quote

So I'm running into the same driver issue for my network interface. Works in the LiveCD, but not in the new kernel.

How do I go about finding which correct driver to compile into the kernel? Maybe I can grab some info about the nic when booted into the LiveCD?

From the LiveCD:

Code:

livecd ~ # ifconfig -a

enp11s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.10.112  netmask 255.255.255.0  broadcast 192.168.10.255
        inet6 fe80::d15d:d3c8:8c8c:ef09  prefixlen 64  scopeid 0x20<link>
        ether 00:50:56:88:f0:82  txqueuelen 1000  (Ethernet)
        RX packets 152  bytes 15879 (15.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 62  bytes 9982 (9.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

livecd ~ # ip a

2: enp11s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:50:56:88:f0:82 brd ff:ff:ff:ff:ff:ff
    inet 192.168.10.112/24 brd 192.168.10.255 scope global dynamic noprefixroute enp11s0
       valid_lft 86367sec preferred_lft 75567sec
    inet6 fe80::d15d:d3c8:8c8c:ef09/64 scope link
       valid_lft forever preferred_lft forever


Last edited by kish on Thu Feb 09, 2023 10:58 pm; edited 1 time in total
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4147
Location: Bavaria

PostPosted: Thu Feb 09, 2023 10:58 pm    Post subject: Reply with quote

kish wrote:
So I'm running into the same driver issue for my network interface. Works in the LiveCD, but not in the new kernel.

How do I go about finding which correct driver to compile into the kernel? Maybe I can grab some info about the nic when booted into the LiveCD?

Yes, this is the correct approach. Do a "lspci -k" and you will see your ethernet device and its used module. Maybe you want read this:
https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Manual_kernel_configuration#Before_you_start
Back to top
View user's profile Send private message
kish
n00b
n00b


Joined: 06 Feb 2023
Posts: 18

PostPosted: Thu Feb 09, 2023 11:00 pm    Post subject: Reply with quote

pietinger wrote:
kish wrote:
So I'm running into the same driver issue for my network interface. Works in the LiveCD, but not in the new kernel.

How do I go about finding which correct driver to compile into the kernel? Maybe I can grab some info about the nic when booted into the LiveCD?

Yes, this is the correct approach. Do a "lspci -k" and you will see your ethernet device and its used module. Maybe you want read this:
https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Manual_kernel_configuration#Before_you_start


Got it!

Code:

0b:00.0 Ethernet controller: VMware VMXNET3 Ethernet Controller (rev 01)
   DeviceName: Ethernet0
   Subsystem: VMware VMXNET3 Ethernet Controller
   Kernel driver in use: vmxnet3
   Kernel modules: vmxnet3


Also found that pesky SCSI disk controller from earlier:

Code:

02:00.0 SATA controller: VMware SATA AHCI controller
   DeviceName: sata0
   Subsystem: VMware SATA AHCI controller
   Kernel driver in use: ahci
   Kernel modules: ahci

03:00.0 Serial Attached SCSI controller: VMware PVSCSI SCSI Controller (rev 02)
   DeviceName: SCSI0
   Subsystem: VMware PVSCSI SCSI Controller
   Kernel driver in use: vmw_pvscsi
   Kernel modules: vmw_pvscsi


vmw_pvscsi . Yeah, we weren't going to guess that.
Back to top
View user's profile Send private message
tippincows
n00b
n00b


Joined: 05 Jan 2013
Posts: 9

PostPosted: Sun Mar 19, 2023 7:16 pm    Post subject: Reply with quote

Quote:
Switched the SCSI controller to a SATA (AHCI) controller and it booted right up to the login prompt!


Getting the exact same error, Installing on a proxmox VM. Thank you for the info.
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
Goto page Previous  1, 2
Page 2 of 2

 
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