Bug 4364 - If I change my bios setting from IDE to AHCI, I can't boot as dracut can't find my device (sdX)
Summary: If I change my bios setting from IDE to AHCI, I can't boot as dracut can't fi...
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: release_blocker critical
Target Milestone: Mageia 2
Assignee: Colin Guthrie
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 4298
  Show dependency treegraph
 
Reported: 2012-01-31 15:43 CET by Damien Lallement
Modified: 2012-04-19 13:28 CEST (History)
2 users (show)

See Also:
Source RPM: dracut-014-16.mga2.src.rpm
CVE:
Status comment:


Attachments

Description Damien Lallement 2012-01-31 15:43:29 CET
Version-Release number of selected component (if applicable):

Steps to Reproduce:
1. Install a cauldron with your drive as IDE in your bios settings,
2. boot your system: all is working as expected,
3. go into bios, change your drive setting to AHCI,
4. reboot to Mageia Cauldron and see that it fails as ahci is not loaded (device can't be found).
Comment 1 Colin Guthrie 2012-01-31 15:48:12 CET
This is nothing new. Same thing happened with mkinitrd if you changed the hardware needed for booting (I had to rebuild initrd manually several times when swapping disks to new h/w).

If you want to create a generic initrd, then you should set the option "hostonly=no" in a file that you drop in /etc/dracut.conf.d/ (with a higher numbered filename than the default mageia config).

Obviously this initrd will be much larger due to it including a lot of different drivers.

If I've missed something in this (or if it used to work with mkinitrd somehow - perhaps the list of always included drivers was a little bit more generous than dracut) then please feel free to reopen.

Status: NEW => RESOLVED
Resolution: (none) => WONTFIX

Damien Lallement 2012-01-31 16:17:51 CET

Priority: Normal => release_blocker
Target Milestone: --- => Mageia 2

Comment 2 Damien Lallement 2012-01-31 16:19:03 CET
I thought there was a list of "generic" modules in mkinitrd. I never had this issue (but ofter switch from IDE to AHCI). :-/
Comment 3 Damien Lallement 2012-01-31 16:19:54 CET
mkinitrd was patch by blino or rtp IIRC...
ahci, usbstorage, ... a lot of generic modules were included by default...
Comment 4 Damien Lallement 2012-01-31 16:20:27 CET
I reopen, if you can find the patch... ;-)
Thanks

Status: RESOLVED => REOPENED
Resolution: WONTFIX => (none)

Comment 5 Colin Guthrie 2012-01-31 17:04:48 CET
OK, fair enough :)

It's trivial to include drivers by default. We just patch the file /etc/dracut.conf.d/50-mageia.conf to have a line:
 add_drivers+="foo bar wibble"

So just need to find that list.... :)

Status: REOPENED => ASSIGNED

Manuel Hiebel 2012-02-06 14:47:03 CET

Blocks: (none) => 4298

Comment 6 Colin Guthrie 2012-02-14 17:16:11 CET
So it seems the ata_piix module is now included by default (in dracut master - not in our package yet) so this at lease partially solves this problem I guess.
Comment 7 Pascal Terjan 2012-02-20 14:55:26 CET
There was a patch to include both ata_piix and ahci if one of them is used

http://svn.mandriva.com/viewvc/packages/cooker/mkinitrd/current/SOURCES/Include-both-ahci-and-ata_piix.patch?revision=541832&view=markup

There was also generic ide modules based on what something (harddrake?) adds in modprobe.conf

http://svn.mandriva.com/viewvc/packages/cooker/mkinitrd/current/SOURCES/Include-ide-modules.patch?revision=541832&view=markup

CC: (none) => pterjan

