Outils pour utilisateurs

Outils du site


Panneau latéral

2012.11.30 Séance 2

  • Présentation sur les sujet 101.1 + 101.2

Topic 101: System Architecture

Hardware setting

  • HAL (Hardware Abstraction Layer)
  • dbus (message bus system, allows application to talk to one another)
  • udev (device manager for the Linux kernel, generate /dev/)

Conceptual understanding needed for LPIC

Folders

Dynamically generated at startup.

running process appear as folder in /proc/

Exemples

  • Running process appear as folder in /proc/??? (??? = process number)
  • information about the processor: /proc/cpuinfo
  • how long the system has been running /proc/uptime
  • Version of the kernel in /proc/version
  • Info about swap /proc/swaps
  • List of module with additional info /proc/modules
  • /proc/interrupts list interrupts (first column is IRQ)
  • /dev/tty* terminal of the current process
  • /dev/ttyS0 usually a serial port
  • /dev/sda First s-ata device
  • /dev/sda1 First partition of first s-ata device
  • /dev/hda First p-ata device
  • /dev/hdb3 3rd partition on second p-ata device
  • /dev/null (“black hole”)
  • /dev/random and * /dev/urandom random number generator wikipedia

special "files"

/dev$ ls -hal
(...)
crw-rw----   1 root dialout     4,  89 Dec  2 19:51 ttyS25
brw-rw---- 1 root disk 8, 0 Dec  2 19:51 sda
brw-rw----   1 root disk        1,  14 Dec  2 19:51 ram14
(...)
  • p FIFO
  • b block (buffered) special file
  • c character (buffered) special file
  • u Character (unbuffered) special file

(source)

Kernel module

Commands:

  • insmod (takes absolute path to module)
  • modprobe (takes the name of the module, dependencies-aware)
  • rmmod (remove kernel module)
  • lsmod (list all kernel module loaded)
  • modinfo (display information about a module)

command to list hardware

  • lsusb list usb devices
  • lspci list pci devices
  • lshw list detailed info about hardware

101.1 Determine and configure hardware settings

101.2 Boot the system

1. Boot sequence

  1. BIOS - Basic Input Output System
  2. Booloader
  3. OS (Kernel)

Note: The boot order (ressource the computer will boot on) is definted in the BIOS.

Bootloader

GRUB = GNU GRand Unified Bootloader ( https://en.wikipedia.org/wiki/GNU_GRUB ) LILO = LInux LOder ( https://en.wikipedia.org/wiki/LILO_%28boot_loader%29 )

GRUB
  • GRUB legacy: version 0.97
  • GRUB2: 1.98 or later

Both are now covered in LPIC1 ! GRUB Legacy and GRUB2 use different configuration file.

GRUB is typically installed on a harddrive (but can also be on CR-ROM, USB, network drive).

  • Can load unlimited number of Harddrive
  • Can boot from network drive
  • Command line interface

GRUB display list of OS. Including sometimes more than one kernel version. It can include additional entries (recovery mode, memory test…)

To determine Grub version: $ grub-install -v

How to access GRUB?: Hold shift key on startup or ESC at timer

LILO

LILO is not covered in LPIC 1 anymore

LILO is hardly used anymore

  • Can't boot from Network
  • MBR must be rewritten everytime the configuration file has been modified
  • NO interactive command line
MBR /GPT

The bootloader is written on the Master Boot Record. The BIOS looks at a specific area of the harddrive to load the bootloader.

MBR is being replace with the GUID Partition Table.

Links / more info

2. Bootloader commands and kernel boot options

There are many options that can be passed to the kernel by the bootloader. The most essential one are:

The harddrive on which the OS is present

  • UUID (unique identifier)
  • root (hd0,0)

Where the linux kernel is located

An initial ram disk that contain kernel module and tools necessary to boot

The system load both vmlinux and initrd in memory and then start the kernel

Other boot options

  • 'ro quiet splash'
    • quiet: display less verbose information
    • splash: show a splash screen instead of kernel message

Changing boot options at boot time is non-persistent

Links / more info
Demo / Have fun
  • Check content of /boot
  • Play with GRUB commad line interface

3. Boot event and log files

dmesg

dmesg refers to the kernel message

The log file /var/log/dmesg show the kernel message up to when the system finished booting (log prompt).

/var/log/message

/var/log/messages

Contain kernel message and additional message from other deamon.

/!\ Not present in latest ubuntu (12.10), has been replaced by /var/log/syslog

4. Boot event and log files

Process that starts all other process. (parent process)

Being replaced with upstart / systemd.

Demo / Have fun
  • Check log files and 'dmesg' command
  • command 'pstree' show all process started by init
groupes_d_interets/linux/lpic1_2012/seance_002.txt · Dernière modification: 2012/12/07 16:42 par arekkusu