Bug 541684

Summary: initrd not created and menu.lst empty after kernel security update when /boot and / are on mirror raid (results in boot failure)
Product: [openSUSE] openSUSE 11.1 Reporter: Olaf Zander <Olaf.Zander>
Component: BasesystemAssignee: Michal Marek <mmarek>
Status: VERIFIED NORESPONSE QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P5 - None CC: bruno, DOlsson
Version: Final   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE 11.1   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: /var/log/YaST2 archive
directory listing of /boot after failed kernel upgrade (initrds are missing)
/boot/grub/menu.lst after failed kernel upgrade (all boot entries are removed)
bash -vx /sbin/mkinitrd &>log
Configuration file for "mkinitrd" to work-around bug in "mkinitrd", when kernel is updated.

Description Olaf Zander 2009-09-24 09:47:16 UTC
User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.14) Gecko/2009090900 SUSE/3.0.14-0.1 Firefox/3.0.14

The following has happened repeatedly on different machines with openSuSE-11.1 and both /boot and / on separate md mirror raid devices:
During the kernel security upgrade, the new initrd is not created and the grub menu.lst file is left empty. There is no error message during the upgrade. Just rebooting after the upgrade will result in a system not able to boot anymore. If you do not have a copy of your old files: bad luck (had that happen before)! as during the upgrade, the old modules and initrd and kernels are deleted.

Work-around:
Get a copy of menu.lst BEFORE upgrading.
After upgrade and before reboot create the missing initrd manually:
  - just "mkinird" will fail
  - execute "mkinitrd -d /dev/md0" with md0 being the / device, this will
    successfully create the missing inirds
Restore the saved menu.lst and edit it to match the new kernel version
Reboot.
 

Reproducible: Always

Steps to Reproduce:
Whenever there was a kernel security update on machines with / and /boot on separate md mirror raid devices, this has happened.
Note: I have not tried a single / on a mirror raid nor have I tried other raid levels.
Actual Results:  
New kernel is put in place, initrd(s) are missing, all boot entries in the grub menu.lst file are missing. Unfortunately, all old kernels/initrds/modules are deleted during the upgrade. So there is no way to boot anymore.

Expected Results:  
Create the inird properly and modify the menu.lst file appropriately. Possibly leave the last known working files on the system as a backup and only delete them later (to revert). Possibly delete old files only AFTER the upgrade was successful.
Comment 3 Michal Marek 2010-01-22 12:42:44 UTC
Please attach y2logs.
Comment 4 Olaf Zander 2010-01-28 12:43:33 UTC
Created attachment 339354 [details]
/var/log/YaST2 archive

This should contain all the y2logs you were requesting. Just prior to this I upgraded to kernel 2.6.27.42-0.1. The result was the same: no initrd created and /boot/grub/menu.lst has no entries. The file mkinitrd.log in the YaST2 directory contains entries of the failed upgrade and then the successful manual initrd creation through calling mkinitrd -d /dev/md6.
Comment 5 Olaf Zander 2010-01-28 12:44:55 UTC
Created attachment 339355 [details]
directory listing of /boot after failed kernel upgrade (initrds are missing)
Comment 6 Olaf Zander 2010-01-28 12:47:24 UTC
Created attachment 339361 [details]
/boot/grub/menu.lst after failed kernel upgrade (all boot entries are removed)
Comment 7 Michal Marek 2010-02-16 21:56:22 UTC
You say that mkinitrd fails unless you specify the root device explicitely, can you run

# bash -vx /sbin/mkinitrd &>log

and attach the log file? Thanks.
Comment 8 Olaf Zander 2010-02-17 07:42:08 UTC
Created attachment 342823 [details]
bash -vx /sbin/mkinitrd &>log
Comment 9 Dennis Olsson 2010-04-14 13:39:09 UTC
Created attachment 354353 [details]
Configuration file for "mkinitrd" to work-around bug in "mkinitrd", when kernel is updated.

When I encounter this bug, I just create a configuration file for "mkinitrd" in "/etc/sysconfig/initrd" (see attachment), where I set the "rootdev=" and "resumedev=" to the devices actual used.   The reason, why "mkinitrd" does everything wrong, is that "mkinitrd" cannot figure out what the "rootdev" and (sometimes also) what the "resumedev" should be set to.

Using a "/etc/sysconfig/initrd" file enables you to work-around this bug by settings these devices and thus enabling that each time a kernel update has been performed, "mkinitrd" will also generate a working "initrd" resp. having a correct "/boot/grub/menu.lst" file.

In fact, I wonder why the "mkinitrd" RPM package does not already contain a "/etc/sysconfig/initrd" file already?!??!
Comment 10 Bruno Friedmann 2011-04-03 11:07:19 UTC
openbug-day comment :

The version with which you had the bug is now obsolete. 
I'll close this as NORESPONSE. 

If you can still reproduce it in current 11.4, please reopen the bug and move it to the appropriate version. 
Thanks!