Tài liệu LPI-201 Intermediate Level Administration

Tài liệu Tài liệu LPI-201 Intermediate Level Administration: SaigonCTT – V1.0 Lưu hành nội bộ LPI-201 Intermediate Level Administration Exam: 117-201 INDEX Chapter 1 The Linux Kernel Chapter 2 Hardware Management Chapter 3 Linux System Startup Chapter 4 Linux Filesystem Chapter 5 RAID and LVM Chapter 6 File Sharing and Services - NFS Chapter 7 File Sharing and Services - Samba Chapter 8 Recovering a Linux System Chapter 9 Part1: Regular Expression Chapter 9 Part2: Perl Language Chapter 9 Part3: System Logging Automation Chapter 10 Troubleshooting © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 1 Intermediate Level Administration – LPI 201 1 2004, SaigonCTT All rights reservedLast updated: 02 March 2004 Linux Kernel Chapter 1 © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 2 2 Last updated: 06 December 2004 Objectives • Kernel Terminology • Kernel Com...

pdf383 trang | Chia sẻ: honghanh66 | Lượt xem: 794 | Lượt tải: 0download
Bạn đang xem trước 20 trang mẫu tài liệu Tài liệu LPI-201 Intermediate Level Administration, để tải tài liệu gốc về máy bạn click vào nút DOWNLOAD ở trên
SaigonCTT – V1.0 Lưu hành nội bộ LPI-201 Intermediate Level Administration Exam: 117-201 INDEX Chapter 1 The Linux Kernel Chapter 2 Hardware Management Chapter 3 Linux System Startup Chapter 4 Linux Filesystem Chapter 5 RAID and LVM Chapter 6 File Sharing and Services - NFS Chapter 7 File Sharing and Services - Samba Chapter 8 Recovering a Linux System Chapter 9 Part1: Regular Expression Chapter 9 Part2: Perl Language Chapter 9 Part3: System Logging Automation Chapter 10 Troubleshooting © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 1 Intermediate Level Administration – LPI 201 1 2004, SaigonCTT All rights reservedLast updated: 02 March 2004 Linux Kernel Chapter 1 © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 2 2 Last updated: 06 December 2004 Objectives • Kernel Terminology • Kernel Components • Compiling a Kernel • Patching a Kernel • Customizing a Kernel _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 3 3 Last updated: 06 December 2004 Kernel Terminology • Kernel – A binary file which is created as a result of compiling the kernel sources. • Kernel sources – large collection of text files mostly written in the C programming language. • Vendor kernel – A kernel that has been patched by a vendor (i.e. Red Hat or Debian). • Patch – A set of instructions to modify a file or set of files from an old version to a new one. _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 4 4 Last updated: 06 December 2004 Kernel Components • Different types of kernel images – monolithic kernel • contains all the driver code • does not need the assistance of modules – kernel image is compressed to save space • make zImage • make bzImage _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 5 5 Last updated: 06 December 2004 Kernel Components • Identifying stable and development kernels – Kernel version are made by three basic components: • The major number • The minor number • The micro number (patch number) – There is the fourth number • Sometimes applied after a dash is generally the patch level , applied by kernel maintainers – The minor number is even = stable version – The minor number is odd = development version. Ex : 2 . 4 . 18 - 10 _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 6 6 Last updated: 06 December 2004 Kernel Modules • insmod – Install & binding a module to kernel.You can customize module loadtime parameters in /etc/modules.conf or /etc/conf.modules • rmmod – Unload a module from kernel • modinfo – Details about a module’s description • modprobe – Load a set of modules either a single module a stack of dependent modules or all modules that are marked with a specified tag ( Package : modutils ) _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 7 7 Last updated: 06 December 2004 Special Kernels • Symmetric Multi Processing kernels - smp – Support Multi Processors (>1 ) Ex: kernel-smp-2.4.21.0.1.EL.i386.rpm • Support large memory ( >4Gb) Ex: kernel-bigmem-2.4.20-31.9.i386.rpm _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 8 8 Last updated: 06 December 2004 Compiling a Kernel • Prepare software utilities • Getting the kernel sources • Creating a .config file • Compiling the kernel • Installing the new kernel • The mkinitrd command _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 9 9 Last updated: 06 December 2004 Software Utilities • make – Determines which pieces of a large program need to be recompiled and compile them. – Executes commands in Makefile (sometime named makefile) to update programs or module components • C/gcc : – C compiler integrated into gcc • binutils: – a collection of binary utilities • gas(assembler), ld(likner),nm, ranlib, objdump, _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 10 10 Last updated: 06 December 2004 Getting the Kernel sources • The latest Linux kernel sources at: _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 11 11 Last updated: 06 December 2004 The Source Tree • Kernel source released as a zipped tar file Ex: linux-2.4.29.tar.bz2 • NEVER unpack your kernel sources directly into /usr/src/linux # tar xjvf linux-2.4.29.tar.bz2 –C /usr/src/ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 12 12 Last updated: 06 December 2004 The Source Tree • Subdirectories in the source tree : /usr/src/linux/ • This is the structure that most kernel sources will follow. ipc kernel lib mm net scripts arch crypto Documentation drivers fs include init _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 13 13 Last updated: 06 December 2004 Creating a .config file • Create new .config file – make config or – make menuconfig or – make xconfig • Create from exists .config file – Copy exists .config file to /usr/src/linux/ – make oldconfig or – make menuconfig with load exists config file. • The results of all of these choices are stored in: /usr/src/linux/.config _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 14 14 Last updated: 06 December 2004 Creating a .config file • Verify : allow load modules # cat .config | grep -i module # Loadable module support CONFIG_MODULES=y • Verify : support ext3 # cat .config | grep -i ext3 CONFIG_EXT3_FS=m CONFIG_EXT3_INDEX=y CONFIG_EXT3_FS_XATTR=y CONFIG_EXT3_FS_XATTR_SHARING=y CONFIG_EXT3_FS_XATTR_USER=y CONFIG_EXT3_FS_POSIX_ACL=y _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 15 15 Last updated: 06 December 2004 make menuconfig Interface _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 16 16 Last updated: 06 December 2004 make xconfig Interface _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 17 17 Last updated: 06 December 2004 Compiling the Kernel ƒ make dep – Source files are examined for dependencies – The resulting table is stored in .depend file. – The .depend files are automatically included in make. • make clean – Removes old output files that may exist from previous kernel builds. • make bzImage and make zImage – Our ultimate goal is a bootable kernel image file. _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 18 18 Last updated: 06 December 2004 Compiling the Kernel (cont.) • make modules – Device drivers and other items that were configured as modules are compiled. • make modules_install – All of the modules compiled are installed under /lib/modules/kernel-version _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 19 19 Last updated: 06 December 2004 Installing the new kernel ƒ *Copy new kernel to /boot cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.29 ƒ Copy Sytem.map to /boot cp Sytem.map /boot/System.map-2.4.29 ƒ Copy .config to /boot cp .config /boot/config-2.4.29 _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 20 20 Last updated: 06 December 2004 The mkinitrd command • Adds the capability to load a RAM disk by the boot loader. • Mainly designed system startup to occur in two phases: – the kernel comes up with a minimum set of compiled-in drivers – additional modules are loaded from initrd • mkinitrd /boot/initrd-2.4.29.img 2.4.29 _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 21 21 Last updated: 06 December 2004 Edit boot loader – lilo ƒ Add new entry to /etc/lilo.conf timeout=50 default=linux boot=/dev/hda . image=/boot/vmlinuz-2.4.29 label=linux initrd=/boot/initrd-2.4.29.img read-only append="hdc=ide-scsi root=LABEL=/" ƒ Execute /sbin/lilo -v _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 22 22 Last updated: 06 December 2004 Edit boot loader – grub ƒ Add new entry to /etc/grub.conf default=15 timeout=10 splashimage=(hd0,0)/grub/splash.xpm.gz . title Red Hat Linux (2.4.9) root (hd0,0) kernel /vmlinuz-2.4.9 ro root=LABEL=/ hdc=ide-scsi initrd /initrd-2.4.9.img _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 23 23 Last updated: 06 December 2004 Patching a Kernel • A patch file is editing instructions to change one set of files into new version of the files Ex: patch-2.4.29.bz2 • Steps to patch : # ln –s /usr/src/linux-2.4.29 /usr/src/linux # cp patch-2.4.29.bz2 /usr/src/linux # cd /usr/src/linux # bzcat patch-2.4.29.bz2 | patch –p1 _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 24 24 Last updated: 06 December 2004 Patching a Kernel • Testing the Patch only, before applying patch –p1 -–dry-run < patchfile • Keep original files patch –b –p1 < patchfile • Keep original files to backup-directory patch –B backup-dir –p1 < patchfile _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 25 25 Last updated: 06 December 2004 Remove patch from Kernel • A kernel patch can be removed from a kernel: – removing it from the production kernel source tree – compiling a new kernel. • Try to apply the patch a second time for remove # bzcat patch-2.4.29.bz2 | patch –p1 • Find any patch files failed: find . -name '*.rej' _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 26 26 Last updated: 06 December 2004 Remove patch from Kernel • A kernel patch can be removed from a kernel: – removing it from the production kernel source tree – compiling a new kernel. • Try to apply the patch a second time for remove # bzcat patch-2.4.29.bz2 | patch –p1 _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 27 27 Last updated: 06 December 2004 Edit Kernel version • Kernel version is defined Makefile file # cd /usr/src/linux # vi Makefile VERSION = 2 PATCHLEVEL = 4 SUBLEVEL = 29 EXTRAVERSION = KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 28 28 Last updated: 06 December 2004 kmod versus kerneld • kmod and kerneld make dynamic loading of kernel-modules. • use modprobe to manage dependencies and dynamic loading of modules • kerneld is a daemon • kmod is a thread in the kernel itself. • kerneld is done through System V IPC. • kmod operates directly from the kernel • kmod replaces kerneld as of Linux kernel 2.2.x. # cat .config | grep -i kmod CONFIG_KMOD=y _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 29 29 Last updated: 06 December 2004 Summary • Kernel Terminology • Kernel Components • Compiling a Kernel • Patching a Kernel • Customizing a Kernel _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – The Linux Kernel> - 30 30 Last updated: 06 December 2004 Question & Answer _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – Hardware Management Chapter 2 - 1 Intermediate Level Administration – LPI 201 1 2004, SaigonCTT All rights reservedLast updated: 02 March 2004 Hardware Management Chapter 2 © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – Hardware Management Chapter 2 - 2 2 Last updated: 06 December 2004 Objectives • Adding New Hardware • Software And Kernel Configuration • Configuring PCMCIA Devices _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – Hardware Management Chapter 2 - 3 3 Last updated: 06 December 2004 Adding New Hardware • Bus structures • USB devices • Configuring disks • Serial devices • Configuring output devices _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – Hardware Management Chapter 2 - 4 4 Last updated: 06 December 2004 The main PC bus-systems • ISA – 16 or 8bit, cheap, slow (usually 8MHz), standard, many cards available, but not many new motherboards are shipped with ISA anymore; • EISA – 32bit, expensive, fast, few cards available, but almost obsolete. • MCA – 32 or 16bit ex-IBM-proprietary, fast, obsolete/rare. • VESA-Local-Bus – 32bit, based on 486 architecture, cheap, fast, many cards available, obsolete. • PCI-Local-Bus – 32bit (64 bit coming), cheap, fast, many cards available, the de facto standard _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – Hardware Management Chapter 2 - 5 5 Last updated: 06 December 2004 USB devices • usbview – find out which USB devices are currently connected. – provides a graphical display. – depends on X and the GTK toolkit. – not always available on all USB aware distributions. – _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – Hardware Management Chapter 2 - 6 6 Last updated: 06 December 2004 USB devices • The USB-device filesystem is a dynamically generated filesystem. – To mount it “by hand”: # mount -t usbdevfs none /proc/bus/usb # ls -l /proc/bus/usb dr-xr-xr-x 1 root root 0 Mar 10 09:42 001 dr-xr-xr-x 1 root root 0 Mar 10 09:42 002 dr-xr-xr-x 1 root root 0 Mar 10 09:42 003 dr-xr-xr-x 1 root root 0 Mar 10 09:42 004 -r--r--r-- 1 root root 0 Mar 10 09:42 devices -r--r--r-- 1 root root 0 Mar 10 09:42 drivers _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – Hardware Management Chapter 2 - 7 7 Last updated: 06 December 2004 USB devices • USB was supported in Kernel 2.2.7 but was not incorporated until the 2.4 kernel ehci-hdc.oEHCI (USB v2.0) usb-uhci.oUHCI (Intel) usb-ohci.oOHCI (Compaq) Kernel ModuleHost controler _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – Hardware Management Chapter 2 - 8 8 Last updated: 06 December 2004 mount & umount USB disk • Mount USB disk (with windows format ) # mkdir /usbdisk # mount –t vfat /dev/sda /usbdisk – If you have more USB devices on system, replace /dev/sda with /dev/sda1|2|3... • Unmount # umount /usbdisk _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – Hardware Management Chapter 2 - 9 9 Last updated: 06 December 2004 Hard Drivers Add a hard driver • 1. Write down the new drive’s specifications • 2. Configure the new drive appropriately for your bus – Setting jumper on the driver for Master, Slave. • 3. Install new driver – Ensuring that all data and power cables are attached • 4. Configure your BIOS • 5. Boot the Operating Sytem _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – Hardware Management Chapter 2 - 10 10 Last updated: 06 December 2004 Hard Drivers • 6. Create one or more partitions on hard disk. # fdisk /dev/hdb • 7. Format filesystems # mkfs – t ext3 –j /dev/hdb1 • 8. Create mount point # mkdir /mnt/newdisk _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – Hardware Management Chapter 2 - 11 11 Last updated: 06 December 2004 Hard Drivers • 9. Mount the driver # mount –t ext3 /dev/hdb1 /mnt/newdisk • 10. Test the new driver • 11. update /etc/fstab /dev/hdb1 /mnt/newdisk ext3 defaults 1 1 _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – Hardware Management Chapter 2 - 12 12 Last updated: 06 December 2004 Serial devices 0x3f8/dev/ttyS04COM1 0x2f8/dev/ttyS13COM2 0x3e8/dev/ttyS24COM3 0x2e8/dev/ttyS33COM4 I/OLinuxIRQDOS • COM ports are also known as serial ports. • COM ports 1-4 are initialized using default I/O ports and IRQ values _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – Hardware Management Chapter 2 - 13 13 Last updated: 06 December 2004 Printer Ports (LPT) ƒ Most PCs have one physical printer port ƒ The second can be set up, if needed. I/OLinuxIRQDOS 0x278/dev/lp15LPT2 0x378/dev/lp07LPT1 _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – Hardware Management Chapter 2 - 14 14 Last updated: 06 December 2004 Serial devices # cat /proc/interrupts CPU0 0: 973258 XT-PIC timer 1: 48 XT-PIC keyboard 2: 0 XT-PIC cascade 5: 0 XT-PIC usb-uhci 8: 1 XT-PIC rtc 9: 5436 XT-PIC usb-uhci, eth0 10: 0 XT-PIC ehci-hcd 11: 0 XT-PIC usb-uhci 12: 323 XT-PIC PS/2 Mouse 15: 4342 XT-PIC ide1 _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – Hardware Management Chapter 2 - 15 15 Last updated: 06 December 2004 Serial devices • Configuring serial devices setserial device [parameters] where: – port [portnumber]: Specify the I/O port address, e.g. 0x2f8 – irq [irqnum]: specify which IRQ line the serial device is using – uart [type]: specify the UART type, e.g. 16550, 16450 or none – autoirq: specify that the kernel should try to figure out the IRQ itself – skip_test: specify that the kernel should skip to test the UART type – autoconfig: the kernel automatically determine the UART type. _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – Hardware Management Chapter 2 - 16 16 Last updated: 06 December 2004 Teminal connection • Check system serial ports # dmesg | grep tty ttyS0 at 0x03f8 (irq = 4) is a 16550A # setserial -g /dev/ttyS[0-3] /dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4 /dev/ttyS1, UART: unknown, Port: 0x02f8, IRQ: 3 /dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4 /dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3 _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – Hardware Management Chapter 2 - 17 17 Last updated: 06 December 2004 Teminal connection • Configure your inittab to support serial console logins – Modify /etc/inittab, add line # Run agetty on COM1/ttyS0 and COM2/ttyS1 s0:2345:respawn:/sbin/agetty -L -f /etc/issueserial 9600 ttyS0 vt100 Where: -L : force line to be local line with no need for detect (do not have modem) -f : alternative /etc/issue file. This is what a user sees at the login prompt. -i : do not display any messages at the login prompt. 9600 : serial line rate in bps. ttyS0 : this is the serial port identifier. vt100 : is the terminal emulation. _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – Hardware Management Chapter 2 - 18 18 Last updated: 06 December 2004 Teminal connection • stty – Handle the configuration of the serial port. – Replaced by agetty. where: -a or --all print all current setting in human-readable -F device or --file=device set the line opened by the filename specified in device -g or --save print all current setting in form that can be used for another STTY commands. _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – Hardware Management Chapter 2 - 19 19 Last updated: 06 December 2004 Kernel Utilities • lsmod – List current loaded modules by scnning /proc/modules # lsmod Module Size Used by Not tainted autofs 13348 0 (autoclean) (unused) 8139too 17704 1 mii 2156 0 [8139too] mousedev 5524 0 (unused) keybdev 2976 0 (unused) hid 22244 0 (unused) input 5888 0 [mousedev keybdev hid] ehci-hcd 17480 0 (unused) . _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – Hardware Management Chapter 2 - 20 20 Last updated: 06 December 2004 Kernel Utilities • modinfo : Display information about the kernel module. options: -a, --author -d, --description -l, --license -n, --filename -p, --parameters # modinfo usbcore filename: /lib/modules/2.4.29/kernel/drivers/usb/usbcore.o description: author: license: "GPL" _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – Hardware Management Chapter 2 - 21 21 Last updated: 06 December 2004 Kernel Utilities • insmod : install module to running kernel. options: -f, --force -k, --autoclean -L, --lock : prevent load the same module. -n, --noload : do everything, except load -o modulename : explicitly name the module -p, --probe -s, --syslog : output to syslog instead of the terminal _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – Hardware Management Chapter 2 - 22 22 Last updated: 06 December 2004 Kernel Utilities • modprobe : load a modules stack and its dependencies options: -a, --all -c, --showconfig -d, --debug -k, --autoclean -l, --list : list matching modules -r, --remove : do autoclean -t moduletype _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – Hardware Management Chapter 2 - 23 23 Last updated: 06 December 2004 Kernel Utilities • rmmod : unload module from running kernel options: -a, --all : autoclean -r, --stacks -s, --syslog _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – Hardware Management Chapter 2 - 24 24 Last updated: 06 December 2004 Kernel Utilities • /etc/modules.conf: controls the modprobe # cat /etc/modules.conf alias parport_lowlevel parport_pc alias eth0 8139too alias usb-controller ehci-hcd alias sound-slot-0 i810_audio ...... _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – Hardware Management Chapter 2 - 25 25 Last updated: 06 December 2004 Hardware utilities • lsdev – part of the procinfo tool suite – list infomation on the hardware installed on the machine – scans from files: /proc/interrupts /proc/dma /proc/ioports _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ _________________________________________________________________________ © Summer 2004, The Saigon Center of Techniques and Technology LPI 201 – Intermediate Level Administration – Hardware Management Chapter 2 - 26 26 Last updated: 06 December 2004 Querying your PCI bus • /sbin/lspci – reads the /proc/bus/pci interface – PCI ID database (e.g. /usr/share/pci.ids) is used to translate PCI vendor and device codes to readable strings. options -n : shows PCI vend

Các file đính kèm theo tài liệu này:

  • pdflpi_201_study_guide_8347.pdf
Tài liệu liên quan