Kernel update, not seen if wrong at 1st try

Hello :wink:

i’m using this kernel :

uname -r
3.7.3-1-desktop

I use this repo tu update my kernel ( Index of /repositories/Kernel:/stable/standard ), which i gave KERNEL_STABLE as its alias name.

today i zypper dup’ed as follows :

# zypper dup -r KERNEL_STABLE 

it was showing me kernel 3.7.4-1-desktop to be available, i wanted it :slight_smile:

the result was bad : error 256 mentioning to check device.map for it was not able to find /dev/sda2 (supposedly root (/) )
then a black screen, with GRUB in grey and a blinking prompt …

I suddenly realised that i added a new ide hard disk a few days before. I formated in in ext4 from yast partionner, which completed the fstab the right way for it.

Question 1 : How come device.map was not updated too ?

Then i reinstalled grub2 thanks to the install doc here https://forums.opensuse.org/content/128-re-install-grub2-dvd-rescue.html and pc boot went back to normal but i wanted my kernel update so i went back to it but now zypper is not showing it anymore (nothing to do is the result).
QUestion 2 : Therefore how can i upgrade to kernel 3.7.4-1-desktop ?

Thanks :wink:

Do you use grub or grub2?

i’m using grub 2

I’m using this one : 3.7.4-1-desktop

Works great.

How I upgraded kernel :
Followed the guide from the link below for installing multiple kernel versions :

openSUSE 12.2: Chapter 12. Installing Multiple Kernel Versions

Then added this repo : Index of /repositories/Kernel:/stable/standard

After that in software manager I went to the Package_groups/ Multiversion packages, then selected kernel-dekstop , there in Versions just checked the latest 3.7.4-1 stable kernel.
Clicked Accept, rebooted and that was it.

it’s installed but not used :

zypper se -si 'kernel*'
Le dépôt 'KDE49' n'est pas à jour. Vous pouvez lancer 'zypper refresh' en tant que root pour le mettre à jour.
Chargement des données du dépôt...
Lecture des paquets installés...

S | Nom                  | Type   | Version          | Arch   | Dépot            
--+----------------------+--------+------------------+--------+------------------
i | kernel-default-devel | paquet | 3.7.4-1.1        | i586   | KERNEL_STABLE    
i | kernel-default-devel | paquet | 3.7.3-1.1        | i586   | (Paquets système)
i | kernel-desktop       | paquet | 3.7.4-1.1        | i686   | KERNEL_STABLE    
i | kernel-desktop       | paquet | 3.7.3-1.1        | i686   | (Paquets système)
i | kernel-desktop-devel | paquet | 3.7.4-1.1        | i686   | KERNEL_STABLE    
i | kernel-desktop-devel | paquet | 3.7.3-1.1        | i686   | (Paquets système)
i | kernel-devel         | paquet | 3.7.4-1.1        | noarch | KERNEL_STABLE    
i | kernel-devel         | paquet | 3.7.3-1.1        | noarch | (Paquets système)
i | kernel-firmware      | paquet | 20120719git-36.1 | noarch | KERNEL_STABLE    
i | kernel-pae-devel     | paquet | 3.7.4-1.1        | i686   | KERNEL_STABLE    
i | kernel-pae-devel     | paquet | 3.7.3-1.1        | i686   | (Paquets système)
i | kernel-source        | paquet | 3.7.4-1.1        | noarch | KERNEL_STABLE    
i | kernel-source        | paquet | 3.7.3-1.1        | noarch | (Paquets système)
i | kernel-syms          | paquet | 3.7.4-1.1        | i586   | KERNEL_STABLE    
i | kernel-syms          | paquet | 3.7.3-1.1        | i586   | (Paquets système)
i | kernel-xen-devel     | paquet | 3.7.4-1.1        | i686   | KERNEL_STABLE    
i | kernel-xen-devel     | paquet | 3.7.3-1.1        | i686   | (Paquets système)
grub2-mkconfig -o /boot/grub2/grub.cfg

If you are on EFI system, replace “grub2” with “grub2-efi”

i added the 1st line in /boot/grub2/device.map , is this ok ? i used what’s in /etc/fstab . i’m not sure about this part : (hd0)

# cat /boot/grub2/device.map
(hd0)   /dev/disk/by-id/ata-ST3160021A_5JS3TMX2
(hd1)   /dev/disk/by-id/ata-WDC_WD1600PD-07FZB1_WD-WMAES3562221
(hd2)   /dev/disk/by-id/ata-SAMSUNG_HD103UJ_S13PJ90S208022
(hd3)   /dev/disk/by-id/ata-ST3320620AS_9QF5PH60


shall it be added manually ?

is it needed or just the above command ?

thanks :wink:

grub2 does not need this file and will work just fine without it. But if this file exists, it is better be correct. Also YaST2 is using it when configuring bootloader.

Unfortunately there is generally no way to find out BIOS device numbers.

hi :wink:

1- i added my ide hdd to the device.map which made the pc able to boot but with kernel 3.7.3.1
2- what you said in your 28-Jan-2013, 16:23 message above regenerated grub.cfg so that kernel 3.7.4.1 is now being used :slight_smile:

Is this grub.cfg regen process mandatory ?
Why is there no auto regeneration of grub.cfg after a kernel update ?

After adding/removing kernel? Yes.

Why is there no auto regeneration of grub.cfg after a kernel update ?

E-h-h … there is, actually. But as evident from your original post it had some problems so probably never finished.

Ok,
the problem was that device.map was wrong for i added a disk just before , and it needed to be updated manually which i did not know (yet) :wink:

Actually there might be something else wrong , i zypper dup’d again the repo and it gave me the same mistake : kernel installed but not used for initrd goes wrong

the exact error i have is :


Perl-Bootloader 2013-02-01 ERROR command '/usr/sbin/grub2-install --force --skip-fs-probe /dev/sda2 >/var/log/Yast2/y2log_bootloader 2>&1' failed with code 256 and output :
/usr/sbin/grub2-probe : error cannot find a GRUB drive for /dev/sda2 . check device.map 

here are the hdds as seen by the os ( 3 sata and 1 ide ) :

# fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x1d7d3d46

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048   312580095   156289024   83  Linux

Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x20e3865f

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1       306280448   312580095     3149824   82  Linux swap / Solaris
/dev/sdb2   *     4209030    67119569    31455270   83  Linux
/dev/sdb3        67119570   306279224   119579827+  83  Linux

Partition table entries are not in disk order
                                                                                                                                                                                                                                             
Disk /dev/sdc: 320.1 GB, 320072933376 bytes                                                                                                                                                                                                  
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors                                                                                                                                                                        
Units = sectors of 1 * 512 = 512 bytes                                                                                                                                                                                                       
Sector size (logical/physical): 512 bytes / 512 bytes                                                                                                                                                                                        
I/O size (minimum/optimal): 512 bytes / 512 bytes                                                                                                                                                                                            
Disk identifier: 0x00072096                                                                                                                                                                                                                  
                                                                                                                                                                                                                                             
   Device Boot      Start         End      Blocks   Id  System                                                                                                                                                                               
/dev/sdc1              63   415248119   207624028+  83  Linux                                                                                                                                                                                
/dev/sdc2   *   415248120   625137344   104944612+  83  Linux                                                                                                                                                                                
                                                                                                                                                                                                                                             
Disk /dev/sdd: 1000.2 GB, 1000204886016 bytes                                                                                                                                                                                                
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors                                                                                                                                                                      
Units = sectors of 1 * 512 = 512 bytes                                                                                                                                                                                                       
Sector size (logical/physical): 512 bytes / 512 bytes                                                                                                                                                                                        
I/O size (minimum/optimal): 512 bytes / 512 bytes                                                                                                                                                                                            
Disk identifier: 0x000c1b47                                                                                                                                                                                                                  
                                                                                                                                                                                                                                             
   Device Boot      Start         End      Blocks   Id  System                                                                                                                                                                               
/dev/sdd1              63  1953520064   976760001   83  Linux  

i have the follwing device.map :

# cat /boot/grub2/device.map                                                                                                                                                                                
# device.map fait l'interface entre l'os et le bios, il est utile à l'os quand il doit lire la présence des disques, en particulier si on a du sata et du pata (ou ide) ensemble.                                                            
# Il faut voir ce que lis le bios et le reporter dans le fichier /boot/grub2/device.map                                                                                                                                                      

(hd0)   /dev/disk/by-id/ata-WDC_WD1600PD-07FZB1_WD-WMAES3562221
(hd1)   /dev/disk/by-id/ata-ST3320620AS_9QF5PH60
(hd2)   /dev/disk/by-id/ata-SAMSUNG_HD103UJ_S13PJ90S208022
(hd3)   /dev/disk/by-id/ata-ST3160021A_5JS3TMX2

I regenerated mannually grub.cfg but how come it’s not working automatically ?

thanks ;=)

What is in /etc/default/grub_installdevice?

hello :wink:
here it is :



# cat /etc/default/grub_installdevice


/dev/sda2
activate
generic_mbr


shall i replace the 1st line with /dev/sdb2 manually or is this file supposed to be generated automatically ?

Are the hdds renamed at boot ? ( i have 3 satas and 1 ide (pata) disk)

This is maintained by YaST2 bootloader module, so going into YaST2 and reconfiguring bootloader for selected location should update it.

Are the hdds renamed at boot ? ( i have 3 satas and 1 ide (pata) disk)

They should not be if configuration does not change, but you can never assume sdXX names will remain stable across reboot. I think, today YaST2 places /dev/disk/by-id name there. My file contains … oops, it contains /dev/dik/by-id for old disk I had before (it started throwing bad blocks …)

bor@opensuse:~/src/systemd/src> LC_ALL=C sudo /sbin/update-bootloader --refresh  
Perl-Bootloader: 2013-02-02 14:13:04 ERROR: Command '/usr/sbin/grub2-install --force --skip-fs-probe /dev/disk/by-id/ata-TOSHIBA_MK2552GSX_48PGT50FT >/var/log/YaST2/y2log_bootloader 2>&1' failed with code 256 and output: /usr/sbin/grub2-probe: error: cannot find a GRUB drive for /dev/disk/by-id/ata-TOSHIBA_MK2552GSX_48PGT50FT.  Check your device.map.

… let’s see if going to YaST2 helps …

… no it does not. Well, probably I did not change anything so it skipped file update. Good, let’s change something, e.g. turn off generic_mbr (makes no sense as I have grub2 on MBR). Still the same old no more valid device name.

Looks like it is a problem indeed. So I suggest changing the file manually. And verify by running “update-bootloader --refresh”.

I can’t submit bug report right now, bugzilla seems to have problems.

hi,

what i did :

  • reboot to see if disks are still named the same, it is so.
  • change bootloader from yast module to /dev/sdb2
  • cat the grub_installdevice file , it is changed indeed :slight_smile:

# cat grub_installdevice                                                                                                                                                                                      
/dev/disk/by-id/ata-WDC_WD1600PD-07FZB1_WD-WMAES3562221-part2                                                                                                                                                                                
activate                                                                                                                                                                                                                                     
generic_mbr                                                                                                                                                                                                                                  
linux-opensuse122:/etc/default # cat etc/fstab                                                                                                                                                                                               
cat: etc/fstab: No such file or directory                                                                                                                                                                                                    
linux-opensuse122:/etc/default # cat /etc/fstab                                                                                                                                                                                              
/dev/disk/by-id/ata-WDC_WD1600PD-07FZB1_WD-WMAES3562221-part2 /                    ext4       acl,user_xattr        1 1                                                                                                                      
/dev/disk/by-id/ata-WDC_WD1600PD-07FZB1_WD-WMAES3562221-part1 swap                 swap       defaults              0 0                                                                                                                      
/dev/disk/by-id/ata-WDC_WD1600PD-07FZB1_WD-WMAES3562221-part3 /home                ext4       acl,user_xattr        1 2                                                                                                                      
/dev/disk/by-id/ata-ST3320620AS_9QF5PH60-part2 /osvirtuels          ext4       acl,user_xattr        1 2                                                                                                                                     
/dev/disk/by-id/ata-ST3320620AS_9QF5PH60-part1 /stockage1           ext4       defaults              1 2                                                                                                                                     
/dev/disk/by-id/ata-SAMSUNG_HD103UJ_S13PJ90S208022-part1 /stockage2           ext4       defaults              1 2                                                                                                                           
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0
/dev/disk/by-id/ata-ST3160021A_5JS3TMX2-part1 /stockage3           ext4       acl,user_xattr        1 2

An IDE in the mix can cause the order to change seemingly at random. There are several threads devoted to this observation.