Why After upgraded from Red Hat 5.7 to 5.8, still getting the old kernel ?

Solution Unverified - Updated -

Environment

Red Hat Enterprise Linux - 5.8.
Kernel-2.6.18-274.12.1.el5.
Architecture - x86_64.

Issue

After upgrading one Linux server from Red Hat 5.7 to 5.8, but after reboot, still getting the old kernel rather grub file is getting updated with new kernel /boot/boot/grub/grub.conf.

Resolution

One possible workaround to the mentioned problem we have suggested which works as well
1) copy grub.conf or create a symbolic link will work.

but requirement is to remove /boot/boot/*. Reason behind this to have /boot/boot/* as /boot is itself a partition than all the path for /boot will be relative to /boot.

Now to remove /boot/boot we need to try following ways ..

1) take a backup of /boot/boot/grub/grub.conf -> /boot/grub.conf_old

2) remove rm /boot/boot/grub/grub.conf.

3) grub-install /dev/sdb (or as per your choice of drive)

4) reboot.

After this system will boot and stop at

grub> find /boot/grub/stage1

will give you your default drive name but as its a relative path so actually it referring to /boot/boot/grub/stage1

now to remove /boot/boot

5) root (hd1, 0) (supposing it is sdb1)

6) setup --prefix=/grub/stage1 (hd1) (suppose we want to shift to /boot/grub/stag1 for this relative path would be /grub/stage1)

7) kernel (hd1,0)/vmlinux(you want to shift manually boot this time as we don't have grub.conf)

8) initrd (hd1,0)/initrd(respective initrd image).

9) boot

after booting up copy backup grub.conf to /boot/grub/ absolute path to boot up automatically..

Root Cause

From the feedback of the question

It seems that running the command on grub console have created the issue

 grub>root (hd1,0) # setup (hd1) etc...

Which signifies change in the default grub root device. Seems to be the possible reason of the problem.

Diagnostic Steps

We have started our finding with following given questions..

1) Can we ask the customer did he tried to customised anything because /boot/boot is unusual to me.

2) Here we have one work around for the problem as by creating a soft link

ln -s <target> <source>.

cu might have tried following (mistakenly)..

 grub-install /dev/vda1 --root-directory=/boot/

Probing devices to guess BIOS drives. This may take a long time.
No suitable drive was found in the generated device map.

 cat /boot/
boot/                             initrd-2.6.18-274.el5.img         symvers-2.6.18-308.4.1.el5.gz     System.map-2.6.18-8.el5           .vmlinuz-2.6.18-308.el5.hmac
config-2.6.18-274.el5             initrd-2.6.18-308.4.1.el5.img     symvers-2.6.18-308.el5.gz         vmlinuz-2.6.18-274.el5            vmlinuz-2.6.18-8.el5
config-2.6.18-308.4.1.el5         initrd-2.6.18-308.el5.img         symvers-2.6.18-8.el5.gz           .vmlinuz-2.6.18-274.el5.hmac      
config-2.6.18-308.el5             initrd-2.6.18-8.el5.img           System.map-2.6.18-274.el5         vmlinuz-2.6.18-308.4.1.el5        
config-2.6.18-8.el5               lost+found/                       System.map-2.6.18-308.4.1.el5     .vmlinuz-2.6.18-308.4.1.el5.hmac  
grub/                             symvers-2.6.18-274.el5.gz         System.map-2.6.18-308.el5         vmlinuz-2.6.18-308.el5            
 cat /boot/boot/grub/
device.map         fat_stage1_5       iso9660_stage1_5   minix_stage1_5     stage1             ufs2_stage1_5      xfs_stage1_5       
e2fs_stage1_5      ffs_stage1_5       jfs_stage1_5       reiserfs_stage1_5  stage2             vstafs_stage1_5    

 cat /boot/boot/grub/device.map 
(fd0)   /dev/fd0
 cat /boot/grub/device.map 
 this device map was generated by anaconda
(hd0)     /dev/vda

 got errors as below:
grub> setup --prefix=/grub/stage1 (hd1)
setup --prefix=/grub/stage1 (hd1)
 Checking if "/grub/stage1/stage1" exists... no --- pretty unusual to me 

ls -l
total 186
-rw-r--r-- 1 root root     75 Apr  5 11:21 device.map
-rw-r--r-- 1 root root   7584 Apr  5 12:00 e2fs_stage1_5
-rw-r--r-- 1 root root   7456 Apr  5 12:00 fat_stage1_5
-rw-r--r-- 1 root root   6720 Apr  5 12:00 ffs_stage1_5
-rw-r--r-- 1 root root   6720 Apr  5 12:00 iso9660_stage1_5
-rw-r--r-- 1 root root   8224 Apr  5 12:00 jfs_stage1_5
-rw-r--r-- 1 root root   6880 Apr  5 12:00 minix_stage1_5
-rw-r--r-- 1 root root   9248 Apr  5 12:00 reiserfs_stage1_5
-rw-r--r-- 1 root root    512 Apr  5 12:00 stage1
-rw-r--r-- 1 root root 104988 Apr  5 12:00 stage2
-rw-r--r-- 1 root root   7072 Apr  5 12:00 ufs2_stage1_5
-rw-r--r-- 1 root root   6272 Apr  5 12:00 vstafs_stage1_5
-rw-r--r-- 1 root root   8872 Apr  5 12:00 xfs_stage1_5

seems after booting up on the grub console system automatically searches the stage1 so the command should have followed

setup --prefix=/grub <default dir>

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.