LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   How to save old kernel in case upgrade crash! (http://www.linuxquestions.org/questions/slackware-14/how-to-save-old-kernel-in-case-upgrade-crash-4175465582/)

zrdc28 06-11-2013 11:44 AM

How to save old kernel in case upgrade crash!
 
I normally try to stay up to date with current, but on the last upgrade to current it crashed and I was unable to recover. I had saved everything that was important and it was not a big loss. I then did a reinstall of slack 14 and everything was fine. I blacklisted kernel 3.2.29-smp and upgraded to current and everything is fine.

My question is if I copy kernel files that I have blacklisted to an external source, can I just copy them back to the original location in case of another problem when I upgrade?

Is there another way that would be easier to save and give me the ability to recover or better yet to list the last kernel when it boots up?

One of the few things that I like about some of the other distros is the ability to just target an older kernel at boot up.
I have googled everything I could think of and can not understand how to do this. Please be gentle with an old man that loves Slackware!

hp 7000 dual core 2.66
single boot slack current

Diantre 06-11-2013 12:04 PM

I've found this post by Alien Bob most useful when installing new kernels. I just followed it to install the recent 3.2.45 kernel alongside the stock 3.2.29 and had no trouble at all, both kernels are installed and I choose which one starts in the lilo boot screen.

https://www.linuxquestions.org/quest...5/#post4676576

Alien Bob 06-11-2013 12:12 PM

Quote:

Originally Posted by Diantre (Post 4969687)
I've found this post by Alien Bob most useful when installing new kernels. I just followed it to install the recent 3.2.45 kernel alongside the stock 3.2.29 and had no trouble at all, both kernels are installed and I choose which one starts in the lilo boot screen.

https://www.linuxquestions.org/quest...5/#post4676576

The story in that forum post has been re-written and expanded for the Slackware Wiki: http://docs.slackware.com/howtos:sla...:systemupgrade

Eric

Diantre 06-11-2013 12:23 PM

Quote:

Originally Posted by Alien Bob (Post 4969690)
The story in that forum post has been re-written and expanded for the Slackware Wiki: http://docs.slackware.com/howtos:sla...:systemupgrade

Thanks Eric, I should check the Slackware docs more often! :)

zrdc28 06-11-2013 02:43 PM

Thanks, I appreciate the response,I have read the article http://docs.slackware.com/howtos:sla...:systemupgrade
a few times and maybe I should have reworded my title differently. I want to keep my old working kernel installed and I
don't fully understand how to do that. I want to use the new kernel but with a backup in case of failure.



From the article listed above.

For that reason, you need to keep your “old” working kernel installed, and keep a section for it in your /etc/lilo.conf file. That way, if the new kernel fails to boot, you can fall-back to the old kernel and start investigating what went wrong

Alien Bob 06-11-2013 02:50 PM

It's all explained at the end of the section http://docs.slackware.com/howtos:sla...using_slackpkg

Eric

dc_eros 06-12-2013 04:14 AM

I usually don't remove the old kernel when upgrading to a new one. Just like the docs suggested, kernels are blacklisted in slackpkg.

What I do is install the new kernel instead of upgrading. Then add a lilo entry and try to reboot. If the new kernel works for several days, then I'll remove the old kernel.

My lilo.conf would usually contain multiple kernel entries (multiple versions, huge and generic). Ex:

Code:

image = /boot/vmlinuz-generic-3.2.29
  initrd = /boot/initrd.gz
  root = /dev/sdb2
  label = Linux3229
  read-only
image = /boot/vmlinuz
  root = /dev/sdb2
  label = Linux
  read-only
image = /boot/vmlinuz-huge-3.2.45
  root = /dev/sdb2
  label = Linux3245
  read-only


Toutatis 06-12-2013 04:26 AM

@dc_eros

I am doing almost the same (all by hand, I have never used slackpkg).
For example to use new kernel 3.9.5 instead of previous 3.8.13 :
- go in /lib/modules and pack the 3.8.13 modules (tar cvf modules-3.8.13.tar 3.8.13/), because upgrading will kill them.
- go in /boot, and copy the old kernel 'vmlinuz-huge-3.8.13' to 'oldkernel'. Of course my "lilo.conf" has an entry for 'oldkernel'
- go in the slackware64 package tree and upgrade */kern*txz
- run 'lilo -C /etc/lilo.conf'
- upgrade all the other new packages if any
- reboot

zrdc28 06-12-2013 10:40 PM

Thanks, I sure appreciate the help and valuable information. I will go for it shortly, it is a must that I learn how
to do this because I wouldn't even think of going to another distro. I have read alien's article several times and just
could not get exactly how to do it.

Alien Bob 06-13-2013 04:56 AM

Quote:

Originally Posted by zrdc28 (Post 4970741)
I have read alien's article several times and just could not get exactly how to do it.

If you succeed, you can send me your feedback of the parts in the text which were not clear to you, and I will try to improve the text.

Eric

zrdc28 06-16-2013 06:24 PM

I was able to get it to work for me using Aliens article along with the advice from toutatis. I could not figure out
exactly what I needed to save. I have upgraded many times over the years with upgrade-all and never had but one problem
and that was solved in Aliens article on mkinitrd.

zrdc28 06-18-2013 11:59 PM

This is the way that I finally was able to save the old kernel and try out the new 3.9.5 kernel. I am sure that I did some of it backwards but it works for me.

slackpkg update
With all kernels blacklisted in /etc/slackpkg/blacklist

slackpkg install-new

slackpkg upgrade-all

slackpkg download kernel* | the new versions will be in /var/cache/packages/slackware/a
cd to /var/cache/packages/slackware/a

Now install the -current kernel-* alongside the old one. The kernel source got downloaded, too.
installpkg *.txz | only the kernel-* was there!

cd to /boot, ls, and you will see both the old and new kernels.

I did a uname -a to make sure which kernel I was using, it turned
out to be 3.2.29-smp so I assumed that I needed the vmlinuz-huge-smp.

nano /etc/lilo.conf | edit to have both versions of the kernel

This is my lilo.conf
image = /boot/vmlinuz-huge-smp-3.9.5-smp
root = /dev/sda2
label = linux395
read-only
image = /boot/vmlinuz
root = sda2
label = linux
read-only

Saved it and then
lilo -v "make sure there are no errors"
REBOOT!
Thatís it! It worked for me, Thanks to all great slackers that helped me!


All times are GMT -5. The time now is 12:17 PM.