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 - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 04-18-2006, 10:43 AM   #1
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,691
Blog Entries: 4

Rep: Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947
Lightbulb TechTips: Advice for managing the kernel


"The kernel! How can I possibly manage that? It is the abode of wizards! It is beyond mortal understanding!"

Well, maybe not. But sometimes it does feel that way.

Here are a few tips for understanding the kernel, for managing changes to it, and for, well, feeling comfortable about the whole process...

The kernel is ... a program: It's a memory-resident program, loaded into your computer's memory at startup by the "boot loader" (Grub or LILO), where it (or most of it) remains for as long as the computer runs. Its purpose, basically, is device-control. Open up the computer's box and look inside. Look at everything that's attached to it by a wire, wireless or Bluetooth. Whatever you can look at or touch, the kernel either controls it outright or brokers all requests that are passing to it and from it. The kernel is actually a comparatively small beast.

The kernel is ... modular: Since the kernel has to control all of the hardware, there are endless possibilities about the hardware it might be called-upon to control. That would get very tricky, so the kernel is built with an "always memory-resident no matter what" part and a whole bunch of "modular" parts that can be loaded, and unloaded, on-demand. When you configure your Linux for your hardware, or it configures itself, it's basically choosing modules.

The kernel lives in the /boot folder: It lives in specially formatted files that the boot loader (Grub, LILO) must know how to find. When the system boots, the BIOS has to be able to find the boot-loader, and the boot-loader has to know how to find Linux and which version of the kernel you want to load. (You can have several different kernel-image files in /boot. When something goes wrong, your first fallback position is to reboot from the previous one.)

You need to always have a bootable CD-ROM (a "LiveCD"): That's your secret weapon. It's a complete copy of Linux that can be booted entirely from a CD-ROM. The "install disk #1" of your distro can probably serve this purpose. Even if the Linux you have can't get off the ground, you can boot the LiveCD and fix things. Pick a time when the system is working just fine, shut it down, boot a LiveCD, and play with it so that you'll know how to use it before you need to use it.

iPods, or portable USB disk-drives, are your best friends: Lots of capacity, and, if your computer supports FireWire or USB 2.0, almost as fast as a built-in drive. Make a folder with today's date, and in it put a copy of /boot, /etc, /lib, /bin/, /sbin/, /usr/src. Use it for ordinary backups, too. Some machines can boot from USB devices. The drives fit easily into the safe-deposit box that you can rent at the local bank .. you know, the one next to the Starbuck's store that you frequent on the way in to work, or that you pass going home.

Preparedness is the key: Be Prepared.{tm} Given that you know that from time to time the ka-ka will encounter the air-movement device ... prepare for it. Experiment with these things -- they won't bite! -- before you need them.

Be willing to experiment, ahead of time: Like I said, "it won't bite." It's really not that mysterious. If you have a spare machine somewhere, so much the better, but even if you don't ... the experience is priceless.

Finally, always have an "out": If what you are trying to do now, doesn't work for whatever reason (did you know your poodle thinks that power-cords taste like chicken?), "what is your 'out?'" What is your recovery-strategy going to be, first, then next, then next? Great. Why not practice it, dry-run ahead of time? You'll need to know what (various) things you can do, first to get the system operable again, then to either complete the change or back it out. Got that freshly-made backup copy finished on the USB drive? Great! Know how to plug it in and boot from it, or how to access it with only a LiveCD? Where is that LiveCD, by the way? It's not scratched, and the CD-ROM drive is in good working order? You checked that? Great! Make a checklist, keep a journal. All of my machines have a plastic envelope taped to the side, with a little notebook inside and a pencil.
 
Old 04-18-2006, 12:44 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
this sort of thing is much better suited as a linuxAnswer or somehwere in our wiki.
 
Old 04-18-2006, 02:09 PM   #3
mimithebrain
Member
 
Registered: Nov 2003
Location: ~
Distribution: Ubuntu 10.04
Posts: 843
Blog Entries: 1

Rep: Reputation: 30
Useful post for the kernel newbies. They will end up learning that anyway, but sooner the better.

I don't keep a copy of /usr (waaay too big), I keep a copy of /home tho...
 
Old 04-18-2006, 08:33 PM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,691

Original Poster
Blog Entries: 4

Rep: Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947
Yeah, I thought it might be seen sooner here...
 
Old 04-19-2006, 01:16 AM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
yeah, sooner, but not for nearly as long. good advice sadly often sinks without trace here, but the info you've provided is good, and deserves to be kept around.
 
  


Reply

Tags
faq, info, kernel



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
kernel advice? linux-idiot Linux - Newbie 4 03-23-2006 07:40 PM
Advice on using very latest kernel with Suse 9.1 rollo SUSE / openSUSE 9 07-19-2005 11:58 AM
Upgrade kernel - advice? bruno buys Debian 10 09-24-2004 04:21 PM
Advice and help updating kernel on Suse 9.1 TheDirtyPenguin Linux - Distributions 1 08-05-2004 09:59 PM
Updating RH 7.2 kernel, need advice Rampage2884 Linux - General 9 04-07-2002 10:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

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