View previous topic :: View next topic |
Author |
Message |
guyuming Apprentice
Joined: 19 Nov 2020 Posts: 253
|
Posted: Thu Dec 03, 2020 1:43 pm Post subject: Could not find the root block device in UUID=94db66e3-blabl |
|
|
background: not sure whether it is encouraged to start new thread or keep on the old thread.
https://forums.gentoo.org/viewtopic-t-1124482-highlight-.html
https://forums.gentoo.org/viewtopic-t-1124446-highlight-.html
After taking the steps in https://wiki.gentoo.org/wiki/Kernel/Rebuild and typed in reboot, i see what follows (i typed in manually, so might be slightly different on screen):
[ 4.094674] Run /init as init process
>> Genkernel 4.1.2 (blabalba) Linux kernel 5.4.72-gentoo-x86_64
>> Activating udev ...
>> Determining root device (trying UUID=94db66e3-blablabla)
...
!! Block device UUID=94db66e3-blablabla is not a valid root device ...
!! Could not find the root block device in UUID=94db66e3-blablabla
!! Please specify another value or:
!! - press Enter for the same
!! - type "shell" for a shell
!! - type "q" to ship ...
root block device(UUID=94db66e3-blablabla)
And after reviewing the kernel/Rebuild document above, i found that i missed the following step:
Do not forget to copy the newly compiled kernel image to the /boot location. If applicable mount /boot.
root #mount /boot
I had just use the commond "ls /boot" to verify that there were something in that folder and did nothing, i had thought "make install" would do everything for me.
Now, what shall i do? type Enter or shell or q? |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54819 Location: 56N 3W
|
Posted: Thu Dec 03, 2020 6:12 pm Post subject: |
|
|
guyuming,
Lets have a quick canter through the boot process to aid your understanding, then make some educated guesses as to what you need to look at.
When you power your system on, the RAM is blank. The firmware loads something for the CPU to execute from the HDD.
Details differ between BIOS and UEFI but that need not concern us here. We will assume the use of the grub boot loader.
The firmware does its thing, loads grub and passes control to it. Grub shows you a menu and you make a selection.
Grub loads the kernel and optionally, one or more initrd files, then passes control to the kernel binary. That's grub done.
Now its just the kernel and the optional initrd files to bring your system up.
The kernel decompresses itself, initialises the built in code and mounts the initrd as a temporary root filesystem. There is a degree of parallelism in the kernel startup too.
With the initrd mounted as root, the kernel executes the init scrlipt it finds at /init. This does everything required to get your real root filesystem mounted. The very last thing it does it to switch to the real root filesystem and tell the kernel to execute /sbin/init.
Its really a house of cards. Keep in mind that the boot process is solving the problem of loading the operating system into a computer that doesn't know how to load its operating system. There are lots of circular dependencies to be broken.
The Code: | Determining root device (trying UUID= | message is significant.
As you are using UUID, you must also have an initrd containing the userspace mount command.
The kernel does not understand UUID.
Round about the same place, there should have been a message Code: | Unable to find root device in <list of block devices>. |
It looks very odd with an empty list. Its just Code: | Unable to find root device in. |
If that appears, your kernel and initrd cannot read any block devices at all. That's a kernel config problem.
Its very easy to install the new kernel and initrd correctly in the wrong place.
There are different places on your system known loosely as boot. The kernel can see both of them but the bootloader can only access one.
First there is /boot. That's a directory on your root partition. It behaves in all respects like any other directory. You can put things in it if you want to.
Then there boot, the boot partition. This is the boot that the boot loader uses.
When you update the files for the boot loader to use, the boot partition needs to be mounted at /boot on the root partition.
If that doesn't happen the files go into the /boot directory on the root partition.
You may need to update the grub.cfg too.
A last trap for the unwary is that grub does not always make the new kernel the default boot option. You may need to search for it in the menu.
Some things to check.
When boot is not mounted at /boot should be empty.
When the boot partition is mounted at /boot will show what the boot loader sees. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
guyuming Apprentice
Joined: 19 Nov 2020 Posts: 253
|
Posted: Fri Dec 04, 2020 7:43 am Post subject: |
|
|
Enter, shell, or q, none of them worked for me. for example, shell leads me into the rescueshell where i can do almost nothing.
I reboot the machine with the original LiveCD USB which i created to install gentoo, and do what follows again, which is part of what i had done in initial installation. now i can use the system as before.
mount /dev/sda3 /mnt/gentoo
mount /dev/sda1 /mnt/gentoo/boot
mount --types proc /proc /mnt/gentoo/proc
mount --rbind /sys /mnt/gentoo/sys
mount --make-rslave /mnt/gentoo/sys
mount --rbind /dev /mnt/gentoo/dev
mount --make-rslave /mnt/gentoo/dev
chroot /mnt/gentoo /bin/bash
source /etc/profile
export PS1="(chroot) ${PS1}"
genkernel --menuconfig all
# in menuconfig, i added two keys suggested by the docker kernel checker and save, and rebuild takes several hours
grub-mkconfig -o /boot/grub/grub.cfg
# and reboot with ctrl+alt+del
by the way, the UUID in my original post refers to the /dev/sda3, the root partition for me. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54819 Location: 56N 3W
|
Posted: Fri Dec 04, 2020 10:09 am Post subject: |
|
|
guyuming,
I suspect that something went wrong with the initrd build but we will never know.
When you update you kernel, keep a good working kernel to fall back on.
Everyone builds a kernel that won't boot from time to time.
My point about UUID, was not so much what it points to as the tools needed to discover it during booting.
UUID is a filesystem property. The kernel can read filesystems but not extract the UUID - hence the requirement for mount, which in turn drives the requirement for an initrd.
The rescue shell is ash, provided by busybox. Depending on what your initrd does before it drops you to the rescue shell, you can either call commands directly or you may need to prefix them all with busybox. There is enough there to look round and see what went wrong, maybe fix it and run the init script again.
Its not as nice as a full shell. There is no less. Make friends with more and so on. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
x90e n00b
Joined: 30 Sep 2020 Posts: 40
|
Posted: Tue Dec 08, 2020 5:52 am Post subject: |
|
|
guyuming wrote: | Enter, shell, or q, none of them worked for me. for example, shell leads me into the rescueshell where i can do almost nothing.
I reboot the machine with the original LiveCD USB which i created to install gentoo, and do what follows again, which is part of what i had done in initial installation. now i can use the system as before.
mount /dev/sda3 /mnt/gentoo
mount /dev/sda1 /mnt/gentoo/boot
mount --types proc /proc /mnt/gentoo/proc
mount --rbind /sys /mnt/gentoo/sys
mount --make-rslave /mnt/gentoo/sys
mount --rbind /dev /mnt/gentoo/dev
mount --make-rslave /mnt/gentoo/dev
chroot /mnt/gentoo /bin/bash
source /etc/profile
export PS1="(chroot) ${PS1}"
genkernel --menuconfig all
# in menuconfig, i added two keys suggested by the docker kernel checker and save, and rebuild takes several hours
grub-mkconfig -o /boot/grub/grub.cfg
# and reboot with ctrl+alt+del
by the way, the UUID in my original post refers to the /dev/sda3, the root partition for me. |
I believe you need to configure fstab before you run genkernel.
https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Kernel#Alternative:_Using_genkernel
Make sure the line pointing to /boot is configured properly. My boot NVMe drive, second partition, is my boot partition. here is my fstab for that line
Code: |
UUID="D70D-41EC" /boot vfat noauto,noatime 1 2 |
sudo blkid will tell you the UUID: for me:
Code: |
x90e@3sr3v3rs3 ~ $ sudo blkid
SSH passphrase:
/dev/nvme1n1p1: SEC_TYPE="msdos" UUID="D7B4-630D" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="grub" PARTUUID="8ff9dcce-8db3-4b81-9b79-67f6b7a274aa"
/dev/nvme1n1p2: UUID="D70D-41EC" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="boot" PARTUUID="cb93e585-94de-4d51-936b-96c54e179ee2"
|
I also added the first one in my fstab
Code: |
UUID="D7B4-630D" /boot/efi vfat noauto,noatime 1 2
|
but you probably don't need that
[edit] spelling [/edit] |
|
Back to top |
|
|
|
|
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
|
|