Arch, dracut, new custom drive booting from a usb stick. The kernel modules for USB seem loaded, because USB shows in dmesg, but no /dev/sd? device nodes appear. How do I force devtmpfs to populate these? Why is dracut not doing it? It works fine if I boot in BIOS mode but I need it to work in EFI mode.
Assistant
You're encountering a common issue when booting Arch (or any Linux distribution) in UEFI mode with a custom drive and a USB installation. The problem often lies in the interaction between the initramfs (initial RAM filesystem) generated by dracut, the kernel's USB drivers, and the firmware's handling of USB devices during the early boot process.
Here's a breakdown of potential causes and troubleshooting steps:
1. Firmware (UEFI) Settings:
Fast Boot / Quick Boot: This feature can sometimes interfere with USB initialization during the early boot stages. Disable Fast Boot/Quick Boot in your UEFI settings.
USB Legacy Support: While generally not recommended for UEFI booting, enabling Legacy USB support might help in some cases. Try enabling it temporarily to see if it resolves the issue.
Secure Boot: While less likely, Secure Boot can sometimes interfere with custom kernels or bootloaders. Try disabling Secure Boot temporarily to see if it makes a difference.
2. Dracut Configuration:
USB Modules: Ensure that the necessary USB modules are included in your initramfs. You can add them explicitly to the dracut configuration:
Create a file: /etc/dracut.conf.d/usb.conf (or any descriptive name)
rootdelay: Add a delay to allow time for USB devices to initialize:
Edit your bootloader configuration (e.g., GRUB) and add rootdelay=5 (or a higher value if needed) to the kernel parameters.
4. USB Controller Drivers:
XHCI vs. EHCI: If your system has both XHCI (USB 3.0) and EHCI (USB 2.0) controllers, try forcing the use of EHCI. You can do this by adding xhci_hcd.quirks=0x8000 to the kernel parameters.
5. Rebuilding the Initramfs:
After making any changes to dracut configuration or kernel parameters, always regenerate the initramfs:dracut -f
Troubleshooting Steps:
Check dmesg Output: Carefully examine the dmesg output for any error messages related to USB initialization or device detection.
Try Different USB Ports: Test the USB drive in different USB ports on your computer.
Try a Different USB Drive: If possible, try using a different USB drive to rule out any issues with the drive itself.
BIOS Mode as a Reference: Since it works in BIOS mode, compare the dmesg output from both BIOS and UEFI boot modes to identify any differences in USB initialization.
Why Dracut Might Not Be Populating /dev/sdX:
Timing Issues: The kernel might be loading the USB modules, but the device enumeration might not be completing before dracut finishes creating the initramfs.
Firmware Quirks: Some UEFI firmwares have specific quirks related to USB device initialization that might interfere with the process.
Driver Compatibility: In rare cases, there might be compatibility issues between the kernel's USB drivers and your specific hardware.
By systematically addressing these potential causes and carefully examining the dmesg output, you should be able to pinpoint the issue and get your custom Arch installation booting correctly from the USB drive in UEFI mode. Remember to regenerate the initramfs after making any changes to the dracut configuration or kernel parameters.