Installing a new kernel while modifying grub adding the older kernel to grub
![](https://seccdn.libravatar.org/avatar/70f9aeb4da1d431e348f2f42547e2448.jpg?s=120&d=mm&r=g)
What do I need to do to add an entry into grub to preserve my ability to mount an existing working kernel BEFORE I install a newer kernel. Under Lilo I knew how to do this, with grub as was installed when I upgraded to SuSE 8.1 I nearly lost my whole damn system when I recently tried upgrading my self compiled 2.4.20 kernel to a mantel 2.4.20-17. Yes, I know the risks of mantel kernels but I figured I was on safe ground since I could boot back into my previous working kernel if the mantel kernel did not operate as I expected. Well, I was wrong I did something wrong and my old kernel will not boot either. After expending much effort working in the restore mode and learning much more about kernels than I care to know I'm fully recovered. Now my question: Can anyone explain to me what I must put into the grub menu.1st file to add such an entry to do what I have described above? What I did was added an entry to /boot/grub/menu.1st as follows: title oldkernel20 kernel (hd0,5)/vmlinuz.org-20 root=/dev/hda7 apm=on acpi=off vga=791 nosmp maxcpus=0 disableapic initrd (hd0,5)/initrd.org-20 The kernel line is NOT word wrapped, this email program did that. vmlinuz.org-20 is a copy of my previous working kernel initrd.org-20 is a working copy of my previous working kernel Upon boot, my added title is visible and selectable. The kernel starts loading and makes it all the way to attempting a "hotsync USB" line where it dies and will go no further and generates no error message. It takes a control-alt-del to reboot which of course was a catch 22 since the new kernel does not work either. As I sated, I fixed everything and I'm back in business. Thank you for reading this far. Now to restate my question: How do you folks modify your working system to provide an escape route in case a newer kernel install bombs? Thanks in advance... Harry
![](https://seccdn.libravatar.org/avatar/6a8d41de21fa98c403b23168a18f2b72.jpg?s=120&d=mm&r=g)
On Saturday 08 March 2003 08:29 pm, Harry Wert wrote:
What do I need to do to add an entry into grub to preserve my ability to mount an existing working kernel BEFORE I install a newer kernel. Under Lilo I knew how to do this, with grub as was installed when I upgraded to SuSE 8.1 I nearly lost my whole damn system when I recently tried upgrading my self compiled 2.4.20 kernel to a mantel 2.4.20-17. Yes, I know the risks of mantel kernels but I figured I was on safe ground since I could boot back into my previous working kernel if the mantel kernel did not operate as I expected. Well, I was wrong I did something wrong and my old kernel will not boot either. After expending much effort working in the restore mode and learning much more about kernels than I care to know I'm fully recovered.
Now my question: Can anyone explain to me what I must put into the grub menu.1st file to add such an entry to do what I have described above? What I did was added an entry to /boot/grub/menu.1st as follows:
You need to run mk_initrd after modifying menu.lst In menu.lst - declare both kernels the, SuSE default and the new kernel title SuSE kernel (hd0,5)/boot/vmlinuz root=/dev/hda7.... #note that by default SuSE places the kernel & initrd in /boot/vmlinuz initrd (hd0,5)/boot/initrd title kernel-2.4.20 kernel (hd0,5)/boot/vmlinuz-2.4.20 root=/dev/hda7..... initrd (hd0,5)/boot/initrd-2.4.20 Then run mk_initrd as follows: mk_initrd -k "vmlinuz vmlinuz-2.4.20" -i "initrd initrd-2.4.20" by default mk_initrd creates /boot/initrd & /boot/initrd.shipped - this is why you need to use the -k & -i options with the quotes. also make sure in YaST2 that hd(0,5) contains the MBR, This should work, however the new kernel may not boot depending on compile options, modules used, etc. Hope this helps, George
title oldkernel20 kernel (hd0,5)/vmlinuz.org-20 root=/dev/hda7 apm=on acpi=off vga=791 nosmp maxcpus=0 disableapic initrd (hd0,5)/initrd.org-20
The kernel line is NOT word wrapped, this email program did that.
vmlinuz.org-20 is a copy of my previous working kernel initrd.org-20 is a working copy of my previous working kernel
Upon boot, my added title is visible and selectable. The kernel starts loading and makes it all the way to attempting a "hotsync USB" line where it dies and will go no further and generates no error message. It takes a control-alt-del to reboot which of course was a catch 22 since the new kernel does not work either. As I sated, I fixed everything and I'm back in business.
Thank you for reading this far. Now to restate my question: How do you folks modify your working system to provide an escape route in case a newer kernel install bombs?
Thanks in advance...
Harry
-- Linux 2.4.20 i686 11:54pm up 99 days, 7:49, 5 users, load average: 0.16, 0.05, 0.01
![](https://seccdn.libravatar.org/avatar/70f9aeb4da1d431e348f2f42547e2448.jpg?s=120&d=mm&r=g)
Thank you very much, this is exactly what I was looking for. Hope I can return the favor sometime to assist you. I was about ready to go back to lilo which I understood. Harry Wert Research Physicist ===================================== On Sunday 09 March 2003 12:09 am, George Auch wrote:
You need to run mk_initrd after modifying menu.lst
In menu.lst - declare both kernels the, SuSE default and the new kernel
title SuSE kernel (hd0,5)/boot/vmlinuz root=/dev/hda7.... #note that by default SuSE places the kernel & initrd in /boot/vmlinuz initrd (hd0,5)/boot/initrd
title kernel-2.4.20 kernel (hd0,5)/boot/vmlinuz-2.4.20 root=/dev/hda7..... initrd (hd0,5)/boot/initrd-2.4.20
Then run mk_initrd as follows:
mk_initrd -k "vmlinuz vmlinuz-2.4.20" -i "initrd initrd-2.4.20"
by default mk_initrd creates /boot/initrd & /boot/initrd.shipped - this is why you need to use the -k & -i options with the quotes.
also make sure in YaST2 that hd(0,5) contains the MBR,
This should work, however the new kernel may not boot depending on compile options, modules used, etc.
Hope this helps, George
![](https://seccdn.libravatar.org/avatar/9deecf86327aa8d2b5a69eabb3d170d7.jpg?s=120&d=mm&r=g)
On Sunday 09 March 2003 02:29, Harry Wert wrote:
Thank you for reading this far. Now to restate my question: How do you folks modify your working system to provide an escape route in case a newer kernel install bombs?
My way to get it: 1. install lilo (thank you SuSE it is still possible) and go to yast->bootloader to choose lilo as your favourite bootloader 2. make a temporary copy of /lib/modules/2.4.19-4GB (say, 2.4.19-4GB.COPY) 3. copy vmlinuz* to vmlinuz_2.4.19-4GB* 4. copy initrd to initrd_2.4.19 (the same with initrd.shipped) 5. copy System.map-2.4.19-GB to System.map-2.4.19-4GB.COPY ********** 6. Now you are ready to create /etc/lilo.conf Mine looks like this: # Modified by YaST2. Last modification on Sun Mar 2 10:08:11 2003 boot = /dev/hda change-rules reset read-only menu-scheme = Wb:kw:Wb:Wb lba32 prompt timeout = 80 message = /boot/message image = /boot/vmlinuz label = linux root = /dev/hda2 vga = 791 initrd = /boot/initrd append = "acpi=off" password = xxx restricted image = /boot/vmlinuz_2.4.19 label = linux-2.4.19 root = /dev/hda2 vga = 791 initrd = /boot/initrd_2.4.19 append = "acpi=off" password = xxx restricted optional other = /dev/hda1 label = windows password = xxx optional image = /boot/vmlinuz.shipped label = rescue root = /dev/hda2 vga = 791 initrd = /boot/initrd.shipped append = "ide=nodma apm=off acpi=off vga=normal nosmp maxcpus=0 disableapic 3" password = xxx restricted optional image = /boot/vmlinuz_2.4.19.shipped label = rescue-2.4.19 root = /dev/hda2 vga = 791 initrd = /boot/initrd_2.4.19.shipped append = "ide=nodma apm=off acpi=off vga=normal nosmp maxcpus=0 disableapic 3" password = xxx restricted optional ******************* 7. Launch lilo to write changes to mbr - as you see at this moment both vmlinux and vmlinuz_2.4.19-4GB means the same 8. Now you can install new kernel (rpm -Uhv ...) 9. Rename /lib/modules/2.4.19-4GB.COPY to 2.4.19-4GB (old kernel modules have been deleted by rpm) 10. Rename /boot/System.map-2.4.19-GB.COPY to System.map-2.4.19-4GB 11. Launch lilo (now vmlinuz is you most recent kernel) ***************** FYI: list of files in /boot in my system: drwxr-xr-x 3 root root 4096 Mar 9 10:40 . drwxr-xr-x 21 root root 4096 Mar 8 20:17 .. -rw-r--r-- 1 root root 611546 Nov 27 02:07 System.map-2.4.19-4GB -rw-r--r-- 1 root root 632255 Feb 25 10:00 System.map-2.4.20-4GB lrwxrwxrwx 1 root root 1 Feb 26 22:00 boot -> . -rw-r--r-- 1 root root 512 Mar 2 10:05 boot.0300 -rw-r--r-- 1 root root 512 Mar 2 10:05 boot.0302 drwxr-xr-x 2 root root 4096 Feb 26 22:09 grub -rw-r--r-- 1 root root 410198 Mar 2 12:40 initrd -rw-r--r-- 1 root root 409753 Mar 2 12:40 initrd.shipped -rw-r--r-- 1 root root 414245 Mar 2 10:08 initrd_2.4.19 -rw-r--r-- 1 root root 404826 Mar 2 10:08 initrd_2.4.19.shipped -rw-r--r-- 1 root root 3759 Mar 2 10:05 lilo.log -rw------- 1 root root 168960 Mar 2 12:44 map -rw------- 1 root root 131584 Mar 2 10:05 map2 -rw-r--r-- 1 root root 83147 Mar 8 20:12 message -rwxr-xr-x 1 root root 1391878 Feb 25 10:00 vmlinux.gz -rw-r--r-- 1 root root 1169218 Feb 25 10:00 vmlinuz -rw-r--r-- 1 root root 100072 Feb 25 10:48 vmlinuz.autoconf.h -rw-r--r-- 1 root root 48891 Feb 25 10:48 vmlinuz.config -rw-r--r-- 1 root root 1169218 Feb 25 10:00 vmlinuz.shipped -rw-r--r-- 1 root root 130 Feb 25 09:58 vmlinuz.version.h -rw-r--r-- 1 root root 1146120 Nov 27 02:07 vmlinuz_2.4.19 -rw-r--r-- 1 root root 94777 Nov 27 03:25 vmlinuz_2.4.19.autoconf.h -rw-r--r-- 1 root root 46345 Nov 27 03:25 vmlinuz_2.4.19.config -rw-r--r-- 1 root root 1146120 Nov 27 02:07 vmlinuz_2.4.19.shipped -rw-r--r-- 1 root root 130 Nov 27 01:55 vmlinuz_2.4.19.version.h *************** Regards, -- Emcek emcek@poczta.onet.pl --------------r-e-k-l-a-m-a----------------- Szukasz banku bez prowizji ? mBank - zaloz konto http://epieniadze.onet.pl/mbank
participants (3)
-
Emcek
-
George Auch
-
Harry Wert