You are not logged in.

#1 2009-04-09 13:58:27

gborzi
Member
From: Sicilia
Registered: 2009-03-18
Posts: 102

kernel upgrade

Sorry if the question I'm going to ask is dumb and/or has already been answered, but I searched the forum and the wiki without finding an answer.
Today kernel26-2.6.29-3 is in the core repo, so pacman -Syu asks for installing the new kernel. If I understood correctly what I read, installing the new kernel will remove the old one, 2.6.28. How can I keep the old kernel installed? I mean, in case the new kernel has problems and doesn't boot, I would have the option to boot the old one and look for a solution. Otherwise I would be left with a non working system.

Thanks in advance.


Giuseppe Borzi' - Registered Linux user #34028

Offline

#2 2009-04-09 14:17:05

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: kernel upgrade

this is a TOTAL guess, and i hope someone will come along and correct me.  that said, can you...

first, rename /boot/kernel26-fallback.img, kernel26.img, and vmlinuz26 to something memorable (-old or something) so they're not overwritten in the upgrade

then, update to the new kernel normally which will recreate the default files in /boot

then just adjust /boot/grub/menu.lst to add a new entry pointing to the renamed files in /boot (two entries if you're keeping your old fallback too)

have a LiveCD handy incase anything goes wrong.

Offline

#3 2009-04-09 14:23:21

Xabre
Member
From: Serbia
Registered: 2009-03-19
Posts: 750

Re: kernel upgrade

/lib/modules/linux-2.6.28-ARCH also must be saved

Offline

#4 2009-04-09 14:33:41

pharcyde
Member
From: Connecticut
Registered: 2009-03-13
Posts: 88

Re: kernel upgrade

I don't think current kernel modules in /lib/modules/ will be deleted upon kernel upgrade; but it is still a good idea to back it up.

Last edited by pharcyde (2009-04-09 14:34:16)

Offline

#5 2009-04-09 14:42:00

Xabre
Member
From: Serbia
Registered: 2009-03-19
Posts: 750

Re: kernel upgrade

@pharcyde
They will, upgraded 30 min ago. Modules are part of old kernel package, therefore will be deleted on upgrade wink

Offline

#6 2009-04-09 14:42:02

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: kernel upgrade

$ ls /lib/modules
2.6.28-ARCH  2.6.29-ARCH

yup your modules should be fine

edit: @Xabre, um... what?

edit2: oh wait, i haven't rebooted into the new kernel yet... you may be right my friend, apologies.

Last edited by brisbin33 (2009-04-09 14:43:19)

Offline

#7 2009-04-09 14:45:30

Xabre
Member
From: Serbia
Registered: 2009-03-19
Posts: 750

Re: kernel upgrade

Maybe you have some kernel modules , like graphics drivers and so, built for kernel 2.6.28, so that dirctory remains. (all drivers go to modules dir for apropriate kernel version)

Check the contents of /lib/modules/2.6.28-ARCH and see if all is there . wink

Offline

#8 2009-04-09 14:48:54

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: kernel upgrade

┌─[ 10:41 ][ blue:~ ]
└─> ls /lib/modules/2.6.28-ARCH/ | wc -l
1
┌─[ 10:47 ][ blue:~ ]
└─> ls /lib/modules/2.6.29-ARCH/ | wc -l
18
┌─[ 10:47 ][ blue:~ ]
└─>

i stand corrected.  thanks for the headsup

Offline

#9 2009-04-09 16:18:53

gborzi
Member
From: Sicilia
Registered: 2009-03-18
Posts: 102

Re: kernel upgrade

Thanks to everyone that answered my question. Now I'll try to backup the old kernel+modules and update. I'll report on my attempt (hoping I'll have a working system :-) ).


Giuseppe Borzi' - Registered Linux user #34028

Offline

#10 2009-04-09 16:36:27

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: kernel upgrade

There is a script floating around in the contrib section for doing automagic backups of the old kernel


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#11 2009-04-09 17:14:10

gborzi
Member
From: Sicilia
Registered: 2009-03-18
Posts: 102

Re: kernel upgrade

Success! The backup worked, here is what I did (as root):

cp -r /lib/modules/2.6.28-ARCH/ /lib/modules/2.6.28-ARCH-old
cp -r /usr/src/linux-2.6.28-ARCH /usr/src/linux-2.6.28-ARCH-old
cp /boot/kernel26.img /boot/kernel26-old.img
cp /boot/kernel26-fallback.img /boot/kernel26-old-fallback.img
cp /boot/vmlinuz26 /boot/vmlinuz26-old
pacman -Syu
....
mv /lib/modules/2.6.28-ARCH-old /lib/modules/2.6.28-ARCH
mv /usr/src/linux-2.6.28-ARCH-old /usr/src/linux-2.6.28-ARCH
vim /boot/grub/menu.lst

to /boot/grub/menu.lst I added the following lines

# (0) Arch Linux
title  Arch Linux old
root   (hd0,0)
kernel /boot/vmlinuz26-old root=/dev/disk/by-uuid/a0e70097-9d86-41b7-94a1-6df9bf6ec5db resume=/dev/disk/by-uuid/6fde335c-aa00-4d4f-a9db-15859aefd4f1 ro vga=773
initrd /boot/kernel26-old.img

# (1) Arch Linux
title  Arch Linux Fallback old
root   (hd0,0)
kernel /boot/vmlinuz26-old root=/dev/disk/by-uuid/a0e70097-9d86-41b7-94a1-6df9bf6ec5db ro
initrd /boot/kernel26-fallback-old.img

It is important to save the modules directory (which is removed by the upgrade) otherwise the old kernel won't have any module, besides those in the initial image. Also, if one wants to compile external modules for the old kernel, the /usr/src/linux-2.6.28-ARCH needs to be saved.

Thanks again.


Giuseppe Borzi' - Registered Linux user #34028

Offline

Board footer

Powered by FluxBB