punkwalrus (punkwalrus) wrote,
punkwalrus
punkwalrus

LPI 102 Exam notes: 23 days until the exam

Since I goof off and LJ so much, I have decided to hijack the process and write my study notes and thoughts. But they are probably totally boring for those not interested in Linux. These notes may be very long and disjointed, so... I put them...

For those interested, think there needs to be corrections, have neat trivia, or have some things to say: COMMENTS ARE ENCOURAGED!!!
___________
I scheduled my next LPI exam for the 26th. After I pass this exam, I will be LPI Level 1 certified, which I think means I get +1 against saving throws, more Magic Missiles, and the spell Tenser's Floating Disk.

I looked over what was going to be my tasks for the next part of the exam a few days ago. Holy cow, ran right into rebuilding the kernel from the start! In all honesty, this is not hard, I have done it many times before.

THANK YOU, GENTOO!

Again, Gentoo and LFS have proven their worth beyond a kind of "gee whiz" nerd factor in my life. Add to that: basic networking stuff, crontab mojo, printing, booting, Apache, NFS, DNS, SSH, and some base issues with Linux security. That's pretty intense. In fact, a lot of this stuff is intense for someone who decided to take the test fresh off the turnip truck. I only have confidence I can study because I have been doing this for so long.

I have taken a practice exam, and scored a 60.61% (again, 70% or higher is passing), which is a good baseline from nothing, I think! I know about half this stuff already, but I still have to make sure I know all the facets. This will be harder than the previous exam.

Am I nervous already? Yeah. But I felt so good passing this one time, I want to feel that way again. And this time, it will be a full certification I can put on resumes (right now I can only say, "working to my LPI Level 1").

Some nifty stuff about the Linux Kernel
The kernel is the core software that manages hardware, like CPU, memory, peripherals, and process scheduling. It is the interface for programs to to indirectly access the hardware. This is why it's so stable most of the time and allows the system to be a true multiuser system. The software can crash, but the kernel will still keep going. Of course, if you have no way to interface the kernel, you're still up shit pulsar without a gravity generator. Sometimes this happens, but it's rare.

Windows has kernel32, but it doesn't have such a hard line between the hardware and the user, which is why it crashes more. But this does make it faster for intensive processes, like having a GUI. Sadly, what it gains in that way, it often loses again when it comes to the "monolithic" structure. Windows has to assume that you could be running any hardware at any time.

Linux can also be "monolithic," but unlike Windows, it doesn't have to be. Being monolithic is a safe "default" if Linux doesn't know what hardware will be set up on the system. A lot of "EZ-U-Install" kernels are like this, from Red Hat to Ubuntu. BUT... suppose you want to trim down the kernel for speed and resources. This is the true strength behind Linux, and is why it can be run on so many types of machines: you can run it modular. Being modular means you don't run anything you don't need, and it becomes very, very flexible.

Linux modular files are "objects," which is why the modules end with ".o" (apparently ".ko" in 2.6 kernels) and are compiled, but not necessarily linked unless you specify it to be. Most modules are distributed with the kernel and compiled along with it. But they are very closely related, so each kernel has its separate set of modules to prevent module-A from screwing up kernel-B.

Modules are stores in /lib/modules/$kernel.version, where $kernel.version would be something you can get from a "uname -r" command, like 2.6.8-10. Then it is further divided into sub directories. Here's an example from my home box:

[punkie@pippi ~]$ ls -l /lib/modules/2.6.18-92.1.6.el5.centos.plus/kernel/
total 28
drwxr-xr-x 3 root root 4096 Jul 1 10:02 arch
drwxr-xr-x 2 root root 4096 Jul 1 10:02 crypto
drwxr-xr-x 38 root root 4096 Jul 1 10:02 drivers
drwxr-xr-x 34 root root 4096 Jul 1 10:02 fs
drwxr-xr-x 4 root root 4096 Jul 1 10:02 lib
drwxr-xr-x 24 root root 4096 Jul 1 10:02 net
drwxr-xr-x 9 root root 4096 Jul 1 10:02 sound


lsmod will list what modules are loaded (same with cat /proc/modules) in the order of module, size, use count, and what is using it.

insmod will "insert" a module into the running kernel. If it hasn't been loaded, it will be now. Just make sure you have it. Sometimes, you have to insert a supporting module before you can insert the module you want.

rmmod removes the module. Again, make sure there's nothing dependent on it.

modinfo will tell you about the module. Options to remember are -a for author, -d for description, and -p for parameters.

modpropbe is like insmod on steroids. It's a wrapper around insmod, but will load all the prerequisite modules as well. In addition, it has a lot more fun options:

-a will load all modules, and when used with -t, will load all modules of one type
-c displays a complete module configuration, including stuff from modules.conf
-l lists modules, can be combined with -t
-r remove modules (on steroids)
-s send to syslog instead of STOUT
-t with listed module type will load all modules in that directory until a match is found, or it runs out of modules to try. This is useful for probing hardware.
-v verbose mode

The LPI stuff I have lists lines for /etc/modules.conf, but most of my systems have /etc/modprobe.conf or /etc/modprobe.d/[conf files]. This may be CentOS specific, or maybe kernel 2.4 specific. It seems to be modeules.conf on my Red Hat boxes with 2.45 at work, so I am going to go with 2.4 specific.

I need to learn what all those lines mean.

/lib/modules/$kernel.verson/modules.dep shows the dependencies that need to be automatically loaded. Having a bad one, or an outdated one, is a very bad thing.

The next entry, we'll show you HOW to compile a Linux kernel. If you already know how to do this, I'd suggest you tell everyone in your company what a PITA this is, how ong it takes, demand an electric slide rule, and a pony. If you don't know how to do this, don't worry, it's a lot simpler than it sounds.

AS LONG AS YOU DON'T SCREW UP!!!

Just kidding.

OR AM I????

__________
Disclaimer: While I have been managing Linux systems for almost 10 years now, but I am mostly self-taught. I have a RHCT certification, but I am taking the LPI and CompTIA Linux+ exams to "flesh out" some of the gaps that occur from too much real-world experience versus my lack of good old fashioned book learnin'. This entry in no way assures you my thoughts are correct, I will have frequent misspellings, and they may or may not help you pass the LPI. HUGE parts of the exam will be missing because I already know half of it by heart, so using me as your only study guide is a terrible idea. Please read this entry with a healthy amount of skepticim, and PLEASE feel free to correct or add comments! My ego is hardy enough to admit when I am wrong.
Tags: linux, lpi
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 1 comment