Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

[SOLVED] mdadm array MIA after kernel rebuild

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
7 posts • Page 1 of 1
Author
Message
statikregimen
Apprentice
Apprentice
Posts: 173
Joined: Sat Jul 16, 2011 7:31 am
Location: USA/Michigan
Contact:
Contact statikregimen
Website

[SOLVED] mdadm array MIA after kernel rebuild

  • Quote

Post by statikregimen » Tue Sep 22, 2020 1:40 am

UPDATE: Yeah, I'm stuck on this one. Have replied with more information....When I made this post, I couldn't find a USB drive to boot the machine, so took a chance in posting while I sorted that, thinking maybe there was a change in genkernel, grub, or something else that I was overlooking. That's why extra details are in my first reply...

Oof...Hello all,

After a seemingly harmless kernel rebuild, my array isn't coming up, causing a kernel panic since it holds my root partition. To rebuild the kernel, I'm using the same commands I always have. Nothing has changed in the config - I only rebuilt because I accidentally deleted the working kernel from my boot partition while trying to clean up some older ones. Was wondering if anything related changed with genkernel (used to build initramfs) or grub that I'm overlooking.

Also, I first noticed this issue a while back when trying to update from 5.4.48 to 5.4.60, so I was using 5.4.48 for a while until I had a chance to sort 5.4.60...

Thank you, as always, for reading! Cheers.
Last edited by statikregimen on Thu Sep 24, 2020 4:13 am, edited 77 times in total.
Top
Whissi
Retired Dev
Retired Dev
User avatar
Posts: 222
Joined: Wed Jan 12, 2011 10:01 pm

  • Quote

Post by Whissi » Tue Sep 22, 2020 12:31 pm

When you are using genkernel to only create initramfs, are you passing --kernel-config to genkernel? Please show us your kernel command-line, too.
Regards,
Whissi
Top
statikregimen
Apprentice
Apprentice
Posts: 173
Joined: Sat Jul 16, 2011 7:31 am
Location: USA/Michigan
Contact:
Contact statikregimen
Website

  • Quote

Post by statikregimen » Wed Sep 23, 2020 1:15 am

Thanks for the reply! Was able to borrow a USB drive, so here is some more infos...

Here is a pic showing the kernel panic:
https://meaninglessinfo.com/IMG_20200922_220204977.jpg

These are the commands I use to rebuild the kernel each time:

Code: Select all

kergen -u
mount /boot
cd /usr/src/linux
make && make modules_install && make install
genkernel initramfs --mdadm
grub-mkconfig -o /boot/grub/grub.cfg
From the screenshot, looking at the lines...:

Code: Select all

...
md: Skipping autodetection of RAID arrays. (raid=autodetect will force)
VFS: Cannot open root device "UUID=f8ea...." or unknown-block(0,0): error -6
Please append a correct "root=" bootoption; here are the available partitions:
...
...I can only speculate that grub-mkconfig is going wrong or genkernel is not building the initramfs properly? Idk how else to explain this, when using such automated tools.

Looks like all the files I'm used to seeing are being generated and are present on my boot partition. Using an Ubuntu Live USB, I've also been able to verify that the array is healthy and partitions/data in-tact.
Top
Whissi
Retired Dev
Retired Dev
User avatar
Posts: 222
Joined: Wed Jan 12, 2011 10:01 pm

  • Quote

Post by Whissi » Wed Sep 23, 2020 11:23 am

I see two problems:
  1. When you don't build both, kernel and initramfs, with genkernel, you must tell genkernel which kernel config you used or generated initramfs won't match used kernel. To do that, pass --kernel-config=/path/to/kernel.config to genkernel when only creating initramfs.
  2. The screenshot doesn't show anything from genkernel. You are only seeing errors from kernel. Looks like you didn't boot genkernel initramfs.
Regards,
Whissi
Top
statikregimen
Apprentice
Apprentice
Posts: 173
Joined: Sat Jul 16, 2011 7:31 am
Location: USA/Michigan
Contact:
Contact statikregimen
Website

  • Quote

Post by statikregimen » Wed Sep 23, 2020 2:35 pm

So this is a documented recent change in Genkernel? I can't stress enough how routine this is (or rather should have been) for me, and always have used the same exact commands. It seems silly for Genkernel to suddenly not use /usr/src/linux/.config by default, when no config is specified. I will nevertheless give it a try when I get home.

Thanks!
Top
Whissi
Retired Dev
Retired Dev
User avatar
Posts: 222
Joined: Wed Jan 12, 2011 10:01 pm

  • Quote

Post by Whissi » Wed Sep 23, 2020 4:02 pm

No, it isn't a changed behavior. Just pay attention to genkernel output. It will always tell you which kernel.config it is using.
But it's complicated:

Genkernel first tries to determine KV from specified kernel sources, /usr/src/linux by default.
Based on read KV, it will look in /etc/kernels/ for a kernel config matching that version (because genkernel by default will save used kernel.config to that directory after a successfully build).
If it cannot find a config in /etc/kernels matching determined KV it will fall back to generic kernel config provided by genkernel. That's for example the case when you build a new kernel for the first time on that system without manually specifying a kernel config.

Only if you pass --no-mrproper you will trigger a special behavior which will make genkernel look for any existing .config in specified KOUTPUT_DIR (by default this is also /usr/src/linux but keep in mind you can also build kernel into a dedicated directory to leave sources untouched...).

I really don't understand why people expect that genkernel would pick up anything from an arbitrary CWD without telling...

Also keep in mind that it only makes limited sense to build kernel on your own but still use genkernel to create an initramfs. For example, genkernel tries to ensure that features you asked for are enabled in kernel. In recent genkernel versions we fixed compression support (--compress-initramfs-type=best|fastest didn't worked). After the fix went stable, people not paying attention to used kernel.config when generating initramfs ended up with an initramfs not supported by the kernel they booted because genkernel fall back to generic kernel config which supports a better compression algorithm which were picked during initramfs generation.
Regards,
Whissi
Top
statikregimen
Apprentice
Apprentice
Posts: 173
Joined: Sat Jul 16, 2011 7:31 am
Location: USA/Michigan
Contact:
Contact statikregimen
Website

  • Quote

Post by statikregimen » Wed Sep 23, 2020 4:15 pm

Thank you for the clarification. I didn't have any expectations about genkernel using CWD, but rather expected it would use /usr/src/linux/.config by default (well, before this I didn't even realize it needed the config for this). Seems like a perfectly reasonable assumption to me. Basically the reason I'm doing it like this, is I like to have a lean kernel and enjoy the hands-on experience of the config process. However, it wasn't until I had already done all the work that I realized I'd also need an initramfs if I wanted to set my drives up the way I wanted. At that point, was just anxious to get the install finished so integrated genkernel into the process to save time. Been using the same kernel config & bash script ever since.

Again, thank you very much for the help. I should have it working as soon as I get home, and will mark solved when I'm sure I don't have any more moronic oversights :)

Solution:
I can still only loosely speculate as to what went wrong that suddenly required this new thing, but the solution for me is to specify --kernel-config to genkernel, thusly:

Code: Select all

genkernel initramfs --mdadm --kernel-config=/usr/src/linux/.config
It also fixed my issue with 5.4.60
Top
Post Reply

7 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic