Bug 304269

Summary: Upgrade: /dev/hdX, /dev/sdX confusion with mixed ATA and SATA drives
Product: [openSUSE] openSUSE 10.3 Reporter: Klaus Kämpf <kkaempf>
Component: Update ProblemsAssignee: Lukas Ocilka <locilka>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Blocker    
Priority: P5 - None CC: hare, stefan.fent
Version: Beta 2   
Target Milestone: ---   
Hardware: x86-64   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: /etc/sysconfig/kernel as requested
hwinfo --disk
compressed tar of /var/log/YaST2

Description Klaus Kämpf 2007-08-24 11:42:43 UTC
During upgrade 10.2 -> 10.3Beta2, installation of kernel-default-2.6.22.3-7.x86_64 failed in %post with $summary.

Looking at /proc/partitions, all disk devices appear as /dev/sdXY

I wonder where /dev/hda2 comes from, its _not_ anywhere below /etc/sysconfig.
Comment 1 Klaus Kämpf 2007-08-24 11:48:32 UTC
running mkinitrd with "sh -x" also reveals:
/lib/mkinitrd/setup/11-storage.sh: line 256: syntax error near unexpected token '<'
Comment 2 Klaus Kämpf 2007-08-24 11:49:15 UTC
/dev/hda2 comes from /etc/fstab -> Blocker
Comment 3 Klaus Kämpf 2007-08-24 11:51:15 UTC
Manually changing /dev/hdXY to /dev/sdXY in fstab fixed it.

Adapting summary
Comment 4 Alexander Graf 2007-08-24 12:21:43 UTC
Could you please attach the sysconfig/kernel file? Usually the disk module should be in there and have priority over the automatically detected one.
Comment 5 Klaus Kämpf 2007-08-24 13:02:24 UTC
By manually fixing /etc/fstab (and running mkinitrd successfully !) things got worse.
When YaST retried the kernel installation, all /dev/sdaX entries were rewritten to /dev/sdbX. The existing /dev/sdb1 entry was left untouched. A nice mess :-(
Comment 6 Klaus Kämpf 2007-08-24 13:06:55 UTC
Created attachment 159731 [details]
/etc/sysconfig/kernel as requested
Comment 7 Alexander Graf 2007-08-24 13:58:03 UTC
amd74xx comes after pata_amd so the libata drivers get used. Maybe this is the intended behavior, but that means that yast seems to have changed that line so libata gets used. In other words this is a pure yast bug, since when the INITRD_MODULES entry gets changed, /etc/fstab and everything else should be changed accordingly as well.

I don't know exactly who is responsible for this. Maybe we should CC fehr?

Could you please attach /boot/grub/device.map as well?
Comment 8 Klaus Kämpf 2007-08-24 14:46:42 UTC
This is the current device.map (probably not very helpful after the upgrade)

(fd0)   /dev/fd0
(hd0)   /dev/sda
(hd1)   /dev/sdb

Rewriting $summary again to make the issue clearer
Comment 9 Klaus Kämpf 2007-08-24 14:47:16 UTC
Created attachment 159746 [details]
hwinfo --disk
Comment 10 Klaus Kämpf 2007-08-24 14:48:04 UTC
setting component to "Upgrade problems"
Comment 11 Stefan Fent 2007-08-24 14:57:43 UTC
To comment #8: just wanted to verify wether at least the device.map got rewritten correctly, what seems to be the case.
Comment 12 Thomas Fehr 2007-08-27 09:35:36 UTC
Need y2log files.
Comment 13 Klaus Kämpf 2007-08-27 09:43:58 UTC
Created attachment 159933 [details]
compressed tar of /var/log/YaST2
Comment 14 Thomas Fehr 2007-08-27 10:13:53 UTC
Lukas you changed semantic of second parameter in call to Storage::DeviceMatchFstab compared to SLES10SP1. 
In SLES10SP1 the second parameter in call to Storage::DeviceMatchFstab was
the untranslated device name from /etc/fstab of the system to update.

In 10.3 you do the translations of device names in fstab of the system to
update (by calling TranslateFsOrCryptoTab in function read_fstab_and_cryptotab) 
before calling Storage::DeviceMatchFstab.
Storage::DeviceMatchFstab still assumes to get an untranslated name and 
therefore translates it again. This of course leads to wrong return values
of Storage::DeviceMatchFstab. Since RootPart.ycp is the only user of function
DeviceMatchFstab it is no problem to change this to expect translated fstab
names. Sould i?

Unfortunately there seem to be further problems.
No idea why updated fstab still has hda2, the translation from y2log file
are correct:

Storage.ycp:5360 GetTranslatedDevices names ["/dev/hda2", "/dev/hda3", "/dev/hda1", "/dev/sda1"
Storage.ycp:5376 GetTranslatedDevices ret ["/dev/sda2", "/dev/sda3", "/dev/sda1", "/dev/sdb1"

Please have a look at the code in RootPart.ycp and tell me if I should change
semantics of Storage::DeviceMatchFstab.
Comment 15 Lukas Ocilka 2007-08-27 12:16:30 UTC
I've change the semantics to call Storage::DeviceMatchFstab with the *old* instead the *new* device name according to comment #14.

Tested with /dev/hda6 -> /dev/sdb6 (openSUSE 10.2)

Changed in yast2-update-2.15.22
Let's test it again with next build, please.