LPIC-201ExamTopics

Exam Topics

test center germany: Test Center: FH Aachen Address: Herr Hoefken FB Elektrotechnik und Informatik Eupenerstrasse 70 Aachen, 52066 Germany Map MapQuest directions are sometimes inaccurate. Be sure to read the test center directions below. Telephone: +49241600952169 Directions: Fachhochschule Aachen Fachbereich Elektrotechnik und Informatik

Eupener Straße 70 52066 Aachen

Anfahrt von der Autobahn:

Aus Richtung Niederlande, Duesseldorf Koeln kommend Autobahnkreuz Aachen Richtung Belgien A 44 bis zur Abfahrt Lichtenbusch (letzte Abfahrt vor der Grenze nach Belgien) rechts abbiegen

Aus Richtung Belgien von der A 44 kommend Abfahrt Lichtenbusch (erste Abfahrt nach der Grenze) links abbiegen auf die Monschauer Straße dieser folgend bis zur Kreuzung Adenauerallee/Robert Schumann Str./Siegelallee; von hieraus links abbiegen in die Siegelallee, an der naechsten Ampel halbrechts abbiegen in die Salierallee, an der naechsten großen Kreuzung (Weißhausstraße/Eupener Straße) vor der Ampel halbrechts abbiegen in die Eupener Straße, nach etwa 200 Metern liegt das Gebaeude links hinter einem Zufahrtstor in einer Grünanlage(Hausnr.70).

25 Linux Kernel

Objective 1:Kernel Components

 2.7 would mean unstable but this enumeration is not longer meaningful because nowadays the last number counts such as 2.6.14

After a kernel is built and the modules installed in their directory hierarchy at /lib/modules, their interdependencies are found with dhe depmod command, an example of which is:

 depmod -ae -F /boot/System.map-2.4.18 2.4.18

objective 2:Compiling a kernel

 make config
 make menuconfig
 make xconfig
 make clean
 make dep (only for 2.4)
 make bzImage or make zImage
 cp arch/i386/boo/bzImage /boot/vmlinuz
 cp System.map  /boot/System.map-2.4.18
enables such things as module loading and the symbolic display of kernel routines by the 'top' program.
 make modules
 make modules_install
 mkinitrd -o /boo/initrd.img 2.4.18
 vim /etc/lilo.conf or /boot/grub/menu.lst

To be able to use an initrd image on Debian, you need support for cramfs (Compressed ROM filesystem) in your kernel.

objective 3: Patching a kernel

You want to upgrade kernel from 2.4.23 to 2.4.24. Load patch to /usr/usrc/patch-2.4.24.bz2.

 cp -a linux-2.4.23 linux-2.4.24-PATCH
 diff -urN linux-2.4.23/Makefile linux-2.4.24/Makefile
 cd linux-2.4.24-PATCH
 bzip -ds ../patch-2.4.24.bz2 | patch -p1
with -p1 option removes one level of path from the front of the filenames in the patch.
 make oldconfig

Removing a patch:

 bzip2 -dc ../patch-2.4.24.bz2 | patch -p1 -R

objective 4: customizing a kernel

 cd /usr/src/linux
 zcat ea-"version".diff.gz | patch -p1
 zcat acl-"version".diff.gz | patch -p1

26 system startup

objective 1: Customizing System Startup and Boot Processes

When the kernel has mounted the root filesystem, it executes /bin/init. This program's first task is to read /etc/inittab, which defines everything done thereafter.

/etc/inittab

This file describes what processes are started at boot time and during normal operation.

 # Run gettys in standard runlevels
 1:2345:respawn:/sbin/mingetty tty1
 2:2345:respawn:/sbin/mingetty tty2

System Initialization Scripts

lies in /etc/init.d directory. The scripts in there will be started from /etc/rc[0-6].d. From there an initial S indicates that the service is to be started. A K indicates that it should be stopped.

On Debian and many others you can use 'update-rc.d' for creating automatically start and stop links under rcX.d directory. Under Redhat the command is chkconfig: Redhat:

 chkconfig --add servicename
 chkconfig servicename off

Debian:

 update-rc.d servicename defaults 23
creates K23servicename and S23servicename
 update-rc.d servicestart 99 2 3 4 5 . stop 11 2 3 4 5
creates S99service and K11 in rc[2345].d

Objective 2:System Recovery

Chapter 27 - Filesystem

nothing new

Chapter 28 - Hardware

Objective 1: Configuring RAID

create a RAID0 cluster for speedup the disk operations

