LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-31-2005, 06:19 PM   #1
GarethC
LQ Newbie
 
Registered: Jul 2005
Location: Durham, Britain
Distribution: Debian (Sarge)
Posts: 3

Rep: Reputation: 0
What do I do to back up the kernel? Which files do I copy? (Debian kernel 2.4.27-2)


Just downloaded kernel 2.6.12.3 and what-do-you-know, I actually managed to complied the thing. Before proceeding I'd like to back up my current kernel (something recommended by the instructions anyway). Which files do I copy? I don't want to miss any.

I'm using debian sarge with the stock kernel (2.4.27-2). I boot using grub with a dual boot setup with windows 98 on the other partition.

The /boot/grub/menu.lst entry for debian looks like this:

title Debian GNU/Linux, kernel 2.4.27-2-386
root (hd0,1)
savedefault
kernel /boot/vmlinuz-2.4.27-2-386 root=/dev/hda2 ro
initrd /boot/initrd.img-2.4.27-2-386

-Gareth C

PS: Is it possible to set up grub to boot from different kernels? For example, adding a entry for the new kernel and keeping the old entry?
 
Old 07-31-2005, 07:24 PM   #2
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid/RPIOS
Posts: 4,887
Blog Entries: 28

Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
Not sure about when you compile a new kernel, but if you install one through apt-get it creates a new entry and at boot you can choose the one you want to use.

I have 2.4.27, 2.6.10, and 2.6.11-7-k7 to choose from.
 
Old 08-01-2005, 03:27 AM   #3
harken
Member
 
Registered: Jan 2005
Location: Between the chair and the desk
Distribution: Debian Sarge, kernel 2.6.13
Posts: 666

Rep: Reputation: 30
After compiling and installing a newer kernel version, I don't really backup my old kernel, instead I keep the image and the modules until I make sure the new one works as I want it to.
Anyway, the files you may want to backup is /boot/vmlinuz-version, /boot/System.map-version, /boot/initrd-version (if case) and the modules found at /lib/modules/version, where version is something like 2.4.27-2.
Quote:
PS: Is it possible to set up grub to boot from different kernels? For example, adding a entry for the new kernel and keeping the old entry?
Of course, after you install the modules (make modules_install), copy the new vmlinuz and the new System.map to /boot, edit menu.lst to look something like:
Code:
title Debian GNU/Linux, kernel 2.4.27-2-386
root (hd0,1)
savedefault
kernel /boot/vmlinuz-2.4.27-2-386 root=/dev/hda2 ro
initrd /boot/initrd.img-2.4.27-2-386

title Debian GNU/Linux, kernel 2.6.12.3
root (hd0,1)
savedefault
kernel /boot/vmlinuz-2.6.12.3 root=/dev/hda2 ro
initrd /boot/initrd.img-2.6.12.3
This way you keep both kernels. Once you think you don't need the old kernel, remove the old files from /boot and the corresponding directory in /lib/modules.

On a side note, you could compile your new kernel without the need of an initrd.

Last edited by harken; 08-01-2005 at 03:28 AM.
 
Old 08-01-2005, 07:13 AM   #4
GarethC
LQ Newbie
 
Registered: Jul 2005
Location: Durham, Britain
Distribution: Debian (Sarge)
Posts: 3

Original Poster
Rep: Reputation: 0
I've located the files, I'll back them up (I'm paranoid, this is my first attempt at this) then try out the new kernel. Thanks for the help.

-Gareth C
 
Old 08-01-2005, 07:38 AM   #5
harken
Member
 
Registered: Jan 2005
Location: Between the chair and the desk
Distribution: Debian Sarge, kernel 2.6.13
Posts: 666

Rep: Reputation: 30
You're welcome. Come back and let us know how it worked.
 
Old 08-01-2005, 03:37 PM   #6
GarethC
LQ Newbie
 
Registered: Jul 2005
Location: Durham, Britain
Distribution: Debian (Sarge)
Posts: 3

Original Poster
Rep: Reputation: 0
It's worked (though I had slight problem getting the initrc.img file to work). I'm typing this on a kernel 2.6 box. Thanks.

-Gareth C
 
Old 08-02-2005, 02:49 AM   #7
harken
Member
 
Registered: Jan 2005
Location: Between the chair and the desk
Distribution: Debian Sarge, kernel 2.6.13
Posts: 666

Rep: Reputation: 30
Great, glad to hear that! Now you can test for a while the new kernel to see if everything works as it should (sound/video/network card, printer, other peripherals) then delete the old kernel and the corresponding modules as they may take up some space and considering future kernel updates you won't want to waste your harddisk space.
Also, it's a good thing to keep a backup of the .config file you used to compile the current kernel, so you can use it for future versions (the compiling options don't change dramatically from version to version).
Anyways, good job.

Last edited by harken; 08-02-2005 at 02:57 AM.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
ISOLinux from Debian etch cannot find kernel image (but kernel is in its place)! Why? *Dark Dragon* Debian 4 11-07-2005 09:54 PM
Debian Kernel Files Location?? SkippyBoy Debian 5 10-15-2005 01:50 AM
Kernel-Patch Debian Logo 2.6.2 not correctly working for custom kernel 2.6.11 smp deepclutch Debian 3 06-27-2005 03:59 AM
How to Back Up the Kernel and Files? Lucinda Slackware 9 05-26-2004 05:51 AM
Copy Files Between Drives Causes Kernel Panic/Freeze of the System php Slackware 7 08-14-2003 07:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration