Généralitées
      hardware, firmware, devices
                               disks
                 kernel, boot, swap
                      files, volumes
                         networking
                             security
software, patching, tracing, logging
                       Bibliographie




              Le système Red Hat

                          Nicolas Ledez


                             06/02/2007




                     Nicolas Ledez      Red Hat
Généralitées
                     hardware, firmware, devices
                                              disks
                                kernel, boot, swap
                                     files, volumes
                                        networking
                                            security
               software, patching, tracing, logging
                                      Bibliographie


Plan
  1    Généralitées
  2    hardware, firmware, devices
  3    disks
  4    kernel, boot, swap
  5    files, volumes
  6    networking
  7    security
  8    software, patching, tracing, logging
  9    Bibliographie

                                    Nicolas Ledez      Red Hat
Généralitées
                  hardware, firmware, devices
                                           disks
                             kernel, boot, swap
                                  files, volumes
                                     networking
                                         security
            software, patching, tracing, logging
                                   Bibliographie


Généralitées

  Version de Red Hat :
      Enterprise Linux ES
          Basic Edition
          Standard Edition
      Enterprise Linux AS
          Standard Edition
          Premium Edition
      Fedora


                                 Nicolas Ledez      Red Hat
Généralitées
                    hardware, firmware, devices
                                             disks
                               kernel, boot, swap
                                                      Information hardware
                                    files, volumes
                                                      Gestion des modules
                                       networking
                                           security
              software, patching, tracing, logging
                                     Bibliographie


Information hardware



     dmesg
     lspci
     lshw *




                                   Nicolas Ledez      Red Hat
Généralitées
                   hardware, firmware, devices
                                            disks
                              kernel, boot, swap
                                                     Information hardware
                                   files, volumes
                                                     Gestion des modules
                                      networking
                                          security
             software, patching, tracing, logging
                                    Bibliographie


Gestion des modules



     lsmod
     modprobe
     modprobe -r
     insmod




                                  Nicolas Ledez      Red Hat
Généralitées
                 hardware, firmware, devices
                                          disks
                            kernel, boot, swap
                                                   Les differents disques
                                 files, volumes
                                                   Gestion des partitions
                                    networking
                                        security
           software, patching, tracing, logging
                                  Bibliographie


Les differents disques



     IDE (PATA) :
         /dev/hd[a-z]
     SCSI et SATA :
         /dev/sd[a-z]




                                Nicolas Ledez      Red Hat
Généralitées
                 hardware, firmware, devices
                                          disks
                            kernel, boot, swap
                                                   Les differents disques
                                 files, volumes
                                                   Gestion des partitions
                                    networking
                                        security
           software, patching, tracing, logging
                                  Bibliographie


Gestion des partitions


     Afficher les partitions
         fdisk -l /dev/sda
     Modifier les partitions
         parted
         fdisk
         sfdisk
         cfdisk *




                                Nicolas Ledez      Red Hat
Généralitées
                 hardware, firmware, devices
                                          disks
                            kernel, boot, swap     Le noyau
                                 files, volumes     Les "Run level"
                                    networking     Swap
                                        security
           software, patching, tracing, logging
                                  Bibliographie


Le noyau



     Present dans /boot
     Modules nécessaire au boot dans initrd
     Chargé par Lilo ou Grub




                                Nicolas Ledez      Red Hat
Généralitées
                   hardware, firmware, devices
                                            disks
                              kernel, boot, swap     Le noyau
                                   files, volumes     Les "Run level"
                                      networking     Swap
                                          security
             software, patching, tracing, logging
                                    Bibliographie


Les "Run level"

  Les principaux :
      0 : halt
      1 : single-user
      3 : default
      6 : reboot
  Runlevel courant :
      runlevel


                                  Nicolas Ledez      Red Hat
Généralitées
                    hardware, firmware, devices
                                             disks
                               kernel, boot, swap     Le noyau
                                    files, volumes     Les "Run level"
                                       networking     Swap
                                           security
              software, patching, tracing, logging
                                     Bibliographie


Swap


 Informations sur le swap :
       swapon -s
       cat /proc/meminfo
       cat /proc/swaps
       free




                                   Nicolas Ledez      Red Hat
Généralitées
                  hardware, firmware, devices
                                                    Généralitées
                                           disks
                                                    Schéma LVM
                             kernel, boot, swap
                                                    PV et VG
                                  files, volumes
                                                    LV
                                     networking
                                                    Creation d’un volume
                                         security
                                                    Extention d’un volume
            software, patching, tracing, logging
                                   Bibliographie


Généralitées


  Système de fichier :
      Ext2/Ext3
      ReiserFS, XFS, JFS ; Ext4, ZFS ?
  Gestion des volumes :
      LVM 1 & 2




                                 Nicolas Ledez      Red Hat
Schéma LVM 1/3
Schéma LVM 2/3
Schéma LVM 3/3
Généralitées
                   hardware, firmware, devices
                                                     Généralitées
                                            disks
                                                     Schéma LVM
                              kernel, boot, swap
                                                     PV et VG
                                   files, volumes
                                                     LV
                                      networking
                                                     Creation d’un volume
                                          security
                                                     Extention d’un volume
             software, patching, tracing, logging
                                    Bibliographie


PV et VG
  Physical Volume

  [root@wh-addmaster ]# pvscan
  PV /dev/sda2 VG rootvg lvm2 [33.66 GB / 19.50 GB free]
  Total : 1 [33.66 GB] / in use : 1 [33.66 GB] / in no VG : 0 [0 ]

  Volume Group

  [root@wh-addmaster ]# vgscan
  Reading all physical volumes. This may take a while...
  Found volume group "rootvg" using metadata type lvm2

                                  Nicolas Ledez      Red Hat
Généralitées
                 hardware, firmware, devices
                                                   Généralitées
                                          disks
                                                   Schéma LVM
                            kernel, boot, swap
                                                   PV et VG
                                 files, volumes
                                                   LV
                                    networking
                                                   Creation d’un volume
                                        security
                                                   Extention d’un volume
           software, patching, tracing, logging
                                  Bibliographie


LV

 Logical Volume

 [root@wh-addmaster ]# lvscan
 ACTIVE ’/dev/rootvg/lv_root’ [1.97 GB] inherit
 ACTIVE ’/dev/rootvg/lv_tmp’ [1.00 GB] inherit
 ACTIVE ’/dev/rootvg/lv_usr’ [2.94 GB] inherit
 ACTIVE ’/dev/rootvg/lv_var’ [2.00 GB] inherit
 ACTIVE ’/dev/rootvg/lv_swap’ [1.97 GB] inherit



                                Nicolas Ledez      Red Hat
Généralitées
                  hardware, firmware, devices
                                                    Généralitées
                                           disks
                                                    Schéma LVM
                             kernel, boot, swap
                                                    PV et VG
                                  files, volumes
                                                    LV
                                     networking
                                                    Creation d’un volume
                                         security
                                                    Extention d’un volume
            software, patching, tracing, logging
                                   Bibliographie


Creation d’un volume




  lvcreate -L 2G –name lv_toto rootvg
  mkfs.ext3 /dev/rootvg/lv_toto
  mount /dev/rootvg/lv_toto /toto




                                 Nicolas Ledez      Red Hat
Généralitées
                   hardware, firmware, devices
                                                     Généralitées
                                            disks
                                                     Schéma LVM
                              kernel, boot, swap
                                                     PV et VG
                                   files, volumes
                                                     LV
                                      networking
                                                     Creation d’un volume
                                          security
                                                     Extention d’un volume
             software, patching, tracing, logging
                                    Bibliographie


Extention d’un volume

  umount /toto

  lvextend -L +2G /dev/rootvg/lv_toto

  ou
  lvextend -L 4G /dev/rootvg/lv_toto

  e2fsck -f /dev/rootvg/lv_toto
  resize2fs /dev/rootvg/lv_toto

                                  Nicolas Ledez      Red Hat
Généralitées
                   hardware, firmware, devices
                                            disks
                                                     NFS
                              kernel, boot, swap
                                                     Interfaces
                                   files, volumes
                                                     Configuration
                                      networking
                                                     Sniff
                                          security
             software, patching, tracing, logging
                                    Bibliographie


NFS



 Exports :

 /etc/exports

 /etc/init.d/nfs-server reload




                                  Nicolas Ledez      Red Hat
Généralitées
                   hardware, firmware, devices
                                            disks
                                                     NFS
                              kernel, boot, swap
                                                     Interfaces
                                   files, volumes
                                                     Configuration
                                      networking
                                                     Sniff
                                          security
             software, patching, tracing, logging
                                    Bibliographie


Interfaces



  eth[0-x]
      ifconfig
      ip addr




                                  Nicolas Ledez      Red Hat
Généralitées
                 hardware, firmware, devices
                                          disks
                                                   NFS
                            kernel, boot, swap
                                                   Interfaces
                                 files, volumes
                                                   Configuration
                                    networking
                                                   Sniff
                                        security
           software, patching, tracing, logging
                                  Bibliographie


Configuration



     /etc/hosts
     /etc/sysconfig/network
     /etc/sysconfig/network-scripts/ifcfg-eth0




                                Nicolas Ledez      Red Hat
Généralitées
                    hardware, firmware, devices
                                             disks
                                                      NFS
                               kernel, boot, swap
                                                      Interfaces
                                    files, volumes
                                                      Configuration
                                       networking
                                                      Sniff
                                           security
              software, patching, tracing, logging
                                     Bibliographie


Sniff



        tcpdump
        ethereal / tethereal
        wireshark




                                   Nicolas Ledez      Red Hat
Généralitées
                 hardware, firmware, devices
                                          disks
                            kernel, boot, swap
                                 files, volumes     Gestion des utilisateurs
                                    networking
                                        security
           software, patching, tracing, logging
                                  Bibliographie


Gestion des utilisateurs



      useradd
      userdel
      adduser




                                Nicolas Ledez      Red Hat
Généralitées
                    hardware, firmware, devices
                                                      Liste des paquets installés
                                             disks
                                                      Truss like
                               kernel, boot, swap
                                                      Logs
                                    files, volumes
                                                      Erreurs systèmes
                                       networking
                                                      Performances
                                           security
                                                      Lister ports/fichiers ouvert/en écoute
              software, patching, tracing, logging
                                     Bibliographie


Liste des paquets installés



      rpm -qa
      urpmi *
      yum *




                                   Nicolas Ledez      Red Hat
Généralitées
                     hardware, firmware, devices
                                                       Liste des paquets installés
                                              disks
                                                       Truss like
                                kernel, boot, swap
                                                       Logs
                                     files, volumes
                                                       Erreurs systèmes
                                        networking
                                                       Performances
                                            security
                                                       Lister ports/fichiers ouvert/en écoute
               software, patching, tracing, logging
                                      Bibliographie


Truss like




      strace
      ltrace




                                    Nicolas Ledez      Red Hat
Généralitées
                   hardware, firmware, devices
                                                     Liste des paquets installés
                                            disks
                                                     Truss like
                              kernel, boot, swap
                                                     Logs
                                   files, volumes
                                                     Erreurs systèmes
                                      networking
                                                     Performances
                                          security
                                                     Lister ports/fichiers ouvert/en écoute
             software, patching, tracing, logging
                                    Bibliographie


Logs



       /var/log/syslog
       /var/log/messages
       /usr/adm/messages
       /var/log/maillog




                                  Nicolas Ledez      Red Hat
Généralitées
                hardware, firmware, devices
                                                  Liste des paquets installés
                                         disks
                                                  Truss like
                           kernel, boot, swap
                                                  Logs
                                files, volumes
                                                  Erreurs systèmes
                                   networking
                                                  Performances
                                       security
                                                  Lister ports/fichiers ouvert/en écoute
          software, patching, tracing, logging
                                 Bibliographie


