Go Back   openSUSE Forums > Archives > SLS Archives > ARCHIVES - Linux Tweaks > ARCHIVES - Tips, Tricks & Tweaks
Forums FAQ Members List Search Today's Posts Mark Forums Read


ARCHIVES - Tips, Tricks & Tweaks Post your tips, tricks and tweaks about SuSE Linux in here. Please do not ask questions here - this is for factual information

 
Page 1 of 3 1 23
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-Mar-2007, 20:08
broch
Guest
 
Posts: n/a
Default

In the view of recent avalanche of problems after kernel update I suggest to back up your working (current) kernel. In theory updater should backup old kernel but it seems that this is not always th case. You can though backup your running kernel and always have safe working kernel copy:

1) open terminal
2) su to root
3) change directory to /boot
#cd /boot
4) see what are the names of running kernels
#ls
5) make backup copy of your kernel and System.map
#cp vmlinuz-2.6.18.8-0.1-default vmlinuz-2.6.18.8-0.1-bak
#cp System.map-2.6.18.8-0.1-default System.map-2.6.18.8-0.1-bak
#cp /lib/modules/2.6.18.8-0.1-default /lib/modules/2.6.18.8-0.1-bak
6) create initrd
#mkinitrd -s 1024x768
7) check if new initrd was created:
#ls
and look for initrd-2.6.18.8-0.1-bak
8) make backup of your current GRUB menu (in the case that you may screw up editing)
#cp /boot/grub/menu.lst /boot/grub/menu.lst_bak
9) edit grub menu whatever editor (I use vi, but you may use kedit.gedit, joe, pico and so on as long as yoy run editor with root privileges)
boot/grub/menu.lst

10) add new entry at the end of the file (copy original entry for SUSE LINUX 10.2):
title SUSE LINUX 10.2 kernel backup
root (hd0,0)
kernel /vmlinuz-2.6.18.8-0.1-bak root=/dev/sda2 vga=0x317 vga=normal video=vesa:1024x768@60 resume=/dev/sda3 elevator=deadline splash=silent showopts
initrd /initrd-2.6.18.8-0.1-bak

important changes are marked bold. You may not have the other stuff or it may be different. Simply keep the rest of the file exactly the same as in the original entry for SUSE LINUX 10.2

11) save the file
12) restart computer and select from GRUB menu "SUSE LINUX 10.2 kernel backup"

if system boots successfully you have working kernel backup, now if suse updates kernel next time and new kernel will not boot properly, you can always boot to SUSE LINUX 10.2 kernel backup which will never be modified (and safe from screwed updates)

Hope this will help
  #2 (permalink)  
Old 11-Mar-2007, 20:24
G0NZ0
Guest
 
Posts: n/a
Default

nice, what about a wiki page with the same explanation too?
  #3 (permalink)  
Old 11-Mar-2007, 20:56
broch
Guest
 
Posts: n/a
Default

Thanks,
I will add this to the suse wiki.
  #4 (permalink)  
Old 12-Mar-2007, 03:24
ilihai
Guest
 
Posts: n/a
Default

This will help me a lot.
Thanks man.
  #5 (permalink)  
Old 12-Mar-2007, 05:08
geoffro
Guest
 
Posts: n/a
Default

Quote:
In the view of recent avalanche of problems after kernel update I suggest to back up your working (current) kernel. In theory updater should backup old kernel but it seems that this is not always th case. You can though backup your running kernel and always have safe working kernel copy:

