LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-10-2006, 04:18 PM   #1
Synt4x_3rr0r
Member
 
Registered: Nov 2005
Location: Sweden
Distribution: Arch Linux 64bit with Gnome
Posts: 138

Rep: Reputation: 15
Backing up my kernel.


Hi.
I'm going to reinstall Slackware. And I was wondering, is it possible to take a backup on the kernel I'm using right now?
Because I think I remember the Slackware setup asking if i wanted a kernel from another disk or something like that.

So can I burn the kernel on a disk and use it instead of the 2.4 one?
In that case, which files is it that I have to burn?

Hope you have time to answer my question.
 
Old 01-10-2006, 04:24 PM   #2
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
What you need is your kernel .config file and some few steps.
Are you going to format your /home directory, or do you just
want to reinstall the operating system? In which directory
did you compile the new kernel?
 
Old 01-10-2006, 04:34 PM   #3
Synt4x_3rr0r
Member
 
Registered: Nov 2005
Location: Sweden
Distribution: Arch Linux 64bit with Gnome
Posts: 138

Original Poster
Rep: Reputation: 15
I have a seperate /home partion yes, so Im just gonna reinstall the OS.
I compiled the kernel in /usr/src/linux-2.6.14.3
 
Old 01-10-2006, 05:00 PM   #4
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
Copy your kernel .config file from /usr/src/linux-2.6.14.3/.config
to /home/<username>/config-2.6.14.3 (name doesn't matter).
Also copy linux-2.6.14.3.tar.bz2 to /home, so you'll have the sources.
(NB: The /usr/src/linux-2.6.14.3/.config is what you'll need
to rebuild the kernel, so you might want to save it somewhere
else, also.)

When you reinstall Slackware, put /home on the same partition, but
DO NOT format it. This will leave everything in /home just as it is
now, including the kernel .config file.

I build kernels under /home where my normal user has permissions,
just as Linus Torvalds instructs. Take a look at this:
Code:
bruce@silas:~/kernel$ ls -alh
total 187M
drwxr-xr-x   7 bruce users  448 2006-01-09 00:39 ./
drwx--x--x  43 bruce users 5.4K 2006-01-10 16:11 ../
-rwxr-xr-x   1 bruce users 5.5K 2005-10-05 22:11 2.6-kernel-build.txt*
drwxr-xr-x  19 bruce users 1.3K 2005-12-07 17:23 linux-2.6.13.3/
-rw-r--r--   1 bruce users  37M 2005-10-05 14:05 linux-2.6.13.3.tar.bz2
drwxr-xr-x  19 bruce users 1.2K 2005-12-07 17:47 linux-2.6.13.4/
-rw-r--r--   1 bruce users  37M 2005-10-11 07:38 linux-2.6.13.4.tar.bz2
drwxr-xr-x  18 bruce users  656 2005-12-07 17:25 linux-2.6.14/
drwxr-xr-x  18 bruce users  744 2005-12-07 17:24 linux-2.6.14.3/
-rw-r--r--   1 bruce users  38M 2005-12-06 11:22 linux-2.6.14.3.tar.bz2
-rw-r--r--   1 bruce users  38M 2005-11-02 08:30 linux-2.6.14.tar.bz2
drwxr-xr-x  20 bruce users 1.3K 2006-01-09 10:19 linux-2.6.15/
-rw-r--r--   1 bruce users  38M 2006-01-08 17:58 linux-2.6.15.tar.bz2
If you don't want to build it under /home, you can still do the
same where you built it before.

First, copy linux-2.6.14.3.tar.bz2 to wherever you decide to
build your kernel.
Second, untar those sources.
Third, cd linux-2.6.14.3
Fourth, copy /home/<username>/config-2.6.14.3 to that directory
as .config and you're ready to go.
Now in your present directory you would issue:
make oldconfig
make
cp System.map /boot/System.map-2.6.14.3 ; ln -sf /boot/System.map-2.6.14.3 /boot/System.map
make modules_install
cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.14.3
and you're done with the kernel. Those are the ONLY
steps you need to build a 2.6.x.y kernel.

Next you'll need to edit /etc/lilo.conf and create
the new entry. Here's my example:
Code:
# Linux bootable partition config begins
image = /boot/vmlinuz-2.6.15
  root = /dev/sda6 
  label = Slackware
  read-only
image = /boot/vmlinuz
  root = /dev/sda6
  label = Slack-2.4.31
  read-only # Non-UMSDOS filesystems should be mounted read-only for checking
# Linux bootable partition config ends
Replace the location of my / (root) directory with yours.

If you need one, here are some good kernel guides:
First, Linus Torvald's instructions in ./linux-2.x.x.x/README
Second, Kwan Lowe's Kernel Build HOW-TO
(be sure to build your kernel under /home as Linus instructs)
Third, Jesper Juhl's Guide to building a 2.6 kernel
(the System.map "shell magic" is not necessary)
 
Old 01-10-2006, 05:44 PM   #5
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
I don't know if this fits your plans, but a separate /boot partition would alleviate your concerns. I have used a separate /boot partition the past three years, and I never worry about my kernels when I reinstall. Additionally, I never edit my boot loader menu options to use the soft link to vmlinuz and that helps me avoid worries about installation scripts clobbering that soft link. I've had the same /boot partition for the past three years and not once has any distro foiled my effort.
 
Old 01-10-2006, 05:49 PM   #6
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
Quote:
Originally Posted by Woodsman
I don't know if this fits your plans, but a separate /boot partition would alleviate your concerns. I have used a separate /boot partition the past three years, and I never worry about my kernels when I reinstall. Additionally, I never edit my boot loader menu options to use the soft link to vmlinuz and that helps me avoid worries about installation scripts clobbering that soft link. I've had the same /boot partition for the past three years and not once has any distro foiled my effort.
What do you do about your modules which reside in /lib/modules/${KVER}/

Last edited by Bruce Hill; 01-10-2006 at 11:14 PM.
 
Old 01-10-2006, 06:05 PM   #7
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
Quote:
What do you do about your modules which reside in /lib/modules/${KVER}/
Never use the upgradepkg tool to install new kernel packages. Skip those files during any mass updating and instead use installpkg.
 
Old 01-10-2006, 07:37 PM   #8
MMYoung
Member
 
Registered: Apr 2004
Location: Arkansas
Distribution: Ubuntu 8.10
Posts: 365

Rep: Reputation: 30
After I compile a kernel and run it for a few days to test it out I always build a package of the image in /boot and any symlinks there. Then a package of /lib/modules/kernelversion and finally a package of the source files (this one ain't completely necessary but I figure what the heck) along with any symlinks that go with it (/usr/src/linux --> /usr/src/linux-kernelversion).

Store the packages on an external drive or on a partition that I won't be formatting and then just use installpkg to put everything back in it's proper place. Best kernel backup's I ever did.

Just my $.02,
MMYoung
 
Old 01-10-2006, 07:55 PM   #9
Synt4x_3rr0r
Member
 
Registered: Nov 2005
Location: Sweden
Distribution: Arch Linux 64bit with Gnome
Posts: 138

Original Poster
Rep: Reputation: 15
Thank you for all the answers.
But I messed it up Apparently the CD i burned Slackware on didnt work, and when I realised that I had already formatted my root partion

Using Knoppix for the moment. Gonna burn a new disk tomorrow.
I tried burning it in knoppix but I can't burn files that are on my /home partion in K3b for some reason. Says that I can only burn local files :/
 
Old 01-10-2006, 11:16 PM   #10
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
Quote:
Originally Posted by Woodsman
Never use the upgradepkg tool to install new kernel packages. Skip those files during any mass updating and instead use installpkg.
I have never installed a kernel with any package tool ... nor will I.
That still doesn't explain how you tell someone who's rolled his own kernel that a separate /boot partition is going to save his modules. I don't have any modules in my /boot partition, nor have I ever.

If you'll read my post again, I didn't tell him to edit the vmlinuz symlink Pat included with Slackware, either.

Last edited by Bruce Hill; 01-10-2006 at 11:18 PM.
 
Old 01-11-2006, 11:32 AM   #11
Synt4x_3rr0r
Member
 
Registered: Nov 2005
Location: Sweden
Distribution: Arch Linux 64bit with Gnome
Posts: 138

Original Poster
Rep: Reputation: 15
I installed Slackware now. But when I didn't format the /home partion Firefox wouldn't show the pages and stuff.
KDE wouldn't start either.
Solved the Firefox problem by deleting the .mozilla folder in my /home folder. But I didn't like that at all.
The whole reason you don't format the /home partion is to keep settings and stuff. So if I'm not able to even start applications without removing the config folder, then that sucks :P

Well anyway I formatted the /home partion too and did a new attempt and now KDE works too.
Luckily I burned the .config file to a CD so i still don't have to make all those choices again.

Now I'm just wondering, can I use that .config file with any kernel? Because 2.6.14.3 isn't the newest anymore and I like the bleeding-edge.
 
Old 01-11-2006, 11:41 AM   #12
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
You can use that config file with any 2.6.x.y kernel.
Don't use a 2.6.x.y config file with a 2.4.x kernel,
or a 2.4.x config file with a 2.6.x.y kernel.

When you run "make oldconfig" it will only display
the options that are new since your 2.6.14.3 kernel.
If you have questions about those options, issue ?
and if you want it choose Y for built-in or M for
module; choose N for no I dont' want that.

I don't see why you can't open something with Firefox?
What is it that you can't open, and why not? If you
supply us with exact error messages, we might can help.

I use Firefox, and never had any problems like that.
I also use Fluxbox, not KDE, because my experiences
with KDE prove it's buggy and similar to Windows.

Also remember that "bleeding-edge" will sometimes get
you bloody. Especially with the 2.6.x.y series kernels.
They are a moving target. Read the ChangeLogs for news.
 
Old 01-11-2006, 02:11 PM   #13
Synt4x_3rr0r
Member
 
Registered: Nov 2005
Location: Sweden
Distribution: Arch Linux 64bit with Gnome
Posts: 138

Original Poster
Rep: Reputation: 15
Compiled 2.6.14.3 instead of a new one since this one works and I don't need a newer.

The Firefox thingy i had problems with, was that it couldn't display webpages nor could you open menus or press buttons.
There were no errormessages at all. Very weird anyway. =/
But thats to late now anyway.
I got the kernel working so now its just configuring left to do. Lucky me that i had burned my previous /etc folder too

Thank you for helping me.
 
Old 01-11-2006, 02:16 PM   #14
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
Do what I say, not what I do...
Keep a file with what you're doing as far as configuration.
It will come in handy in the future.
I also keep a file called "good_commands" without which,
I'd be a lost puppy...
 
Old 01-11-2006, 03:33 PM   #15
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
Quote:
That still doesn't explain how you tell someone who's rolled his own kernel that a separate /boot partition is going to save his modules.
Looking through this thread, I did not write that.

I responded that a separate /boot partition helps to automatically save the kernel. I made no mention of the modules and the OP did not ask about that in the first post. The quality of an answer usually is related to the quality of the question. Of course, people in learning mode don't know what they don't know. That's why people engage in continual dialogue to ensure they understand each other.

People who want to experiment with installing different kernels will learn with only one attempt that they need to avoid clobbering the modules directory. That's how I learned. The OP initially asked about the kernel and not the modules. My first answer was not intended to force this person to learn the hard way. I simply responded only to the immediate question and did not pause to consider additional challenges.

Quote:
If you'll read my post again, I didn't tell him to edit the vmlinuz symlink Pat included with Slackware, either.
I never wrote or implied that. I merely offered that on my box I never use the vmlinuz soft link in my GRUB menu.lst file. When I update Slack, because PV insists upon relinking that particular soft link to the new kernel, I never worry about my boot loader options getting clobbered. Never. In fact, I don't understand why anybody would run this continual risk by using that soft link.

Whenever updating I like to preserve my previous kernel for a few days until I am happy things are working sufficiently. I always like having a Plan B. I also maintain separate alternate Slack partitions (distinct from my normal and testing partitions) that I seldom update or touch---and that portal always provides me an emergency back door.

Regarding my kernel modules, after recompiling my kernel I avoid clobbering the modules in any permanent manner by creating a parallel backup directory. I learned the hard way not to use upgradepkg when updating the kernel. Never use upgradepkg to update the kernel because that process will delete the existing modules. IMO, a separate script should be used to update the kernel, which of course, does not exist in the stock Slackware distro. And that separate script should ask the user whether or not to maintain or delete the previous kernel and modules.

I also am rather particular about routinely performing system backups and for more than a dozen years I have performed full backups of my systems before attempting any major updating project. And yes, I have had to restore from those backups because I found the "latest and greatest" to be too buggy for my satisfaction.

Quote:
Solved the Firefox problem by deleting the .mozilla folder in my /home folder. But I didn't like that at all.
The whole reason you don't format the /home partion is to keep settings and stuff. So if I'm not able to even start applications without removing the config folder, then that sucks
Despite the merits of FF, this is one area where the Mozilla developers fail to understand usability. Much like the standard Microsoft response to reinstall and reboot, the standard Mozilla response is delete and create a new profile. That's just sloppy programming. And FF is hosed when the multi-user model is considered. FF is designed from a single-user perspective. Go figure.

Quote:
Well anyway I formatted the /home partion too and did a new attempt and now KDE works too.
I always make a backup of my $HOME/.kde directory before attempting any grand KDE project.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Backing up ChristineCrawford Linux - Newbie 8 12-17-2005 07:21 AM
backing up koyi Linux From Scratch 2 10-09-2004 10:54 AM
Backing up osx Linux - General 5 03-24-2003 02:09 PM
backing up ! Snake007uk Linux - General 1 07-14-2002 04:13 PM
backing up dilberim82 Linux - General 6 10-30-2001 09:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:17 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