Erreurs systèmes




  dmesg




                               Nicolas Ledez      Red Hat
Généralitées
                 hardware, firmware, devices
                                                   Liste des paquets installés
                                          disks
                                                   Truss like
                            kernel, boot, swap
                                                   Logs
                                 files, volumes
                                                   Erreurs systèmes
                                    networking
                                                   Performances
                                        security
                                                   Lister ports/fichiers ouvert/en écoute
           software, patching, tracing, logging
                                  Bibliographie


Performances




  vmstat




                                Nicolas Ledez      Red Hat
Généralitées
                   hardware, firmware, devices
                                                     Liste des paquets installés
                                            disks
                                                     Truss like
                              kernel, boot, swap
                                                     Logs
                                   files, volumes
                                                     Erreurs systèmes
                                      networking
                                                     Performances
                                          security
                                                     Lister ports/fichiers ouvert/en écoute
             software, patching, tracing, logging
                                    Bibliographie


Lister ports/fichiers ouvert/en écoute




      lsof
      netstat -atup




                                  Nicolas Ledez      Red Hat
Généralitées
                 hardware, firmware, devices
                                          disks
                            kernel, boot, swap
                                 files, volumes
                                    networking
                                        security
           software, patching, tracing, logging
                                  Bibliographie


Bibliographie


     http ://bhami.com/rosetta.html
     http ://tldp.org/HOWTO/LVM-HOWTO/

     http ://www.linuxdevcenter.com/pub/a/linux/2006/04/27/managing
     disk-space-with-lvm.html
     http ://www.google.fr/



                                Nicolas Ledez      Red Hat

Redhat

  • 1.
    Généralitées hardware, firmware, devices disks kernel, boot, swap files, volumes networking security software, patching, tracing, logging Bibliographie Le système Red Hat Nicolas Ledez 06/02/2007 Nicolas Ledez Red Hat
  • 2.
    Généralitées hardware, firmware, devices disks kernel, boot, swap files, volumes networking security software, patching, tracing, logging Bibliographie Plan 1 Généralitées 2 hardware, firmware, devices 3 disks 4 kernel, boot, swap 5 files, volumes 6 networking 7 security 8 software, patching, tracing, logging 9 Bibliographie Nicolas Ledez Red Hat
  • 3.
    Généralitées hardware, firmware, devices disks kernel, boot, swap files, volumes networking security software, patching, tracing, logging Bibliographie Généralitées Version de Red Hat : Enterprise Linux ES Basic Edition Standard Edition Enterprise Linux AS Standard Edition Premium Edition Fedora Nicolas Ledez Red Hat
  • 4.
    Généralitées hardware, firmware, devices disks kernel, boot, swap Information hardware files, volumes Gestion des modules networking security software, patching, tracing, logging Bibliographie Information hardware dmesg lspci lshw * Nicolas Ledez Red Hat
  • 5.
    Généralitées hardware, firmware, devices disks kernel, boot, swap Information hardware files, volumes Gestion des modules networking security software, patching, tracing, logging Bibliographie Gestion des modules lsmod modprobe modprobe -r insmod Nicolas Ledez Red Hat
  • 6.
    Généralitées hardware, firmware, devices disks kernel, boot, swap Les differents disques files, volumes Gestion des partitions networking security software, patching, tracing, logging Bibliographie Les differents disques IDE (PATA) : /dev/hd[a-z] SCSI et SATA : /dev/sd[a-z] Nicolas Ledez Red Hat
  • 7.
    Généralitées hardware, firmware, devices disks kernel, boot, swap Les differents disques files, volumes Gestion des partitions networking security software, patching, tracing, logging Bibliographie Gestion des partitions Afficher les partitions fdisk -l /dev/sda Modifier les partitions parted fdisk sfdisk cfdisk * Nicolas Ledez Red Hat
  • 8.
    Généralitées hardware, firmware, devices disks kernel, boot, swap Le noyau files, volumes Les "Run level" networking Swap security software, patching, tracing, logging Bibliographie Le noyau Present dans /boot Modules nécessaire au boot dans initrd Chargé par Lilo ou Grub Nicolas Ledez Red Hat
  • 9.
    Généralitées hardware, firmware, devices disks kernel, boot, swap Le noyau files, volumes Les "Run level" networking Swap security software, patching, tracing, logging Bibliographie Les "Run level" Les principaux : 0 : halt 1 : single-user 3 : default 6 : reboot Runlevel courant : runlevel Nicolas Ledez Red Hat
  • 10.
    Généralitées hardware, firmware, devices disks kernel, boot, swap Le noyau files, volumes Les "Run level" networking Swap security software, patching, tracing, logging Bibliographie Swap Informations sur le swap : swapon -s cat /proc/meminfo cat /proc/swaps free Nicolas Ledez Red Hat
  • 11.
    Généralitées hardware, firmware, devices Généralitées disks Schéma LVM kernel, boot, swap PV et VG files, volumes LV networking Creation d’un volume security Extention d’un volume software, patching, tracing, logging Bibliographie Généralitées Système de fichier : Ext2/Ext3 ReiserFS, XFS, JFS ; Ext4, ZFS ? Gestion des volumes : LVM 1 & 2 Nicolas Ledez Red Hat
  • 12.
  • 13.
  • 14.
  • 15.
    Généralitées hardware, firmware, devices Généralitées disks Schéma LVM kernel, boot, swap PV et VG files, volumes LV networking Creation d’un volume security Extention d’un volume software, patching, tracing, logging Bibliographie PV et VG Physical Volume [root@wh-addmaster ]# pvscan PV /dev/sda2 VG rootvg lvm2 [33.66 GB / 19.50 GB free] Total : 1 [33.66 GB] / in use : 1 [33.66 GB] / in no VG : 0 [0 ] Volume Group [root@wh-addmaster ]# vgscan Reading all physical volumes. This may take a while... Found volume group "rootvg" using metadata type lvm2 Nicolas Ledez Red Hat
  • 16.
    Généralitées hardware, firmware, devices Généralitées disks Schéma LVM kernel, boot, swap PV et VG files, volumes LV networking Creation d’un volume security Extention d’un volume software, patching, tracing, logging Bibliographie LV Logical Volume [root@wh-addmaster ]# lvscan ACTIVE ’/dev/rootvg/lv_root’ [1.97 GB] inherit ACTIVE ’/dev/rootvg/lv_tmp’ [1.00 GB] inherit ACTIVE ’/dev/rootvg/lv_usr’ [2.94 GB] inherit ACTIVE ’/dev/rootvg/lv_var’ [2.00 GB] inherit ACTIVE ’/dev/rootvg/lv_swap’ [1.97 GB] inherit Nicolas Ledez Red Hat
  • 17.
    Généralitées hardware, firmware, devices Généralitées disks Schéma LVM kernel, boot, swap PV et VG files, volumes LV networking Creation d’un volume security Extention d’un volume software, patching, tracing, logging Bibliographie Creation d’un volume lvcreate -L 2G –name lv_toto rootvg mkfs.ext3 /dev/rootvg/lv_toto mount /dev/rootvg/lv_toto /toto Nicolas Ledez Red Hat
  • 18.
    Généralitées hardware, firmware, devices Généralitées disks Schéma LVM kernel, boot, swap PV et VG files, volumes LV networking Creation d’un volume security Extention d’un volume software, patching, tracing, logging Bibliographie Extention d’un volume umount /toto lvextend -L +2G /dev/rootvg/lv_toto ou lvextend -L 4G /dev/rootvg/lv_toto e2fsck -f /dev/rootvg/lv_toto resize2fs /dev/rootvg/lv_toto Nicolas Ledez Red Hat
  • 19.
    Généralitées hardware, firmware, devices disks NFS kernel, boot, swap Interfaces files, volumes Configuration networking Sniff security software, patching, tracing, logging Bibliographie NFS Exports : /etc/exports /etc/init.d/nfs-server reload Nicolas Ledez Red Hat
  • 20.
    Généralitées hardware, firmware, devices disks NFS kernel, boot, swap Interfaces files, volumes Configuration networking Sniff security software, patching, tracing, logging Bibliographie Interfaces eth[0-x] ifconfig ip addr Nicolas Ledez Red Hat
  • 21.
    Généralitées hardware, firmware, devices disks NFS kernel, boot, swap Interfaces files, volumes Configuration networking Sniff security software, patching, tracing, logging Bibliographie Configuration /etc/hosts /etc/sysconfig/network /etc/sysconfig/network-scripts/ifcfg-eth0 Nicolas Ledez Red Hat
  • 22.
    Généralitées hardware, firmware, devices disks NFS kernel, boot, swap Interfaces files, volumes Configuration networking Sniff security software, patching, tracing, logging Bibliographie Sniff tcpdump ethereal / tethereal wireshark Nicolas Ledez Red Hat
  • 23.
    Généralitées hardware, firmware, devices disks kernel, boot, swap files, volumes Gestion des utilisateurs networking security software, patching, tracing, logging Bibliographie Gestion des utilisateurs useradd userdel adduser Nicolas Ledez Red Hat
  • 24.
    Généralitées hardware, firmware, devices Liste des paquets installés disks Truss like kernel, boot, swap Logs files, volumes Erreurs systèmes networking Performances security Lister ports/fichiers ouvert/en écoute software, patching, tracing, logging Bibliographie Liste des paquets installés rpm -qa urpmi * yum * Nicolas Ledez Red Hat
  • 25.
    Généralitées hardware, firmware, devices Liste des paquets installés disks Truss like kernel, boot, swap Logs files, volumes Erreurs systèmes networking Performances security Lister ports/fichiers ouvert/en écoute software, patching, tracing, logging Bibliographie Truss like strace ltrace Nicolas Ledez Red Hat
  • 26.
    Généralitées hardware, firmware, devices Liste des paquets installés disks Truss like kernel, boot, swap Logs files, volumes Erreurs systèmes networking Performances security Lister ports/fichiers ouvert/en écoute software, patching, tracing, logging Bibliographie Logs /var/log/syslog /var/log/messages /usr/adm/messages /var/log/maillog Nicolas Ledez Red Hat
  • 27.
    Généralitées hardware, firmware, devices Liste des paquets installés disks Truss like kernel, boot, swap Logs files, volumes Erreurs systèmes networking Performances security Lister ports/fichiers ouvert/en écoute software, patching, tracing, logging Bibliographie Erreurs systèmes dmesg Nicolas Ledez Red Hat
  • 28.
    Généralitées hardware, firmware, devices Liste des paquets installés disks Truss like kernel, boot, swap Logs files, volumes Erreurs systèmes networking Performances security Lister ports/fichiers ouvert/en écoute software, patching, tracing, logging Bibliographie Performances vmstat Nicolas Ledez Red Hat
  • 29.
    Généralitées hardware, firmware, devices Liste des paquets installés disks Truss like kernel, boot, swap Logs files, volumes Erreurs systèmes networking Performances security Lister ports/fichiers ouvert/en écoute software, patching, tracing, logging Bibliographie Lister ports/fichiers ouvert/en écoute lsof netstat -atup Nicolas Ledez Red Hat
  • 30.
    Généralitées hardware, firmware, devices disks kernel, boot, swap files, volumes networking security software, patching, tracing, logging Bibliographie Bibliographie http ://bhami.com/rosetta.html http ://tldp.org/HOWTO/LVM-HOWTO/ http ://www.linuxdevcenter.com/pub/a/linux/2006/04/27/managing disk-space-with-lvm.html http ://www.google.fr/ Nicolas Ledez Red Hat