1) open terminal
2) su to root
3) change directory to /boot
#cd /boot
4) see what are the names of running kernels
#ls
5) make backup copy of your kernel and System.map
#cp vmlinuz-2.6.18.8-0.1-default vmlinuz-2.6.18.8-0.1-bak
#cp System.map-2.6.18.8-0.1-default System.map-2.6.18.8-0.1-bak
#cp /lib/modules/2.6.18.8-0.1-default /lib/modules/2.6.18.8-0.1-bak
....
[/b]
It fails for me at 5) :
# cp /lib/modules/2.6.18.8-0.1-default /lib/modules/2.6.18.8-0.1-bak
cp: omitting directory `/lib/modules/2.6.18.8-0.1-default'

tested cd: /lib/modules/2.6.18.8-0.1-bak: No such file or directory

Do i need to create /lib/modules/2.6.18.8-0.1-bak first ?

/Geoff
  #6 (permalink)  
Old 12-Mar-2007, 08:12
broch
Guest
 
Posts: n/a
Default

ohh,

forgot you need to add switch "-R" to copy directory:
#cp -R /lib/modules/2.6.18.8-0.1-default /lib/modules/2.6.18.8-0.1-bak

sorry.



ideally would be do something different:
1) install kernel sources
2) su to root
3) copy kernel sources to the new direcory:
#cp -R /usr/src/linux-2.6.18.8-0.1 /usr/src/linux-2.6.18.8-0.1-bak
4) change directory to /usr/src/linux-2.6.18.8-0.1-bak
#cd /usr/src/linux-2.6.18.8-0.1-bak
5) create config file
#make oldconfig
6) change kernel name (super important!!!)
by editing .config file (in /usr/src/linux-2.6.18.8-0.1-bak) Tehre is a dot before "config"
scroll down to the line:
#
# General setup
#
CONFIG_LOCALVERSION=""
and change local kernel name version by adding:
CONFIG_LOCALVERSION="-bak"

if there is anything already written in the line

CONFIG_LOCALVERSION=""
delete old name remember that new name must have quotation marks.

7) save file
8) compile kernel
#make bzImage && make modules && make modules_install && make install

You just created a new kernel! Exactly the same as the running one but the name will have "-bak" at the end

there is nothing more required. in your GRUB menu will appear a new entry pointing to the new kernel. Old kernel will not be affected (if you did exactly as I suggested)

new kernel is invisible to Yast and will never be changed.

Because the latest kernel upgrade is a real disaster I would make backup copy of grub menu (as root):
#cp /boot/grub/menu.lst /boot/grub/menu.lst_bak

now you can boot to the new kernel
you will get to command line (when booting to the new kernel) if you installed nvidia/ati drivers,

That is easy to fix of course. what is important, you have working suse setup in spite of all suse devs efforts to screw you up
  #7 (permalink)  
Old 18-Mar-2007, 07:40
G0NZ0
Guest
 
Posts: n/a
Default

broch, i added your post in a wiki page, http://wiki.suselinuxsupport.de/wikka.php?...eKernelUpgrades
Can you please have a look and correct there, in case i messed up something while merging your very first post with the added comments?
  #8 (permalink)  
Old 18-Mar-2007, 13:02
broch
Guest
 
Posts: n/a
Default

Thank you GONZO,
I tried to add this to wiki myself, but I had some strange problems with editing. I would like to add short info about getting back GUI after booting bak kernel.
-----------------------------------------------

full description would look like this:

Making a backup copy of working kernel is a good idea. In the unfortunate case that suse kernel update fails, you will always have working kernel backup. Blow I will use as a reference suse kernel version 2.6.18.8-0.1. This will be obviously different in a specific suse installation so keep your kernel name.


Below you will find two ways of securing working in the case that kernel update fails.

Method 1 - simple kernel copy
1) open terminal
2) su to root
3) change directory to /boot
#cd /boot
4) see what are the names of running kernels:
#ls
5) make backup copy of your kernel and System.map
#cp vmlinuz-2.6.18.8-0.1-default vmlinuz-2.6.18.8-0.1-bak
#cp System.map-2.6.18.8-0.1-default System.map-2.6.18.8-0.1-bak
#cp -R /lib/modules/2.6.18.8-0.1-default /lib/modules/2.6.18.8-0.1-bak
6) create initrd
#mkinitrd -s 1024x768
7) check if new initrd was created:
#ls
and look for initrd-2.6.18.8-0.1-bak
8) make backup of your current GRUB menu (in the case that you may screw up editing)
#cp /boot/grub/menu.lst /boot/grub/menu.lst_bak
9) edit grub menu whatever editor (I use vi, but you may use kedit.gedit, joe, pico and so on as long as yoy run editor with root privileges)
boot/grub/menu.lst

10) add new entry at the end of the file (copy original entry for SUSE LINUX 10.2) :
title SUSE LINUX 10.2 kernel backup
root (hd0,0)
kernel /vmlinuz-2.6.18.8-0.1-bak root=/dev/sda2 vga=0x317 pci=noacpi acpi=noirq agp=off nolapic resume=/dev/sda3 elevator=deadline splash=silent showopts
initrd /initrd-2.6.18.8-0.1-bak

important changes are marked bold. You may not have the other stuff or it may be different. Simply keep the rest of the file exactly the same as in the original entry for SUSE LINUX 10.2

This is an example from my system: leave references to: root=/dev/ and resume=/dev/ exactly as in your original GRUB entry

11) save the file
12) restart computer and select from GRUB menu "SUSE LINUX 10.2 kernel backup"

if system boots successfully you have working kernel backup, now if suse updates kernel next time and new kernel will not boot properly, you can always boot to SUSE LINUX 10.2 kernel backup which will never be modified (and safe from screwed updates)


Method 2 - kernel compilation

Although this (compilation) seems scary, it does not require any arcane knowledge. In fact, it does not require any previous experience with software compilation. Simply follow exactly steps listed below.

Note: as an example I used suse kernel version 2.6.18.8-0.1. But this method will work with any version of suse kernel (sources)

1) install suse kernel sources using yast. Try to keep the version of kernel sources with sync in installed kernel. This is not really required though.
Open Yast package manager and do either search for kernel, or scroll down to the line "kernel sources". Selest kernel sources and press install. Remember "kernel sources" not "kernel"!
2) open terminal window
3) su to root:
#su
enter root password
4) copy kernel sources to the new direcory (this way you will make sorures invisible to Yast and Yast will never try to update backup copy of kernel sources.:
#cp -R /usr/src/linux-2.6.18.8-0.1 /usr/src/linux-2.6.18.8-0.1-bak
4) change directory to /usr/src/linux-2.6.18.8-0.1-bak
#cd /usr/src/linux-2.6.18.8-0.1-bak

5)create kernel config file
#make oldconfig

6) change kernel name (super important!!!)
by editing .config file (in /usr/src/linux-2.6.18.8-0.1-bak/) There is a dot before before word "config"
scroll down to the line:
#
# General setup
#
CONFIG_LOCALVERSION=""
and change local kernel name version by adding:
CONFIG_LOCALVERSION="-bak"

if there is anything already written in this line
e.g.
CONFIG_LOCALVERSION="-default"
delete old name remember that new name must have quotation marks.

8) compile kernel
#make bzImage && make modules && make modules_install && make install

You just created a new kernel! Exactly the same as the running one but the name will have "-bak" at the end

there is nothing more required. In your GRUB menu will appear a new entry pointing to the new kernel. Old kernel will not be affected (if you did exactly as I suggested)

new kernel is invisible to Yast and will never be changed/updated.


now you can boot to the new kernel
you will get to command line (when booting to the new kernel) if you installed nvidia/ati drivers. To get GUI back follow the steps below.

Instant GUI: (for nvidia users, sorry, I don't have any experience with ATI.)

When you boot new kernel and you have installed nvidia drivers, you will be greeted with terminal window, not GUI. Don't worry.
1) login as user
2) su to root
#su
enter root password
3) backup original X config file:
#cp /etc/X11/xorg.conf /etc/X11/xorg.conf-bak
4) edit /etc/X11/xorg.conf
#vi /etc/X11/xorg.conf
scroll down to the line:

Section "Device"
BoardName "GeForce Go 7400" <- your card model
BusID "1:0:0"
Driver "nvidia"

place the mouse cursor on the first letter of the word nvidia, on your keyboard press (button) ESC once (do not keep it pressed!), now press the letter "x". Each time when you press "x" one letter will disappear. Keep pressing untill you will get the line looking as follows:

Driver ""


press ESC button again, press letter "i" once
enter the word "nv" in between quotation marks


Now press button ESC, press letters "wq" ("q" like queen ) and press enter. If you did exactly as described you should be now back in the terminal.


Now start X still with root privileges!):
1)enter
#init 3
2) after X shut down (bunch of lines) enter:
#init 5

If you did exactly as described, you should be back in GUI (with nv driver non accelerated, but still in familiar GUI)

Good luck,
broch

  #9 (permalink)  
Old 18-Mar-2007, 13:28
G0NZ0
Guest
 
Posts: n/a
Default

ok i have now replaced the previous with this one.
Hell yeah the formatting got all screwed up when adding "" ... i had to put a space between the quotes and put a comment aside...
  #10 (permalink)  
Old 18-Mar-2007, 16:12
broch
Guest
 
Posts: n/a
Default

thanks GONZO,

hopefully this will be useful
 
Page 1 of 3 1 23

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2