For partition work one can use the classcic fdisk tool or the newer tool cfdisk which is more like the msdos tool from ealier days.

 mdadm --create --verbose /dev/md0 --level=0
      --raid-devices=2  /dev/sdb1 /dev/sdc1
 echo "DEVICE  /dev/sdb1 /dev/sdc1" >> /etc/mdadm.conf
 mdadm --detail --scan >> /etc/mdadm.conf
 mkfs.ext3 /dev/md0

 mdadm -S /dev/md0
stops running array

mount an existing array on /dev/md0

 #mdadm --detail /dev/md0
 mdadm: md device /dev/md0 does not appear to be active.
 # cat /proc/mdstat
 Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
 md0 : inactive sda1[0](S) sdd1[2](S) sdc1[1](S)
      1465151808 blocks

 # cat /etc/mdadm/mdadm.conf
 DEVICE /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1
 ARRAY /dev/md0 level=raid10 num-devices=4 UUID=4711471147114711

 #mdadm -As /dev/md0
 mdadm: /dev/md0 has been started with 4 drives.

Removing and readding a device that cannot assembled

#mdadm -As /dev/md1 
mdadm: /dev/md1 has been started with 1 drive (out of 2).
#mdadm /dev/md1 --fail /dev/sdg1
#mdadm /dev/md1 --remove /dev/sdg1
#mdadm /dev/md1 --add /dev/sdg1
#mdadm -D /dev/md1 
...
active sync        /dev/sdf1
spare rebuilding   /dev/sdg1
...
Error Message 'mdadm: /dev/md0 has been started with 3 drives (out of 4)'

Try this

 mdadm --query --detail /dev/md0
 mdadm /dev/md0 --re-add /dev/sdd1 

create a RAID10 cluster which is a RAID0 over two RAID1 cluster with 4 drives

 aptitude install mdadm xfsprogs
 mdadm -v --create /dev/md0 --level=raid10 --raid-devices=4 /dev/sda2 /dev/sdb1 /dev/sdc1 /dev/sdd1
 mkfs.xfs /dev/md0
 mount /dev/md0 /mnt/tmp
 echo "DEVICE  /dev/sda2 /dev/sdb1 /dev/sdc1 /dev/sdd1" >> /etc/mdadm.conf
 mdadm --detail --scan >> /etc/mdadm.conf

 raiddev /dev/md0
    raid-level 1
    nr-raid-disks 2
    nr-spare-disks 0
    persistent-superblock 1 device /dev/sdb1
    raid-disk 0
    device /dev/sdb2
    raid-disk 1

objective 2: adding new hardware

objective 3: software and kernel configuration

 hdparm /dev/hda
 hdparm -i /dev/hda
 tune2fs -i 0 -c 0 /dev/sda7
turns off the maximum mount count and check interval tests on /dev/sda7

Logical Volume Manager (LVM)

starting stopping lvm

snapshots

sysctl

displays and changes kernel parameters.

objective 4:configuring PCMCIA devices

chapter 30: file services

objective 1: configuring a samba server

List of important files:

 [global]
   workgroup = WORKGROUP
...

Login Settings

 net use h: /home
 net use p: \\server\public

Shares

 [public]
  comment = Public Stuff
  path = /home/samba
  public = yes
  read only=yes
  write list = @staff

 #nmblookup client1
 #smbmount //server1/public /mnt/public -o username=adamh,password=mypassword

objective 2: configuring an NFS server

Miscellneous

 egrep -i '(warning|error)' /var/log/messages
shows only lines with warning or error patterns in it
 grep -v Raw_Read_Error_Rate
negative grep search which gives all except the given pattern.
 /usr/sbin/sendmail -t <<EOM
 To: asdf@nowhere.no
 Subject: this is a test

 email body content
 Regards,
  test process
 .
 EOM

Creating booting cdrom

You need to use the file named 'stage2_eltorito' which lies at /usr/lib/grub/i386-pc/stage2_eltorito in a ubuntu installation.

 mkdir -p mydisk/boot/grub
 cp /usr/lib/grub/i386-pc/stage2_eltorito ~/mydisk/boot/grub/
 mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o grub.iso mydisk
the last command creates a rock ridge protocol file

The grub.iso file you can burn with any application you want.

Flushing all data and writing data to hard disk

by executing command:

 sync

To verify the speed of a usb connected cd-rom drive

 sysctl -a

To specify the number how many times the drive has been mounted

 tune2fs -C 3

To specify the serial port

 setserial