Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Could not find the root block device in UUID
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
FordArthur
n00b
n00b


Joined: 25 Jul 2022
Posts: 6

PostPosted: Mon Aug 01, 2022 1:26 pm    Post subject: [SOLVED] Could not find the root block device in UUID Reply with quote

I know that's there are several threads about this but none of them seem to solve my situation.

I've used genkernel for my compiling my current kernel, but since I want to use QEMU and disable stuff that I don't use in my system I followed the steps from the handbook, but even when I don't touch anything, disk / filesystem related the kernel isn't able to recognize my root partition.

Thanks in advance!


Last edited by FordArthur on Wed Aug 10, 2022 4:40 am; edited 2 times in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Mon Aug 01, 2022 8:37 pm    Post subject: Reply with quote

FordArthur,

That's not a lot to go on.

There are at least two ways to use QEMU.
To use an unmodified kernel, you set it up to use the emulated hardware that lspci shows you in the guest.

If you modify the host kernel to support virtio, you use the virtual devices.
Which are you doing?

UUID is a property of a filesystem. To mount root via UUID, requires an initrd.
Did you make one of those.?

The kernel can mount root using the PARTUUID, That's a property of a partition. No initrd required.

Here are some High Level pointers.
_________________
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
FordArthur
n00b
n00b


Joined: 25 Jul 2022
Posts: 6

PostPosted: Tue Aug 02, 2022 11:14 am    Post subject: Reply with quote

I want to modify the kernel, not only for QEMU but also for disabling things that I don't use.

I haven't made an initrd as far as I know, currently I'm using UUID and genkernel so maybe genkernel did that work for me, and when I try to customize, do I need to do that too? and if so, how?

Edit: just realized, is initrd similar to initramfs? if so yes, I've set it up with dracut.

Thanks.
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5373
Location: Bavaria

PostPosted: Tue Aug 02, 2022 12:07 pm    Post subject: Reply with quote

FordArthur wrote:
I want to modify the kernel, not only for QEMU but also for disabling things that I don't use.

FordArthur,

I like your approach ... not many users today want to do this ... but it is the best way to have totally control ... and security ;-)

You will need initrd/initramfs only IF you 1. dont want configure your kernel by yourself, OR 2. if you use an encrypted root partition. If both are not true, you dont need dracut for building an initramfs, and you can configure all by yourself. This is chapter "manual configuring the kernel" in our AMD64 handbook. If you dont have much experience with configuring a kernel, I recommend to read my article first: https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Manual_kernel_configuration Here you will find also two articles from @Neddy. ;-) (read it !)

Next you have to know: Kernel must know where it find its root partition. There exists two/three choices:
1. You configure this information "hard" into your kernel (then it doesnt matter what information comes from a bootloader), OR
2a. You configure your bootloader (e.g. grub2) telling your kernel which partition it is, OR
2b. You configure your UEFI to tell your kernel (only possible if you are using a STUB kernel)

I do 1. with this:
Code:
Processor type and features  --->
[*] Built-in kernel command line
(root=PARTUUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx ro) Built-in kernel command string
[*]   Built-in command line overrides boot loader arguments


You cannot use your UUID of your root partition for telling your kernel; you must use PARTUUID of your root partition. Maybe you want read also these wiki articles:
https://wiki.gentoo.org/wiki/EFI_System_Partition
https://wiki.gentoo.org/wiki/Efibootmgr
https://wiki.gentoo.org/wiki/EFI_stub

(I am using UEFI booting a stub kernel)

If you have more specific questions, be free to ask here more.

Have fun with Gentoo !
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Tue Aug 02, 2022 4:13 pm    Post subject: Reply with quote

FordArthur,

The initrd was the original temporary root filesystem in a file. It was a compressed ext2 filesystem in a file.
The initramfs in a compressed archive og CPIO archives. Its still a root filesystem in a file. Only the internal structure has changed.

Old timers use the terms initrd and initramfs interchangeably.

Without outside (userspace) help the kernel understands
Code:
root=/dev/<simple_block_device>
root=PARTUUID=
root=<major>:<minor>

Where <major>:<minor> are the kernel device numbers.
Anything else, the user space mount tool is required.

PARTUUID has a different value to UUID.
_________________
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
FordArthur
n00b
n00b


Joined: 25 Jul 2022
Posts: 6

PostPosted: Wed Aug 03, 2022 7:43 am    Post subject: Reply with quote

pietinger wrote:
FordArthur wrote:
I want to modify the kernel, not only for QEMU but also for disabling things that I don't use.

FordArthur,

I like your approach ... not many users today want to do this ... but it is the best way to have totally control ... and security ;-)

You will need initrd/initramfs only IF you 1. dont want configure your kernel by yourself, OR 2. if you use an encrypted root partition. If both are not true, you dont need dracut for building an initramfs, and you can configure all by yourself. This is chapter "manual configuring the kernel" in our AMD64 handbook. If you dont have much experience with configuring a kernel, I recommend to read my article first: https://wiki.gentoo.org/wiki/User:Pietinger/Tutorials/Manual_kernel_configuration Here you will find also two articles from @Neddy. ;-) (read it !)

Next you have to know: Kernel must know where it find its root partition. There exists two/three choices:
1. You configure this information "hard" into your kernel (then it doesnt matter what information comes from a bootloader), OR
2a. You configure your bootloader (e.g. grub2) telling your kernel which partition it is, OR
2b. You configure your UEFI to tell your kernel (only possible if you are using a STUB kernel)

I do 1. with this:
Code:
Processor type and features  --->
[*] Built-in kernel command line
(root=PARTUUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx ro) Built-in kernel command string
[*]   Built-in command line overrides boot loader arguments


You cannot use your UUID of your root partition for telling your kernel; you must use PARTUUID of your root partition. Maybe you want read also these wiki articles:
https://wiki.gentoo.org/wiki/EFI_System_Partition
https://wiki.gentoo.org/wiki/Efibootmgr
https://wiki.gentoo.org/wiki/EFI_stub

(I am using UEFI booting a stub kernel)

If you have more specific questions, be free to ask here more.

Have fun with Gentoo !


I just did the built-in kernel command string and it finally boots! Thanks a lot.

Although I have a question, If I do menuconfig after genkernel, Do the settings from genkernel stay the same? If so, why does my screen have a different resolution if I didn't touch anything gpu related? I also have problems with my wifi, the antenna isnt recognized with ifconfig.

Thanks for the help!

My mistake, sorry!

I probably have touched something that the guide didnt said to, I have finally a custom kernel with all the features I need, Thanks everyone!
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