Comment 8 Damien Lallement 2012-03-14 15:35:21 CET
I still have the issue on my cauldron machine.
I'm using ata_piix and if I change for ahci in my bios, can't boot anymore.
Any ETA for this bug please? I need it on a lot of test machines so... :-þ
Comment 9 Colin Guthrie 2012-03-14 15:47:59 CET
I'll try and look tomorrow night. Sorry for the delay!
Comment 10 AL13N 2012-04-09 13:57:23 CEST
i would suggest to workaround with booting into rescue (using ahci mode) and remaking the dracut image from chroot, so that it includes ahci driver.

tbh: i don't think this is release_blocker, can we lower the priority?

this is not really standard behavior to switch bios settings after install...

CC: (none) => alien

Comment 11 Damien Lallement 2012-04-10 11:44:04 CEST
It's release_blocker as it's a big regression from Mandriva (this was mandatory by th Intel contract and all OEM deals). So, tbh, it's blocker.
Comment 12 Colin Guthrie 2012-04-10 12:58:35 CEST
I'm OK to fix this for release. Just need to be able to get a good test case as I don't think VirtualBox is a good testing ground. I can have a separate AHCI controller vs. IDE Controller and I guess I can move my virtual disk between them, but not sure that's testing the same thing.
Comment 13 Damien Lallement 2012-04-10 16:17:25 CEST
I will test all what you need Colin. \o/
Comment 14 Colin Guthrie 2012-04-14 14:34:01 CEST
OK, just looking at this now.

Interesting, if I create a VM without a SATA controller, the ahci driver was still included in the initrd generated during install (this is now a hostonly initrd, so it should be small and specific to the h/w only)

After install, I flipped the h/w around and it booted fine (no surprise due to the ahci driver being included).

I'm pretty sure this worked because dracut will include any loaded modules and the installer likely loads that module as part of it's brute force approach (eventually we may get a more hotplug friendly installer, but that's another story!).


Anyway, this initrd worked well, so I regenerated another one after boot. This time, ahci was not included in the initrd. As expected, flipping things around caused a boot failure.

So back to the original plan, and I added the line:
  add_drivers+="ahci"
to /etc/dracut.conf.d/50-mageia.conf

Even tho' no ahci module was loaded and even tho' the hardware did not exist, the initrd still included this driver.


So I think the fix is simply to add this line to the default config.

Can you confirm?
Comment 15 Damien Lallement 2012-04-19 13:13:51 CEST
Works for me if adding this line.
And only this line. ata_piix seems added by default.
Comment 16 Damien Lallement 2012-04-19 13:24:21 CEST
Just for having a log:
[root@localhost a]# lspcidrake 
xhci_hcd        : NEC Corporation|uPD720200 USB 3.0 Host Controller [SERIAL_USB] (rev: 03)
i2c_i801        : Intel Corporation|6 Series/C200 Series Chipset Family SMBus Controller [SERIAL_SMBUS] (rev: 05)
ahci            : Intel Corporation|6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller [STORAGE_SATA] (rev: 05)
iTCO_wdt        : Intel Corporation|H67 Express Chipset Family LPC Controller [BRIDGE_ISA] (rev: 05)
ehci_hcd        : Intel Corporation|6 Series/C200 Series Chipset Family USB Enhanced Host Controller #1 [SERIAL_USB] (rev: 05)
shpchp          : Intel Corporation|6 Series/C200 Series Chipset Family PCI Express Root Port 2 [BRIDGE_PCI] (rev: b5)
shpchp          : Intel Corporation|6 Series/C200 Series Chipset Family PCI Express Root Port 1 [BRIDGE_PCI] (rev: b5)
snd_hda_intel   : Intel Corporation|6 Series/C200 Series Chipset Family High Definition Audio Controller (rev: 05)
ehci_hcd        : Intel Corporation|6 Series/C200 Series Chipset Family USB Enhanced Host Controller #2 [SERIAL_USB] (rev: 05)
e1000e          : Intel Corporation|82579V Gigabit Network Connection [NETWORK_ETHERNET] (rev: 05)
mei             : Intel Corporation|6 Series/C200 Series Chipset Family MEI Controller #1 [COMMUNICATION_OTHER] (rev: 04)
Card:Intel 810 and later: Intel Corporation|2nd Generation Core Processor Family Integrated Graphics Controller [DISPLAY_VGA] (rev: 09)
unknown         : Intel Corporation|2nd Generation Core Processor Family DRAM Controller [BRIDGE_HOST] (rev: 09)
hub             : Linux 3.3.1-desktop-2.mga2 xhci_hcd|xHCI Host Controller [Hub|Unused|Full speed (or root) hub]
hub             : Linux 3.3.1-desktop-2.mga2 xhci_hcd|xHCI Host Controller [Hub|Unused|Full speed (or root) hub]
usb_storage     : Kingston|DataTraveler2.0 [Mass Storage|SCSI|Bulk-Only]
hub             : Linux 3.3.1-desktop-2.mga2 ehci_hcd|EHCI Host Controller [Hub|Unused|Full speed (or root) hub]
hub             : Intel Corp.|Integrated Rate Matching Hub [Hub|Unused|Full speed (or root) hub]
hub             : Linux 3.3.1-desktop-2.mga2 ehci_hcd|EHCI Host Controller [Hub|Unused|Full speed (or root) hub]
hub             : Intel Corp.|Integrated Rate Matching Hub [Hub|Unused|Full speed (or root) hub]
usbhid          : CHESEN|USB Keyboard [Human Interface Device|Boot Interface Subclass|Keyboard]
usbhid          : Logitech|USB-PS/2 Optical Mouse [Human Interface Device|Boot Interface Subclass|Mouse]

[root@localhost a]# rmmod ata_piix
[root@localhost a]# rmmod ata_piix
Error: Module ata_piix is not currently loaded
 
[root@localhost a]# dracut -f
I: *** Including module: dash ***
I: *** Including module: i18n ***
I: *** Including module: rpmversion ***
I: *** Including module: plymouth ***
I: *** Including module: kernel-modules ***
I: *** Including module: resume ***
I: *** Including module: rootfs-block ***
I: *** Including module: terminfo ***
I: *** Including module: udev-rules ***
I: Skipping udev rule: 50-udev.rules
I: Skipping udev rule: 95-late.rules
I: Skipping udev rule: 50-firmware.rules
I: *** Including module: usrmount ***
I: *** Including module: base ***
I: *** Including module: fs-lib ***
I: *** Including module: shutdown ***
I: Skipping program kexec as it cannot be found and is flagged to be optional
I: *** Including modules done ***
I: Wrote /boot/initrd-3.3.1-desktop-2.mga2.img:
I: -rw-r--r-- 1 root root 6175739 avril 19 13:19 /boot/initrd-3.3.1-desktop-2.mga2.img

[root@localhost a]# lsinitrd | grep ata
-rwxr-xr-x   1 root     root        22752 Apr 12 11:33 lib/udev/ata_id
drwxr-xr-x   2 root     root            0 Apr 19 13:19 lib/modules/3.3.1-desktop-2.mga2/kernel/drivers/ata
-rw-r--r--   1 root     root        83624 Apr  4 11:46 lib/modules/3.3.1-desktop-2.mga2/kernel/drivers/ata/libata.ko.xz
-rw-r--r--   1 root     root         7672 Apr  4 11:46 lib/modules/3.3.1-desktop-2.mga2/kernel/drivers/ata/ata_piix.ko.xz
-rw-r--r--   1 root     root        12412 Apr  4 11:46 lib/modules/3.3.1-desktop-2.mga2/kernel/drivers/ata/libahci.ko.xz
-rw-r--r--   1 root     root         7528 Apr  4 11:46 lib/modules/3.3.1-desktop-2.mga2/kernel/drivers/ata/ahci.ko.xz
[root@localhost a]#
Comment 17 Colin Guthrie 2012-04-19 13:28:15 CEST
Cool. Added to the default config in the latest release.

Status: ASSIGNED => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.