Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
elearning:workbooks:centos:8:avance:l112 [2023/08/24 15:36] adminelearning:workbooks:centos:8:avance:l112 [2024/10/01 08:07] (Version actuelle) admin
Ligne 1: Ligne 1:
 ~~PDF:LANDSCAPE~~ ~~PDF:LANDSCAPE~~
  
-Version : **2023.01**+Version : **2024.01**
  
 Dernière mise-à-jour : ~~LASTMOD~~ Dernière mise-à-jour : ~~LASTMOD~~
  
-======LCF602 - Gestion du Noyau et des Quotas======+======LCF604 - Gestion des Paramètres du matériel et les Ressources====== 
 + 
 +<code> 
 +[root@centos8 ~]# sed -i 's/^mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* 
 +[root@centos8 ~]# sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* 
 +</code>
  
 =====Contenu du Module===== =====Contenu du Module=====
  
-  * **LCF602 - Gestion du Noyau et des Quotas**+  * **LCF604 - Gestion des Paramètres et les Ressources du Matériel**
     * Contenu du Module     * Contenu du Module
-    * Rôle du noyau +    * Présentation des Fichiers Spéciaux  
-    * LAB #1 - Modules +    * LAB #1 - Découvrir le Matériel 
-    LAB #2 Compilation et installation du noyau et des modules +      1.1 La Commande lspci 
-      * 2.1 - Déplacer /home +      * 1.- La Commande lsusb 
-      * 2.Préparer l'Environnement +      * 1.3 - La Commande lsblk 
-      * 2.Préparer l'Arborescence Source du Noyau +      * 1.4 La Commande lsscsi 
-        Le Fichier .config +      * 1.La Commande lscpu 
-        Le Fichier Makefile +      * 1.La Commande lshw 
-      * 2.Paramétrage du noyau +      1.7 - La Commande dmidecode 
-      * 2.Compiler le Noyau +      1.8 - La Commande smartctl 
-      * 2.Installer le Nouveau Noyau +      * 1.Les Commandes accton et dump-acct 
-    * LAB #3 - Gestion des Quotas +      * 1.10 - La Commande lastcomm 
-      * 3.1 - La Commande quotacheck +      * 1.11 - La Commande sa 
-      * 3.2 - La Commande edquota +      * 1.12 - La Commande ac 
-      * 3.3 - La Commande quotaon +    * LAB #2 - La Commande sysctl 
-      * 3.4 - La Commande repquota +      * 2.Répertoire /proc 
-      * 3.5 - La Commande quota +        * Fichiers 
-      * 3.6 - La Commande warnquota+          * Processeur 
 +          * Interruptions système 
 +          * Canaux DMA 
 +          * Plages d'entrée/sortie 
 +          * Périphériques 
 +          * Modules 
 +          * Statistiques de l'utilisation des disques 
 +          * Partitions 
 +          * Espaces de pagination 
 +          * Statistiques d'utilisation du processeur 
 +          * Statistiques d'utilisation de la mémoire 
 +          * Version du noyau 
 +        * Répertoires 
 +          * ide/scsi 
 +          * acpi 
 +          * bus 
 +          * net 
 +          * sys 
 +      * 2.Utilisation de la Commande sysctl        
 +    * LAB #3 - Interprétation des informations dans /proc 
 +      * 3.1 - free 
 +      * 3.2 - uptime ou w  
 +      * 3.3 - iostat 
 +      * 3.4 - hdparm 
 +      * 3.5 - vmstat 
 +      * 3.6 - mpstat 
 +      * 3.7 - sar 
 +    * Modules usb 
 +    * udev 
 +      * La Commande udevadm 
 +    * Système de fichiers /sys 
 +    * LAB #4 - Limiter les Ressources 
 +      * 4.1 - ulimit 
 +      * 4.2 - Groupes de Contrôle 
 +        * La Limitation de la Mémoire 
 +        * La Commande cgcreate 
 +        * La Commande cgdelete 
 +        * Le Fichier /etc/cgconfig.conf 
 +        * La Commande cgconfigparser
  
-=====Rôle du noyau=====+=====Présentation des Fichiers Spéciaux=====
  
-Le noyau ou //kernel// est la partie du système d'exploitation qui gère les entrées/sorties avec des périphériques. Dans certains cas il est préférable de recompiler le noyau de LinuxLa motivation de cette recompilation peut être :+Dans l'ordinateur les périphériques sont reliés à un **contrôleur** qui communique avec le processeur à l'aide d'un **bus**. Le contrôleur ainsi que les périphériques nécessitent des pilotesSous Linux, les pilotes sont généralement fournis sous la forme d'un **module**. Chaque périphérique est représenté par un **fichier spécial** dans le répertoire **/dev** et c'est dans ce fichier que le système trouve les informations nécessaires pour s'adresser au pilote.
  
-  * la diminution de la taille du noyau, +<WRAP center round important 60%> 
-  la prise en charge de nouveau matériel, +**Important** : Les périphériques qui nécessitent à ce que l'ordinateur soit éteint afin des les brancher/débrancher sont appelés communément **Cold Plug Devices**. Les périphériques qui peuvent être brancher/débrancher à chaud sont appelés des **Hot Plug Devices**. 
-  l'ajout de fonctionnalités, +</WRAP> 
-  * l'optimisation du code, + 
-  la correction de bogues, +Consultez le contenu du répertoire /dev :
-  le besoin d'une fonctionnalité expérimentale+
-   +
-Commencez par mettre à jour CentOS 8 :+
  
 <code> <code>
-[root@centos8 ~]# dnf update +[root@centos8 ~]# ls -l /dev | more 
-... +total 0 
-[root@centos8 ~]# reboot+crw-r--r-- 1 root root     10, 235 Jun 28 02:04 autofs 
 +drwxr-xr-x 2 root root         180 Jun 28 02:04 block 
 +drwxr-xr-x 2 root root         100 Jun 28 02:04 bsg 
 +drwxr-xr-x. root root          60 Jun 28 02:04 bus 
 +lrwxrwxrwx.  1 root root           3 Jun 28 02:04 cdrom -> sr0 
 +drwxr-xr-x.  2 root root        2940 Jun 28 02:04 char 
 +drwxr-xr-x.  2 root root          80 Jun 28 02:04 cl_centos8 
 +crw-------.  1 root root      5,   1 Jun 28 02:04 console 
 +lrwxrwxrwx.  1 root root          11 Jun 28 02:04 core -> /proc/kcore 
 +drwxr-xr-x. 10 root root         200 Jun 28 02:04 cpu 
 +crw-------.  1 root root     10,  62 Jun 28 02:04 cpu_dma_latency 
 +drwxr-xr-x.  6 root root         120 Jun 28 02:04 disk 
 +brw-rw----.  1 root disk    253,   0 Jun 28 02:04 dm-0 
 +brw-rw----.  1 root disk    253,   1 Jun 28 02:04 dm-1 
 +drwxr-xr-x.  3 root root          80 Jun 28 02:04 dri 
 +crw-rw----.  1 root video    29,   0 Jun 28 02:04 fb0 
 +lrwxrwxrwx.  1 root root          13 Jun 28 02:04 fd -> /proc/self/fd 
 +crw-rw-rw-.  1 root root      1,   7 Jun 28 02:04 full 
 +crw-rw-rw-.  1 root root     10, 229 Jun 28 02:04 fuse 
 +crw-------.  1 root root    245,   0 Jun 28 02:04 hidraw0 
 +crw-------.  1 root root     10, 228 Jun 28 02:04 hpet 
 +drwxr-xr-x.  3 root root           0 Jun 28 02:04 hugepages 
 +crw-------.  1 root root     10, 183 Jun 28 02:04 hwrng 
 +lrwxrwxrwx.  1 root root          12 Jun 28 02:04 initctl -> /run/initctl 
 +drwxr-xr-x.  4 root root         280 Jun 28 02:04 input 
 +crw-r--r--.  1 root root      1,  11 Jun 28 02:04 kmsg 
 +lrwxrwxrwx.  1 root root          28 Jun 28 02:04 log -> /run/systemd/journal/dev-log 
 +crw-rw----.  1 root disk     10, 237 Jun 28 02:04 loop-control 
 +crw-rw----.  1 root lp        6,   0 Jun 28 02:04 lp0 
 +crw-rw----.  1 root lp        6,   1 Jun 28 02:04 lp1 
 +crw-rw----.  1 root lp        6,   2 Jun 28 02:04 lp2 
 +crw-rw----.  1 root lp        6,   3 Jun 28 02:04 lp3 
 +drwxr-xr-x.  2 root root         100 Jun 28 02:04 mapper 
 +crw-------.  1 root root     10, 227 Jun 28 02:04 mcelog 
 +crw-r-----.  1 root kmem      1,   1 Jun 28 02:04 mem 
 +drwxrwxrwt.  2 root root          40 Jun 28 02:04 mqueue 
 +drwxr-xr-x.  2 root root          60 Jun 28 02:04 net 
 +crw-rw-rw-.  1 root root      1,   3 Jun 28 02:04 null 
 +--More--
 </code> </code>
  
-Identifiez ensuite le noyau utilisé par votre machine virtuelle :+On peut noter dans la sortie de la commande que certains fichiers sont de type **bloc** (**b**), tandis que d'autre sont de type **caractère** (**c**). 
  
 <code> <code>
-[root@centos8 ~]# uname -r +... 
-4.18.0-305.7.1.el8_4.x86_64+brw-rw----.  1 root disk      8,   1 Jun 28 02:04 sda1 
 +..
 +crw-rw-rw-.  root tty       5,   0 Jun 28 02:04 tty 
 +...
 </code> </code>
  
-=====LAB #1 - Modules=====+La différence entre les deux repose sur le type de communication entre le système et le module. Dans le premier cas le système accède au périphérique par des coordonnées du bloc de données sur le support tandis que dans le deuxième cas la communication d'échange de données se fait octet par octet sans utiliser des tampons.
  
-Dans le cas d'une utilisation courante de Linux, il est cependant préférable de faire appel aux **modules**. Les modules se trouvent dans le répertoire **/lib/modules/<version-du-noyau>** :+Les deux informations clefs du fichier spécial sont situées à la place de la taille d'un fichier normal et se nomment le **majeur** et le **mineur** : 
 + 
 +  * le **majeur** identifie le pilote du périphérique et donc son contrôleur, 
 +  le **mineur** identifie le périphérique ou une particularité du périphérique telle une partition d'un disque. 
 + 
 +=====LAB #1 - Découvrir le Matériel===== 
 + 
 +====1.1 - La Commande lspci==== 
 + 
 +Cette commande vous renseigne sur les adaptateurs reliés aux bus PCI, AGP et PCI express :
  
 <code> <code>
-[root@centos8 ~]# ls /lib/modules/`uname -r`+[root@centos8 ~]# lspci 
-bls.conf           modules.builtin      modules.networking   System.map +00:00.0 Host bridge: Intel Corporation 440FX 82441FX PMC [Natoma] (rev 02) 
-build              modules.builtin.bin  modules.order        updates +00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II] 
-config             modules.dep          modules.softdep      vdso +00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II] 
-kernel             modules.dep.bin      modules.symbols      vmlinuz +00:01.2 USB controller: Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II] (rev 01) 
-modules.alias      modules.devname      modules.symbols.bin  weak-updates +00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03) 
-modules.alias.bin  modules.drm          source +00:02.0 VGA compatible controller: Device 1234:1111 (rev 02) 
-modules.block      modules.modesetting  symvers.gz+00:03.0 Unclassified device [00ff]: Red Hat, IncVirtio memory balloon 
 +00:07.0 SATA controller: Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA Controller [AHCI mode] (rev 02) 
 +00:12.0 Ethernet controller: Red Hat, IncVirtio network device 
 +00:1e.0 PCI bridge: Red Hat, IncQEMU PCI-PCI bridge 
 +00:1f.0 PCI bridge: Red Hat, IncQEMU PCI-PCI bridge
 </code> </code>
  
-Les commandes pour manipuler les modules sont :+Pour obtenir de l'information sur un adaptateur spécifique, il convient d'utiliser la même commande avec l'option **-v** en spécifiant l'identifiant concerné :
  
-  * insmod +<code> 
-  * rmmod +[root@centos8 ~]# lspci -v -s 00:03.0 
-  * lsmod +00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon 
-  * modprobe+        Subsystem: Red Hat, Inc. Device 0005 
 +        Physical Slot: 3 
 +        Flags: bus master, fast devsel, latency 0, IRQ 10 
 +        I/O ports at e000 [size=64] 
 +        Memory at fe400000 (64-bit, prefetchable) [size=16K] 
 +        Capabilities: [84] Vendor Specific Information: VirtIO: <unknown> 
 +        Capabilities: [70] Vendor Specific Information: VirtIO: Notify 
 +        Capabilities: [60] Vendor Specific Information: VirtIO: DeviceCfg 
 +        Capabilities: [50] Vendor Specific Information: VirtIO: ISR 
 +        Capabilities: [40] Vendor Specific Information: VirtIO: CommonCfg 
 +        Kernel driver in use: virtio-pci 
 +</code>
  
-Par exemple :+ou :
  
 <code> <code>
-[root@centos8 ~]# lsmod +[root@centos8 ~]# lspci -vv -s 00:03.
-Module                  Size  Used by +00:03.0 Unclassified device [00ff]: Red HatInc. Virtio memory balloon 
-xt_CHECKSUM            16384  1 +        Subsystem: Red HatInc. Device 0005 
-ipt_MASQUERADE         16384 +        Physical Slot: 
-xt_conntrack           16384 +        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx- 
-ipt_REJECT             16384 +        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- 
-nft_compat             20480  16 +        Latency: 
-nf_nat_tftp            16384  +        Interrupt: pin A routed to IRQ 10 
-nft_objref             16384 +        Region 0: I/O ports at e000 [size=64] 
-nf_conntrack_tftp      16384  3 nf_nat_tftp +        Region 4: Memory at fe400000 (64-bitprefetchable) [size=16K] 
-nft_counter            16384  33 +        Capabilities: [84] Vendor Specific Information: VirtIO: <unknown> 
-tun                    53248  1 +                BAR=0 offset=00000000 size=00000000 
-bridge                192512  0 +        Capabilities: [70] Vendor Specific Information: VirtIO: Notify 
-stp                    16384  1 bridge +                BAR=4 offset=00003000 size=00001000 multiplier=00000004 
-llc                    16384  2 bridge,stp +        Capabilities: [60] Vendor Specific Information: VirtIO: DeviceCfg 
-nft_fib_inet           16384 +                BAR=4 offset=00002000 size=00001000 
-nft_fib_ipv4           16384  1 nft_fib_inet +        Capabilities: [50] Vendor Specific Information: VirtIO: ISR 
-nft_fib_ipv6           16384  1 nft_fib_inet +                BAR=offset=00001000 size=00001000 
-nft_fib                16384  3 nft_fib_ipv6,nft_fib_ipv4,nft_fib_inet +        Capabilities: [40] Vendor Specific Information: VirtIO: CommonCfg 
-nft_reject_inet        16384  5 +                BAR=4 offset=00000000 size=00001000 
-nf_reject_ipv4         16384  2 nft_reject_inet,ipt_REJECT +        Kernel driver in use: virtio-pci
-nf_reject_ipv6         16384  1 nft_reject_inet +
-nft_reject             16384  1 nft_reject_inet +
-nft_ct                 20480  19 +
-nf_tables_set          49152  21 +
-nft_chain_nat          16384  12 +
-nf_nat                 45056  ipt_MASQUERADE,nf_nat_tftp,nft_chain_nat +
-nf_conntrack          172032  6 xt_conntrack,nf_nat,nf_conntrack_tftp,nft_ct,ipt_MASQUERADE,nf_nat_tftp +
-nf_defrag_ipv6         20480  1 nf_conntrack +
-nf_defrag_ipv4         16384  1 nf_conntrack +
-ip_set                 49152  +
-nf_tables             172032  414 nft_ct,nft_compat,nft_reject_inet,nft_fib_ipv6,nft_objref,nft_fib_ipv4,nft_counter,nft_chain_nat,nf_tables_set,nft_reject,nft_fib,nft_fib_inet +
-nfnetlink              16384  4 nft_compat,nf_tables,ip_set +
-sunrpc                540672 +
-ext4                  761856 +
-mbcache                16384  1 ext4 +
-jbd2                  131072  1 ext4 +
-virtio_balloon         20480  +
-pcspkr                 16384 +
-i2c_piix4              24576  0 +
-joydev                 24576 +
-ip_tables              28672  0 +
-xfs                  1515520 +
-libcrc32c              16384  nf_conntrack,nf_nat,nf_tables,xfs +
-sr_mod                 28672  0 +
-sd_mod                 53248 +
-cdrom                  65536  1 sr_mod +
-t10_pi                 16384  1 sd_mod +
-sg                     40960  +
-ata_generic            16384  0 +
-bochs_drm              16384  1 +
-drm_vram_helper        28672  1 bochs_drm +
-drm_kms_helper        233472  drm_vram_helper,bochs_drm +
-syscopyarea            16384  1 drm_kms_helper +
-sysfillrect            16384  1 drm_kms_helper +
-sysimgblt              16384  1 drm_kms_helper +
-fb_sys_fops            16384  1 drm_kms_helper +
-drm_ttm_helper         16384  1 drm_vram_helper +
-ttm                   114688  2 drm_vram_helper,drm_ttm_helper +
-drm                   569344  7 drm_kms_helper,drm_vram_helper,bochs_drm,drm_ttm_helper,ttm +
-ahci                   40960  2 +
-libahci                40960  1 ahci +
-virtio_net             53248  0 +
-net_failover           24576  1 virtio_net +
-ata_piix               36864 +
-serio_raw              16384  0 +
-failover               16384  1 net_failover +
-libata                270336  ata_piix,libahci,ahci,ata_generic +
-dm_mirror              28672  0 +
-dm_region_hash         20480  1 dm_mirror +
-dm_log                 20480  2 dm_region_hash,dm_mirror +
-dm_mod                151552  8 dm_log,dm_mirror +
-fuse                  151552  3+
 </code> </code>
  
-Pour ajouter un module, on peut utiliser la commande **insmod** ou **modprobe**. Cette dernière ajoute non seulement le module passé en argument mais également ses dépendances :+===Options de la commande=== 
 + 
 +Les options de cette commande sont :
  
 <code> <code>
-[root@centos8 ~]# modprobe bonding +[root@centos8 ~]# lspci --help 
-[root@centos8 ~]# lsmod | more +lspci: invalid option -- '-' 
-Module                  Size  Used by +Usage: lspci [<switches>
-bonding               196608  0 + 
-xt_CHECKSUM            16384  1 +Basic display modes: 
-ipt_MASQUERADE         16384  3 +-mm             Produce machine-readable output (single -m for an obsolete format) 
-xt_conntrack           16384  1 +-t              Show bus tree 
-ipt_REJECT             16384  2 + 
-nft_compat             20480  16 +Display options: 
-nf_nat_tftp            16384  0 +-v              Be verbose (-vv or -vvv for higher verbosity) 
-nft_objref             16384  1 +-k              Show kernel drivers handling each device 
-nf_conntrack_tftp      16384  3 nf_nat_tftp +-x              Show hex-dump of the standard part of the config space 
-nft_counter            16384  33 +-xxx            Show hex-dump of the whole config space (dangerous; root only) 
-tun                    53248  1 +-xxxx           Show hex-dump of the 4096-byte extended config space (root only) 
-bridge                192512  0 +-b              Bus-centric view (addresses and IRQ's as seen by the bus) 
-stp                    16384  1 bridge +-D              Always show domain numbers 
-llc                    16384  2 bridge,stp +-P              Display bridge path in addition to bus and device number 
-nft_fib_inet           16384  1 +-PP             Display bus path in addition to bus and device number 
-nft_fib_ipv4           16384  1 nft_fib_inet + 
-nft_fib_ipv6           16384  1 nft_fib_inet +Resolving of device ID's to names: 
-nft_fib                16384  3 nft_fib_ipv6,nft_fib_ipv4,nft_fib_inet +-n              Show numeric ID's 
-nft_reject_inet        16384  5 +-nn             Show both textual and numeric ID's (names & numbers) 
-nf_reject_ipv4         16384  2 nft_reject_inet,ipt_REJECT +-q              Query the PCI ID database for unknown ID's via DNS 
-nf_reject_ipv6         16384  1 nft_reject_inet +-qq             As abovebut re-query locally cached entries 
---More--+-Q              Query the PCI ID database for all ID's via DNS 
 + 
 +Selection of devices: 
 +-s [[[[<domain>]:]<bus>]:][<slot>][.[<func>]]   Show only devices in selected slots 
 +-d [<vendor>]:[<device>][:<class>             Show only devices with specified ID's 
 + 
 +Other options: 
 +-i <file>       Use specified ID database instead of /usr/share/hwdata/pci.ids 
 +-p <file>       Look up kernel modules in a given file instead of default modules.pcimap 
 +-M              Enable `bus 
 </code> </code>
  
-Pour supprimer un module, on peut utiliser la commande **rmmod** ou **modprobe -r**. Cette dernière essaie de supprimer les dépendances non-utilisées :+====1.2 La Commande lsusb==== 
 + 
 +Cette commande vous renseigne sur les adaptateurs reliés au bus usb :
  
 <code> <code>
-[root@centos8 ~]# modprobe -r bonding +[root@centos8 ~]# lsusb 
-[root@centos8 ~]# lsmod | more +Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd  
-Module                  Size  Used by +Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub 
-xt_CHECKSUM            16384  1 + 
-ipt_MASQUERADE         16384 +[root@centos8 ~]# lsusb -vt 
-xt_conntrack           16384  +/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M 
-ipt_REJECT             16384 +    |__ Port 1: Dev 2, If 0Class=Human Interface DeviceDriver=usbhid12M
-nft_compat             20480  16 +
-nf_nat_tftp            16384  0 +
-nft_objref             16384  1 +
-nf_conntrack_tftp      16384  3 nf_nat_tftp +
-nft_counter            16384  33 +
-tun                    53248  1 +
-bridge                192512 +
-stp                    16384  1 bridge +
-llc                    16384  bridge,stp +
-nft_fib_inet           16384 +
-nft_fib_ipv4           16384  1 nft_fib_inet +
-nft_fib_ipv6           16384  1 nft_fib_inet +
-nft_fib                16384  3 nft_fib_ipv6,nft_fib_ipv4,nft_fib_inet +
-nft_reject_inet        16384  5 +
-nf_reject_ipv4         16384  2 nft_reject_inet,ipt_REJECT +
-nf_reject_ipv6         16384  1 nft_reject_inet +
-nft_reject             16384  1 nft_reject_inet +
---More--+
 </code> </code>
  
-Les dépendances des modules sont résolues par la commande **modprobe** grâce aux fichier **/lib/modules/<version-du-noyau>/modules.dep**. Ce dernier peut être créé manuellement grâce à la commande **depmod** :+===Options de la commande=== 
 + 
 +Les options de cette commande sont :
  
 <code> <code>
-[root@centos8 ~]# more /lib/modules/`uname -r`/modules.dep +[root@centos8 ~]# lsusb --help 
-kernel/arch/x86/events/amd/power.ko.xz: +Usagelsusb [options]... 
-kernel/arch/x86/events/intel/intel-uncore.ko.xz: +List USB devices 
-kernel/arch/x86/events/intel/intel-cstate.ko.xz: +  -v, --verbose 
-kernel/arch/x86/events/rapl.ko.xz: +      Increase verbosity (show descriptors) 
-kernel/arch/x86/kernel/cpu/mce/mce-inject.ko.xz: +  -s [[bus]:][devnum] 
-kernel/arch/x86/crypto/des3_ede-x86_64.ko.xz: kernel/crypto/des_generic.ko.xz +      Show only devices with specified device and/or 
-kernel/arch/x86/crypto/camellia-x86_64.ko.xz: +      bus numbers (in decimal) 
-kernel/arch/x86/crypto/blowfish-x86_64.ko.xz: kernel/crypto/blowfish_common.ko.xz +  -d vendor:[product] 
-kernel/arch/x86/crypto/twofish-x86_64.ko.xzkernel/crypto/twofish_common.ko.xz +      Show only devices with the specified vendor and 
-kernel/arch/x86/crypto/twofish-x86_64-3way.ko.xz: kernel/arch/x86/crypto/twofish-x86_64.ko. +      product ID numbers (in hexadecimal) 
-xz kernel/crypto/twofish_common.ko.xz + .LAB#1 
-kernel/arch/x86/crypto/chacha20-x86_64.ko.xzkernel/crypto/chacha20_generic.ko.xz +  -D device 
-kernel/arch/x86/crypto/serpent-sse2-x86_64.ko.xz: kernel/crypto/serpent_generic.ko.xz +      Selects which device lsusb will examine 
-kernel/arch/x86/crypto/ghash-clmulni-intel.ko.xz: +  -t, --tree 
-kernel/arch/x86/crypto/crc32c-intel.ko.xz: +      Dump the physical USB device hierarchy as a tree 
-kernel/arch/x86/crypto/crc32-pclmul.ko.xz: +  -V, --version 
-kernel/arch/x86/crypto/sha512-ssse3.ko.xz: kernel/crypto/sha512_generic.ko.xz +      Show version of program 
-kernel/arch/x86/crypto/crct10dif-pclmul.ko.xz: +  -h, --help 
-kernel/arch/x86/crypto/poly1305-x86_64.ko.xz: kernel/crypto/poly1305_generic.ko.xz +      Show usage and help
-kernel/arch/x86/crypto/camellia-aesni-avx-x86_64.ko.xz: kernel/arch/x86/crypto/camellia-x86 +
-_64.ko.xz +
-kernel/arch/x86/crypto/cast5-avx-x86_64.ko.xz: kernel/crypto/cast5_generic.ko.xz kernel/cry +
---More--(0%)+
 </code> </code>
  
-Il est possible d'obtenir des informations sur un module grâce à la commande **modinfo** :+====1.3 - La Commande lsblk==== 
 + 
 +Cette commande vous rensigne sur les partitions des disques :
  
 <code> <code>
-[root@centos8 ~]# modinfo bonding +[root@centos8 ~]# lsblk 
-filename      /lib/modules/4.18.0-305.7.1.el8_4.x86_64/kernel/drivers/net/bonding/bonding.ko.xz +NAME                MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT 
-author        Thomas Davis, tadavis@lbl.gov and many others +sda                   8:0    0   32G  0 disk  
-description:    Ethernet Channel Bonding Driver +├─sda1                8:   0    1G  0 part /boot 
-license       GPL +└─sda2                8:2    0   31G  0 part  
-alias:          rtnl-link-bond +  ├─cl_centos8-root 253:   0 27.8G  0 lvm  / 
-rhelversion:    8.4 +  └─cl_centos8-swap 253:1    0  3.2G  lvm  [SWAP] 
-srcversion    445F4CC9A2F7E64E3A87FD0 +sdb                   8:16      4G  0 disk  
-depends:         +sdc                   8:32   0   64G  0 disk  
-intree:         Y +└─sdc1                8:33   0   64G  0 part /home 
-name:           bonding +sdd                   8:48   0   32G  0 disk  
-vermagic:       4.18.0-305.7.1.el8_4.x86_64 SMP mod_unload modversions  +sr0                  11:0    1 1024M  0 rom  
-sig_id        PKCS#7 + 
-signer:         CentOS kernel signing key +[root@centos8 ~]# lsblk -l 
-sig_key:        3B:5A:0A:B8:8E:4A:51:C0:AA:FF:97:FD:CB:94:D6:B6:D2:46:B8:17 +NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT 
-sig_hashalgo:   sha256 +sda               8:0    0   32G  0 disk  
-signature:      B2:3A:20:BE:2B:F3:E0:5A:1A:74:0E:69:76:40:2A:D4:80:10:2C:5A: +sda1              8:1    0    1G  0 part /boot 
-                B7:F1:1E:7A:71:13:29:F0:0A:4A:28:EE:81:33:C8:C2:5C:BD:FF:E4: +sda2              8:2    0   31G  0 part  
-                3F:A9:15:A3:9A:0E:A7:98:9E:99:06:23:10:47:D3:B2:48:B3:F1:61: +sdb               8:16      4G  disk  
-                BE:4B:B0:FC:62:B9:3B:D6:64:CC:E3:29:01:4D:91:92:32:FD:EB:54: +sdc               8:32     64G  disk  
-                44:F1:2C:1B:23:30:F1:3E:EE:69:EA:94:54:D9:A0:8D:16:53:F5:20: +sdc1              8:33     64G  0 part /home 
-                DE:38:A0:13:E8:2F:89:66:CB:11:D7:AA:30:37:7B:EC:DF:A1:69:29: +sdd               8:48     32G  0 disk  
-                7F:4E:80:4D:34:6E:F2:07:01:FA:18:23:94:58:10:C6:97:27:68:B9: +sr0              11:0    1024M  rom   
-                D8:08:5E:9D:00:17:F4:1B:48:BE:CA:BF:5C:5A:A8:6D:36:EE:3F:95: +cl_centos8-root 253:0    0 27.8G  0 lvm  / 
-                BA:BE:59:82:EE:7B:CA:BB:32:1E:E3:05:ED:C9:C2:C8:10:64:B9:29+cl_centos8-swap 253:1     3.2G  0 lvm  [SWAP]
-                B8:09:4B:79:42:65:1A:FA:99:96:BA:7E:2D:6E:75:F1:91:0E:F4:9A+
-                8F:11:10:9F:70:BD:35:06:BE:F0:4C:D8:AB:D5:C4:E1:B3:A2:2A:CA+
-                58:CA:9E:16:1D:0C:BE:9C:37:A1:82:20:6F:24:CD:23:63:F7:F5:BC+
-                6E:81:14:F0:52:DA:04:0E:9D:CC:17:60:2D:B0:D8:BD:6E:2C:AD:E7: +
-                50:48:49:B6:57:96:AC:FD:A4:29:33:01:43:92:32:88:A2:AC:CB:93: +
-                2F:C3:29:F3:01:77:84:00:AB:AA:C8:59:43:F1:DA:90:7B:5F:9A:A9: +
-                CA:60:97:34:85:5E:98:56:73:03:0D:D7:8D:A6:AB:51:D4:8C:92:91: +
-                0C:0A:BA:6B:92:01:16:FE:8B:86:80:11:5F:8E:21:BD:C2:2F:02:58: +
-                A6:CF:6C:E3:87:28:8B:4D:CE:54:8C:00:B3:F7:AE:9E:01:81:1E:83: +
-                AE:6D:58:B0:10:98:36:D9:69:76:E2:C0:E2:15:94:3B:D4:14:19:D9: +
-                59:86:75:31 +
-parm:           max_bonds:Max number of bonded devices (int) +
-parm:           tx_queues:Max number of transmit queues (default = 16) (int) +
-parm:           num_grat_arp:Number of peer notifications to send on failover event (alias of num_unsol_na) (int) +
-parm:           num_unsol_na:Number of peer notifications to send on failover event (alias of num_grat_arp) (int) +
-parm:           miimon:Link check interval in milliseconds (int) +
-parm:           updelay:Delay before considering link up, in milliseconds (int) +
-parm:           downdelay:Delay before considering link down, in milliseconds (int) +
-parm:           use_carrier:Use netif_carrier_ok (vs MII ioctls) in miimon; for off, 1 for on (default) (int) +
-parm:           mode:Mode of operation; for balance-rr, 1 for active-backup, 2 for balance-xor, 3 for broadcast, 4 for 802.3ad, 5 for balance-tlb, 6 for balance-alb (charp) +
-parm          primary:Primary network device to use (charp) +
-parm:           primary_reselect:Reselect primary slave once it comes up; for always (default), 1 for only if speed of primary is better, 2 for only on active slave failure (charp) +
-parm:           lacp_rate:LACPDU tx rate to request from 802.3ad partner; for slow, 1 for fast (charp) +
-parm          ad_select:802.3ad aggregation selection logic; for stable (default), 1 for bandwidth, 2 for count (charp) +
-parm          min_links:Minimum number of available links before turning on carrier (int) +
-parm:           xmit_hash_policy:balance-alb, balance-tlb, balance-xor, 802.3ad hashing method; for layer 2 (default), 1 for layer 3+4, 2 for layer 2+3, 3 for encap layer 2+3, 4 for encap layer 3+4, 5 for vlan+srcmac (charp) +
-parm          arp_interval:arp interval in milliseconds (int) +
-parm:           arp_ip_target:arp targets in n.n.n.n form (array of charp) +
-parm:           arp_validate:validate src/dst of ARP probes; for none (default), for active, 2 for backup, 3 for all (charp) +
-parm:           arp_all_targets:fail on any/all arp targets timeout; for any (default), 1 for all (charp) +
-parm:           fail_over_mac:For active-backup, do not set all slaves to the same MAC; 0 for none (default), 1 for active, 2 for follow (charp) +
-parm          all_slaves_active:Keep all frames received on an interface by setting active flag for all slaves; for never (default), 1 for always(int) +
-parm:           resend_igmp:Number of IGMP membership reports to send on link failure (int) +
-parm:           packets_per_slave:Packets to send per slave in balance-rr mode; 0 for a random slave, 1 packet per slave (default), >1 packets per slave. (int) +
-parm          lp_interval:The number of seconds between instances where the bonding driver sends learning packets to each slaves peer switch. The default is 1. (uint)+
 </code> </code>
  
-Dernièrement, les fichiers dans le repertoire **/etc/modprobe.d** sont utilisés pour spécifier les options éventuelles à passer aux modules lors de leur chargement ainsi que les alias utilisés pour leur faire référence :+===Options de la commande=== 
 + 
 +Les options de cette commande sont :
  
 <code> <code>
-[root@centos8 ~]# ls /etc/modprobe.d +[root@centos8 ~]# lsblk --help
-firewalld-sysctls.conf  lockd.conf  nvdimm-security.conf  tuned.conf +
-kvm.conf                mlx4.conf   truescale.conf        vhost.conf+
  
-[root@centos8 ~]# cat /etc/modprobe.d/kvm.conf  +Usage: 
-# Setting modprobe kvm_intel/kvm_amd nested = 1 + lsblk [options[<device> ...] 
-only enables Nested Virtualization until the next reboot or + 
-# module reloadUncomment the option applicable +List information about block devices. 
-# to your system below to enable the feature permanently. + 
-# +Options: 
-# User changes in this file are preserved across upgrades. + -a, --all            print all devices 
-# + -b, --bytes          print SIZE in bytes rather than in human readable format 
-# For Intel + -d, --nodeps         don't print slaves or holders 
-#options kvm_intel nested=1 + -D, --discard        print discard capabilities 
-# + -z, --zoned          print zone model 
-# For AMD + -e, --exclude <list> exclude devices by major number (default: RAM disks) 
-#options kvm_amd nested=1+ -f, --fs             output info about filesystems 
 + -i, --ascii          use ascii characters only 
 + -I, --include <list> show only devices with specified major numbers 
 + -J, --json           use JSON output format 
 + -l, --list           use list format output 
 + -T, --tree           use tree format output 
 + -m, --perms          output info about permissions 
 + -n, --noheadings     don't print headings 
 + -o, --output <list>  output columns 
 + -O, --output-all     output all columns 
 + -p, --paths          print complete device path 
 + -P, --pairs          use key="value" output format 
 + -r, --raw            use raw output format 
 + -s, --inverse        inverse dependencies 
 + -S, --scsi           output info about SCSI devices 
 + -t, --topology       output info about topology 
 + -x, --sort <column>  sort output by <column> 
 + 
 + -h, --help           display this help 
 + -V, --version        display version 
 + 
 +Available output columns: 
 +        NAME  device name 
 +       KNAME  internal kernel device name 
 +     MAJ:MIN  major:minor device number 
 +      FSTYPE  filesystem type 
 +  MOUNTPOINT  where the device is mounted 
 +       LABEL  filesystem LABEL 
 +        UUID  filesystem UUID 
 +    PARTTYPE  partition type UUID 
 +   PARTLABEL  partition LABEL 
 +    PARTUUID  partition UUID 
 +   PARTFLAGS  partition flags 
 +          RA  read-ahead of the device 
 +          RO  read-only device 
 +          RM  removable device 
 +     HOTPLUG  removable or hotplug device (usb, pcmcia, ...) 
 +       MODEL  device identifier 
 +      SERIAL  disk serial number 
 +        SIZE  size of the device 
 +       STATE  state of the device 
 +       OWNER  user name 
 +       GROUP  group name 
 +        MODE  device node permissions 
 +   ALIGNMENT  alignment offset 
 +      MIN-IO  minimum I/O size 
 +      OPT-IO  optimal I/O size 
 +     PHY-SEC  physical sector size 
 +     LOG-SEC  logical sector size 
 +        ROTA  rotational device 
 +       SCHED  I/O scheduler name 
 +     RQ-SIZE  request queue size 
 +        TYPE  device type 
 +    DISC-ALN  discard alignment offset 
 +   DISC-GRAN  discard granularity 
 +    DISC-MAX  discard max bytes 
 +   DISC-ZERO  discard zeroes data 
 +       WSAME  write same max bytes 
 +         WWN  unique storage identifier 
 +        RAND  adds randomness 
 +      PKNAME  internal parent kernel device name 
 +        HCTL  Host:Channel:Target:Lun for SCSI 
 +        TRAN  device transport type 
 +  SUBSYSTEMS  de-duplicated chain of subsystems 
 +         REV  device revision 
 +      VENDOR  device vendor 
 +       ZONED  zone model 
 + 
 +For more details see lsblk(8).
 </code> </code>
  
-=====LAB #2 Compilation et installation du noyau et des modules=====+====1.4 La Commande lsscsi====
  
-Activez le dépôt **CentOS-Linux-PowerTools** en passant la directive **enabled** à **1** :+Cette commmande vous renseigne sur les périphériques SCSI et NVMe :
  
 <code> <code>
-[root@centos8 ~]# vi /etc/yum.repos.d/CentOS-Linux-PowerTools.repo  +[root@centos8 ~]# lsscsi 
-[root@centos8 ~]# cat /etc/yum.repos.d/CentOS-Linux-PowerTools.repo  +[1:0:0:0]    cd/dvd  QEMU     QEMU DVD-ROM     2.5+  /dev/sr0  
-# CentOS-Linux-PowerTools.repo +[2:0:0:0   disk    ATA      QEMU HARDDISK    2.5+  /dev/sda  
-+[3:0:0:0]    disk    ATA      QEMU HARDDISK    2.5+  /dev/sdb  
-# The mirrorlist system uses the connecting IP address of the client and the +[4:0:0:0]    disk    ATA      QEMU HARDDISK    2.5+  /dev/sdc  
-# update status of each mirror to pick current mirrors that are geographically +[5:0:0:0]    disk    ATA      QEMU HARDDISK    2.5+  /dev/sdd  
-# close to the client.  You should use this for CentOS updates unless you are +</code>
-# manually picking other mirrors. +
-+
-# If the mirrorlist does not work for you, you can try the commented out +
-# baseurl line instead.+
  
-[powertools] +===Options de la commande=== 
-name=CentOS Linux $releasever - PowerTools + 
-mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=PowerTools&infra=$infra +Les options de cette commande sont : 
-#baseurl=http://mirror.centos.org/$contentdir/$releasever/PowerTools/$basearch/os+ 
-gpgcheck=1 +<code> 
-enabled=1 +[root@centos8 ~]man lsscsi  
-gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial+[root@centos8 ~]# lsscsi --help 
 +Usage: lsscsi   [--brief] [--classic] [--controllers] [--device] [--generic] 
 +                [--help] [--hosts] [--kname] [--list] [--long] [--long-unit] 
 +                [--lunhex] [--no-nvme] [--pdt] [--protection] [--prot-mode] 
 +                [--scsi_id] [--size] [--sz-lbs] [--sysfsroot=PATH] [--transport] 
 +                [--unit] [--verbose] [--version] [--wwn]  [<h:c:t:l>
 +  where: 
 +    --brief|-b        tuple and device name only 
 +    --classic|-c      alternate output similar to 'cat /proc/scsi/scsi' 
 +    --controllers|-C   synonym for --hosts since NVMe controllers treated 
 +                       like SCSI hosts 
 +    --device|-d       show device node's major + minor numbers 
 +    --generic|-g      show scsi generic device name 
 +    --help|-h         this usage information 
 +    --hosts|-H        lists scsi hosts rather than scsi devices 
 +    --kname|-k        show kernel name instead of device node name 
 +    --list|-L         additional information output one 
 +                      attribute=value per line 
 +    --long|-l         additional information output 
 +    --long-unit|-U    print LU name in full, use twice to prefix with 
 +                      '.naa', 'eui.', 'uuid.' or 't10.' 
 +    --lunhex|-x       show LUN part of tuple as hex number in T10 format; 
 +                      use twice to get full 16 digit hexadecimal LUN 
 +    --no-nvme|-N      exclude NVMe devices from output 
 +    --pdt|-D          show the peripheral device type in hex 
 +    --protection|-p   show target and initiator protection information 
 +    --protmode|-P     show negotiated protection information mode 
 +    --scsi_id|-i      show udev derived /dev/disk/by-id/scsi* entry 
 +    --size|-s         show disk size, (once for decimal (e.g. 3 GB), 
 +                      twice for power of two (e.g. 2.7 GiB), 
 +                      thrice for number of blocks)) 
 +    --sysfsroot=PATH|-y PATH    set sysfs mount point to PATH (def: /sys) 
 +    --sz-lbs|-S       show size as a number of logical blocks; if used twice 
 +                      adds comma followed by logical block size in bytes 
 +    --transport|-t    transport information for target or, if '--hosts' 
 +                      given, for initiator 
 +    --unit|-u         logical unit (LU) name (aka WWN for ATA/SATA) 
 +    --verbose|-v      output path names where data is found 
 +    --version|-V      output version string and exit 
 +    --wwn|-w          output WWN for disks (from /dev/disk/by-id/wwn*) 
 +    <h:c:t:l>         filter output list (def: '*:*:*:*' (all)). Meaning: 
 +                      <host_num:controller:target:lun> or for NVMe: 
 +                      <'N':ctl_num:cntlid:namespace_id> 
 + 
 +List SCSI devices or hosts, followed by NVMe namespaces or controllers. 
 +Many storage devices (e.g. SATA disks and USB attached storage) use SCSI 
 +command sets and hence are also listed by this utility. Hyphenated long 
 +options can also take underscore (and vice versa).
 </code> </code>
  
-Installez maintenant les paquets nécessaires :+====1.5 - La Commande lscpu==== 
 + 
 +Cett commande vous renseigne sur l'architecture des CPUs :
  
 <code> <code>
-[root@centos8 ~]# dnf groupinstall "Development Tools" +[root@centos8 ~]# lscpu 
-... +Architecture:        x86_64 
-[root@centos8 ~]# dnf install asciidoc audit-libs-devel bash bc binutils binutils-devel bison diffutils elfutils elfutils-devel elfutils-libelf-devel findutils flex gawk gcc gettext gzip hmaccalc hostname make module-init-tools ncurses-devel net-tools newt-devel numactl-devel openssl patch pciutils-devel perl perl-ExtUtils-Embed pesign redhat-rpm-config rpm-build rpmdevtools sh-utils tar xmlto xz zlib-devel +CPU op-mode(s):      32-bit, 64-bit 
-...+Byte Order:          Little Endian 
 +CPU(s):              8 
 +On-line CPU(s) list: 0-
 +Thread(s) per core:  1 
 +Core(s) per socket: 
 +Socket(s):           2 
 +NUMA node(s):        1 
 +Vendor ID:           GenuineIntel 
 +BIOS Vendor ID:      QEMU 
 +CPU family:          6 
 +Model:               158 
 +Model name:          Intel(R) Xeon(R) CPU E3-1270 v6 @ 3.80GHz 
 +BIOS Model name:     pc-i440fx-7.0 
 +Stepping:            9 
 +CPU MHz:             3791.998 
 +BogoMIPS:            7583.99 
 +Virtualization:      VT-x 
 +Hypervisor vendor:   KVM 
 +Virtualization type: full 
 +L1d cache:           32K 
 +L1i cache:           32K 
 +L2 cache:            4096K 
 +L3 cache:            16384K 
 +NUMA node0 CPU(s):   0-7 
 +Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl xtopology cpuid tsc_known_freq pni pclmulqdq vmx ssse3 fma cx16 pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 xsaves arat umip md_clear arch_capabilities
 </code> </code>
  
-====2.1 - Déplacer /home====+===Options de la commande===
  
-<WRAP center round alert 60%> +Les options de cette commande sont :
-**Important** - Il n'est pas conseillé de compiler en tant que root pour des raisons de sécurité. Pour pouvoir utiliser le compte d'un utilisateur pour créer un nouveau noyau, celui-ci doit disposer de plus de 10 Go d'espace libre. +
-</WRAP>+
  
-<WRAP center round todo 60%+<code
-**A faire** **Déconnectez-vous** de votre session **CentOS8_SSH_10.0.2.45** et re-connectez-vous à la VM en tant que root en utilisant la connexion **CentOS8_ROOT_10.0.2.45**. +[root@centos8 ~]# lscpu --help
-</WRAP>+
  
-Créez ensuite une seule partition sur **/dev/sdc** :+Usage: 
 + lscpu [options] 
 + 
 +Display information about the CPU architecture. 
 + 
 +Options: 
 + -a, --all               print both online and offline CPUs (default for -e) 
 + -b, --online            print online CPUs only (default for -p) 
 + -c, --offline           print offline CPUs only 
 + -J, --json              use JSON for default or extended format 
 + -e, --extended[=<list>] print out an extended readable format 
 + -p, --parse[=<list>   print out a parsable format 
 + -s, --sysroot <dir>     use specified directory as system root 
 + -x, --hex               print hexadecimal masks rather than lists of CPUs 
 + -y, --physical          print physical instead of logical IDs 
 + 
 + -h, --help              display this help 
 + -V, --version           display version 
 + 
 +Available output columns: 
 +           CPU  logical CPU number 
 +          CORE  logical core number 
 +        SOCKET  logical socket number 
 +       CLUSTER  logical cluster number 
 +          NODE  logical NUMA node number 
 +          BOOK  logical book number 
 +        DRAWER  logical drawer number 
 +         CACHE  shows how caches are shared between CPUs 
 +  POLARIZATION  CPU dispatching mode on virtual hardware 
 +       ADDRESS  physical address of a CPU 
 +    CONFIGURED  shows if the hypervisor has allocated the CPU 
 +        ONLINE  shows if Linux currently makes use of the CPU 
 +        MAXMHZ  shows the maximum MHz of the CPU 
 +        MINMHZ  shows the minimum MHz of the CPU 
 + 
 +For more details see lscpu(1). 
 +</code> 
 + 
 +====1.6 - La Command lshw==== 
 + 
 +Cette commande vous renseigne sur le matériel selon la **classe** de celui-ci. Commencez par visualiser les périphériques et leurs classes répectives :
  
 <code> <code>
-[root@centos8 ~]# fdisk /dev/sdc+[root@centos8 ~]# lshw -businfo 
 +Bus info          Device      Class      Description 
 +==================================================== 
 +                              system     Standard PC (i440FX + PIIX, 1996) 
 +                              bus        Motherboard 
 +                              memory     96KiB BIOS 
 +cpu@0                         processor  Intel(R) Xeon(R) CPU E3-1270 v6 @ 3.80GHz 
 +cpu@1                         processor  Intel(R) Xeon(R) CPU E3-1270 v6 @ 3.80GHz 
 +                              memory     16GiB System Memory 
 +                              memory     DIMM RAM [empty] 
 +pci@0000:00:00.0              bridge     440FX - 82441FX PMC [Natoma] 
 +pci@0000:00:01.0              bridge     82371SB PIIX3 ISA [Natoma/Triton II] 
 +                              input      PnP device PNP0303 
 +                              input      PnP device PNP0f13 
 +                              storage    PnP device PNP0700 
 +                              system     PnP device PNP0b00 
 +pci@0000:00:01.1  scsi1       storage    82371SB PIIX3 IDE [Natoma/Triton II] 
 +scsi@1:0.0.0      /dev/cdrom  disk       QEMU DVD-ROM 
 +pci@0000:00:01.2              bus        82371SB PIIX3 USB [Natoma/Triton II] 
 +usb@1             usb1        bus        UHCI Host Controller 
 +usb@1:          input5      input      QEMU QEMU USB Tablet 
 +pci@0000:00:01.3              bridge     82371AB/EB/MB PIIX4 ACPI 
 +pci@0000:00:02.0  /dev/fb0    display    bochs-drmdrmfb 
 +pci@0000:00:03.0              generic    Virtio memory balloon 
 +virtio@0                      generic    Virtual I/O device 
 +pci@0000:00:07.0  scsi2       storage    82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA Contr 
 +scsi@2:0.0.0      /dev/sda    disk       34GB QEMU HARDDISK 
 +scsi@2:0.0.0,   /dev/sda1   volume     1GiB EXT4 volume 
 +scsi@2:0.0.0,   /dev/sda2   volume     30GiB Linux LVM Physical Volume partition 
 +scsi@3:0.0.0      /dev/sdb    disk       4294MB QEMU HARDDISK 
 +scsi@4:0.0.0      /dev/sdc    disk       68GB QEMU HARDDISK 
 +scsi@4:0.0.0,   /dev/sdc1   volume     63GiB EXT4 volume 
 +scsi@5:0.0.0      /dev/sdd    disk       34GB QEMU HARDDISK 
 +pci@0000:00:12.0              network    Virtio network device 
 +virtio@1          ens18       network    Ethernet interface 
 +pci@0000:00:13.0              network    Virtio network device 
 +virtio@2          ens19       network    Ethernet interface 
 +pci@0000:00:1e.0              bridge     QEMU PCI-PCI bridge 
 +pci@0000:00:1f.0              bridge     QEMU PCI-PCI bridge 
 +                  input0      input      Power Button 
 +                  input1      input      AT Translated Set 2 keyboard 
 +                  input3      input      VirtualPS/2 VMware VMMouse 
 +                  input4      input      VirtualPS/2 VMware VMMouse 
 +                  input6      input      PC Speaker 
 +</code>
  
-Welcome to fdisk (util-linux 2.32.1). +Consultez maintenant le matériel de la classe **system** :
-Changes will remain in memory only, until you decide to write them. +
-Be careful before using the write command.+
  
-Device does not contain a recognized partition table+<code> 
-Created a new DOS disklabel with disk identifier 0xc321702b.+[root@centos8 ~]# lshw -c system 
 +centos8.ittraining.loc       
 +    description: Computer 
 +    product: Standard PC (i440FX + PIIX, 1996) 
 +    vendor: QEMU 
 +    version: pc-i440fx-7.
 +    width: 64 bits 
 +    capabilities: smbios-2.8 dmi-2.8 smp vsyscall32 
 +    configuration: boot=normal uuid=95bd69e3-4a74-44a7-b58c-b74fbfb86df2 
 +  *-pnp00:03 
 +       product: PnP device PNP0b00 
 +       physical id: 3 
 +       capabilities: pnp 
 +       configuration: driver=rtc_cmos 
 +</code>
  
-Command (m for help): n +Consultez maintenant le matériel des autres classes principales :
-Partition type +
-     primary (0 primary, 0 extended, 4 free) +
-     extended (container for logical partitions) +
-Select (default p)+
  
-Using default response p. +<code> 
-Partition number (1-4, default 1):  +[root@centos8 ~]# lshw -c memory 
-First sector (2048-41943039, default 2048):  +  *-firmware                 
-Last sector, +sectors or +size{K,M,G,T,P} (2048-41943039, default 41943039)+       description: BIOS 
 +       vendor: SeaBIOS 
 +       physical id: 0 
 +       version: rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 
 +       date04/01/2014 
 +       size: 96KiB 
 +  *-memory 
 +       descriptionSystem Memory 
 +       physical id: 1000 
 +       size: 16GiB 
 +       capabilities: ecc 
 +       configuration: errordetection=multi-bit-ecc 
 +     *-bank 
 +          description: DIMM RAM [empty] 
 +          vendor: QEMU 
 +          physical id: 0 
 +          slotDIMM 0
  
-Created a new partition 1 of type 'Linux' and of size 20 GiB.+[root@centos8 ~]# lshw -c video 
 +  *-display                  
 +       description: VGA compatible controller 
 +       product: bochs-drmdrmfb 
 +       physical id: 2 
 +       bus info: pci@0000:00:02.
 +       logical name: /dev/fb0 
 +       version: 02 
 +       width: 32 bits 
 +       clock: 33MHz 
 +       capabilities: vga_controller rom fb 
 +       configuration: depth=32 driver=bochs-drm latency=0 resolution=1280,800 
 +       resources: irq:0 memory:fd000000-fdffffff memory:fea90000-fea90fff memory:c0000-dffff
  
-Command (m for help): w + 
-The partition table has been altered+[root@centos8 ~]# lshw -c storage 
-Calling ioctl() to re-read partition table+  *-pnp00:02                 
-Syncing disks.+       product: PnP device PNP0700 
 +       physical id: 2 
 +       capabilities: pnp 
 +  *-ide 
 +       description: IDE interface 
 +       product: 82371SB PIIX3 IDE [Natoma/Triton II] 
 +       vendor: Intel Corporation 
 +       physical id: 1.1 
 +       bus info: pci@0000:00:01.1 
 +       logical name: scsi1 
 +       version: 00 
 +       width: 32 bits 
 +       clock: 33MHz 
 +       capabilities: ide isa_compat_mode bus_master emulated 
 +       configuration: driver=ata_piix latency=0 
 +       resources: irq:0 ioport:1f0(size=8ioport:3f6 ioport:170(size=8) ioport:376 ioport:e0c0(size=16) 
 +  *-sata 
 +       description: SATA controller 
 +       product: 82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA Controller [AHCI mode] 
 +       vendor: Intel Corporation 
 +       physical id: 7 
 +       bus info: pci@0000:00:07.0 
 +       logical name: scsi2 
 +       logical name: scsi3 
 +       logical name: scsi4 
 +       logical name: scsi5 
 +       version: 02 
 +       width: 32 bits 
 +       clock: 33MHz 
 +       capabilities: sata msi ahci_1.0 bus_master cap_list emulated 
 +       configuration: driver=ahci latency=0 
 +       resources: irq:30 ioport:e060(size=32memory:fea91000-fea91fff 
 + 
 + 
 +[root@centos8 ~]# lshw -c disk 
 +  *-cdrom                    
 +       description: DVD reader 
 +       product: QEMU DVD-ROM 
 +       vendor: QEMU 
 +       physical id: 0.0.0 
 +       bus info: scsi@1:0.0.0 
 +       logical name: /dev/cdrom 
 +       logical name: /dev/sr0 
 +       version: 2.5+ 
 +       capabilities: removable audio dvd 
 +       configuration: ansiversion=5 status=nodisc 
 +  *-disk:0 
 +       description: ATA Disk 
 +       product: QEMU HARDDISK 
 +       physical id: 0 
 +       bus info: scsi@2:0.0.0 
 +       logical name: /dev/sda 
 +       version: 2.5+ 
 +       serial: QM00005 
 +       size: 32GiB (34GB) 
 +       capabilities: partitioned partitioned:dos 
 +       configuration: ansiversion=5 logicalsectorsize=512 sectorsize=512 signature=b39ec5c8 
 +  *-disk:1 
 +       description: ATA Disk 
 +       product: QEMU HARDDISK 
 +       physical id: 1 
 +       bus info: scsi@3:0.0.0 
 +       logical name: /dev/sdb 
 +       version: 2.5+ 
 +       serial: QM00007 
 +       size: 4GiB (4294MB) 
 +       configuration: ansiversion=5 logicalsectorsize=512 sectorsize=512 
 +  *-disk:2 
 +       description: ATA Disk 
 +       product: QEMU HARDDISK 
 +       physical id: 2 
 +       bus info: scsi@4:0.0.0 
 +       logical name: /dev/sdc 
 +       version: 2.5+ 
 +       serial: QM00009 
 +       size: 64GiB (68GB) 
 +       capabilities: partitioned partitioned:dos 
 +       configuration: ansiversion=5 logicalsectorsize=512 sectorsize=512 signature=45352f44 
 +  *-disk:3 
 +       description: ATA Disk 
 +       product: QEMU HARDDISK 
 +       physical id: 3 
 +       bus info: scsi@5:0.0.0 
 +       logical name: /dev/sdd 
 +       version: 2.5+ 
 +       serial: QM00011 
 +       size: 32GiB (34GB) 
 +       configuration: ansiversion=5 logicalsectorsize=512 sectorsize=512 
 + 
 + 
 +[root@centos8 ~]# lshw -c volume 
 +  *-volume:                
 +       description: EXT4 volume 
 +       vendor: Linux 
 +       physical id: 1 
 +       bus info: scsi@2:0.0.0,
 +       logical name: /dev/sda1 
 +       logical name: /boot 
 +       version: 1.0 
 +       serial: 1c04981e-5317-4b73-9695-3ce25246835d 
 +       size: 1GiB 
 +       capacity: 1GiB 
 +       capabilities: primary bootable journaled extended_attributes large_files huge_files dir_nlink recover 64bit extents ext4 ext2 initialized 
 +       configuration: created=2021-06-16 12:21:27 filesystem=ext4 lastmountpoint=/boot modified=2022-11-10 07:12:41 mount.fstype=ext4 mount.options=rw,seclabel,relatime mounted=2022-11-10 07:12:41 state=mounted 
 +  *-volume:
 +       description: Linux LVM Physical Volume partition 
 +       physical id: 2 
 +       bus info: scsi@2:0.0.0,2 
 +       logical name: /dev/sda2 
 +       serial: kOJTuY-TbBA-JSvU-vhkb-rvpz-QoPt-bIKe2e 
 +       size: 30GiB 
 +       capacity: 30GiB 
 +       capabilities: primary multi lvm2 
 +  *-volume 
 +       description: EXT4 volume 
 +       vendor: Linux 
 +       physical id: 1 
 +       bus info: scsi@4:0.0.0,
 +       logical name: /dev/sdc1 
 +       logical name: /home 
 +       version: 1.0 
 +       serial: f76d6b66-985b-4a91-af9c-4987e8c1443c 
 +       size: 63GiB 
 +       capacity: 63GiB 
 +       capabilities: primary journaled extended_attributes large_files huge_files dir_nlink recover 64bit extents ext4 ext2 initialized 
 +       configuration: created=2021-07-19 18:02:13 filesystem=ext4 lastmountpoint=/home modified=2022-11-10 15:34:07 mount.fstype=ext4 mount.options=rw,seclabel,relatime mounted=2022-11-10 15:34:07 state=mounted 
 + 
 +[root@centos8 ~]# lshw -c network 
 +  *-network:               
 +       description: Ethernet controller 
 +       product: Virtio network device 
 +       vendor: Red Hat, Inc. 
 +       physical id: 12 
 +       bus info: pci@0000:00:12.0 
 +       version: 00 
 +       width: 64 bits 
 +       clock: 33MHz 
 +       capabilities: msix bus_master cap_list rom 
 +       configuration: driver=virtio-pci latency=0 
 +       resources: irq:10 ioport:e080(size=32) memory:fea92000-fea92fff memory:fe404000-fe407fff memory:fea00000-fea3ffff 
 +     *-virtio1 
 +          description: Ethernet interface 
 +          physical id: 0 
 +          bus info: virtio@1 
 +          logical name: ens18 
 +          serial: 5e:3f:e8:43:d5:f9 
 +          capabilities: ethernet physical 
 +          configuration: autonegotiation=off broadcast=yes driver=virtio_net driverversion=1.0.0 ip=10.0.2.45 link=yes multicast=yes 
 +  *-network:
 +       description: Ethernet controller 
 +       product: Virtio network device 
 +       vendor: Red Hat, Inc. 
 +       physical id: 13 
 +       bus info: pci@0000:00:13.0 
 +       version: 00 
 +       width: 64 bits 
 +       clock: 33MHz 
 +       capabilities: msix bus_master cap_list rom 
 +       configuration: driver=virtio-pci latency=0 
 +       resources: irq:10 ioport:e0a0(size=32) memory:fea93000-fea93fff memory:fe408000-fe40bfff memory:fea40000-fea7ffff 
 +     *-virtio2 
 +          description: Ethernet interface 
 +          physical id: 0 
 +          bus info: virtio@2 
 +          logical name: ens19 
 +          serial: ea:c8:86:9e:73:a6 
 +          capabilities: ethernet physical 
 +          configuration: autonegotiation=off broadcast=yes driver=virtio_net driverversion=1.0.0 link=yes multicast=yes
 </code> </code>
  
-Créez maintenant un système de fichiers ext4 sur **/dev/sdc1** :+===Options de la commande=== 
 + 
 +Les options de cette commande sont :
  
 <code> <code>
-[root@centos8 ~]# mkfs.ext4 /dev/sdc1 +[root@centos8 ~]# lshw -h 
-mke2fs 1.45.6 (20-Mar-2020) +Hardware Lister (lshw) - B.02.19.2 
-Discarding device blocksdone                             +usagelshw [-format] [-options ...] 
-Creating filesystem with 16776960 4k blocks and 4194304 inodes +       lshw -version
-Filesystem UUID: dc92c0d7-919b-4fff-8719-53e9e7e628dd +
-Superblock backups stored on blocks:  +
-        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,  +
-        4096000, 7962624, 11239424+
  
-Allocating group tables: done                             +        -version        print program version (B.02.19.2) 
-Writing inode tables: done                             + 
-Creating journal (65536 blocks): done +format can be 
-Writing superblocks and filesystem accounting information: done +        -html           output hardware tree as HTML 
 +        -xml            output hardware tree as XML 
 +        -json           output hardware tree as a JSON object 
 +        -short          output hardware paths 
 +        -businfo        output bus information 
 + 
 +options can be 
 +        -dump filename  displays output and dump collected information into a file (SQLite database
 +        -class CLASS    only show a certain class of hardware 
 +        -C CLASS        same as '-class CLASS' 
 +        -c CLASS        same as '-class CLASS' 
 +        -disable TEST   disable a test (like pci, isapnp, cpuid, etc. ) 
 +        -enable TEST    enable a test (like pci, isapnp, cpuid, etc. ) 
 +        -quiet          don't display status 
 +        -sanitize       sanitize output (remove sensitive information like serial numbers, etc.) 
 +        -numeric        output numeric IDs (for PCI, USB, etc.) 
 +        -notime         exclude volatile attributes (timestamps) from output
 </code> </code>
  
-Montez **/dev/sdc1** sur /mnt :+====1.7 - La Commande dmidecode==== 
 + 
 +La commande **dmidecode** lit la table **DMI** (//Desktop Management Interface//) aussi appelée **SMBIOS** (//System Management BIOS//) et fourni les informations sur : 
 + 
 +  * l'état du matériel actuel, 
 +  * les extensions possibles.
  
 <code> <code>
-[root@centos8 ~]# mount /dev/sdc1 /mnt+[root@centos8 ~]# dmidecode 
 +# dmidecode 3.2 
 +Getting SMBIOS data from sysfs. 
 +SMBIOS 2.8 present. 
 +11 structures occupying 511 bytes. 
 +Table at 0x000F5870. 
 + 
 +Handle 0x0000, DMI type 0, 24 bytes 
 +BIOS Information 
 +        Vendor: SeaBIOS 
 +        Version: rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 
 +        Release Date: 04/01/2014 
 +        Address: 0xE8000 
 +        Runtime Size: 96 kB 
 +        ROM Size: 64 kB 
 +        Characteristics: 
 +                BIOS characteristics not supported 
 +                Targeted content distribution is supported 
 +        BIOS Revision: 0.0 
 + 
 +Handle 0x0100, DMI type 1, 27 bytes 
 +System Information 
 +        Manufacturer: QEMU 
 +        Product Name: Standard PC (i440FX + PIIX, 1996) 
 +        Version: pc-i440fx-5.2 
 +        Serial Number: Not Specified 
 +        UUID: 95bd69e3-4a74-44a7-b58c-b74fbfb86df2 
 +        Wake-up Type: Power Switch 
 +        SKU Number: Not Specified 
 +        Family: Not Specified 
 + 
 +Handle 0x0300, DMI type 3, 22 bytes 
 +Chassis Information 
 +        Manufacturer: QEMU 
 +        Type: Other 
 +        Lock: Not Present 
 +        Version: pc-i440fx-5.2 
 +        Serial Number: Not Specified 
 +        Asset Tag: Not Specified 
 +        Boot-up State: Safe 
 +        Power Supply State: Safe 
 +        Thermal State: Safe 
 +        Security Status: Unknown 
 +        OEM Information: 0x00000000 
 +        Height: Unspecified 
 +        Number Of Power Cords: Unspecified 
 +        Contained Elements: 0 
 +        SKU Number: Not Specified 
 + 
 +Handle 0x0400, DMI type 4, 42 bytes 
 +Processor Information 
 +        Socket Designation: CPU 0 
 +        Type: Central Processor 
 +        Family: Other 
 +        Manufacturer: QEMU 
 +        ID: 61 0F 00 00 FF FB 8B 07 
 +        Version: pc-i440fx-5.2 
 +        Voltage: Unknown 
 +        External Clock: Unknown 
 +        Max Speed: 2000 MHz 
 +        Current Speed: 2000 MHz 
 +        Status: Populated, Enabled 
 +        Upgrade: Other 
 +        L1 Cache Handle: Not Provided 
 +        L2 Cache Handle: Not Provided 
 +        L3 Cache Handle: Not Provided 
 +        Serial Number: Not Specified 
 +        Asset Tag: Not Specified 
 +        Part Number: Not Specified 
 +        Core Count: 4 
 +        Core Enabled: 4 
 +        Thread Count: 1 
 +        Characteristics: None 
 + 
 +Handle 0x0401, DMI type 4, 42 bytes 
 +Processor Information 
 +        Socket Designation: CPU 1 
 +        Type: Central Processor 
 +        Family: Other 
 +        Manufacturer: QEMU 
 +        ID: 61 0F 00 00 FF FB 8B 07 
 +        Version: pc-i440fx-5.2 
 +        Voltage: Unknown 
 +        External Clock: Unknown 
 +        Max Speed: 2000 MHz 
 +        Current Speed: 2000 MHz 
 +        Status: Populated, Enabled 
 +        Upgrade: Other 
 +        L1 Cache Handle: Not Provided 
 +        L2 Cache Handle: Not Provided 
 +        L3 Cache Handle: Not Provided 
 +        Serial Number: Not Specified 
 +        Asset Tag: Not Specified 
 +        Part Number: Not Specified 
 +        Core Count: 4 
 +        Core Enabled: 4 
 +        Thread Count: 1 
 +        Characteristics: None 
 + 
 +Handle 0x1000, DMI type 16, 23 bytes 
 +Physical Memory Array 
 +        Location: Other 
 +        Use: System Memory 
 +        Error Correction Type: Multi-bit ECC 
 +        Maximum Capacity: 4 GB 
 +        Error Information Handle: Not Provided 
 +        Number Of Devices: 1 
 + 
 +Handle 0x1100, DMI type 17, 40 bytes 
 +Memory Device 
 +        Array Handle: 0x1000 
 +        Error Information Handle: Not Provided 
 +        Total Width: Unknown 
 +        Data Width: Unknown 
 +        Size: 4 GB 
 +        Form Factor: DIMM 
 +        Set: None 
 +        Locator: DIMM 0 
 +        Bank Locator: Not Specified 
 +        Type: RAM 
 +        Type Detail: Other 
 +        Speed: Unknown 
 +        Manufacturer: QEMU 
 +        Serial Number: Not Specified 
 +        Asset Tag: Not Specified 
 +        Part Number: Not Specified 
 +        Rank: Unknown 
 +        Configured Memory Speed: Unknown 
 +        Minimum Voltage: Unknown 
 +        Maximum Voltage: Unknown 
 +        Configured Voltage: Unknown 
 + 
 +Handle 0x1300, DMI type 19, 31 bytes 
 +Memory Array Mapped Address 
 +        Starting Address: 0x00000000000 
 +        Ending Address: 0x000BFFFFFFF 
 +        Range Size: 3 GB 
 +        Physical Array Handle: 0x1000 
 +        Partition Width: 1 
 + 
 +Handle 0x1301, DMI type 19, 31 bytes 
 +Memory Array Mapped Address 
 +        Starting Address: 0x00100000000 
 +        Ending Address: 0x0013FFFFFFF 
 +        Range Size: 1 GB 
 +        Physical Array Handle: 0x1000 
 +        Partition Width: 1 
 + 
 +Handle 0x2000, DMI type 32, 11 bytes 
 +System Boot Information 
 +        Status: No errors detected 
 + 
 +Handle 0x7F00, DMI type 127, 4 bytes 
 +End Of Table
 </code> </code>
  
-Copiez le contenu de /home vers /mnt :+===Options de la commande=== 
 + 
 +Les options de cette commande sont :
  
 <code> <code>
-[root@centos8 ~]# cp -/home/* /mnt+[root@centos7 ~]# dmidecode --help 
 +Usage: dmidecode [OPTIONS] 
 +Options are: 
 + -d, --dev-mem FILE     Read memory from device FILE (default: /dev/mem) 
 + -h, --help             Display this help text and exit 
 + -q, --quiet            Less verbose output 
 + -s, --string KEYWORD   Only display the value of the given DMI string 
 + -t, --type TYPE        Only display the entries of given type 
 + -u, --dump             Do not decode the entries 
 +     --dump-bin FILE    Dump the DMI data to a binary file 
 +     --from-dump FILE   Read the DMI data from a binary file 
 + -V, --version          Display the version and exit
 </code> </code>
  
-Démontez /dev/sdc1 et déplacez /home vers /root :+====1.8 - La Commande smartctl==== 
 + 
 +**smartctl** contrôle le système SMART (Self-Monitoring, Analysis and Reporting Technology) intégré à la plupart des disques durs et disques SSD ATA/SATA et SCSI/SAS :
  
 <code> <code>
-[root@centos8 ~]# umount /mnt +[root@centos8 ~]# smartctl --smart=on --saveauto=on --offlineauto=on /dev/sdb 
-[root@centos8 ~]# mv /home /root+ 
 +[root@centos8 ~]# smartctl -a /dev/sdb 
 +smartctl 7.1 2020-04-05 r5049 [x86_64-linux-4.18.0-305.7.1.el8_4.x86_64] (local build) 
 +Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org 
 + 
 +=== START OF INFORMATION SECTION === 
 +Device Model:     QEMU HARDDISK 
 +Serial Number:    QM00007 
 +Firmware Version: 2.5+ 
 +User Capacity:    4,294,967,296 bytes [4.29 GB] 
 +Sector Size:      512 bytes logical/physical 
 +Device is:        Not in smartctl database [for details use: -P showall] 
 +ATA Version is:   ATA/ATAPI-7, ATA/ATAPI-5 published, ANSI NCITS 340-2000 
 +Local Time is:    Sun Nov 13 09:12:18 2022 CET 
 +SMART support is: Available - device has SMART capability. 
 +SMART support is: Enabled 
 + 
 +=== START OF READ SMART DATA SECTION === 
 +SMART overall-health self-assessment test result: PASSED 
 + 
 +General SMART Values: 
 +Offline data collection status:  (0x02) Offline data collection activity 
 +                                        was completed without error. 
 +                                        Auto Offline Data Collection: Disabled. 
 +Self-test execution status:      (   0) The previous self-test routine completed 
 +                                        without error or no self-test has ever  
 +                                        been run. 
 +Total time to complete Offline  
 +data collection:                (  288) seconds. 
 +Offline data collection 
 +capabilities:                    (0x19) SMART execute Offline immediate. 
 +                                        No Auto Offline data collection support. 
 +                                        Suspend Offline collection upon new 
 +                                        command. 
 +                                        Offline surface scan supported. 
 +                                        Self-test supported. 
 +                                        No Conveyance Self-test supported. 
 +                                        No Selective Self-test supported. 
 +SMART capabilities:            (0x0003) Saves SMART data before entering 
 +                                        power-saving mode. 
 +                                        Supports SMART auto save timer. 
 +Error logging capability:        (0x01) Error logging supported. 
 +                                        No General Purpose Logging support. 
 +Short self-test routine  
 +recommended polling time:        (   2) minutes. 
 +Extended self-test routine 
 +recommended polling time:        (  54) minutes. 
 + 
 +SMART Attributes Data Structure revision number: 1 
 +Vendor Specific SMART Attributes with Thresholds: 
 +ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE 
 +  1 Raw_Read_Error_Rate     0x0003   100   100   006    Pre-fail  Always             0 
 +  3 Spin_Up_Time            0x0003   100   100   000    Pre-fail  Always             16 
 +  4 Start_Stop_Count        0x0002   100   100   020    Old_age   Always             100 
 +  5 Reallocated_Sector_Ct   0x0003   100   100   036    Pre-fail  Always             0 
 +  9 Power_On_Hours          0x0003   100   100   000    Pre-fail  Always             1 
 + 12 Power_Cycle_Count       0x0003   100   100   000    Pre-fail  Always             0 
 +190 Airflow_Temperature_Cel 0x0003   069   069   050    Pre-fail  Always             31 (Min/Max 31/31) 
 + 
 +SMART Error Log Version: 1 
 +No Errors Logged 
 + 
 +SMART Self-test log structure revision number 1 
 +No self-tests have been logged.  [To run self-tests, use: smartctl -t] 
 + 
 +Selective Self-tests/Logging not supported
 </code> </code>
  
-Identifiez l'UUID de /dev/sdc1 :+===Options de la commande=== 
 + 
 +Les options de cette commande sont :
  
 <code> <code>
-[root@centos8 ~]# ls -/dev/disk/by-uuid/ | grep sdc1 +[root@centos8 ~]# smartctl --help 
-lrwxrwxrwx1 root root 10 Jul 19 12:02 f76d6b66-985b-4a91-af9c-4987e8c1443c -> ../../sdc +smartctl 7.1 2020-04-05 r5049 [x86_64-linux-4.18.0-305.7.1.el8_4.x86_64] (local build) 
-[root@centos8 ~]+Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org 
 + 
 +Usage: smartctl [options] device 
 + 
 +============================================ SHOW INFORMATION OPTIONS ===== 
 + 
 +  -h, --help, --usage 
 +         Display this help and exit 
 + 
 +  -V, --version, --copyright, --license 
 +         Print license, copyright, and version information and exit 
 + 
 +  -i, --info 
 +         Show identity information for device 
 + 
 +  --identify[=[w][nvb]] 
 +         Show words and bits from IDENTIFY DEVICE data                (ATA) 
 + 
 +  -g NAME, --get=NAME 
 +        Get device setting: all, aam, apm, dsn, lookahead, security, 
 +        wcache, rcache, wcreorder, wcache-sct 
 + 
 +  -a, --all 
 +         Show all SMART information for device 
 + 
 +  -x, --xall 
 +         Show all information for device 
 + 
 +  --scan 
 +         Scan for devices 
 + 
 +  --scan-open 
 +         Scan for devices and try to open each device 
 + 
 +================================== SMARTCTL RUN-TIME BEHAVIOR OPTIONS ===== 
 + 
 +  -j, --json[=[cgiosuv]] 
 +         Print output in JSON format 
 + 
 +  -q TYPE, --quietmode=TYPE                                           (ATA) 
 +         Set smartctl quiet mode to one of: errorsonly, silent, noserial 
 + 
 +  -d TYPE, --device=TYPE 
 +         Specify device type to one of: 
 +         ata, scsi[+TYPE], nvme[,NSID], sat[,auto][,N][+TYPE], usbcypress[,X], usbjmicron[,p][,x][,N], usbprolific, usbsunplus, sntjmicron[,NSID], intelliprop,N[+TYPE], jmb39x,N[,sLBA][,force][+TYPE], marvell, areca,N/E, 3ware,N, hpt,L/M/N, megaraid,N, aacraid,H,L,ID, cciss,N, auto, test 
 + 
 +  -T TYPE, --tolerance=TYPE                                           (ATA) 
 +         Tolerance: normal, conservative, permissive, verypermissive 
 + 
 +  -b TYPE, --badsum=TYPE                                              (ATA) 
 +         Set action on bad checksum to one of: warn, exit, ignore 
 + 
 +  -r TYPE, --report=TYPE 
 +         Report transactions (see man page) 
 + 
 +  -n MODE[,STATUS], --nocheck=MODE[,STATUS]                           (ATA) 
 +         No check if: never, sleep, standby, idle (see man page) 
 + 
 +============================== DEVICE FEATURE ENABLE/DISABLE COMMANDS ===== 
 + 
 +  -s VALUE, --smart=VALUE 
 +        Enable/disable SMART on device (on/off) 
 + 
 +  -o VALUE, --offlineauto=VALUE                                       (ATA) 
 +        Enable/disable automatic offline testing on device (on/off) 
 + 
 +  -S VALUE, --saveauto=VALUE                                          (ATA) 
 +        Enable/disable Attribute autosave on device (on/off) 
 + 
 +  -s NAME[,VALUE], --set=NAME[,VALUE] 
 +        Enable/disable/change device setting: aam,[N|off], apm,[N|off], 
 +        dsn,[on|off], lookahead,[on|off], security-freeze, 
 +        standby,[N|off|now], wcache,[on|off], rcache,[on|off], 
 +        wcreorder,[on|off[,p]], wcache-sct,[ata|on|off[,p]] 
 + 
 +======================================= READ AND DISPLAY DATA OPTIONS ===== 
 + 
 +  -H, --health 
 +        Show device SMART health status 
 + 
 +  -c, --capabilities                                            (ATA, NVMe) 
 +        Show device SMART capabilities 
 + 
 +  -A, --attributes 
 +        Show device SMART vendor-specific Attributes and values 
 + 
 +  -f FORMAT, --format=FORMAT                                          (ATA) 
 +        Set output format for attributes: old, brief, hex[,id|val] 
 + 
 +  -l TYPE, --log=TYPE 
 +        Show device logTYPEerror, selftest, selective, directory[,g|s], 
 +        xerror[,N][,error], xselftest[,N][,selftest], background, 
 +        sasphy[,reset], sataphy[,reset], scttemp[sts,hist], 
 +        scttempint,N[,p], scterc[,N,M], devstat[,N], defects[,N], ssd, 
 +        gplog,N[,RANGE], smartlog,N[,RANGE], nvmelog,N,SIZE 
 + 
 +  -v N,OPTION , --vendorattribute=N,OPTION                            (ATA) 
 +        Set display OPTION for vendor Attribute N (see man page) 
 + 
 +  -F TYPE, --firmwarebug=TYPE                                         (ATA) 
 +        Use firmware bug workaround: 
 +        none, nologdir, samsung, samsung2, samsung3, xerrorlba, swapid 
 + 
 +  -P TYPE, --presets=TYPE                                             (ATA) 
 +        Drive-specific presets: use, ignore, show, showall 
 + 
 +  -B [+]FILE, --drivedb=[+]FILE                                       (ATA) 
 +        Read and replace [add] drive database from FILE 
 +        [default is +/etc/smartmontools/smart_drivedb.
 +         and then    /usr/share/smartmontools/drivedb.h] 
 + 
 +============================================ DEVICE SELF-TEST OPTIONS ===== 
 + 
 +  -t TEST, --test=TEST 
 +        Run testTEST: offline, short, long, conveyance, force, vendor,N, 
 +                        select,M-N, pending,N, afterselect,[on|off] 
 + 
 +  -C, --captive 
 +        Do test in captive mode (along with -t) 
 + 
 +  -X, --abort 
 +        Abort any non-captive test on device 
 + 
 +=================================================== SMARTCTL EXAMPLES ===== 
 + 
 +  smartctl --all /dev/sda                    (Prints all SMART information) 
 + 
 +  smartctl --smart=on --offlineauto=on --saveauto=on /dev/sda 
 +                                              (Enables SMART on first disk) 
 + 
 +  smartctl --test=long /dev/sda          (Executes extended disk self-test) 
 + 
 +  smartctl --attributes --log=selftest --quietmode=errorsonly /dev/sda 
 +                                      (Prints Self-Test & Attribute errors) 
 +  smartctl --all --device=3ware,2 /dev/sda 
 +  smartctl --all --device=3ware,2 /dev/twe0 
 +  smartctl --all --device=3ware,2 /dev/twa0 
 +  smartctl --all --device=3ware,2 /dev/twl0 
 +          (Prints all SMART info for 3rd ATA disk on 3ware RAID controller) 
 +  smartctl --all --device=hpt,1/1/3 /dev/sda 
 +          (Prints all SMART info for the SATA disk attached to the 3rd PMPort 
 +           of the 1st channel on the 1st HighPoint RAID controller) 
 +  smartctl --all --device=areca,3/1 /dev/sg2 
 +          (Prints all SMART info for 3rd ATA disk of the 1st enclosure 
 +           on Areca RAID controller)
 </code> </code>
  
-Editez le fichier **/etc/fstab** et ajoutez une ligne pour /dev/sdc1 :+====1.9 - Les Commandes accton et dump-acct==== 
 + 
 +Cette commande permet d'activer ou désactiver la comptabilisation des processus :
  
 <code> <code>
-[root@centos8 ~]# vi /etc/fstab +[root@centos8 ~]# accton on 
-[root@centos8 ~]# cat /etc/fstab+Turning on process accounting, file set to the default '/var/account/pacct'. 
 +[root@centos8 ~]# systemctl status psacct 
 +● psacct.service - Kernel process accounting 
 +   Loaded: loaded (/usr/lib/systemd/system/psacct.service; disabled; vendor preset: d> 
 +   Active: inactive (dead) 
 +...skipping... 
 +● psacct.service - Kernel process accounting 
 +   Loaded: loaded (/usr/lib/systemd/system/psacct.service; disabled; vendor preset: d> 
 +   Active: inactive (dead)
  
-+[root@centos8 ~]systemctl enable psacct 
-/etc/fstab +Created symlink /etc/systemd/system/multi-user.target.wants/psacct.service → /usr/lib/systemd/system/psacct.service
-# Created by anaconda on Wed Jun 16 06:21:32 2021 + 
-+[root@centos8 ~]systemctl start psacct 
-# Accessible filesystems, by reference, are maintained under '/dev/disk/'. + 
-# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info+[root@centos8 ~]# systemctl status psacct 
-+● psacct.service Kernel process accounting 
-After editing this file, run 'systemctl daemon-reload' to update systemd +   Loaded: loaded (/usr/lib/systemd/system/psacct.service; enabled; vendor preset: di> 
-# units generated from this file+   Active: active (exited) since Sun 2022-11-13 09:35:16 CET; 4s ago 
-# +  Process: 39765 ExecStart=/usr/sbin/accton /var/account/pacct (code=exited, status=0> 
-/dev/mapper/cl_centos8-root                       xfs     defaults        0 +  Process: 39763 ExecStartPre=/usr/libexec/psacct/accton-create (code=exited, status=> 
-UUID=1c04981e-5317-4b73-9695-3ce25246835d /boot                   ext4    defaults        1 2 + Main PID: 39765 (code=exited, status=0/SUCCESS) 
-/dev/mapper/cl_centos8-swap swap                    swap    defaults        0 0 + 
-UUID=f76d6b66-985b-4a91-af9c-4987e8c1443c /home     ext4          defaults            2+Nov 13 09:35:16 centos8.ittraining.loc systemd[1]: Starting Kernel process accounting> 
 +Nov 13 09:35:16 centos8.ittraining.loc accton[39765]: Turning on process accounting, > 
 +Nov 13 09:35:16 centos8.ittraining.loc systemd[1]: Started Kernel process accounting.
 </code> </code>
  
-Créez le point de montage /home :+Par contre le fichier **/var/account/pacct** ne peut pas être lu avec les utilitaires de consultation de fichiers texte :
  
 <code> <code>
-[root@centos8 ~]# mkdir /home+[root@centos8 ~]# cat /var/account/pacct 
 +#pcKaccton pcEusleep%$pcu,awk$pc-iksmtuned('pc6pgrep'&pc-`ksmtuned)&pc,Eksmtuned*&pcd,awk&pc-ksmtuned/.'pc`D$less.'pcDEsystemctl+pcEssleep107pcu,awk07pc-jksmtuned437pc6pgrep327pc-bksmtuned527pc,Gksmtuned627pcd,awk27pc-ksmtuned?9;pc2rpc-pipefs-gene=9;pc2nfs-server-geneA9;pcEsystemd-cryptseI9;pcEsystemd-system-G9;pcEsystemd-hibernaC9;pcEsystemd-fstab-gE:;pc(^readlinkM;;pc$dgrepJ<;pc?lvmconfigN@;pc&`selinuxenabled;9;pc?s+Hkdump-dep-gener<9;pc?k0lvm2-activation:9;pc?B+anaconda-generaH9;pc?Esystemd-rc-loca>9;pc?SIostree-system-gO@;pc$agrep@9;pc?B+selinux-autorelB9;pc?Esystemd-debug-gK9;pc?Esystemd-sysv-geL9;pc?Esystemd-veritysD9;pc?Esystemd-getty-gF9;pc?Esystemd-gpt-aut9;pc@OC(sd-executor)8;pc`AEsystemctlSDpc?,accton-createUDpcacctonUDpacctonRQDpc@Esystemd-tty-askQDpc@@EsystemctlTDpcEsystemd-cgroupsVDpcEsystemd-cgroupsZYIpc`C$lessYIpcaCE%systemctlǘpcGkworker/dying77pcEssleepdcspcu,awkcspc-iksmtunedgfspc6pgrepfespc-_ksmtunedhespc,Fksmtunediespcd,awkespc?-ksmtuned[root@centos8 ~]#
 </code> </code>
  
-Montez /dev/sdc1 :+La commande **dump-acct** permet de voir son contenu mais pas de l'exploiter :
  
 <code> <code>
-[root@centos8 ~]# mount -+[root@centos8 ~]# dump-acct /var/account/pacct 
-[root@centos8 ~]# mount +accton          |v3|     0.00|     0.00|     1.00|     0|     0|  4360.00|     0.00|   39715|   37763|S    |       0|pts/0   |Sun Nov 13 09:33:52 2022 
-sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime,seclabel) +sleep           |v3|     0.00|     0.00|  6000.00|     0|     0|  7308.00|     0.00|   39712|    1022|           0|__      |Sun Nov 13 09:33:03 2022 
-proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) +awk             |v3|     0.00|     0.00|     0.00|     0|     0| 25512.00|     0.00|   39717|   39716|           0|__      |Sun Nov 13 09:34:03 2022 
-devtmpfs on /dev type devtmpfs (rw,nosuid,seclabel,size=1882880k,nr_inodes=470720,mode=755) +ksmtuned        |v3|     0.00|     0.00|     0.00|     0|     0| 26632.00|     0.00|   39716|    1022| F         0|__      |Sun Nov 13 09:34:03 2022 
-securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime) +pgrep           |v3|     0.00|     0.00|     0.00|     0|     0| 45104.00|     0.00|   39720|   39719|           1|__      |Sun Nov 13 09:34:03 2022 
-tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,seclabel) +ksmtuned        |v3|     0.00|     0.00|     0.00|     0|     0| 26632.00|     0.00|   39719|   39718| F         1|__      |Sun Nov 13 09:34:03 2022 
-devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,seclabel,gid=5,mode=620,ptmxmode=000) +ksmtuned        |v3|     0.00|     0.00|     0.00|     0|     0| 26112.00|     0.00|   39721|   39718| F         0|__      |Sun Nov 13 09:34:03 2022 
-tmpfs on /run type tmpfs (rw,nosuid,nodev,seclabel,mode=755) +awk             |v3|     0.00|     0.00|     0.00|     0|     0| 25376.00|     0.00|   39722|   39718|           0|__      |Sun Nov 13 09:34:03 2022 
-tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,seclabel,mode=755) +ksmtuned        |v3|     0.00|     0.00|     0.00|     0|     0| 26632.00|     0.00|   39718|    1022| F         0|__      |Sun Nov 13 09:34:03 2022 
-cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd) +less            |v3|     0.00|     0.00|  1187.00|     0|     0|  9704.00|     0.00|   39727|   39726|S    |       0|pts/0   |Sun Nov 13 09:34:47 2022 
-pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime,seclabel) +systemctl       |v3|     0.00|     0.00|  1188.00|     0|     0| 93504.00|     0.00|   39726|   37763|S    |       3|pts/0   |Sun Nov 13 09:34:47 2022 
-bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700) +sleep           |v3|     0.00|     0.00|  6000.00|     0|     0|  7308.00|     0.00|   39723|    1022|           0|__      |Sun Nov 13 09:34:03 2022 
-cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,hugetlb) +awk             |v3|     0.00|     0.00|     0.00|     0|     0| 25512.00|     0.00|   39729|   39728|           0|__      |Sun Nov 13 09:35:03 2022 
-cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,memory) +ksmtuned        |v3|     0.00|     0.00|     0.00|     0|     0| 26632.00|     0.00|   39728|    1022| F         0|__      |Sun Nov 13 09:35:03 2022 
-cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,cpu,cpuacct) +pgrep           |v3|     0.00|     0.00|     0.00|     0|     0| 45104.00|     0.00|   39732|   39731|           1|__      |Sun Nov 13 09:35:03 2022 
-cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,rdma) +ksmtuned        |v3|     0.00|     0.00|     0.00|     0|     0| 26632.00|     0.00|   39731|   39730| F         1|__      |Sun Nov 13 09:35:03 2022 
-cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,pids) +ksmtuned        |v3|     0.00|     0.00|     0.00|     0|     0| 26112.00|     0.00|   39733|   39730| F         0|__      |Sun Nov 13 09:35:03 2022 
-cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,cpuset) +awk             |v3|     0.00|     0.00|     0.00|     0|     0| 25376.00|     0.00|   39734|   39730|           0|__      |Sun Nov 13 09:35:03 2022 
-cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,perf_event) +ksmtuned        |v3|     0.00|     0.00|     0.00|     0|     0| 26632.00|     0.00|   39730|    1022| F         0|__      |Sun Nov 13 09:35:03 2022 
-cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,freezer) +rpc-pipefs-gene |v3|     0.00|     0.00|     0.00|     0|     0| 38752.00|     0.00|   39743|   39737|S    |       0|__      |Sun Nov 13 09:35:07 2022 
-cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,blkio) +nfs-server-gene |v3|     0.00|     0.00|     0.00|     0|     0| 38880.00|     0.00|   39741|   39737|S    |       0|__      |Sun Nov 13 09:35:07 2022 
-cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,net_cls,net_prio) +systemd-cryptse |v3|     0.00|     0.00|     0.00|     0|     0| 90368.00|     0.00|   39745|   39737|S    |       0|__      |Sun Nov 13 09:35:07 2022 
-cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,devices) +systemd-system- |v3|     0.00|     0.00|     0.00|     0|     0| 90368.00|     0.00|   39753|   39737|S    |       0|__      |Sun Nov 13 09:35:07 2022 
-none on /sys/kernel/tracing type tracefs (rw,relatime,seclabel) +systemd-hiberna |v3|     0.00|     0.00|     0.00|     0|     0| 90368.00|     0.00|   39751|   39737|S    |       0|__      |Sun Nov 13 09:35:07 2022 
-configfs on /sys/kernel/config type configfs (rw,relatime) +...
-/dev/mapper/cl_centos8-root on / type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota) +
-selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime) +
-mqueue on /dev/mqueue type mqueue (rw,relatime,seclabel) +
-hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,seclabel,pagesize=2M) +
-debugfs on /sys/kernel/debug type debugfs (rw,relatime,seclabel) +
-systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=40,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=6022) +
-fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime) +
-/dev/sda1 on /boot type ext4 (rw,relatime,seclabel) +
-sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime) +
-tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,seclabel,size=382500k,mode=700,uid=1000,gid=1000) +
-tmpfs on /run/user/42 type tmpfs (rw,nosuid,nodev,relatime,seclabel,size=382500k,mode=700,uid=42,gid=42) +
-gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000) +
-tmpfs on /run/user/type tmpfs (rw,nosuid,nodev,relatime,seclabel,size=382500k,mode=700) +
-gvfsd-fuse on /run/user/0/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=0,group_id=0) +
-/dev/sdc1 on /home type ext4 (rw,relatime,seclabel)+
 </code> </code>
  
-Notez la taille de /home :+===Options de la commande=== 
 + 
 +Les options de cette commande sont :
  
 <code> <code>
-[root@centos8 ~]# df -h +[root@centos8 ~]# dump-acct --help 
-Filesystem                   Size  Used Avail Use% Mounted on +Usage: dump-acct [-hrR] [-n <recs>] <files> 
-devtmpfs                     1.8G      1.8G   0% /dev +          [--num <recs>] [--raw] [--reverse] [--help] 
-tmpfs                        1.9G      1.9G   0% /dev/shm +          [--format <version>] [--byteswap] 
-tmpfs                        1.9G  9.4M  1.9G   1% /run +          [--ahz <freq>] 
-tmpfs                        1.9G      1.9G   0% /sys/fs/cgroup + 
-/dev/mapper/cl_centos8-root   28G  5.2G   23G  19% / +The system's default process accounting file is /var/account/pacct.
-/dev/sda1                    976M  289M  620M  32% /boot +
-tmpfs                        374M   16K  374M   1% /run/user/1000 +
-tmpfs                        374M  1.2M  373M   1% /run/user/42 +
-/dev/sdc1                     63G   67M   60G   1% /home+
 </code> </code>
  
-<WRAP center round todo 60%> +====1.10 La Commande lastcomm====
-**A faire** - **Déconnectez-vous** de votre session **CentOS8_ROOT_10.0.2.45** et re-connectez-vous à la VM en tant que trainee en utilisant la connexion **CentOS8_SSH_10.0.2.45**. +
-</WRAP>+
  
-====2.2 - Préparer l'Environnement====+Cette commande vous renseigne sur l'historique et les statistiques des commandes par utilisateur :
  
-Pour créer l'arborescence de l'environnement de création de paquets dans /home/trainee, utilisez la commande **rpmdev-setuptree** :+<code> 
 +[root@centos8 ~]# lastcomm 
 +bash              F    root     pts/0      0.00 secs Sun Nov 13 09:41 
 +gdbus                X root     pts/0      0.00 secs Sun Nov 13 09:41 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:41 
 +awk                    root     __         0.00 secs Sun Nov 13 09:41 
 +kworker/dying        root     __         0.00 secs Sun Nov 13 09:30 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:41 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:41 
 +pgrep                  root     __         0.00 secs Sun Nov 13 09:41 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:41 
 +awk                    root     __         0.00 secs Sun Nov 13 09:41 
 +sleep                  root     __         0.00 secs Sun Nov 13 09:40 
 +kworker/dying        root     __         0.00 secs Sun Nov 13 09:07 
 +kworker/dying        root     __         0.00 secs Sun Nov 13 09:35 
 +kworker/dying        root     __         0.00 secs Sun Nov 13 09:07 
 +dump-acct              root     pts/     0.00 secs Sun Nov 13 09:40 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:40 
 +awk                    root     __         0.00 secs Sun Nov 13 09:40 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:40 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:40 
 +pgrep                  root     __         0.00 secs Sun Nov 13 09:40 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:40 
 +awk                    root     __         0.00 secs Sun Nov 13 09:40 
 +sleep                  root     __         0.00 secs Sun Nov 13 09:39 
 +dump-acct              root     pts/     0.00 secs Sun Nov 13 09:39 
 +man                    root     pts/     0.01 secs Sun Nov 13 09:38 
 +less                   root     pts/     0.00 secs Sun Nov 13 09:38 
 +kworker/dying        root     __         0.00 secs Sat Nov 12 19:37 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:39 
 +awk                    root     __         0.00 secs Sun Nov 13 09:39 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:39 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:39 
 +pgrep                  root     __         0.00 secs Sun Nov 13 09:39 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:39 
 +awk                    root     __         0.00 secs Sun Nov 13 09:39 
 +sleep                  root     __         0.00 secs Sun Nov 13 09:38 
 +man                  root     pts/     0.00 secs Sun Nov 13 09:38 
 +nroff                  root     pts/     0.00 secs Sun Nov 13 09:38 
 +groff                  root     pts/     0.00 secs Sun Nov 13 09:38 
 +grotty                 root     pts/     0.00 secs Sun Nov 13 09:38 
 +troff                  root     pts/     0.00 secs Sun Nov 13 09:38 
 +nroff                root     pts/     0.00 secs Sun Nov 13 09:38 
 +locale                 root     pts/     0.00 secs Sun Nov 13 09:38 
 +tbl                    root     pts/     0.00 secs Sun Nov 13 09:38 
 +preconv                root     pts/     0.00 secs Sun Nov 13 09:38 
 +man                  root     pts/     0.00 secs Sun Nov 13 09:38 
 +man                  root     pts/     0.00 secs Sun Nov 13 09:38 
 +man                  root     pts/     0.00 secs Sun Nov 13 09:38 
 +man                  root     pts/     0.00 secs Sun Nov 13 09:38 
 +man                  root     pts/     0.00 secs Sun Nov 13 09:38 
 +man                  root     pts/     0.00 secs Sun Nov 13 09:38 
 +man                  root     pts/     0.00 secs Sun Nov 13 09:38 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:38 
 +awk                    root     __         0.00 secs Sun Nov 13 09:38 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:38 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:38 
 +pgrep                  root     __         0.00 secs Sun Nov 13 09:38 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:38 
 +awk                    root     __         0.00 secs Sun Nov 13 09:38 
 +sleep                  root     __         0.00 secs Sun Nov 13 09:37 
 +dump-acct              root     pts/     0.00 secs Sun Nov 13 09:37 
 +kworker/dying        root     __         0.00 secs Sun Nov 13 09:05 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:37 
 +awk                    root     __         0.00 secs Sun Nov 13 09:37 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:37 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:37 
 +pgrep                  root     __         0.00 secs Sun Nov 13 09:37 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:37 
 +awk                    root     __         0.00 secs Sun Nov 13 09:37 
 +sleep                  root     __         0.00 secs Sun Nov 13 09:36 
 +cat                    root     pts/     0.00 secs Sun Nov 13 09:36 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:36 
 +awk                    root     __         0.00 secs Sun Nov 13 09:36 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:36 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:36 
 +pgrep                  root     __         0.00 secs Sun Nov 13 09:36 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:36 
 +awk                    root     __         0.00 secs Sun Nov 13 09:36 
 +sleep                  root     __         0.00 secs Sun Nov 13 09:35 
 +kworker/dying        root     __         0.00 secs Sun Nov 13 09:19 
 +systemctl        S     root     pts/     0.00 secs Sun Nov 13 09:35 
 +less                 root     pts/     0.00 secs Sun Nov 13 09:35 
 +systemd-cgroups        root     __         0.00 secs Sun Nov 13 09:35 
 +systemd-cgroups        root     __         0.00 secs Sun Nov 13 09:35 
 +systemctl        S     root     pts/     0.00 secs Sun Nov 13 09:35 
 +systemd-tty-ask  S     root     pts/     0.00 secs Sun Nov 13 09:35 
 +accton               root     __         0.00 secs Sun Nov 13 09:35 
 +accton                 root     __         0.00 secs Sun Nov 13 09:35 
 +accton-create    S     root     __         0.00 secs Sun Nov 13 09:35 
 +systemctl        S     root     pts/     0.00 secs Sun Nov 13 09:35 
 +(sd-executor)    SF    root     __         0.00 secs Sun Nov 13 09:35 
 +systemd-gpt-aut  S     root     __         0.00 secs Sun Nov 13 09:35 
 +systemd-getty-g  S     root     __         0.00 secs Sun Nov 13 09:35 
 +systemd-veritys  S     root     __         0.00 secs Sun Nov 13 09:35 
 +systemd-sysv-ge  S     root     __         0.00 secs Sun Nov 13 09:35 
 +systemd-debug-g  S     root     __         0.00 secs Sun Nov 13 09:35 
 +selinux-autorel  S     root     __         0.00 secs Sun Nov 13 09:35 
 +grep                   root     __         0.00 secs Sun Nov 13 09:35 
 +ostree-system-g  S     root     __         0.01 secs Sun Nov 13 09:35 
 +systemd-rc-loca  S     root     __         0.00 secs Sun Nov 13 09:35 
 +anaconda-genera  S     root     __         0.00 secs Sun Nov 13 09:35 
 +lvm2-activation  S     root     __         0.00 secs Sun Nov 13 09:35 
 +kdump-dep-gener  S     root     __         0.00 secs Sun Nov 13 09:35 
 +selinuxenabled         root     __         0.00 secs Sun Nov 13 09:35 
 +lvmconfig              root     __         0.00 secs Sun Nov 13 09:35 
 +grep                   root     __         0.00 secs Sun Nov 13 09:35 
 +readlink               root     __         0.00 secs Sun Nov 13 09:35 
 +systemd-fstab-g  S     root     __         0.00 secs Sun Nov 13 09:35 
 +systemd-hiberna  S     root     __         0.00 secs Sun Nov 13 09:35 
 +systemd-system-  S     root     __         0.00 secs Sun Nov 13 09:35 
 +systemd-cryptse  S     root     __         0.00 secs Sun Nov 13 09:35 
 +nfs-server-gene  S     root     __         0.00 secs Sun Nov 13 09:35 
 +rpc-pipefs-gene  S     root     __         0.00 secs Sun Nov 13 09:35 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:35 
 +awk                    root     __         0.00 secs Sun Nov 13 09:35 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:35 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:35 
 +pgrep                  root     __         0.00 secs Sun Nov 13 09:35 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:35 
 +awk                    root     __         0.00 secs Sun Nov 13 09:35 
 +sleep                  root     __         0.00 secs Sun Nov 13 09:34 
 +systemctl        S     root     pts/     0.00 secs Sun Nov 13 09:34 
 +less                 root     pts/     0.00 secs Sun Nov 13 09:34 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:34 
 +awk                    root     __         0.00 secs Sun Nov 13 09:34 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:34 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:34 
 +pgrep                  root     __         0.00 secs Sun Nov 13 09:34 
 +ksmtuned          F    root     __         0.00 secs Sun Nov 13 09:34 
 +awk                    root     __         0.00 secs Sun Nov 13 09:34 
 +sleep                  root     __         0.00 secs Sun Nov 13 09:33 
 +accton               root     pts/     0.00 secs Sun Nov 13 09:33 
 + 
 +[root@centos8 ~]# lastcomm grep 
 +grep                   root     pts/     0.00 secs Sun Nov 13 09:46 
 +grep                   root     pts/     0.00 secs Sun Nov 13 09:45 
 +grep                   root     __         0.00 secs Sun Nov 13 09:35 
 +grep                   root     __         0.00 secs Sun Nov 13 09:35 
 +</code> 
 + 
 +===Options de la commande=== 
 + 
 +Les options de cette commande sont :
  
 <code> <code>
-[trainee@centos8 ~]$ rpmdev-setuptree +[root@centos8 ~]# lastcomm --help 
-...+Usage: lastcomm [-hpV] [-f file] [command] ... [user] ... [terminal] ... 
-[trainee@centos8 ~]$ ls -laR rpmbuild/ +       [--forwards] [--file <file>] [--strict-match] [--print-controls] 
-rpmbuild/: +       [--user <name>] [--tty <name>] [--command <name>] [--debug] 
-total 28 +       [--show-paging] [--pid] [--ahz <freq>] [--version] [--help]
-drwxrwxr-x 7 trainee trainee 4096 Jul 19 12:10 . +
-drwxr-xr-x17 trainee trainee 4096 Jul 19 12:10 .. +
-drwxrwxr-x 2 trainee trainee 4096 Jul 19 12:10 BUILD +
-drwxrwxr-x.  2 trainee trainee 4096 Jul 19 12:10 RPMS +
-drwxrwxr-x.  2 trainee trainee 4096 Jul 19 12:10 SOURCES +
-drwxrwxr-x.  2 trainee trainee 4096 Jul 19 12:10 SPECS +
-drwxrwxr-x.  2 trainee trainee 4096 Jul 19 12:10 SRPMS+
  
-rpmbuild/BUILD: +The system's default process accounting file is /var/account/pacct
-total 8 +</code>
-drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 +
-drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 ..+
  
-rpmbuild/RPMS: +====1.11 La Commande sa====
-total 8 +
-drwxrwxr-x2 trainee trainee 4096 Jul 19 12:10 . +
-drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 ..+
  
-rpmbuild/SOURCES: +Cette commande vous renseigne sur les statistiques sur les processus lancés et leurs ressources systèmes:
-total 8 +
-drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 . +
-drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 ..+
  
-rpmbuild/SPECS: +<code> 
-total 8 +[root@centos8 ~]# sa -u | egrep "root" 
-drwxrwxr-x2 trainee trainee 4096 Jul 19 12:10 +root       0.00 cpu     1090k mem      0 io accton           
-drwxrwxr-x7 trainee trainee 4096 Jul 19 12:10 ..+root       0.00 cpu     1827k mem      0 io sleep            
 +root       0.00 cpu     6378k mem      0 io awk              
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu    11276k mem      0 io pgrep            
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu     6528k mem      0 io ksmtuned        * 
 +root       0.00 cpu     6344k mem      0 io awk              
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu     2426k mem      0 io less             
 +root       0.00 cpu    23376k mem      0 io systemctl        
 +root       0.00 cpu     1827k mem      0 io sleep            
 +root       0.00 cpu     6378k mem      0 io awk              
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu    11276k mem      0 io pgrep            
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu     6528k mem      0 io ksmtuned        * 
 +root       0.00 cpu     6344k mem      0 io awk              
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu     9688k mem      0 io rpc-pipefs-gene  
 +root       0.00 cpu     9720k mem      0 io nfs-server-gene  
 +root       0.00 cpu    22592k mem      0 io systemd-cryptse  
 +root       0.00 cpu    22592k mem      0 io systemd-system-  
 +root       0.00 cpu    22592k mem      0 io systemd-hiberna  
 +root       0.00 cpu    22592k mem      0 io systemd-fstab-g  
 +root       0.00 cpu     1098k mem      0 io readlink         
 +root       0.00 cpu     2302k mem      0 io grep             
 +root       0.00 cpu    16260k mem      0 io lvmconfig        
 +root       0.00 cpu     3350k mem      0 io selinuxenabled   
 +root       0.00 cpu     5862k mem      0 io kdump-dep-gener  
 +root       0.00 cpu     8406k mem      0 io lvm2-activation  
 +root       0.00 cpu     5764k mem      0 io anaconda-genera  
 +root       0.00 cpu    22592k mem      0 io systemd-rc-loca  
 +root       0.01 cpu    38192k mem      0 io ostree-system-g  
 +root       0.00 cpu     2302k mem      0 io grep             
 +root       0.00 cpu     5764k mem      0 io selinux-autorel  
 +root       0.00 cpu    22592k mem      0 io systemd-debug-g  
 +root       0.00 cpu    22592k mem      0 io systemd-sysv-ge  
 +root       0.00 cpu    22592k mem      0 io systemd-veritys  
 +root       0.00 cpu    22592k mem      0 io systemd-getty-g  
 +root       0.00 cpu    22592k mem      0 io systemd-gpt-aut  
 +root       0.00 cpu    63728k mem      0 io (sd-executor)   * 
 +root       0.00 cpu    23632k mem      0 io systemctl        
 +root       0.00 cpu     6496k mem      0 io accton-create    
 +root       0.00 cpu        0k mem      0 io accton           
 +root       0.00 cpu     1090k mem      0 io accton           
 +root       0.00 cpu    22592k mem      0 io systemd-tty-ask  
 +root       0.00 cpu    23376k mem      0 io systemctl        
 +root       0.00 cpu    22592k mem      0 io systemd-cgroups  
 +root       0.00 cpu    22592k mem      0 io systemd-cgroups  
 +root       0.00 cpu     2426k mem      0 io less             
 +root       0.00 cpu    23376k mem      0 io systemctl        
 +root       0.00 cpu        0k mem      0 io kworker/dying   * 
 +root       0.00 cpu     1827k mem      0 io sleep            
 +root       0.00 cpu     6378k mem      0 io awk              
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu    11276k mem      0 io pgrep            
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu     6528k mem      0 io ksmtuned        * 
 +root       0.00 cpu     6344k mem      0 io awk              
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu     1828k mem      0 io cat              
 +root       0.00 cpu     1827k mem      0 io sleep            
 +root       0.00 cpu     6378k mem      0 io awk              
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu    11276k mem      0 io pgrep            
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu     6528k mem      0 io ksmtuned        * 
 +root       0.00 cpu     6344k mem      0 io awk              
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu        0k mem      0 io kworker/dying   * 
 +root       0.00 cpu     1994k mem      0 io dump-acct        
 +root       0.00 cpu     1827k mem      0 io sleep            
 +root       0.00 cpu     6378k mem      0 io awk              
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu    11276k mem      0 io pgrep            
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu     6528k mem      0 io ksmtuned        * 
 +root       0.00 cpu     6344k mem      0 io awk              
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu     4582k mem      0 io man             * 
 +root       0.00 cpu     4804k mem      0 io man             * 
 +root       0.00 cpu     4804k mem      0 io man             * 
 +root       0.00 cpu     4804k mem      0 io man             * 
 +root       0.00 cpu     4804k mem      0 io man             * 
 +root       0.00 cpu     4804k mem      0 io man             * 
 +root       0.00 cpu     4844k mem      0 io man             * 
 +root       0.00 cpu     4186k mem      0 io preconv          
 +root       0.00 cpu     3476k mem      0 io tbl              
 +root       0.00 cpu     1831k mem      0 io locale           
 +root       0.00 cpu     3182k mem      0 io nroff           * 
 +root       0.00 cpu     4186k mem      0 io troff            
 +root       0.00 cpu     3674k mem      0 io grotty           
 +root       0.00 cpu     3496k mem      0 io groff            
 +root       0.00 cpu     3182k mem      0 io nroff            
 +root       0.00 cpu     4804k mem      0 io man             * 
 +root       0.00 cpu     1827k mem      0 io sleep            
 +root       0.00 cpu     6378k mem      0 io awk              
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu    11276k mem      0 io pgrep            
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu     6528k mem      0 io ksmtuned        * 
 +root       0.00 cpu     6344k mem      0 io awk              
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu        0k mem      0 io kworker/dying   * 
 +root       0.00 cpu     2426k mem      0 io less             
 +root       0.01 cpu     4770k mem      0 io man              
 +root       0.00 cpu     1994k mem      0 io dump-acct        
 +root       0.00 cpu     1827k mem      0 io sleep            
 +root       0.00 cpu     6378k mem      0 io awk              
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu    11276k mem      0 io pgrep            
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu     6528k mem      0 io ksmtuned        * 
 +root       0.00 cpu     6344k mem      0 io awk              
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu     2094k mem      0 io dump-acct        
 +root       0.00 cpu        0k mem      0 io kworker/dying   * 
 +root       0.00 cpu        0k mem      0 io kworker/dying   * 
 +root       0.00 cpu        0k mem      0 io kworker/dying   * 
 +root       0.00 cpu     1827k mem      0 io sleep            
 +root       0.00 cpu     6378k mem      0 io awk              
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu    11276k mem      0 io pgrep            
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu     6528k mem      0 io ksmtuned        * 
 +root       0.00 cpu        0k mem      0 io kworker/dying   * 
 +root       0.00 cpu     6344k mem      0 io awk              
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu    93648k mem      0 io gdbus            
 +root       0.00 cpu     6888k mem      0 io bash            * 
 +root       0.00 cpu     5410k mem      0 io lastcomm         
 +root       0.00 cpu     1827k mem      0 io sleep            
 +root       0.00 cpu     6378k mem      0 io awk              
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu    11276k mem      0 io pgrep            
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu     6528k mem      0 io ksmtuned        * 
 +root       0.00 cpu     6344k mem      0 io awk              
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu     4570k mem      0 io man             * 
 +root       0.00 cpu     4804k mem      0 io man             * 
 +root       0.00 cpu     4804k mem      0 io man             * 
 +root       0.00 cpu     4804k mem      0 io man             * 
 +root       0.00 cpu     4804k mem      0 io man             * 
 +root       0.00 cpu     4804k mem      0 io man             * 
 +root       0.00 cpu     4844k mem      0 io man             * 
 +root       0.00 cpu     4186k mem      0 io preconv          
 +root       0.00 cpu     3476k mem      0 io tbl              
 +root       0.00 cpu     1831k mem      0 io locale           
 +root       0.00 cpu     3182k mem      0 io nroff           * 
 +root       0.00 cpu     4186k mem      0 io troff            
 +root       0.00 cpu     3706k mem      0 io grotty           
 +root       0.00 cpu     3496k mem      0 io groff            
 +root       0.00 cpu     3182k mem      0 io nroff            
 +root       0.00 cpu     4804k mem      0 io man             * 
 +root       0.00 cpu     1827k mem      0 io sleep            
 +root       0.00 cpu     6378k mem      0 io awk              
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu    11276k mem      0 io pgrep            
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu     6528k mem      0 io ksmtuned        * 
 +root       0.00 cpu     6344k mem      0 io awk              
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu     2426k mem      0 io less             
 +root       0.00 cpu     4770k mem      0 io man              
 +root       0.00 cpu     4604k mem      0 io man             * 
 +root       0.00 cpu     4760k mem      0 io man             * 
 +root       0.00 cpu     4804k mem      0 io man             * 
 +root       0.00 cpu     4804k mem      0 io man             * 
 +root       0.00 cpu     4804k mem      0 io man             * 
 +root       0.00 cpu     4804k mem      0 io man             * 
 +root       0.00 cpu     4804k mem      0 io man             * 
 +root       0.00 cpu     4844k mem      0 io man             * 
 +root       0.00 cpu     4186k mem      0 io preconv          
 +root       0.00 cpu     3476k mem      0 io tbl              
 +root       0.00 cpu     1831k mem      0 io locale           
 +root       0.00 cpu     3182k mem      0 io nroff           * 
 +root       0.00 cpu     4186k mem      0 io troff            
 +root       0.00 cpu     3700k mem      0 io grotty           
 +root       0.00 cpu     3496k mem      0 io groff            
 +root       0.00 cpu     3182k mem      0 io nroff            
 +root       0.00 cpu     4804k mem      0 io man             * 
 +root       0.00 cpu     1827k mem      0 io sleep            
 +root       0.00 cpu     6378k mem      0 io awk              
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu    11276k mem      0 io pgrep            
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu     6528k mem      0 io ksmtuned        * 
 +root       0.00 cpu     6344k mem      0 io awk              
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu     1827k mem      0 io sleep            
 +root       0.00 cpu     6378k mem      0 io awk              
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu    11276k mem      0 io pgrep            
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu     6528k mem      0 io ksmtuned        * 
 +root       0.00 cpu     6344k mem      0 io awk              
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu        0k mem      0 io kworker/dying   * 
 +root       0.00 cpu     2426k mem      0 io less             
 +root       0.00 cpu     4770k mem      0 io man              
 +root       0.00 cpu     5312k mem      0 io sa               
 +root       0.00 cpu     3034k mem      0 io grep             
 +root       0.00 cpu     5312k mem      0 io sa               
 +root       0.00 cpu     1827k mem      0 io sleep            
 +root       0.00 cpu     6378k mem      0 io awk              
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu    11276k mem      0 io pgrep            
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu     6528k mem      0 io ksmtuned        * 
 +root       0.00 cpu     6344k mem      0 io awk              
 +root       0.00 cpu     6658k mem      0 io ksmtuned        * 
 +root       0.00 cpu        0k mem      0 io kworker/dying   * 
 +</code>
  
-rpmbuild/SRPMS+===Options de la commande=== 
-total 8 + 
-drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 . +Les options de cette commande sont 
-drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 ..+ 
 +<code> 
 +[root@centos8 ~]# sa --help 
 + 
 +                Usagesa [ options ] [ file ] 
 +                 
 +                options: [-abcdfiljkmnprstuDKP] [-v <num>] [--version] [--help] 
 +                [--other-acct-file <name>] [--other-usracct-file <name>
 +                [--print-seconds] [--dont-read-summary-files] [--debug] 
 +                 [--separate-times] [--other-savacct-file <name>] [--percentages] 
 +                 [--print-ratio] [--print-users] [--merge] [--user-summary] [--group-summary] 
 +                [--list-all-names] [--not-interactive] [--threshold <num>
 +                 [--sort-ksec] [--sort-tio] [--sort-sys-user-div-calls] [--sort-avio] 
 +                 [--sort-cpu-avmem] [--sort-num-calls] [--sort-real-time] [--ahz hz] 
 +       [--show-paging] [--show-paging-avg] 
 + 
 +The system's default process accounting files are: 
 + 
 +  raw process accounting data: /var/account/pacct 
 +      summary by command name: /var/account/savacct 
 +          summary by username: /var/account/usracct
 </code> </code>
  
-Téléchargez le rpm source du noyau :+====1.12 - La Commande ac==== 
 + 
 +Cette commande vous renseigne sur les statistiques des temps de connexion des utilisateurs :
  
 <code> <code>
-[trainee@centos8 ~]$ uname -a +[root@centos8 ~]# ac -p 
-Linux centos8.ittraining.loc 4.18.0-305.7.1.el8_4.x86_64 #1 SMP Tue Jun 29 21:55:12 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux+        trainee                            247.51 
 +        total      247.51
  
-[trainee@centos8 ~]$ cat /etc/centos-release +[root@centos8 ~]# ac -d 
-CentOS Linux release 8.4.2105+Jun 16  total        6.41 
 +Jun 17  total       12.09 
 +Jul 19  total        6.94 
 +Jul 20  total       38.95 
 +Sep  2  total        0.03 
 +Sep  3  total        0.01 
 +Sep  5  total       11.01 
 +Oct  9  total        0.92 
 +Oct 11  total        4.17 
 +Oct 12  total        5.45 
 +Nov  7  total       19.40 
 +Nov  8  total       54.12 
 +Nov  9  total       67.32 
 +Nov 10  total        8.48 
 +Nov 11  total        3.01 
 +Today   total        9.23 
 +</code> 
 + 
 +===Options de la commande=== 
 + 
 +Les options de cette commande sont : 
 + 
 +<code> 
 +[root@centos8 ~]# ac --help
  
-[trainee@centos8 ~]$ wget https://vault.centos.org/8.4.2105/BaseOS/Source/SPackages/kernel-4.18.0-305.7.1.el8_4.src.rpm +Usageac [OPTION] ...
---2021-07-14 02:54:14--  https://vault.centos.org/8.4.2105/BaseOS/Source/SPackages/kernel-4.18.0-305.7.1.el8_4.src.rpm +
-Resolving vault.centos.org (vault.centos.org)... 81.171.33.194, 2a05:d014:10:7803:4af1:9320:7050:d28e +
-Connecting to vault.centos.org (vault.centos.org)|81.171.33.194|:443... connected. +
-HTTP request sent, awaiting response... 200 OK +
-Length: 123000617 (117M) [application/x-rpm] +
-Saving to: ‘kernel-4.18.0-305.7.1.el8_4.src.rpm’+
  
-kernel-4.18.0-305.7.1. 100%[===========================>] 117.30M  1.49MB/   in 79s     +OPTIONS: 
 +  -d, --daily-totals        Print totals for each day 
 +  -p, --individual-totals   Print time totals for each user 
 +  -f, --file <file        Read from <file> 
 +  --complain                Print errors for whatever problem 
 +  --reboots                 Count the time between login and reboot 
 +  --supplants               Count the time between logins on the terminal 
 +  --timewarps               Count the time between login and time warp 
 +  --compatibility           Shortcut for --reboots --supplants --timewarps 
 +  -a, --all-days            Do not skip days without login activity 
 +  --tw-leniency <value>     Set the time warp leniency <value> in seconds 
 +  --tw-suspicious <value>   Set the time warp suspicious <value> in seconds 
 +  --print-year              Print year when displaying dates 
 +  --print-zeros             Don't suppress zeros in category totals 
 +  --debug                   Print verbose internal information 
 +  -V, --version             Show version and exit 
 +  -h, --help                Show help and exit
  
-2021-07-14 02:55:33 (1.49 MB/s) - ‘kernel-4.18.0-305.7.1.el8_4.src.rpm’ saved [123000617/123000617]+The system's default login accounting file is /var/log/wtmp.
 </code> </code>
  
-Installez maintenant les dépendances pour le rpm source en tant que root :+=====LAB #2 - La commande sysctl===== 
 + 
 +====2.1 - Répertoire /proc==== 
 + 
 +Le répertoire /proc contient des fichiers et des répertoires virtuels. Le contenu de ces fichiers est créé dynamiquement lors de la consultation. Seul root peut consulter la totalité des informations dans le répertoire /proc.
  
 <code> <code>
-[trainee@centos8 ~]$ su +[root@centos8 ~]# ls /proc 
-Mot de passe : fenestros+1      16391  19    2212  2427  2622  431   59    84    999          mdstat 
 +10     16476  1931  2215  2428  2659  432       842   acpi         meminfo 
 +1007   16534  1956  2222  2431  2667  433   60    8465  buddyinfo    misc 
 +11     16576  1960  2226  2432  2686  434   61    866   bus          modules 
 +11805  16593  2     2230  2435  27    435   63    867   cgroups      mounts 
 +12     16598  20    2237  2439  28    436   64    868   cmdline      mtrr 
 +1219   16600  2007  2238  244   29    437   65    869   consoles     net 
 +1228   16613  2029  2241  2443  3     44    6568  87    cpuinfo      pagetypeinfo 
 +1232   16646  203   2244  2445  31    446   66    870   crypto       partitions 
 +1234   16673  2034  2247  2449  32    45    67    871   devices      sched_debug 
 +1235   16677  2037  2260  2451  33    46    674   872   diskstats    schedstat 
 +1247   16711  2054  2262  2465  34    47    68    874   dma          scsi 
 +13     16712  2062  2267  2472  35    4790  69    875   driver       self 
 +1307   16729  21    2268  2473  37    49    70    878   execdomains  slabinfo 
 +1339   16742  210   2274  2474  38    50    701   879   fb           softirqs 
 +1356   17     2118  2275  2475  39    5076  71    880   filesystems  stat 
 +14     1764   2121  2280  2476  4     51    714   884   fs           swaps 
 +1441   180    2124  2287  2478  40    52    72    887   interrupts   sys 
 +1443   181    2126  2292  2481  402   53    73    9     iomem        sysrq-trigger 
 +1444   1817   2156  23    2484  41    532   74    901   ioports      sysvipc 
 +1446   182    2160  2302  25    419   539   75    903   irq          thread-self 
 +14977  1828   2164  2307  2536  420   55    76    9144  kallsyms     timer_list 
 +15     1829   2165  2310  2539  421   568       916   kcore        tty 
 +15067  183    2167  2330  2571  422   569   808   918   keys         uptime 
 +1536   1845   2169  2332  2578  423   570   809   919   key-users    version 
 +1553   185    2177  2349  2579  425   571   81    921   kmsg         vmallocinfo 
 +15594  186    2187  2358  259   426   572   833   969   kpagecgroup  vmstat 
 +15735  187    2190  2373  2593  427   573   835   986   kpagecount   zoneinfo 
 +16     1880   2194  2384  26    428   574   837   989   kpageflags 
 +16165  1883   22    239   2602  43    575   838   990   loadavg 
 +16167  1888   2204  241   2608  430   576   839   993   locks 
 +</code>
  
-[root@centos8 ~]# dnf install yum-utils +===Fichiers===
-...+
  
-[root@centos8 ~]# yum-builddep /home/trainee/kernel-4.18.0-305.7.1.el8_4.src.rpm  +==Processeur== 
-...+ 
 +<code> 
 +[root@centos8 ~]# cat /proc/cpuinfo 
 +processor       : 0 
 +vendor_id       : GenuineIntel 
 +cpu family      : 15 
 +model           : 6 
 +model name      : Common KVM processor 
 +stepping        : 1 
 +microcode       : 0x1 
 +cpu MHz         : 1999.987 
 +cache size      : 16384 KB 
 +physical id     : 0 
 +siblings        : 4 
 +core id         : 0 
 +cpu cores       : 4 
 +apicid          : 0 
 +initial apicid  : 0 
 +fpu             : yes 
 +fpu_exception   : yes 
 +cpuid level     : 13 
 +wp              : yes 
 +flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti 
 +bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit 
 +bogomips        : 3999.97 
 +clflush size    : 64 
 +cache_alignment : 128 
 +address sizes   : 40 bits physical, 48 bits virtual 
 +power management: 
 + 
 +processor       : 1 
 +vendor_id       : GenuineIntel 
 +cpu family      : 15 
 +model           : 6 
 +model name      : Common KVM processor 
 +stepping        : 1 
 +microcode       : 0x1 
 +cpu MHz         : 1999.987 
 +cache size      : 16384 KB 
 +physical id     : 0 
 +siblings        : 4 
 +core id         : 1 
 +cpu cores       : 4 
 +apicid          : 1 
 +initial apicid  : 1 
 +fpu             : yes 
 +fpu_exception   : yes 
 +cpuid level     : 13 
 +wp              : yes 
 +flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti 
 +bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit 
 +bogomips        : 3999.97 
 +clflush size    : 64 
 +cache_alignment : 128 
 +address sizes   : 40 bits physical, 48 bits virtual 
 +power management: 
 + 
 +processor       : 2 
 +vendor_id       : GenuineIntel 
 +cpu family      : 15 
 +model           : 6 
 +model name      : Common KVM processor 
 +stepping        : 1 
 +microcode       : 0x1 
 +cpu MHz         : 1999.987 
 +cache size      : 16384 KB 
 +physical id     : 0 
 +siblings        : 4 
 +core id         : 2 
 +cpu cores       : 4 
 +apicid          : 2 
 +initial apicid  : 2 
 +fpu             : yes 
 +fpu_exception   : yes 
 +cpuid level     : 13 
 +wp              : yes 
 +flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti 
 +bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit 
 +bogomips        : 3999.97 
 +clflush size    : 64 
 +cache_alignment : 128 
 +address sizes   : 40 bits physical, 48 bits virtual 
 +power management: 
 + 
 +processor       : 3 
 +vendor_id       : GenuineIntel 
 +cpu family      : 15 
 +model           : 6 
 +model name      : Common KVM processor 
 +stepping        : 1 
 +microcode       : 0x1 
 +cpu MHz         : 1999.987 
 +cache size      : 16384 KB 
 +physical id     : 0 
 +siblings        : 4 
 +core id         : 3 
 +cpu cores       : 4 
 +apicid          : 3 
 +initial apicid  : 3 
 +fpu             : yes 
 +fpu_exception   : yes 
 +cpuid level     : 13 
 +wp              : yes 
 +flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti 
 +bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit 
 +bogomips        : 3999.97 
 +clflush size    : 64 
 +cache_alignment : 128 
 +address sizes   : 40 bits physical, 48 bits virtual 
 +power management: 
 + 
 +processor       : 4 
 +vendor_id       : GenuineIntel 
 +cpu family      : 15 
 +model           : 6 
 +model name      : Common KVM processor 
 +stepping        : 1 
 +microcode       : 0x1 
 +cpu MHz         : 1999.987 
 +cache size      : 16384 KB 
 +physical id     : 1 
 +siblings        : 4 
 +core id         : 0 
 +cpu cores       : 4 
 +apicid          : 4 
 +initial apicid  : 4 
 +fpu             : yes 
 +fpu_exception   : yes 
 +cpuid level     : 13 
 +wp              : yes 
 +flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti 
 +bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit 
 +bogomips        : 3999.97 
 +clflush size    : 64 
 +cache_alignment : 128 
 +address sizes   : 40 bits physical, 48 bits virtual 
 +power management: 
 + 
 +processor       : 5 
 +vendor_id       : GenuineIntel 
 +cpu family      : 15 
 +model           : 6 
 +model name      : Common KVM processor 
 +stepping        : 1 
 +microcode       : 0x1 
 +cpu MHz         : 1999.987 
 +cache size      : 16384 KB 
 +physical id     : 1 
 +siblings        : 4 
 +core id         : 1 
 +cpu cores       : 4 
 +apicid          : 5 
 +initial apicid  : 5 
 +fpu             : yes 
 +fpu_exception   : yes 
 +cpuid level     : 13 
 +wp              : yes 
 +flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti 
 +bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit 
 +bogomips        : 3999.97 
 +clflush size    : 64 
 +cache_alignment : 128 
 +address sizes   : 40 bits physical, 48 bits virtual 
 +power management: 
 + 
 +processor       : 6 
 +vendor_id       : GenuineIntel 
 +cpu family      : 15 
 +model           : 6 
 +model name      : Common KVM processor 
 +stepping        : 1 
 +microcode       : 0x1 
 +cpu MHz         : 1999.987 
 +cache size      : 16384 KB 
 +physical id     : 1 
 +siblings        : 4 
 +core id         : 2 
 +cpu cores       : 4 
 +apicid          : 6 
 +initial apicid  : 6 
 +fpu             : yes 
 +fpu_exception   : yes 
 +cpuid level     : 13 
 +wp              : yes 
 +flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti 
 +bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit 
 +bogomips        : 3999.97 
 +clflush size    : 64 
 +cache_alignment : 128 
 +address sizes   : 40 bits physical, 48 bits virtual 
 +power management: 
 + 
 +processor       : 7 
 +vendor_id       : GenuineIntel 
 +cpu family      : 15 
 +model           : 6 
 +model name      : Common KVM processor 
 +stepping        : 1 
 +microcode       : 0x1 
 +cpu MHz         : 1999.987 
 +cache size      : 16384 KB 
 +physical id     : 1 
 +siblings        : 4 
 +core id         : 3 
 +cpu cores       : 4 
 +apicid          : 7 
 +initial apicid  : 7 
 +fpu             : yes 
 +fpu_exception   : yes 
 +cpuid level     : 13 
 +wp              : yes 
 +flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti 
 +bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit 
 +bogomips        : 3999.97 
 +clflush size    : 64 
 +cache_alignment : 128 
 +address sizes   : 40 bits physical, 48 bits virtual 
 +power management:
 </code> </code>
  
-Installez maintenant le paquet **kernel-4.18.0-305.7.1.el8_4.src.rpm** :+==Interruptions système==
  
 <code> <code>
-[root@centos8 ~]# exit +[root@centos8 ~]# cat /proc/interrupts 
-logout +           CPU0       CPU1       CPU2       CPU3       CPU4       CPU5       CPU6       CPU7        
-[trainee@centos8 ~]$ rpm -Uvh kernel-4.18.0-305.7.1.el8_4.src.rpm +  0:        109          0          0          0          0          0          0          0   IO-APIC   2-edge      timer 
-Updating / installing... +  1:                            0          0          9          0          0          0   IO-APIC   1-edge      i8042 
-   1:kernel-4.18.0-305.7.1.el8_4      warning: user mockbuild does not exist using root +  8                  0          0          0          0          1          0          0   IO-APIC   8-edge      rtc0 
-warninggroup mockbuild does not exist using root +  9                  0          0          0          0          0          0          0   IO-APIC   9-fasteoi   acpi 
-warning: user mockbuild does not exist using root + 10                  0          0          0      47098          0          0          0   IO-APIC  10-fasteoi   virtio0 
-warninggroup mockbuild does not exist using root + 11                  0         31          0          0          0          0          0   IO-APIC  11-fasteoi   uhci_hcd:usb1 
-warning: user mockbuild does not exist using root + 12                  0          0         15          0          0          0          0   IO-APIC  12-edge      i8042 
-warninggroup mockbuild does not exist using root + 14                  0          0          0          0          0          0          0   IO-APIC  14-edge      ata_piix 
-warning: user mockbuild does not exist using root + 15      7376          0        144          0          0          0          0      84588   IO-APIC  15-edge      ata_piix 
-warninggroup mockbuild does not exist using root + 24                  0          0          0          0          0          0          0   PCI-MSI 294912-edge      virtio1-config 
-warning: user mockbuild does not exist using root + 25                  0          0          0          0       5640          0         16   PCI-MSI 294913-edge      virtio1-input.0 
-warninggroup mockbuild does not exist - using root + 26        36          0          0       5058          0          0          0          0   PCI-MSI 294914-edge      virtio1-output.0 
-warninguser mockbuild does not exist using root + 27              16008          0       9431          0          0          0          0   PCI-MSI 114688-edge      ahci[0000:00:07.0] 
-warning: group mockbuild does not exist using root +NMI                  0          0          0          0          0          0          0   Non-maskable interrupts 
-warninguser mockbuild does not exist using root +LOC    870537     771900    1117711     288839     833717     502365     758229     405110   Local timer interrupts 
-warning: group mockbuild does not exist using root +SPU                  0          0          0          0          0          0          0   Spurious interrupts 
-warninguser mockbuild does not exist using root +PMI                  0          0          0          0          0          0          0   Performance monitoring interrupts 
-warning: group mockbuild does not exist using root +IWI                  0          0          0          2          0          0          0   IRQ work interrupts 
-warninguser mockbuild does not exist using root +RTR                  0          0          0          0          0          0          0   APIC ICR read retries 
-warning: group mockbuild does not exist using root +RES    178171      67749      43116      65994      71361     118585      54139      53452   Rescheduling interrupts 
-warning: user mockbuild does not exist using root +CAL     11095      11007      10841      10343      14679       9998      12165      12443   Function call interrupts 
-warninggroup mockbuild does not exist using root +TLB      2295       2297       2000       1728       2330       2338       1991       1861   TLB shootdowns 
-warning: user mockbuild does not exist using root +TRM                  0          0          0          0          0          0          0   Thermal event interrupts 
-warning: group mockbuild does not exist using root +THR                  0          0          0          0          0          0          0   Threshold APIC interrupts 
-warninguser mockbuild does not exist using root +DFR                  0          0          0          0          0          0          0   Deferred Error APIC interrupts 
-warning: group mockbuild does not exist using root +MCE                  0          0          0          0          0          0          0   Machine check exceptions 
-warning: user mockbuild does not exist using root +MCP       288        288        288        288        288        288        288        288   Machine check polls 
-warninggroup mockbuild does not exist using root +HYP                  0          0          0          0          0          0          0   Hypervisor callback interrupts 
-warning: user mockbuild does not exist using root +HRE                  0          0          0          0          0          0          0   Hyper-V reenlightenment interrupts 
-warninggroup mockbuild does not exist - using root +HVS                  0          0          0          0          0          0          0   Hyper-V stimer0 interrupts 
-warninguser mockbuild does not exist - using root +ERR         0 
-warninggroup mockbuild does not exist using root +MIS         0 
-warninguser mockbuild does not exist - using root +PIN                  0          0          0          0          0          0          0   Posted-interrupt notification event 
-warninggroup mockbuild does not exist - using root +NPI                  0          0          0          0          0          0          0   Nested posted-interrupt event 
-warninguser mockbuild does not exist - using root +PIW                  0          0          0          0          0          0          0   Posted-interrupt wakeup event
-warninggroup mockbuild does not exist - using root +
-warninguser mockbuild does not exist - using root +
-warninggroup mockbuild does not exist - using root +
-warninguser mockbuild does not exist - using root +
-warninggroup mockbuild does not exist - using root +
-warninguser mockbuild does not exist - using root +
-warninggroup mockbuild does not exist - using root +
-warninguser mockbuild does not exist - using root +
-warninggroup mockbuild does not exist - using root +
-warninguser mockbuild does not exist - using root +
-warninggroup mockbuild does not exist - using root +
-warninguser mockbuild does not exist using root +
-warninggroup mockbuild does not exist using root +
-warninguser mockbuild does not exist - using root +
-warninggroup mockbuild does not exist - using root +
-warninguser mockbuild does not exist using root +
-warninggroup mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist using root +
-warninguser mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-################################# [100%] +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist - using root +
-warning: user mockbuild does not exist - using root +
-warning: group mockbuild does not exist using root+
 </code> </code>
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** - Les erreurs sont sans importance.+**Important** : Un pilote de périphérique demande au processeur de fournir un service en utilisant un IRQ. Quand la demande est faite, le processeur interrompe ses activités et passe le contrôle au pilote identifié par l'IRQ. Techniquement l'attribution d'un IRQ à un périphérique doit être exclusive. Dans le cas où deux périphériques demandent un service en même temps, c'est le périphérique ayant l'IRQ le plus bas qui est prioritaire. 
 +</WRAP>  
 + 
 +==Canaux DMA== 
 + 
 +<code> 
 +[root@centos8 ~]# cat /proc/dma 
 + 4: cascade 
 +</code> 
 + 
 +==Plages d'entrée/sortie== 
 + 
 +<code> 
 +root@centos8 ~]# cat /proc/ioports | more 
 +0000-0cf7 : PCI Bus 0000:00 
 +  0000-001f : dma1 
 +  0020-0021 : pic1 
 +  0040-0043 : timer0 
 +  0050-0053 : timer1 
 +  0060-0060 : keyboard 
 +  0064-0064 : keyboard 
 +  0070-0077 : rtc0 
 +  0080-008f : dma page reg 
 +  00a0-00a1 : pic2 
 +  00c0-00df : dma2 
 +  00f0-00ff : fpu 
 +  0170-0177 : 0000:00:01.1 
 +    0170-0177 : ata_piix 
 +  01f0-01f7 : 0000:00:01.1 
 +    01f0-01f7 : ata_piix 
 +  0376-0376 : 0000:00:01.1 
 +    0376-0376 : ata_piix 
 +  03c0-03df : vga+ 
 +  03f6-03f6 : 0000:00:01.1 
 +    03f6-03f6 : ata_piix 
 +--More-- 
 +</code> 
 + 
 +<WRAP center round alert 60%> 
 +**Important** - Si deux périphériques ont le même port, les **deux** périphériques seront inutilisables.
 </WRAP> </WRAP>
  
-====2.3 - Préparer l'Arborescence Source du Noyau====+==Périphériques==
  
-Naviguez vers le repertoire **~/rpmbuild/SPECS** et utilisez la commande **rpmbuild** pour préparer l'arborescence source du noyau :+<code> 
 +[root@centos8 ~]# cat /proc/devices 
 +Character devices: 
 +  1 mem 
 +  4 /dev/vc/0 
 +  4 tty 
 +  4 ttyS 
 +  5 /dev/tty 
 +  5 /dev/console 
 +  5 /dev/ptmx 
 +  7 vcs 
 + 10 misc 
 + 13 input 
 + 21 sg 
 + 29 fb 
 +128 ptm 
 +136 pts 
 +162 raw 
 +180 usb 
 +188 ttyUSB 
 +189 usb_device 
 +202 cpu/msr 
 +203 cpu/cpuid 
 +226 drm 
 +244 aux 
 +245 hidraw 
 +246 usbmon 
 +247 bsg 
 +248 watchdog 
 +249 ptp 
 +250 pps 
 +251 rtc 
 +252 dax 
 +253 tpm 
 +254 gpiochip 
 + 
 +Block devices: 
 +  8 sd 
 +  9 md 
 + 11 sr 
 + 65 sd 
 + 66 sd 
 + 67 sd 
 + 68 sd 
 + 69 sd 
 + 70 sd 
 + 71 sd 
 +128 sd 
 +129 sd 
 +130 sd 
 +131 sd 
 +132 sd 
 +133 sd 
 +134 sd 
 +135 sd 
 +253 device-mapper 
 +254 mdp 
 +259 blkext 
 +</code> 
 + 
 +==Modules==
  
 <code> <code>
-[trainee@centos7 ~]$ cd ~/rpmbuild/SPECS +[root@centos8 ~]# cat /proc/modules | more 
-[trainee@centos7 SPECS]$ rpmbuild -bp --target=$(uname -m) kernel.spec +xt_CHECKSUM 16384 1 Live 0xffffffffc09a8000 
-...+ipt_MASQUERADE 16384 3 Live 0xffffffffc09a3000 
 +xt_conntrack 16384 1 Live 0xffffffffc099e000 
 +ipt_REJECT 16384 2 Live 0xffffffffc0999000 
 +nft_compat 20480 16 - Live 0xffffffffc0993000 
 +nf_nat_tftp 16384 0 - Live 0xffffffffc098b000 
 +nft_objref 16384 1 - Live 0xffffffffc0986000 
 +nf_conntrack_tftp 16384 3 nf_nat_tftp, Live 0xffffffffc0981000 
 +nft_counter 16384 33 - Live 0xffffffffc097c000 
 +tun 53248 1 - Live 0xffffffffc096e000 
 +bridge 192512 0 - Live 0xffffffffc093e000 
 +stp 16384 1 bridge, Live 0xffffffffc0939000 
 +llc 16384 2 bridge,stp, Live 0xffffffffc0930000 
 +nft_fib_inet 16384 1 - Live 0xffffffffc08f5000 
 +nft_fib_ipv4 16384 1 nft_fib_inet, Live 0xffffffffc08ed000 
 +nft_fib_ipv6 16384 1 nft_fib_inet, Live 0xffffffffc08e8000 
 +nft_fib 16384 3 nft_fib_inet,nft_fib_ipv4,nft_fib_ipv6, Live 0xffffffffc08e3000 
 +nft_reject_inet 16384 5 - Live 0xffffffffc08de000 
 +nf_reject_ipv4 16384 2 ipt_REJECT,nft_reject_inet, Live 0xffffffffc08d9000 
 +nf_reject_ipv6 16384 1 nft_reject_inet, Live 0xffffffffc08d4000 
 +nft_reject 16384 1 nft_reject_inet, Live 0xffffffffc08cf000 
 +--More--
 </code> </code>
  
-l'issu du processus, examinez l'arborescence :+==Statistiques de l'utilisation  des disques==
  
 <code> <code>
-[trainee@centos8 SPECS]$ ls -la ~/rpmbuild/BUILD/kernel-4.18.0-305.7.1.el8_4/linux-4.18.0-305.7.1.el8.x86_64/ +[root@centos8 ~]# cat /proc/diskstats 
-total 812 +         0 sda 15481 112 1445637 154103 10272 2377 277530 890611 0 237219 1044714 0 0 0 0 
-drwxr-xr-x.  26 trainee trainee   4096 Jul 14 03:13 . +   8       1 sda1 402 66754 13349 31 18 392 4632 0 2824 17981 0 0 0 0 
-drwxr-xr-x.   3 trainee trainee   4096 Jul 14 03:12 .. +   8       sda2 14915 109 1375516 140528 8450 2359 277138 869788 0 225416 1010316 0 0 0 0 
-drwxr-xr-x.  27 trainee trainee   4096 Jul 14 03:13 arch +   8      16 sdb 230 0 5991 36 0 0 0 0 0 110 36 0 0 0 
-drwxr-xr-x.   3 trainee trainee   4096 Jun 14 10:33 block +  11       0 sr0 10 4 2 0 0 0 0 0 9 0 0 0 0 
-drwxr-xr-x.   2 trainee trainee   4096 Jul 14 03:13 certs + 253       0 dm-0 11651 0 1364532 72138 12121 0 288727 1208138 0 227630 1280276 0 0 0 0 
--rw-r--r--.   1 trainee trainee  13079 Jun 14 10:33 .clang-format + 253       dm-1 104 0 4440 79 0 0 0 0 0 71 79 0 0 0 0
--rw-r--r--.   1 trainee trainee     59 Jun 14 10:33 .cocciconfig +
-drwxr-xr-x.   2 trainee trainee   4096 Jul 14 03:13 configs +
--rw-r--r--.   1 trainee trainee    423 Jun 14 10:33 COPYING-4.18.+
--rw-r--r--.   1 trainee trainee  98651 Jun 14 10:33 CREDITS +
-drwxr-xr-x.   trainee trainee   4096 Jun 14 10:33 crypto +
-drwxr-xr-x. 119 trainee trainee   4096 Jul 14 03:13 Documentation +
-drwxr-xr-x. 137 trainee trainee   4096 Jun 14 10:33 drivers +
-drwxr-xr-x.   trainee trainee   4096 Jul 14 03:13 firmware +
-drwxr-xr-x.  73 trainee trainee   4096 Jun 14 10:33 fs +
--rw-r--r--.   1 trainee trainee     68 Jun 14 10:33 .get_maintainer.conf +
--rw-r--r--.   1 trainee trainee     31 Jun 14 10:33 .get_maintainer.ignore +
--rw-r--r--.   1 trainee trainee     76 Jun 14 10:33 .gitattributes +
--rw-r--r--.   1 trainee trainee   1639 Jun 14 10:33 .gitlab-ci-private.yml +
--rw-r--r--.   1 trainee trainee   1668 Jun 14 10:33 .gitlab-ci.yml +
-drwxr-xr-x.  30 trainee trainee   4096 Jun 14 10:33 include +
-drwxr-xr-x.   trainee trainee   4096 Jun 14 10:33 init +
-drwxr-xr-x.   2 trainee trainee   4096 Jun 14 10:33 ipc +
--rw-r--r--.   1 trainee trainee   2245 Jun 14 10:33 Kbuild +
--rw-r--r--.   1 trainee trainee    575 Jun 14 10:33 Kconfig +
-drwxr-xr-x.  19 trainee trainee   4096 Jul 14 03:13 kernel +
-drwxr-xr-x.  20 trainee trainee  12288 Jul 14 03:13 lib +
-drwxr-xr-x.   5 trainee trainee   4096 Jun 14 10:33 LICENSES +
--rw-r--r--.   1 trainee trainee   9559 Jun 14 10:33 .mailmap +
--rw-r--r--.   1 trainee trainee 471696 Jun 14 10:33 MAINTAINERS +
--rw-r--r--.   1 trainee trainee  61558 Jun 14 10:33 Makefile +
--rw-r--r--.   1 trainee trainee   1324 Jun 14 10:33 Makefile.rhelver +
--rw-r--r--.   1 trainee trainee      Jul 14 03:13 .mismatches +
-drwxr-xr-x.   3 trainee trainee   4096 Jun 14 10:33 mm +
-drwxr-xr-x.  72 trainee trainee   4096 Jun 14 10:33 net +
--rw-r--r--.   trainee trainee    800 Jun 14 10:33 README +
-drwxr-xr-x.  28 trainee trainee   4096 Jun 14 10:33 samples +
--rw-r--r--.   trainee trainee      Jul 14 03:12 .scmversion +
-drwxr-xr-x.  14 trainee trainee   4096 Jul 14 03:13 scripts +
-drwxr-xr-x.  10 trainee trainee   4096 Jun 14 10:33 security +
-drwxr-xr-x.  26 trainee trainee   4096 Jun 14 10:33 sound +
-drwxr-xr-x.  33 trainee trainee   4096 Jun 14 10:33 tools +
-drwxr-xr-x.   2 trainee trainee   4096 Jul 14 03:13 usr +
-drwxr-xr-x.   4 trainee trainee   4096 Jun 14 10:33 virt+
 </code> </code>
  
-===Le Fichier .config===+==Partitions== 
 + 
 +<code> 
 +[root@centos8 ~]# cat /proc/partitions 
 +major minor  #blocks  name 
 + 
 +          0   33554432 sda 
 +          1    1048576 sda1 
 +          2   32504832 sda2 
 +         16    4194304 sdb 
 +  11        0    1048575 sr0 
 + 253        0   29143040 dm-0 
 + 253        1    3358720 dm-1 
 +</code>
  
-Changez de répertoire de travail :+==Espaces de pagination==
  
 <code> <code>
-[trainee@centos8 SPECS]$ cd ~/rpmbuild/BUILD/kernel-*/linux-*/+[root@centos8 ~]# cat /proc/swaps 
 +Filename                                Type            Size    Used    Priority 
 +/dev/dm-1                               partition       3358716 0       -2
 </code> </code>
  
-Copiez le fichier **configs/kernel-4.18.0-`uname -m`.config** vers **.config** dans le répertoire courant :+==Statistiques d'utilisation du processeur==
  
 <code> <code>
-[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ cp configs/kernel-4.18.0-`uname -m`.config .config+[root@centos8 ~]# cat /proc/loadavg 
 +0.00 0.00 0.00 1/697 16936
 </code> </code>
  
-Mettez à jour le fichier .config par rapport à la configuration actuelle du noyau :+==Statistiques d'utilisation de la mémoire==
  
 <code> <code>
-[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ make oldconfig +[root@centos8 ~]# cat /proc/meminfo 
-scripts/kconfig/conf  --oldconfig Kconfig +MemTotal:        3825032 kB 
-# +MemFree:         1862116 kB 
-# configuration written to .config +MemAvailable:    2420560 kB 
-#+Buffers:            3300 kB 
 +Cached:           750496 kB 
 +SwapCached:            0 kB 
 +Active:           315572 kB 
 +Inactive:        1400260 kB 
 +Active(anon):       1856 kB 
 +Inactive(anon):   974728 kB 
 +Active(file):     313716 kB 
 +Inactive(file):   425532 kB 
 +Unevictable:           0 kB 
 +Mlocked:               0 kB 
 +SwapTotal:       3358716 kB 
 +SwapFree:        3358716 kB 
 +Dirty:                 0 kB 
 +Writeback:             0 kB 
 +AnonPages:        962004 kB 
 +Mapped:           261084 kB 
 +Shmem:             14552 kB 
 +KReclaimable:      46980 kB 
 +Slab:             118396 kB 
 +SReclaimable:      46980 kB 
 +SUnreclaim:        71416 kB 
 +KernelStack:       11280 kB 
 +PageTables:        46532 kB 
 +NFS_Unstable:          0 kB 
 +Bounce:                0 kB 
 +WritebackTmp:          0 kB 
 +CommitLimit:     5271232 kB 
 +Committed_AS:    5072744 kB 
 +VmallocTotal:   34359738367 kB 
 +VmallocUsed:           0 kB 
 +VmallocChunk:          0 kB 
 +Percpu:             5920 kB 
 +HardwareCorrupted:     0 kB 
 +AnonHugePages:    546816 kB 
 +ShmemHugePages:        0 kB 
 +ShmemPmdMapped:        0 kB 
 +FileHugePages:         0 kB 
 +FilePmdMapped:         0 kB 
 +HugePages_Total:       0 
 +HugePages_Free:        0 
 +HugePages_Rsvd:        0 
 +HugePages_Surp:        0 
 +Hugepagesize:       2048 kB 
 +Hugetlb:               0 kB 
 +DirectMap4k:      173944 kB 
 +DirectMap2M:     4020224 kB
 </code> </code>
  
-<WRAP center round important 60%> +==Version du noyau==
-**Important** - Cette commande lit le fichier .config du noyau actuel et le compare avec celui des sources du noyau. S'il existent des nouvelles configurations à effectuer dans les sources du noyau, la commande vous pose des questions. +
-</WRAP>+
  
-La configuration du noyau se trouve dans un fichier dénommé **.config**Le fichier **.config** est généré par une des trois commandes suivantes et ne doit **pas** être édité manuellement :+<code> 
 +[root@centos8 ~]# cat /proc/version 
 +Linux version 4.18.0-305.3.1.el8.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 8.4.1 20200928 (Red Hat 8.4.1-1) (GCC)) #1 SMP Tue Jun 1 16:14:33 UTC 2021 
 +</code>
  
-  * make config +===Répertoires=== 
-  * make menuconfig + 
-  make xconfig +==ide/scsi== 
-   + 
-Exécutez la commande **make menuconfig** :+Ce répertoire contient des répertoires dans lesquels se trouvent des informations sur la capacité, le type et la géométrie des disques. 
 + 
 +==acpi== 
 + 
 +Ce répertoire contient des informations sur la gestion de l'énérgie, les températures, les vitesses de ventilateurs, la charge des batteries. 
 + 
 +==bus== 
 + 
 +Ce répertoire contient un sous-répertoire par bus. 
 + 
 +==net== 
 + 
 +Ce répertoire contient des informations sur le réseau. 
 + 
 +==sys== 
 + 
 +Ce répertoire contient des paramètres du noyau. Certains des fichiers dans ce répertoire sont accessibles en écriture par root en temps réel. Par exemple pour éviter des attaques réseau **%%DoS%%** utilisant la commande **ping**, saisissez la commande suivante : 
 + 
 +  # echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all [Entrée] 
 + 
 +Cette commande a pour résultat d'ignorer les reqûetes ping. 
 + 
 +====2.2 - Utilisation de la Commande sysctl==== 
 + 
 +Les fichiers dans le répertoire **/proc/sys** peuvent être administrés par la commande **sysctl** en temps réel.  
 + 
 +La commande **sysctl** applique les règles consignés dans le fichier **/etc/sysctl.conf** au démarrage de la machine. 
 + 
 +Saisissez la commande :
  
 <code> <code>
-[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ make menuconfig +[root@centos8 ~]# cat /etc/sysctl.conf 
-  UPD     scripts/kconfig/.mconf-cfg +# sysctl settings are defined through files in 
-  HOSTCC  scripts/kconfig/mconf.o +/usr/lib/sysctl.d//run/sysctl.d/, and /etc/sysctl.d/.
-  HOSTCC  scripts/kconfig/lxdialog/checklist.+
-  HOSTCC  scripts/kconfig/lxdialog/inputbox.+
-  HOSTCC  scripts/kconfig/lxdialog/menubox.+
-  HOSTCC  scripts/kconfig/lxdialog/textbox.+
-  HOSTCC  scripts/kconfig/lxdialog/util.o +
-  HOSTCC  scripts/kconfig/lxdialog/yesno.o +
-  HOSTLD  scripts/kconfig/mconf +
-scripts/kconfig/mconf  Kconfig+
 # #
-using defaults found in /boot/config-4.18.0-305.7.1.el8_4.x86_64+Vendors settings live in /usr/lib/sysctl.d/. 
 +# To override a whole file, create a new file with the same in 
 +# /etc/sysctl.d/ and put new settings thereTo override 
 +# only specific settings, add a file with a lexically later 
 +# name in /etc/sysctl.d/ and put new settings there.
 # #
 +# For more information, see sysctl.conf(5) and sysctl.d(5).
 +
 +[root@centos8 ~]# ls -l /etc/sysctl.d/
 +total 0
 +lrwxrwxrwx. 1 root root 14 Mar 16 15:42 99-sysctl.conf -> ../sysctl.conf
 +[root@centos8 ~]# ls -l /usr/lib/sysctl.d/
 +total 24
 +-rw-r--r--. 1 root root 1810 Dec 22  2020 10-default-yama-scope.conf
 +-rw-r--r--. 1 root root  524 Mar 16 15:42 50-coredump.conf
 +-rw-r--r--. 1 root root 1270 Mar 16 15:42 50-default.conf
 +-rw-r--r--. 1 root root  246 Jun 15  2020 50-libkcapi-optmem_max.conf
 +-rw-r--r--. 1 root root  636 Mar 16 15:42 50-pid-max.conf
 +-rw-r--r--. 1 root root  499 Nov 26  2019 60-libvirtd.conf
 +
 +[root@centos8 ~]# cat /usr/lib/sysctl.d/50-default.conf 
 +#  This file is part of systemd.
 +#
 +#  systemd is free software; you can redistribute it and/or modify it
 +#  under the terms of the GNU Lesser General Public License as published by
 +#  the Free Software Foundation; either version 2.1 of the License, or
 +#  (at your option) any later version.
 +
 +# See sysctl.d(5) and core(5) for documentation.
 +
 +# To override settings in this file, create a local file in /etc
 +# (e.g. /etc/sysctl.d/90-override.conf), and put any assignments
 +# there.
 +
 +# System Request functionality of the kernel (SYNC)
 +#
 +# Use kernel.sysrq = 1 to allow all keys.
 +# See https://www.kernel.org/doc/html/latest/admin-guide/sysrq.html for a list
 +# of values and keys.
 +kernel.sysrq = 16
 +
 +# Append the PID to the core filename
 +kernel.core_uses_pid = 1
 +
 +# https://bugzilla.redhat.com/show_bug.cgi?id=1689346
 +kernel.kptr_restrict = 1
 +
 +# Source route verification
 +net.ipv4.conf.all.rp_filter = 1
 +
 +# Do not accept source routing
 +net.ipv4.conf.all.accept_source_route = 0
 +
 +# Promote secondary addresses when the primary address is removed
 +net.ipv4.conf.all.promote_secondaries = 1
 +
 +# Fair Queue CoDel packet scheduler to fight bufferbloat
 +net.core.default_qdisc = fq_codel
 +
 +# Enable hard and soft link protection
 +fs.protected_hardlinks = 1
 +fs.protected_symlinks = 1
 </code> </code>
  
-Dans l'interface, vous pouvez constater la présence de lignes correspondantes à des fonctionalités suivies par une lettre ou une valeur. Dans le cas d'une lettre, la signification est la suivante :+Les options de la commande **sysctl** sont :
  
-  * **y**+<code> 
-    * la fonctionalité est incluse dans le noyau monolithique ou dans le cas d'une dépendance d'un module, dans le module concerné+[root@centos8 ~]# sysctl --help 
-  * **m**+ 
-    * la fonctionalité est incluse en tant que module+Usage: 
-  * **n**+ sysctl [options] [variable[=value] ...] 
-    * la fonctionalité n'est pas incluse.+ 
 +Options: 
 +  -a--all            display all variables 
 +  -A                   alias of -a 
 +  -X                   alias of -a 
 +      --deprecated     include deprecated parameters to listing 
 +  -b--binary         print value without new line 
 +  -e--ignore         ignore unknown variables errors 
 +  -N--names          print variable names without values 
 +  -n, --values         print only values of the given variable(s) 
 +  -p, --load[=<file> read values from file 
 +  -f                   alias of -p 
 +      --system         read values from all system directories 
 +  -r, --pattern <expression> 
 +                       select setting that match expression 
 +  -q, --quiet          do not echo variable set 
 +  -w, --write          enable writing a value to variable 
 +  -o                   does nothing 
 +  -x                   does nothing 
 +  -d                   alias of -h 
 + 
 + -h, --help     display this help and exit 
 + -V, --version  output version information and exit 
 + 
 +For more details see sysctl(8). 
 +</code>
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** - Cette commande permet la modification de la configuration du noyau.+**Important** : Consultez la page de la traduction du manuel de **sysctl** **[[http://www.delafond.org/traducmanfr/man/man8/sysctl.8.html|ici]]** pour comprendre la commande.
 </WRAP> </WRAP>
-   + 
-Sauvegardez simplement la configuration actuelle et sortez de l'interface :+=====LAB#3 - Interprétation des informations dans /proc===== 
 + 
 +Les informations brutes stockées dans /proc peuvent être interprétées grâce à l'utilisation des commandes dites de //gestion des performances//
 + 
 +  * free, 
 +  * uptime et w, 
 +  * iostat, 
 +  * hdparm, 
 +  * vmstat, 
 +  * mpstat, 
 +  * sar. 
 + 
 +====3.1 - La Commande free==== 
 + 
 +La commande **free** permet de donner l’état de la mémoire totale, libre, partagée, swap et bufferisée. Saisissez donc la commande suivante :
  
 <code> <code>
-*** End of the configuration. +[root@centos8 ~]# free -m 
-*** Execute 'make' to start the build or try 'make help'.+              total        used        free      shared  buff/cache   available 
 +Mem:           3735        1135        1818          14         782        2363 
 +Swap:          3279                  3279
 </code> </code>
  
-Vérifiez que le fichier **.config** a été" créé par l'exécution de makeconfig :+Dans le cas de cet exemple, nous pouvons constater que l’affichage montre : 
 + 
 +  3735 Mo de mémoire physique totale, 
 +  1135 Mo de mémoire physique utilisée et 1818 Mo de mémoire physique libre, 
 +  3279 Mo de mémoire swap totale et 0 Mo de swap utilisé 
 + 
 +Les options de cette commande sont :
  
 <code> <code>
-[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ ls -a +[root@centos8 ~]# free --help 
-.      certs          configs         Documentation  .get_maintainer.conf    .gitlab-ci.yml  Kbuild   LICENSES     Makefile.rhelver  README       security  virt + 
-..     .clang-format  COPYING-4.18.0  drivers        .get_maintainer.ignore  include         Kconfig  .mailmap     .mismatches       samples      sound +Usage: 
-arch   .cocciconfig   CREDITS         firmware       .gitattributes          init            kernel   MAINTAINERS  mm                .scmversion  tools + free [options] 
-block  .config        crypto          fs             .gitlab-ci-private.yml  ipc             lib      Makefile     net               scripts      usr+ 
 +Options: 
 + -b, --bytes         show output in bytes 
 +     --kilo          show output in kilobytes 
 +     --mega          show output in megabytes 
 +     --giga          show output in gigabytes 
 +     --tera          show output in terabytes 
 +     --peta          show output in petabytes 
 + -k, --kibi          show output in kibibytes 
 + -m, --mebi          show output in mebibytes 
 + -g, --gibi          show output in gibibytes 
 +     --tebi          show output in tebibytes 
 +     --pebi          show output in pebibytes 
 + -h, --human         show human-readable output 
 +     --si            use powers of 1000 not 1024 
 + -l, --lohi          show detailed low and high memory statistics 
 + -t, --total         show total for RAM + swap 
 + -s N, --seconds N   repeat printing every N seconds 
 + -c N, --count N     repeat printing N times, then exit 
 + -w, --wide          wide output 
 + 
 +     --help     display this help and exit 
 + -V, --version  output version information and exit 
 + 
 +For more details see free(1).
 </code> </code>
  
-Consultez ce fichier :+====3.2 - Les Commandes uptime et w==== 
 + 
 +Chacune des ces commandes indique la charge moyenne du ou des processeurs depuis 1 minute, 5 minutes et 15 minutes :
  
 <code> <code>
-[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ more .config +[root@centos8 ~]# uptime 
-# + 04:39:03 up 1 day,  2:34,  1 user,  load average: 0.00, 0.00, 0.00 
-# Automatically generated file; DO NOT EDIT. +  
-# Linux/x86 4.18.0 Kernel Configuration +[root@centos8 ~]# w 
-#+ 04:39:04 up day,  2:34,  1 user,  load average: 0.00, 0.00, 0.00 
 +USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT 
 +trainee  pts/0    10.0.2.1         03:58    0.00s  0.11s  0.02s sshd: trainee [priv] 
 +</code>
  
-+Les valeurs **load average** ou //charge moyenne// indiquent le nombre moyen de processus en cours de traitement ou en attente pour la période concernée
-# Compiler: gcc (GCC) 8.4.1 20200928 (Red Hat 8.4.1-1) + 
-# +Par exemple si les valeurs sur un système muni d'un seul processeur étaient **3,48  4,00  3,85** ceci indiquerait que le processeur a du mal à traiter les processus mettant en moyenne : 
-CONFIG_64BIT=y + 
-CONFIG_X86_64=y +  * 2,48 processus en attente dans la dernière minute, 
-CONFIG_X86=y +  * 3,00 processus en attente dans les dernières 5 minutes, 
-CONFIG_INSTRUCTION_DECODER=y +  * 2,85 processus en attente dans les dernières 15 minutes. 
-CONFIG_OUTPUT_FORMAT="elf64-x86-64" + 
-CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig" +Les options de ces commandes sont : 
-CONFIG_LOCKDEP_SUPPORT=y + 
-CONFIG_STACKTRACE_SUPPORT=y +<code> 
-CONFIG_MMU=y +[root@centos8 ~]# uptime --help 
-CONFIG_ARCH_MMAP_RND_BITS_MIN=28 + 
-CONFIG_ARCH_MMAP_RND_BITS_MAX=32 +Usage: 
-CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 + uptime [options] 
-CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16 + 
-CONFIG_GENERIC_ISA_DMA=y +Options: 
-CONFIG_GENERIC_BUG=y + -p, --pretty   show uptime in pretty format 
-CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y + -h, --help     display this help and exit 
-CONFIG_GENERIC_HWEIGHT=y + -s, --since    system up since 
-CONFIG_ARCH_MAY_HAVE_PC_FDC=y + -V, --version  output version information and exit 
-CONFIG_GENERIC_CALIBRATE_DELAY=y + 
-CONFIG_ARCH_HAS_CPU_RELAX=y +For more details see uptime(1). 
-CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y + 
-CONFIG_ARCH_HAS_FILTER_PGPROT=y +[root@centos8 ~]# w --help 
-CONFIG_HAVE_SETUP_PER_CPU_AREA=y + 
-CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y +Usage: 
-CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y + w [options] 
-CONFIG_ARCH_HIBERNATION_POSSIBLE=y + 
-CONFIG_ARCH_SUSPEND_POSSIBLE=y +Options: 
-CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y + -h, --no-header     do not print header 
-CONFIG_ARCH_WANT_GENERAL_HUGETLB=y + -u, --no-current    ignore current process username 
-CONFIG_ZONE_DMA32=y + -s, --short         short format 
-CONFIG_AUDIT_ARCH=y + -f, --from          show remote hostname field 
-CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y + -o, --old-style     old style output 
-CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y + -i, --ip-addr       display IP address instead of hostname (if possible) 
-CONFIG_HAVE_INTEL_TXT=y + 
-CONFIG_X86_64_SMP=y +     --help     display this help and exit 
---More--(0%)+ -V, --version  output version information and exit 
 + 
 +For more details see w(1).
 </code> </code>
  
-===Le Fichier Makefile===+====3.3 - La Commande iostat====
  
-Le fichier **Makefile** contient le nom du noyau et spécifie les informations suivantes :+La commande **iostat** affiche des statistiques sur l'utilisation des disques, des terminaux et des lecteurs de cartouche :
  
-  * VERSION, +<code> 
-  * PATCHLEVEL, +[root@centos8 ~]# iostat 
-  * SUBLEVEL, +bash: iostat: command not found... 
-  * EXTRAVERSION.+Install package 'sysstat' to provide command 'iostat'? [N/y] y
  
-Les trois premières informations sont gérées par **kernel.org** et Linus Torvalds en personne tandis que l'EXTRAVERSION est gérée par Red Hat :+ 
 + Waiting in queue...  
 +The following packages have to be installed: 
 + lm_sensors-libs-3.4.0-22.20180522git70f7e08.el8.x86_64 Lm_sensors core libraries 
 + sysstat-11.7.3-5.el8.x86_64    Collection of performance monitoring tools for Linux 
 +Proceed with changes? [N/y] y 
 + 
 + 
 + Waiting in queue...  
 + Waiting for authentication...  
 + Waiting in queue...  
 + * Downloading packages...  
 + * Requesting data...  
 + * Testing changes...  
 + * Installing packages...  
 +Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_(8 CPU) 
 + 
 +avg-cpu:  %user   %nice %system %iowait  %steal   %idle 
 +           0.03    0.00    0.03    0.01    0.00   99.93 
 + 
 +Device             tps    kB_read/   kB_wrtn/   kB_read    kB_wrtn 
 +sda               0.28         7.67         1.49     735338     142510 
 +sdb               0.00         0.03         0.00       2995          0 
 +scd0              0.00         0.00         0.00          2          0 
 +dm-0              0.26         7.25         1.55     694786     148837 
 +dm-1              0.00         0.02         0.00       2220          0 
 +</code> 
 + 
 +Au-dessous de la première ligne indiquant la version du noyau du système et son nom d'hôte ainsi que la date actuelle, iostat affiche une vue d'ensemble de l'utilisation CPU moyenne du système depuis le dernier démarrage. Le rapport d'utilisation du CPU inclut les pourcentages suivants : 
 + 
 +  * **%user** - Pourcentage de temps passé en mode utilisateur (exécutant des applications, etc.) 
 +  * **%nice** - Pourcentage de temps passé en mode utilisateur (pour les processus qui ont modifié leur priorité de programmation à l'aide de la commande nice) 
 +  * **%system** - Pourcentage de temps passé en mode noyau 
 +  * **%steal** - Pourcentage du temps passé par des CPU virtuels en attendant que l'hyperviseur s'occupe d'un autre CPU virtuel. 
 +  * **%iowait** - Pourcentage du temps passé à attendre les entrées et les sorties des disques. 
 +  * **%idle** - Pourcentage de temps passé en inactivité 
 + 
 +Notez la valeur de **%iowait**. Dans le cas où ce pourcentage est trop élévé, ceci indique que le processeur passe son temps à attendre les entrées et les sorties de disque. 
 + 
 +Au-dessous du rapport d'utilisation du CPU de la sortie de la commande **iostat** figure le rapport d'utilisation des périphériques. Ce dernier contient une ligne pour chaque périphérique disque du système et inclut les informations suivantes : 
 + 
 +  * La spécification du périphérique. 
 +  * Le nombre de transferts (ou opérations d'E/S) par seconde. 
 +  * Le nombre de blocs de KB lus par seconde. 
 +  * Le nombre de blocs de KB écrits par seconde. 
 +  * Le nombre total de KB lus. 
 +  * Le nombre total de KB écrits. 
 +   
 +Dernièrement, pour voir les statistiques étendues des disques, utilisez la commande suivante :
  
 <code> <code>
-[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ more Makefile +[root@centos8 ~]# iostat -d -x 
-# SPDX-License-Identifier: GPL-2.+Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        30/06/21        _x86_64_        (8 CPU)
-VERSION = 4 +
-PATCHLEVEL = 18 +
-SUBLEVEL = 0 +
-EXTRAVERSION = +
-NAME = Merciless Moray+
  
-# +Device            r/s     w/    rkB/    wkB/  rrqm/  wrqm/ %rrqm  %wrqm r_await w_await aqu-sz rareq-sz wareq-sz  svctm  %util 
-# DRM backport version +sda              0.20    0.16     11.67      1.81     0.00     0.03   0.48  17.45    6.79   69.99   0.01    58.28    11.33   9.13   0.33 
-# +sdb              0.00    0.00      0.02      0.00     0.00     0.00   0.00   0.00    0.13    0.00   0.00     8.81     0.00   0.51   0.00 
-RHEL_DRM_VERSION = 5 +scd0             0.00    0.00      0.00      0.00     0.00     0.00   0.00   0.00    0.20    0.00   0.00     0.20     0.00   0.90   0.00 
-RHEL_DRM_PATCHLEVEL = 9 +dm-0             0.12    0.19      3.98      1.90     0.00     0.00   0.00   0.00    4.18   79.07   0.02    32.88    10.07  10.34   0.32 
-RHEL_DRM_SUBLEVEL = 14+dm-1             0.00    0.00      0.01      0.00     0.00     0.00   0.00   0.00    0.76    0.00   0.00    21.35     0.00   0.68   0.00 
 +</code>
  
-# *DOCUMENTATION* +Les options de cette commande sont :
-# To see a list of typical targets execute "make help" +
-# More info can be located in ./README +
-# Comments in this file are targeted only to the developer, do not +
-# expect to learn how to build the kernel reading this file.+
  
-That's our default target when none is given on the command line +<code> 
-PHONY := _all +[root@centos8 ~]iostat --help 
-_all:+Usageiostat [ options ] [ <interval> [ <count> ] ] 
 +Options are: 
 +[ -c ] [ -d ] [ -h ] [ -k | -m ] [ -N ] [ -s ] [ -t ] [ -V ] [ -x ] [ -y ] [ -z ] 
 +[ -j { ID | LABEL | PATH | UUID | ... } ] [ --human ] [ -o JSON ] 
 +[ [ -H ] -g <group_name> ] [ -p [ <device> [,...] | ALL ] ] 
 +[ <device> [...] | ALL ] 
 +</code>
  
-# o Do not use make's built-in rules and variables +====3.4 La Commande hdparm====
-#   (this increases performance and avoids hard-to-debug behaviour); +
-# o Look for make include files relative to root of kernel src +
-MAKEFLAGS += -rR --include-dir=$(CURDIR)+
  
-# Avoid funny character set dependencies +Pour surveiller la vitesse des entrées et des sorties du disque, vous pouvez utiliser la commande **hdparm** :
-unexport LC_ALL +
-LC_COLLATE=C +
-LC_NUMERIC=C +
-export LC_COLLATE LC_NUMERIC+
  
-# Avoid interference with shell env settings +<code> 
-unexport GREP_OPTIONS+[root@centos8 ~]# hdparm -t /dev/sda
  
-Set RHEL variables +/dev/sda: 
-Use this spot to avoid future merge conflicts + Timing buffered disk reads: 1410 MB in  3.00 seconds = 469.98 MB/sec 
-include Makefile.rhelver+</code> 
 + 
 +====3.5 - La Commande vmstat==== 
 + 
 +La commande **vmstat** affiche des statistiques sur la mémoire, la pagination et la charge ponctuelle du processeur : 
 + 
 +<code> 
 +[root@centos8 ~]vmstat 1 10 
 +procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----- 
 +  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st 
 +  0      0 1765216   2256 866336    0    0            9   12  0  0 100  0  0 
 +  0      0 1765136   2256 866336    0    0           57   80  0  0 100  0  0 
 +  0      0 1765136   2256 866376    0    0           54   77  0  0 100  0  0 
 +  0      0 1765136   2256 866376    0    0           66  100  0  0 100  0  0 
 +  0      0 1765136   2256 866376    0    0          103  125  0  0 100  0  0 
 +  0      0 1765108   2256 866376    0    0           64   86  0  0 100  0  0 
 +  0      0 1765108   2256 866376    0    0           62   88  0  0 100  0  0 
 +  0      0 1765108   2256 866376    0    0           68   97  0  0 100  0  0 
 +  0      0 1765108   2256 866376    0    0           60   88  0  0 100  0  0 
 +  0      0 1765108   2256 866376    0    0          177  251  0  0 100  0  0 
 +</code> 
 + 
 +La première ligne subdivise le champ en six catégories à savoir : processus, mémoire, swap, E/S, système et CPU sur lesquelles elle donne des statistiques. La seconde ligne identifie de manière encore plus détaillée chacun des champs, permettant ainsi de parcourir simplement et rapidement l'ensemble des données lors de la recherche de statistiques spécifiques. 
 + 
 +Les champs relatifs aux processus sont les suivants : 
 + 
 +  * r — Le nombre de processus exécutables attendant d'avoir accès au CPU 
 +  * b — Le nombre de processus exécutables dans un état de veille qui ne peut être interrompu 
 + 
 +Les champs relatifs à la mémoire sont les suivants : 
 + 
 +  * swpd — La quantité de mémoire virtuelle utilisée 
 +  * free — La quantité de mémoire libre 
 +  * buff — La quantité de mémoire utilisée par les tampons (ou buffers) 
 +  * cache — La quantité de mémoire utilisée comme cache de pages 
 + 
 +Les champs relatifs au swap sont les suivants : 
 + 
 +  * si — La quantité de mémoire chargée depuis le disque 
 +  * so — La quantité de mémoire déchargée sur le disque 
 + 
 +Les champs relatifs aux Entrées/Sorties (E/S) sont les suivants : 
 + 
 +  * bi — Blocs envoyés vers un périphérique blocs 
 +  * bo— Blocs reçus d'un périphérique blocs  
 + 
 +Les champs relatifs au système sont les suivants : 
 + 
 +  * in — Nombre d'interruptions par seconde 
 +  * cs — Nombre de changements de contexte par seconde 
 + 
 +Les champs relatifs au CPU sont les suivants : 
 + 
 +  * us — Le pourcentage de temps pendant lequel le CPU exécute un code de niveau utilisateur 
 +  * sy — Le pourcentage de temps pendant lequel le CPU exécute un code de niveau système 
 +  * id — Le pourcentage de temps pendant lequel le CPU était inoccupé 
 +  * wa — Attente d'E/
 + 
 +Les options de cette commande sont : 
 + 
 +<code> 
 +[root@centos8 ~]vmstat --help 
 + 
 +Usage: 
 + vmstat [options] [delay [count]] 
 + 
 +Options: 
 + -a, --active           active/inactive memory 
 + -f, --forks            number of forks since boot 
 + -m, --slabs            slabinfo 
 + -n, --one-header       do not redisplay header 
 + -s, --stats            event counter statistics 
 + -d, --disk             disk statistics 
 + -D, --disk-sum         summarize disk statistics 
 + -p, --partition <dev>  partition specific statistics 
 + -S, --unit <char>      define display unit 
 + -w, --wide             wide output 
 + -t, --timestamp        show timestamp 
 + 
 + -h, --help     display this help and exit 
 + -V, --version  output version information and exit
  
-# We are using a recursive build, so we need to do a little thinking +For more details see vmstat(8).
---Plus--(2%)+
 </code> </code>
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** - La version 2.6 du noyau a vu le jour en **2003**. Les **SUBLEVEL** se suivaient régulièrement. Avec la version 2.6 du noyau, la valeur paire du **PATCHLEVEL** indiquait que le noyau était stable. Quand vous recompilez le noyau à partir des sources, vous devez modifier la valeur de l'EXTRAVERSION.  Le passage à la version 3.0 fut décidé par Linus Torvalds à l'occasion des 20 ans du noyau Linux. Depuis l'arrivée de la version 3 du noyau, la signification de la valeur de PATCHLEVEL paire et impaire a été abondonnée.+**Important** : Par défaut la commande vmstat affiche des informations depuis le démarrage du système.
 </WRAP> </WRAP>
  
-====2.Paramétrage du noyau====+====3.La Commande mpstat====
  
-Insérez la sortie de la commande **uname -i** sur la première ligne du fichier .config :+La commande **mpstat** affiche des statistiques détaillées sur le CPU :
  
 <code> <code>
-[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ uname -i +[root@centos8 ~]# mpstat 
-x86_64 +Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_(8 CPU)
-[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ vi .config +
-[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ head .config +
-# x86_64 +
-+
-# Automatically generated file; DO NOT EDIT. +
-# Linux/x86 4.18.0 Kernel Configuration +
-#+
  
-# +04:53:22     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle 
-# Compilergcc (GCC) 8.4.1 20200928 (Red Hat 8.4.1-1) +04:53:22     all    0.03    0.00    0.01    0.02    0.01    0.01    0.00    0.00    0.00   99.92
-+
-CONFIG_64BIT=y+
 </code> </code>
  
-Renommez le fichier .config en le plaçant dans le répertoire **~/rpmbuild/SOURCES/** :+Dans le cas où vous avez plusieurs processeurs ou coeurs, vous pouvez visualiser ces mêmes informations par unité de traitement :
  
 <code> <code>
-[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ cp .config ~/rpmbuild/SOURCES/config-`uname -m`-generic +[root@centos8 ~]# mpstat -P ALL 
-[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ ls ~/rpmbuild/SOURCES +Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_(8 CPU) 
-centos-ca-secureboot.der  cpupower.config            filter-x86_64.sh                           kernel-s390x.config                mod-extra.list           Module.kabi_s390x + 
-centos-dup.x509           cpupower.service           generate_all_configs.sh                    kernel-s390x-debug.config          mod-internal.list        Module.kabi_x86_64 +04:54:28     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle 
-centos-kpatch.x509        debrand-rh-i686-cpu.patch  generate_bls_conf.sh                       kernel-s390x-zfcpdump.config       mod-sign.sh              parallel_xz.sh +04:54:28     all    0.03    0.00    0.01    0.02    0.01    0.01    0.00    0.00    0.00   99.92 
-centos.pem                debrand-rh_taint.patch     kernel-aarch64.config                      kernel-x86_64.config               Module.kabi_aarch64      process_configs.sh +04:54:28          0.03    0.00    0.01    0.00    0.01    0.00    0.00    0.00    0.00   99.94 
-centossecureboot001.der   debrand-single-cpu.patch   kernel-aarch64-debug.config                kernel-x86_64-debug.config         Module.kabi_dup_aarch64  x509.genkey +04:54:28          0.02    0.00    0.02    0.03    0.02    0.00    0.00    0.00    0.00   99.91 
-centossecureboot201.der   filter-aarch64.sh          kernel-abi-stablelists-4.18.0-305.tar.bz2  kvm_stat.logrotate                 Module.kabi_dup_ppc64le +04:54:28       2    0.02    0.00    0.01    0.01    0.01    0.04    0.00    0.00    0.00   99.90 
-centossecurebootca2.der   filter-modules.sh          kernel-kabi-dw-4.18.0-305.tar.bz2          linux-4.18.0-305.7.1.el8_4.tar.xz  Module.kabi_dup_s390x +04:54:28          0.01    0.00    0.01    0.02    0.00    0.00    0.00    0.00    0.00   99.95 
-check-kabi                filter-ppc64le.sh          kernel-ppc64le.config                      linux-kernel-test.patch            Module.kabi_dup_x86_64 +04:54:28          0.05    0.00    0.02    0.03    0.01    0.00    0.00    0.00    0.00   99.88 
-config-x86_64-generic     filter-s390x.sh            kernel-ppc64le-debug.config                mod-blacklist.sh                   Module.kabi_ppc64le+04:54:28          0.03    0.01    0.01    0.02    0.01    0.00    0.00    0.00    0.00   99.92 
 +04:54:28          0.02    0.00    0.02    0.01    0.01    0.00    0.00    0.00    0.00   99.95 
 +04:54:28          0.02    0.00    0.01    0.01    0.01    0.00    0.00    0.00    0.00   99.94
 </code> </code>
  
-Copiez le contenu du répertoire **configs** vers le répertoire **~/rpmbuild/SOURCES/** :+Pour afficher 5 jeux de statistiques à des intervales de 2 secondes pour tous les unités de traitement, il convient d'utiliser la commande suivante :
  
 <code> <code>
-[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ cp configs/* ~/rpmbuild/SOURCES/+[root@centos8 ~]# mpstat -P ALL 2 5 
 +Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_        (8 CPU) 
 + 
 +04:55:11     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle 
 +04:55:13     all    0.00    0.00    0.00    0.00    0.00    0.00    0.06    0.00    0.00   99.94 
 +04:55:13          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:13          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:13          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:13          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:13          0.00    0.00    0.00    0.00    0.00    0.00    0.50    0.00    0.00   99.50 
 +04:55:13          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:13          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:13          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 + 
 +04:55:13     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle 
 +04:55:15     all    0.00    0.00    0.00    0.00    0.06    0.00    0.00    0.00    0.00   99.94 
 +04:55:15          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:15          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:15          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:15          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:15          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:15          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:15          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:15          0.00    0.00    0.00    0.00    0.50    0.00    0.00    0.00    0.00   99.50 
 + 
 +04:55:15     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle 
 +04:55:17     all    0.00    0.00    0.00    0.00    0.06    0.00    0.00    0.00    0.00   99.94 
 +04:55:17          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:17          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:17          0.00    0.00    0.00    0.00    0.50    0.00    0.00    0.00    0.00   99.50 
 +04:55:17          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:17          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:17          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:17          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:17          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 + 
 +04:55:17     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle 
 +04:55:19     all    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 + 
 +04:55:19     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle 
 +04:55:21     all    0.06    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00   99.94 
 +04:55:21          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:21          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:21          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:21          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:21          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:21          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:21          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +04:55:21          0.50    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00   99.50 
 + 
 +Average:     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle 
 +Average:     all    0.01    0.00    0.00    0.00    0.02    0.00    0.01    0.00    0.00   99.95 
 +Average:          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +Average:          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +Average:          0.00    0.00    0.00    0.00    0.10    0.00    0.00    0.00    0.00   99.90 
 +Average:          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +Average:          0.00    0.00    0.00    0.00    0.00    0.00    0.10    0.00    0.00   99.90 
 +Average:          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +Average:          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 
 +Average:          0.10    0.00    0.00    0.00    0.10    0.00    0.00    0.00    0.00   99.80
 </code> </code>
  
-Editez la directive **buildid** dans le fichier **~/rpmbuild/SPECS/kernel.spec** :+Les options de cette commande sont :
  
 <code> <code>
-[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ cd ~/rpmbuild/SPECS+[root@centos8 ~]# mpstat --help 
 +Usage: mpstat [ options [ <interval> [ <count> ] ] 
 +Options are: 
 +[ -A ] [ -n ] [ -u ] [ -V ] [ -I { SUM | CPU | SCPU | ALL } ] 
 +[ -N { <node_list> | ALL } ] [ -o JSON ] [ -P { <cpu_list> | ALL } ] 
 +</code>
  
-[trainee@centos8 SPECS]$ vi kernel.spec+====3.7 - La Commande sar====
  
-[trainee@centos8 SPECS]$ head -n 50 kernel.spec +La commande **sar** (**S**ystem **A**ctivity **R**eporter) permet de surveiller toutes les ressources du système selon l'option qui est passée en argument à la commande
-# We have to override the new %%install behavior because, well... the kernel is special. +
-%global __spec_install_pre %{___build_pre}+
  
-# At the time of this writing (2019-03), RHEL8 packages use w2.xzdio +Sous RHEL/CentOS 8 la commande **/usr/lib64/sa/sadc** permet de collecter les informations :
-# compression for rpms (xz, level 2). +
-# Kernel has several large (hundreds of mbytes) rpms, they take ~5 mins +
-# to compress by single-threaded xz. Switch to threaded compression, +
-# and from level 2 to 3 to keep compressed sizes close to "w2" results. +
-+
-# NB: if default compression in /usr/lib/rpm/redhat/macros ever changes, +
-# this one might need tweaking (e.g. if default changes to w3.xzdio, +
-# change below to w4T.xzdio): +
-%define _binary_payload w3T.xzdio+
  
-# For a kernel released for public testing, released_kernel should be 1. +<code> 
-For internal testing builds during development, it should be 0. +[root@centos8 ~]ls /usr/lib64/sa 
-%global released_kernel 1+sa1  sa2  sadc 
 +</code>
  
-%global distro_build 305+Le script **/usr/lib64/sa/sa1** exécute la commande **sadc**. Ce script prend deux options :
  
-# Sign the x86_64 kernel for secure boot authentication +^ Option ^ Description ^ 
-%ifarch x86_64 aarch64 +| -t | L'intervalle entre les collectes | 
-%global signkernel 1 +| -n | Nombre de collectes |
-%else +
-%global signkernel 0 +
-%endif+
  
-# Sign modules on all arches +Le script **/usr/lib64/sa/sa2** exécute la commande **sar** et consigne les informations dans un fichier au format **/var/log/sa/sar<jj>** :
-%global signmodules 1+
  
-Compress modules only for architectures that build modules +<code> 
-%ifarch noarch +[root@centos8 ~]ls /var/log/sa/ 
-%global zipmodules 0 +sa29  s
-%else +
-%global zipmodules 1 +
-%endif+
  
-%if %{zipmodules} 
-%global zipsed -e 's/\.ko$/\.ko.xz/' 
-%endif 
  
-%define buildid .i2tch+ar29 
 +</code> 
 + 
 +Sous CentOS / RHEL 8, l'intervalle entre les collectes des informations est configuré par les **timers** de systemd au lieu des cron jobs : 
 + 
 +<code> 
 +[root@centos8 ~]# cat /usr/lib/systemd/system/sysstat-collect.timer 
 +# /usr/lib/systemd/system/sysstat-collect.timer 
 +# (C) 2014 Tomasz Torcz <tomek@pipebreaker.pl> 
 +
 +# sysstat-11.7.3 systemd unit file: 
 +#        Activates activity collector every 10 minutes
  
-%define rpmversion 4.18.0 +[Unit] 
-%define pkgrelease 305.7.1.el8_4+Description=Run system activity accounting tool every 10 minutes
  
-# allow pkg_release to have configurable %%{?dist} tag +[Timer] 
-%define specrelease 305.7.1%{?dist}+OnCalendar=*:00/10
  
-%define pkg_release %{specrelease}%{?buildid}+[Install] 
 +WantedBy=sysstat.service
 </code> </code>
  
-====2.5 - Compiler le Noyau====+La valeur de **OnCalendar** indique un collecte toutes les dix minutes.
  
-La compilation du noyau peut prendre beaucoup de temps (~5 heures). La commande utilisée est la suivante :+Pour modifier l'intervalle entre les collectes, il faut créer un fichier **override** dans le répertoire **/etc/systemd/system/** en utilisant la commande **systemctl edit**. En effet, il ne faut jamais éditer les fichiers dans le répertoire **/usr/lib/systemd/system** :
  
 <code> <code>
-[trainee@centos7 SPECS]$ rpmbuild -bb --target=`uname -m` kernel.spec 2> build-err.log | tee build-out.log &+[root@centos8 ~]# systemctl edit sysstat-collect.timer 
 +[root@centos8 ~]# cat /etc/systemd/system/sysstat-collect.timer.d/override.conf  
 +[Unit] 
 +Description=Run system activity accounting tool every 2 minutes 
 + 
 +[Timer] 
 +OnCalendar= 
 +OnCalendar=*:00/
 +AccuracySec=0
 </code> </code>
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** - La compilation peut prendre des heures. Arrêtez donc le processus avec les touches ^C. Arrêtez ensuite votre VM. Demandez à votre formateur de démarrer la VM contenant le noyau déjà compilé.+**Important** : Notez la ligne **OnCalendar=** qui est necessaire afin de surcharger la valeur par défaut.
 </WRAP> </WRAP>
  
-A l'issu du processus, les RPMs se trouvent dans le répertoire **/home/trainee/rpmbuild/RPMS/x86_64/** :+Vérifiez ensuite la prise en compte de la configuration :
  
 <code> <code>
-... +[root@centos8 ~]# systemctl status sysstat-collect.timer 
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +● sysstat-collect.timer Run system activity accounting tool every 2 minutes 
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-headers-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +   Loadedloaded (/usr/lib/systemd/system/sysstat-collect.timer; enabled; vendor presetdisabled) 
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-cross-headers-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +  Drop-In: /etc/systemd/system/sysstat-collect.timer.d 
-Wrote/home/trainee/rpmbuild/RPMS/x86_64/kernel-debuginfo-common-x86_64-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +           └─override.conf 
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/perf-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +   Activeactive (waiting) since Tue 2021-06-29 06:16:04 EDT; 3h 2min ago 
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/perf-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +  TriggerTue 2021-06-29 09:20:00 EDT; 1min 19s left
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/python3-perf-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote/home/trainee/rpmbuild/RPMS/x86_64/python3-perf-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote/home/trainee/rpmbuild/RPMS/x86_64/kernel-tools-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote/home/trainee/rpmbuild/RPMS/x86_64/kernel-tools-libs-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote/home/trainee/rpmbuild/RPMS/x86_64/kernel-tools-libs-devel-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote/home/trainee/rpmbuild/RPMS/x86_64/kernel-tools-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote/home/trainee/rpmbuild/RPMS/x86_64/bpftool-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/bpftool-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-selftests-internal-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-debug-core-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-debug-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-debug-devel-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-debug-modules-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-debug-modules-extra-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-debug-modules-internal-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-debug-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-core-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-devel-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-modules-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-modules-extra-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-modules-internal-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-ipaclones-internal-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +
-Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rkOgfs+
  
-[1]+  Done                    rpmbuild -bb --target=`uname -m` kernel.spec 2> build-err.log | tee build-out.log+Jun 29 06:16:04 centos8.ittraining.loc systemd[1]: Started Run system activity accounting tool every 10 minutes.
 </code> </code>
  
 <code> <code>
-[trainee@centos8 SPECS]$ cd ../RPMS +[root@centos8 ~]# journalctl -g sysstat-collect.service 
-[trainee@centos8 RPMS]$ ls +-- Logs begin at Mon 2021-06-28 02:04:10 EDT, end at Tue 2021-06-29 09:18:00 EDT. -- 
-x86_64 +Jun 29 06:20:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. 
-[trainee@centos8 RPMS]$ cd x86_64/ +Jun 29 06:26:29 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded
-[trainee@centos8 x86_64]$ ls +Jun 29 06:30:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. 
-bpftool-4.18.0-305.7.1.el8.i2tch.x86_64.rpm                 kernel-debuginfo-common-x86_64-4.18.0-305.7.1.el8.i2tch.x86_64.rpm  kernel-selftests-internal-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +Jun 29 06:40:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded
-bpftool-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm       kernel-debug-modules-4.18.0-305.7.1.el8.i2tch.x86_64.rpm            kernel-tools-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +Jun 29 06:50:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. 
-kernel-4.18.0-305.7.1.el8.i2tch.x86_64.rpm                  kernel-debug-modules-extra-4.18.0-305.7.1.el8.i2tch.x86_64.rpm      kernel-tools-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +Jun 29 07:00:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded
-kernel-core-4.18.0-305.7.1.el8.i2tch.x86_64.rpm             kernel-debug-modules-internal-4.18.0-305.7.1.el8.i2tch.x86_64.rpm   kernel-tools-libs-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +Jun 29 07:10:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. 
-kernel-cross-headers-4.18.0-305.7.1.el8.i2tch.x86_64.rpm    kernel-devel-4.18.0-305.7.1.el8.i2tch.x86_64.rpm                    kernel-tools-libs-devel-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +Jun 29 07:20:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded
-kernel-debug-4.18.0-305.7.1.el8.i2tch.x86_64.rpm            kernel-headers-4.18.0-305.7.1.el8.i2tch.x86_64.rpm                  perf-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +Jun 29 07:30:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. 
-kernel-debug-core-4.18.0-305.7.1.el8.i2tch.x86_64.rpm       kernel-ipaclones-internal-4.18.0-305.7.1.el8.i2tch.x86_64.rpm       perf-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +Jun 29 07:40:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded
-kernel-debug-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm  kernel-modules-4.18.0-305.7.1.el8.i2tch.x86_64.rpm                  python3-perf-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +Jun 29 07:50:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. 
-kernel-debug-devel-4.18.0-305.7.1.el8.i2tch.x86_64.rpm      kernel-modules-extra-4.18.0-305.7.1.el8.i2tch.x86_64.rpm            python3-perf-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm +Jun 29 07:53:56 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded
-kernel-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm        kernel-modules-internal-4.18.0-305.7.1.el8.i2tch.x86_64.rpm+Jun 29 07:54:00 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. 
 +Jun 29 07:56:00 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded
 +Jun 29 07:58:00 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. 
 +Jun 29 08:00:00 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded
 +...
 </code> </code>
  
-Notez que la génération du nouveau noyau peut consommer jusqu'à 21 Go d'espace disque :+Saisissez la commande suivante :
  
 <code> <code>
-[trainee@centos8 x86_64]$ df -h +[root@centos8 ~]# sar 
-Filesystem                   Size  Used Avail UseMounted on +Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_        (8 CPU) 
-devtmpfs                     1.8G     0  1.8G   0% /dev + 
-tmpfs                        1.9G     0  1.9G   0% /dev/shm +06:16:04     LINUX RESTART      (8 CPU) 
-tmpfs                        1.9G  9.4M  1.9G   1/run + 
-tmpfs                        1.9G     0  1.9G   0% /sys/fs/cgroup +06:20:33        CPU     %user     %nice   %system   %iowait    %steal     %idle 
-/dev/mapper/cl_centos8-root   28G  5.5G   23G  20% / +06:26:29        all      0.03      0.00      0.03      0.00      0.00     99.94 
-/dev/sda1                    976M  289M  620M  32% /boot +06:30:33        all      0.02      0.00      0.03      0.00      0.00     99.95 
-tmpfs                        374M   24K  374M   1% /run/user/1000 +06:40:33        all      0.02      0.00      0.03      0.00      0.00     99.94 
-tmpfs                        374M  1.2M  373M   1% /run/user/42 +06:50:33        all      0.02      0.00      0.02      0.00      0.00     99.95 
-/dev/sdc1                     63G   21G   39G  35/home+07:00:33        all      0.02      0.00      0.02      0.00      0.00     99.95 
 +07:10:33        all      0.02      0.00      0.02      0.00      0.00     99.95 
 +07:20:33        all      0.02      0.00      0.03      0.00      0.00     99.95 
 +07:30:33        all      0.02      0.01      0.03      0.00      0.00     99.94 
 +07:40:33        all      0.03      0.00      0.04      0.00      0.00     99.93 
 +07:50:33        all      0.03      0.00      0.03      0.00      0.00     99.94 
 +07:53:56        all      0.08      0.00      0.06      0.00      0.00     99.86 
 +07:54:00        all      0.09      0.00      0.06      0.00      0.00     99.85 
 +Average:        all      0.03      0.00      0.03      0.00      0.00     99.94 
 + 
 +07:55:44     LINUX RESTART      (8 CPU) 
 + 
 +07:56:00        CPU     %user     %nice   %system   %iowait    %steal     %idle 
 +07:58:00        all      0.03      0.00      0.03      0.00      0.00     99.94 
 +08:00:00        all      0.02      0.00      0.04      0.00      0.00     99.94 
 +08:02:00        all      0.02      0.00      0.03      0.00      0.00     99.94 
 +08:04:00        all      0.02      0.00      0.03      0.00      0.00     99.95 
 +08:06:00        all      0.02      0.00      0.03      0.00      0.00     99.95 
 +08:08:00        all      0.02      0.00      0.04      0.00      0.00     99.94 
 +08:10:00        all      0.02      0.00      0.03      0.00      0.00     99.95 
 +08:12:00        all      0.03      0.00      0.03      0.00      0.00     99.95 
 +08:14:00        all      0.02      0.00      0.03      0.01      0.00     99.94 
 +08:16:00        all      0.02      0.00      0.03      0.00      0.00     99.95 
 +08:18:00        all      0.02      0.00      0.03      0.00      0.00     99.95 
 +08:20:00        all      0.02      0.00      0.04      0.00      0.00     99.94 
 +08:22:00        all      0.02      0.00      0.03      0.00      0.00     99.95 
 +08:24:00        all      0.02      0.00      0.02      0.00      0.00     99.95 
 +08:26:00        all      0.02      0.00      0.03      0.00      0.00     99.95 
 +08:28:00        all      0.02      0.00      0.04      0.00      0.00     99.94 
 +08:30:00        all      0.02      0.05      0.05      0.00      0.00     99.87 
 +08:32:00        all      0.02      0.00      0.04      0.00      0.00     99.94 
 +08:34:00        all      0.02      0.00      0.04      0.00      0.00     99.94 
 +08:36:00        all      0.03      0.00      0.04      0.00      0.00     99.94 
 +08:38:00        all      0.02      0.00      0.04      0.00      0.00     99.94 
 +08:40:00        all      0.02      0.00      0.04      0.00      0.00     99.94 
 +08:42:00        all      0.02      0.00      0.03      0.00      0.00     99.94 
 +08:44:00        all      0.03      0.00      0.03      0.00      0.00     99.94 
 +08:46:00        all      0.02      0.00      0.03      0.00      0.00     99.94 
 +08:48:00        all      0.03      0.00      0.03      0.00      0.00     99.95 
 +08:50:00        all      0.02      0.00      0.04      0.00      0.00     99.94 
 +08:52:00        all      0.02      0.00      0.06      0.00      0.00     99.92 
 +08:54:00        all      0.02      0.00      0.03      0.00      0.00     99.95 
 +08:56:00        all      0.02      0.00      0.04      0.00      0.00     99.94 
 +08:58:00        all      0.02      0.00      0.02      0.00      0.00     99.96 
 +09:00:00        all      0.07      0.00      0.05      0.00      0.00     99.88 
 +09:02:00        all      0.02      0.00      0.04      0.00      0.00     99.94 
 +09:04:00        all      0.02      0.00      0.03      0.00      0.00     99.95 
 +09:06:00        all      0.02      0.00      0.04      0.00      0.00     99.94 
 +09:08:00        all      0.02      0.00      0.04      0.00      0.00     99.94 
 +09:10:00        all      0.02      0.00      0.03      0.00      0.00     99.95 
 +09:12:00        all      0.02      0.00      0.03      0.00      0.00     99.94 
 + 
 +09:12:00        CPU     %user     %nice   %system   %iowait    %steal     %idle 
 +09:14:00        all      0.02      0.00      0.03      0.00      0.00     99.95 
 +09:16:00        all      0.02      0.00      0.06      0.00      0.00     99.92 
 +09:18:00        all      0.03      0.00      0.03      0.00      0.00     99.95 
 +09:20:00        all      0.02      0.00      0.03      0.00      0.00     99.94 
 +Average:        all      0.02      0.00      0.03      0.00      0.00     99.94
 </code> </code>
  
-====2.6 - Installer le Nouveau Noyau====+===Statistiques d'Utilisation du CPU===
  
-Installez maintenant les paquets **kernel***. L'installation du noyau peut prendre beaucoup de temps (~2 heures). La commande utilisée est la suivante : :+Visualisez maintenant les statistiques d'utilisation du CPU
  
 <code> <code>
-[root@centos8 x86_64]# dnf localinstall kernel-*.rpm +[root@centos8 ~]# sar -3 
-Last metadata expiration check: 2:25:32 ago on Tue 20 Jul 2021 08:37:00 EDT. +Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_        (8 CPU)
-Dependencies resolved. +
-=============================================================================================================================================================================================================== +
- Package                                                       Architecture                          Version                                                 Repository                                   Size +
-=============================================================================================================================================================================================================== +
-Installing: +
- kernel                                                        x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                5.9 M +
- kernel-core                                                   x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 36 M +
- kernel-cross-headers                                          x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 11 M +
- kernel-debug                                                  x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                5.9 M +
- kernel-debug-core                                             x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 63 M +
- kernel-debug-debuginfo                                        x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                683 M +
- kernel-debug-devel                                            x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 19 M +
- kernel-debug-modules                                          x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 54 M +
- kernel-debug-modules-extra                                    x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                7.2 M +
- kernel-debug-modules-internal                                 x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                6.3 +
- kernel-debuginfo                                              x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                570 M +
- kernel-debuginfo-common-x86_64                                x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 75 M +
- kernel-devel                                                  x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 18 M +
- kernel-ipaclones-internal                                     x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 20 M +
- kernel-modules                                                x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 28 M +
- kernel-modules-extra                                          x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                6.5 M +
- kernel-modules-internal                                       x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                6.1 M +
- kernel-selftests-internal                                     x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 19 M +
- kernel-tools-debuginfo                                        x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                6.2 M +
- kernel-tools-libs-devel                                       x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                5.9 M +
-Downgrading: +
- kernel-headers                                                x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                7.1 M +
- kernel-tools                                                  x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                6.1 M +
- kernel-tools-libs                                             x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                5.9 M +
- +
-Transaction Summary +
-=============================================================================================================================================================================================================== +
-Install    20 Packages +
-Downgrade   3 Packages+
  
-Total size1.6 G +09:22:52        CPU     %user     %nice   %system   %iowait    %steal     %idle 
-Is this ok [y/N]y+09:22:57        all      0.03      0.00      0.03      0.00      0.00     99.95 
 +09:23:02        all      0.03      0.00      0.03      0.00      0.00     99.95 
 +09:23:07        all      0.00      0.00      0.03      0.00      0.00     99.97 
 +Average:        all      0.02      0.00      0.03      0.00      0.00     99.96
 </code> </code>
  
-A l'issu de l'installation, re-démarrez la VM :+D'avantage de statistiques peuvent être obtenues en utilisant l'option **ALL** :
  
 <code> <code>
-[root@centos7 ~]# reboot+[root@centos8 ~]# sar -u ALL 5 3 
 +Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_(8 CPU) 
 + 
 +01:49:14        CPU      %usr     %nice      %sys   %iowait    %steal      %irq     %soft    %guest    %gnice     %idle 
 +01:49:19        all      0.03      0.00      0.00      0.00      0.00      0.03      0.00      0.00      0.00     99.95 
 +01:49:24        all      0.03      0.00      0.03      0.00      0.00      0.10      0.05      0.00      0.00     99.80 
 +01:49:29        all      0.00      0.00      0.00      0.25      0.00      0.10      0.05      0.00      0.00     99.60 
 +Average:        all      0.02      0.00      0.01      0.08      0.00      0.08      0.03      0.00      0.00     99.78
 </code> </code>
  
-Connectez-vous en tant que trainee et devenez root. Listez ensuite les noyaux installés :+Pour consulter les statistiques d'un coeur spécifique, utilisez l'option **-P** :
  
 <code> <code>
-[root@centos8 ~]# rpm -qa | grep kernel +[root@centos8 ~]# sar --P 1 5 3 
-kernel-modules-4.18.0-305.3.1.el8.x86_64 +Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_        (8 CPU) 
-kernel-tools-4.18.0-305.7.1.el8.i2tch.x86_64 + 
-kernel-headers-4.18.0-305.7.1.el8.i2tch.x86_64 +01:51:52        CPU     %user     %nice   %system   %iowait    %steal     %idle 
-kernel-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64 +01:51:57          1      0.00      0.00      0.00      0.00      0.00    100.00 
-kernel-debug-core-4.18.0-305.7.1.el8.i2tch.x86_64 +01:52:02               0.20      0.00      0.00      0.00      0.00     99.80 
-kernel-modules-internal-4.18.0-305.7.1.el8.i2tch.x86_64 +01:52:07               0.00      0.00      0.00      0.00      0.00    100.00 
-kernel-modules-4.18.0-305.7.1.el8_4.x86_64 +Average:               0.07      0.00      0.00      0.00      0.00     99.93 
-kernel-debug-modules-4.18.0-305.7.1.el8.i2tch.x86_64 +[root@centos8 ~]# sar --P 5 5 3 
-kernel-devel-4.18.0-305.7.1.el8.i2tch.x86_64 +Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_        (8 CPU) 
-kernel-tools-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64 + 
-kernel-tools-libs-4.18.0-305.7.1.el8.i2tch.x86_64 +01:52:16        CPU     %user     %nice   %system   %iowait    %steal     %idle 
-kernel-debug-modules-internal-4.18.0-305.7.1.el8.i2tch.x86_64 +01:52:21          5      0.00      0.00      0.00      0.00      0.00    100.00 
-kernel-cross-headers-4.18.0-305.7.1.el8.i2tch.x86_64 +01:52:26          5      0.00      0.00      0.00      0.00      0.00    100.00 
-kernel-core-4.18.0-305.7.1.el8_4.x86_64 +01:52:31          5      0.00      0.00      0.00      0.00      0.00    100.00 
-kernel-devel-4.18.0-305.7.1.el8_4.x86_64 +Average:          5      0.00      0.00      0.00      0.00      0.00    100.00
-kernel-debuginfo-common-x86_64-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-debug-modules-extra-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-debug-devel-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-tools-libs-devel-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-modules-extra-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-4.18.0-305.7.1.el8_4.x86_64 +
-kernel-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-core-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-selftests-internal-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-debug-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-debug-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-4.18.0-305.3.1.el8.x86_64 +
-kernel-core-4.18.0-305.3.1.el8.x86_64 +
-kernel-modules-4.18.0-305.7.1.el8.i2tch.x86_64 +
-kernel-ipaclones-internal-4.18.0-305.7.1.el8.i2tch.x86_64+
 </code> </code>
  
-Constatez l'entrée **saved-entry** du fichier **/boot/grub2/grubenv** :+===Statistiques d'Utilisation de la Mémoire et du Swap=== 
 + 
 +Utilisez l'option **-r** pour visualiser les statistiques concernant la mémoire :
  
 <code> <code>
-[root@centos8 ~]# grep i2tch /boot/grub2/grubenv  +[root@centos8 ~]# sar -r 5 3 
-saved_entry=95bd69e34a7444a7b58cb74fbfb86df2-4.18.0-305.7.1.el8.i2tch.x86_64+Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        30/06/21        _x86_64_(8 CPU) 
 + 
 +07:33:32    kbmemfree   kbavail kbmemused  %memused kbbuffers  kbcached  kbcommit   %commit  kbactive   kbinact   kbdirty 
 +07:33:37      1647240   2297232   2177792     56.94      3356    827396   5096432     70.94    359072   1486368         0 
 +07:33:42      1647232   2297224   2177800     56.94      3356    827396   5095788     70.93    359072   1486300         0 
 +07:33:47      1647232   2297224   2177800     56.94      3356    827396   5095788     70.93    359072   1486376         0 
 +Average:      1647235   2297227   2177797     56.94      3356    827396   5096003     70.94    359072   1486348         0
 </code> </code>
  
-Dernièrement, vérifiez l'utilisation du nouveau noyau :+Utilisez l'option **-S** pour visualiser les statistiques concernant le Swap :
  
 <code> <code>
-[root@centos8 ~]# uname -r +[root@centos8 ~]# sar -S 5 3 
-4.18.0-305.7.1.el8.i2tch.x86_64+Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        30/06/21        _x86_64_(8 CPU) 
 + 
 +07:31:58    kbswpfree kbswpused  %swpused  kbswpcad   %swpcad 
 +07:32:03      3358716              0.00              0.00 
 +07:32:08      3358716              0.00              0.00 
 +07:32:13      3358716              0.00              0.00 
 +Average:      3358716              0.00              0.00
 </code> </code>
  
-=====LAB #3 - Gestion des Quotas=====+===Statistiques des E/S===
  
-Sous Linux il est possible de mettre en place des quotas par utilisateur et par groupe. Ceci étant, Linux ne sait  pas gérer des quotas par répertoire, uniquement des  +Utilisez l'option **-b** pour visualiser les statistiques concernant les E/S  :
-quotas par partition. L'administrateur met souvent des quotas en place sur l'arborescence de /home pour limiter l'espace de stockage occupé par les utilisateurs.+
  
-Déconnectez-vous et reconnectez-vous **directement** en tant que root :+<code> 
 +[root@centos8 ~]# sar -b 5 3 
 +Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_        (8 CPU) 
 + 
 +09:24:49          tps      rtps      wtps   bread/  bwrtn/
 +09:24:54         0.00      0.00      0.00      0.00      0.00 
 +09:24:59         1.20      0.00      1.20      0.00     20.20 
 +09:25:04         0.00      0.00      0.00      0.00      0.00 
 +Average:         0.40      0.00      0.40      0.00      6.73 
 +</code> 
 + 
 +===Statistiques des E/S par Disque=== 
 + 
 +Utilisez l'option **-d** pour visualiser les statistiques concernant les E/S par disque :
  
 <code> <code>
-root@computeXX:~# ssh -l root 10.0.2.45 +[root@centos8 ~]sar -d 5 3 
-root@10.0.2.45's password: fenestros +Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_        (8 CPU)
-Activate the web console with: systemctl enable --now cockpit.socket+
  
-Last loginWed Jul 21 11:14:31 2021 +09:25:45          DEV       tps     rkB/    wkB/  areq-sz    aqu-sz     await     svctm     %util 
-[root@centos8 ~]# +09:25:50       dev8-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +09:25:50      dev8-16      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +09:25:50      dev11-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +09:25:50     dev253-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +09:25:50     dev253-1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 + 
 +09:25:50          DEV       tps     rkB/    wkB/  areq-sz    aqu-sz     await     svctm     %util 
 +09:25:55       dev8-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +09:25:55      dev8-16      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +09:25:55      dev11-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +09:25:55     dev253-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +09:25:55     dev253-1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 + 
 +09:25:55          DEV       tps     rkB/    wkB/  areq-sz    aqu-sz     await     svctm     %util 
 +09:26:00       dev8-0      0.60      0.00      0.30      0.50      0.01     13.00     13.00      0.78 
 +09:26:00      dev8-16      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +09:26:00      dev11-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +09:26:00     dev253-0      0.60      0.00      0.50      0.83      0.01     12.67     13.00      0.78 
 +09:26:00     dev253-1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 + 
 +Average:          DEV       tps     rkB/    wkB/  areq-sz    aqu-sz     await     svctm     %util 
 +Average:       dev8-0      0.20      0.00      0.10      0.50      0.00     13.00     13.00      0.26 
 +Average:      dev8-16      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +Average:      dev11-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +Average:     dev253-0      0.20      0.00      0.17      0.83      0.00     12.67     13.00      0.26 
 +Average:     dev253-1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
 </code> </code>
  
-Avant de mettre en place des quotasconfigurer SELINUX en mode **permissive** afin de ne pas avoir d'erreurs de ce dernier :+La colonne **DEV** indentifie les disques par leurs majeurs et mineurs. Pour voir les informations avec les noms des disquesajoutez l'option **-p** :
  
 <code> <code>
-[root@centos8 ~]# getenforce +[root@centos8 ~]# sar -p -d 5 3 
-Enforcing +Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        30/06/21        _x86_64_        (8 CPU) 
-[root@centos8 ~]# setenforce permissive + 
-[root@centos8 ~]# getenforce +07:48:32          DEV       tps     rkB/    wkB/  areq-sz    aqu-sz     await     svctm     %util 
-Permissive +07:48:37          sda      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
-[root@centos8 ~]# +07:48:37          sdb      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +07:48:37          sr0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +07:48:37    cl_centos8-root      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +07:48:37    cl_centos8-swap      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 + 
 +07:48:37          DEV       tps     rkB/    wkB/  areq-sz    aqu-sz     await     svctm     %util 
 +07:48:42          sda      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +07:48:42          sdb      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +07:48:42          sr0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +07:48:42    cl_centos8-root      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +07:48:42    cl_centos8-swap      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 + 
 +07:48:42          DEV       tps     rkB/    wkB/  areq-sz    aqu-sz     await     svctm     %util 
 +07:48:47          sda      0.40      0.00      0.40      1.00      0.02     56.00     56.50      2.26 
 +07:48:47          sdb      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +07:48:47          sr0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +07:48:47    cl_centos8-root      0.40      0.00      0.80      2.00      0.02     56.00     56.50      2.26 
 +07:48:47    cl_centos8-swap      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 + 
 +Average:          DEV       tps     rkB/    wkB/  areq-sz    aqu-sz     await     svctm     %util 
 +Average:          sda      0.13      0.00      0.13      1.00      0.01     56.00     56.50      0.75 
 +Average:          sdb      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +Average:          sr0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 
 +Average:    cl_centos8-root      0.13      0.00      0.27      2.00      0.01     56.00     56.50      0.75 
 +Average:    cl_centos8-swap      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00
 </code> </code>
  
-Editez ensuite le fichier /etc/sysconfig/selinux ainsi :+Les options de la commande sar sont :
  
 <code> <code>
-[root@centos8 ~]# vi /etc/sysconfig/selinux +[root@centos8 ~]# sar --help 
-[root@centos8 ~]# cat /etc/sysconfig/selinux+Usage: sar options [ <interval> [ <count> ] ] 
 +Main options and reports (report name between square brackets): 
 +        -B      Paging statistics [A_PAGE] 
 +        -b      I/O and transfer rate statistics [A_IO] 
 +        -d      Block devices statistics [A_DISK] 
 +        -F [ MOUNT ] 
 +                Filesystems statistics [A_FS] 
 +        -H      Hugepages utilization statistics [A_HUGE] 
 +        -I { <int_list> | SUM | ALL } 
 +                Interrupts statistics [A_IRQ] 
 +        -m { <keyword> [,...] | ALL } 
 +                Power management statistics [A_PWR_...] 
 +                Keywords are: 
 +                CPU     CPU instantaneous clock frequency 
 +                FAN     Fans speed 
 +                FREQ    CPU average clock frequency 
 +                IN      Voltage inputs 
 +                TEMP    Devices temperature 
 +                USB     USB devices plugged into the system 
 +        -n { <keyword> [,...] | ALL } 
 +                Network statistics [A_NET_...] 
 +                Keywords are: 
 +                DEV     Network interfaces 
 +                EDEV    Network interfaces (errors) 
 +                NFS     NFS client 
 +                NFSD    NFS server 
 +                SOCK    Sockets (v4) 
 +                IP      IP traffic      (v4) 
 +                EIP     IP traffic      (v4) (errors) 
 +                ICMP    ICMP traffic    (v4) 
 +                EICMP   ICMP traffic    (v4) (errors) 
 +                TCP     TCP traffic     (v4) 
 +                ETCP    TCP traffic     (v4) (errors) 
 +                UDP     UDP traffic     (v4) 
 +                SOCK6   Sockets (v6) 
 +                IP6     IP traffic      (v6) 
 +                EIP6    IP traffic      (v6) (errors) 
 +                ICMP6   ICMP traffic    (v6) 
 +                EICMP6  ICMP traffic    (v6) (errors) 
 +                UDP6    UDP traffic     (v6) 
 +                FC      Fibre channel HBAs 
 +                SOFT    Software-based network processing 
 +        -q      Queue length and load average statistics [A_QUEUE] 
 +        -r [ ALL ] 
 +                Memory utilization statistics [A_MEMORY] 
 +        -S      Swap space utilization statistics [A_MEMORY] 
 +        -u [ ALL ] 
 +                CPU utilization statistics [A_CPU] 
 +        -v      Kernel tables statistics [A_KTABLES] 
 +        -W      Swapping statistics [A_SWAP] 
 +        -w      Task creation and system switching statistics [A_PCSW] 
 +        -y      TTY devices statistics [A_SERIAL] 
 +</code>
  
-# This file controls the state of SELinux on the system. +=====Modules usb=====
-# SELINUXcan take one of these three values: +
-#     enforcing - SELinux security policy is enforced. +
-#     permissive - SELinux prints warnings instead of enforcing. +
-#     disabled - No SELinux policy is loaded. +
-SELINUX=permissive +
-# SELINUXTYPEcan take one of these three values: +
-#     targeted - Targeted processes are protected, +
-#     minimum - Modification of targeted policy. Only selected processes are protected.  +
-#     mls - Multi Level Security protection. +
-SELINUXTYPE=targeted+
  
 +L'**USB** (//Universal Serial Bus//) est un bus de données qui peut offrir des taux de transfert jusqu'à 480Mb/s sous la version 2.0 et jusqu'à 4.8 Gb/s sous la version 3.0. Les modules nécessaires pour les contrôleurs USB sont :
 +
 +^ Version USB ^ Module ^ Nom Complet ^
 +|  1.0\1.1  | **UHCI** | //Universal Controller Host Interface// |
 +|  :::  | **OHCI** | //Open Controller Host Interface// |
 +|  2.0  | **EHCI** | //Enhanced Host Controller Interface// |
 +|  3.0  | **XHCI** | //Extensible Host Controller Interface// |
 +
 +Le tableau suivant liste les modules courrament chargés en fonction du périphérique utilisé :
 +
 +^ Module ^ Type de Périphérique ^ 
 +|  **usb_storage**  | Supports de masse |
 +|  **usbhid**  | Periphériques HID (//Human Interface Device//) |
 +|  **snd-usb-audio**  | Cartes son usb |
 +|  **usbvidéo**  | Cartes vidéo et d'acquisition |
 +|  **irda-usb**  | Périphériques infrarouges |
 +|  **usbnet**  | Cartes réseaux usb |
 +
 +Les modules peuvent être chargés par un des moyens suivants :
 +
 +  * INITrd,
 +  * Le processus init (systemd),
 +  * kmod, d'une manière dynamique et transparente lors du branchement du périphérique,
 +  * udev,
 +  * manuellement.
 +
 +=====udev=====
 +
 +Depuis le noyau Linux 2.6 Linux est capable de détecter des périphériques branchés à chaud. Cette technologie s'appelle le **//hotplugging//**. Le //hotplugging// est obtenu grâce à l'utilisation de trois composants :
 +
 +  * Udev,
 +  * HAL,
 +  * Dbus.
 +
 +Les rôles de chaque composant sont les suivants :
 +
 +  * Udev se charge de créer et supprimer d'une manière dynamique les nœuds dans le répertoire **/dev**,
 +  * HAL obtient des informations à partir d'Udev et créé un fichier au format XML représentant le périphérique branché. Il informe ensuite Nautilus en utilisant le Dbus,
 +  * Dbus joue le rôle d'un bus système qui est utilisé pour la communication inter-processus.
 +
 +Lors de démarrage de Linux, Udev joue un rôle important :
 +
 +  * Au démarrage **tmpfs** est monté sur /dev,
 +  * Udev copie les éventuels nœuds statiques de **/lib/udev/devices** vers /dev,
 +  * le démon **udevd** collecte des données appelées **uevents** du noyau et cherche une règle correspondante dans le répertoire **/lib/udev/rules.d/**,
 +  * Udev crée les nœuds et liens symboliques spécifiés dans la règle identifiée,
 +  * Udev stocke les règles contenues dans **/lib/udev/rules.d/*.rules** en mémoire,
 +  * En cas de modification des ces règles, Udev met à jour la mémoire.
 +
 +Udev repose sur le filesystem **sysfs** monté sur /sys qui permet de rendre les périphériques visibles à Udev dans l'//User Space//. Par exemple, lors du branchement d'une clé USB, Udev crée **/dev/sdb1** automatiquement et utilise les informations contenues dans le fichier **/lib/modules/`uname -r`/modules.alias** pour trouver le pilote nécessaire :
 +
 +Le fichier de configuration principal d'Udev est **/etc/udev/udev.conf** :
 +
 +<code>
 +[root@centos8 ~]# cat /etc/udev/udev.conf
 +# see udev.conf(5) for details
 +#
 +# udevd is also started in the initrd.  When this file is modified you might
 +# also want to rebuild the initrd, so that it will include the modified configuration.
 +
 +#udev_log="info"
 </code> </code>
  
-Commencez par vérifiez que le paquet **quota** est bien installé :+Les fichiers de règles se trouvent dans **/lib/udev/rules.d/** :
  
 <code> <code>
-[root@centos8 ~]# rpm -qa | grep quota +[root@centos8 ~]# ls /lib/udev/rules.d/ 
-quota-4.04-12.el8.x86_64 +01-md-raid-creating.rules              70-uaccess.rules 
-quota-nls-4.04-12.el8.noarch+10-dm.rules                            70-wacom.rules 
 +11-dm-lvm.rules                        71-biosdevname.rules 
 +11-dm-mpath.rules                      71-nvmf-iopolicy-netapp.rules 
 +11-dm-parts.rules                      71-prefixdevname.rules 
 +13-dm-disk.rules                       71-seat.rules 
 +39-usbmuxd.rules                       73-idrac.rules 
 +40-elevator.rules                      73-seat-late.rules 
 +40-libgphoto2.rules                    75-net-description.rules 
 +40-redhat.rules                        75-probe_mtd.rules 
 +40-usb-blacklist.rules                 75-rdma-description.rules 
 +40-usb_modeswitch.rules                77-mm-cinterion-port-types.rules 
 +50-udev-default.rules                  77-mm-dell-port-types.rules 
 +60-alias-kmsg.rules                    77-mm-ericsson-mbm.rules 
 +60-block.rules                         77-mm-fibocom-port-types.rules 
 +60-cdrom_id.rules                      77-mm-haier-port-types.rules 
 +60-drm.rules                           77-mm-huawei-net-port-types.rules 
 +60-evdev.rules                         77-mm-longcheer-port-types.rules 
 +60-fido-id.rules                       77-mm-mtk-port-types.rules 
 +60-input-id.rules                      77-mm-nokia-port-types.rules 
 +60-libfprint-2-autosuspend.rules       77-mm-pcmcia-device-blacklist.rules 
 +60-net.rules                           77-mm-quectel-port-types.rules 
 +60-persistent-alsa.rules               77-mm-sierra.rules 
 +60-persistent-input.rules              77-mm-simtech-port-types.rules 
 +60-persistent-storage.rules            77-mm-telit-port-types.rules 
 +60-persistent-storage-tape.rules       77-mm-ublox-port-types.rules 
 +60-persistent-v4l.rules                77-mm-usb-device-blacklist.rules 
 +60-raw.rules                           77-mm-usb-serial-adapters-greylist.rules 
 +60-rdma-ndd.rules                      77-mm-x22x-port-types.rules 
 +60-rdma-persistent-naming.rules        77-mm-zte-port-types.rules 
 +60-sensor.rules                        78-sound-card.rules 
 +60-serial.rules                        80-drivers.rules 
 +60-tpm-udev.rules                      80-iio-sensor-proxy.rules 
 +61-gdm.rules                           80-libinput-device-groups.rules 
 +61-gnome-bluetooth-rfkill.rules        80-mm-candidate.rules 
 +61-gnome-settings-daemon-rfkill.rules  80-net-setup-link.rules 
 +61-scsi-sg3_id.rules                   80-udisks2.rules 
 +62-multipath.rules                     81-kvm-rhel.rules 
 +63-fc-wwpn-id.rules                    84-nm-drivers.rules 
 +63-md-raid-arrays.rules                85-nm-unmanaged.rules 
 +63-scsi-sg3_symlink.rules              85-regulatory.rules 
 +64-btrfs.rules                         90-alsa-restore.rules 
 +64-md-raid-assembly.rules              90-bolt.rules 
 +65-libwacom.rules                      90-fwupd-devices.rules 
 +65-md-incremental.rules                90-iprutils.rules 
 +65-sane-backends.rules                 90-libinput-fuzz-override.rules 
 +66-kpartx.rules                        90-nm-thunderbolt.rules 
 +68-del-part-nodes.rules                90-pulseaudio.rules 
 +69-btattach-bcm.rules                  90-rdma-hw-modules.rules 
 +69-cd-sensors.rules                    90-rdma-ulp-modules.rules 
 +69-dm-lvm-metad.rules                  90-rdma-umad.rules 
 +69-libmtp.rules                        90-vconsole.rules 
 +69-md-clustered-confirm-device.rules   91-drm-modeset.rules 
 +70-hypervfcopy.rules                   95-cd-devices.rules 
 +70-hypervkvp.rules                     95-dm-notify.rules 
 +70-hypervvss.rules                     95-upower-csr.rules 
 +70-joystick.rules                      95-upower-hid.rules 
 +70-mouse.rules                         95-upower-wup.rules 
 +70-nvmf-autoconnect.rules              98-kexec.rules 
 +70-power-switch.rules                  99-qemu-guest-agent.rules 
 +70-printers.rules                      99-systemd.rules 
 +70-spice-vdagentd.rules                99-vmware-scsi-udev.rules 
 +70-touchpad.rules
 </code> </code>
  
-Editez le fichier **/etc/fstab** en ajoutant les options **usrquota** et **grpquota** à la ligne **/home** :+<WRAP center round important 60%> 
 +**Important** : Il vous est possible d'ajouter des règles si besoin est. Dans ce cas, créez un fichier **99-local.rules** est éditez-le au lieu d'éditer les fichiers existants. 
 +</WRAP> 
 + 
 +Comme indique le nom de chaque fichier, le contenu est composé de règles à l'attention d'udev. Le fichier des règles par défaut est le **50-udev-default.rules** :
  
 <code> <code>
-[root@centos8 ~]# vi /etc/fstab +[root@centos8 ~]# cat /lib/udev/rules.d/50-udev-default.rules | more 
-[root@centos8 ~]# cat /etc/fstab+# do not edit this file, it will be overwritten on update
  
-+run a command on remove events 
-# /etc/fstab +ACTION=="remove", ENV{REMOVE_CMD}!="", RUN+="$env{REMOVE_CMD}" 
-# Created by anaconda on Wed Jun 16 06:21:32 2021 +ACTION=="remove", GOTO="default_end" 
-# + 
-# Accessible filesystemsby referenceare maintained under '/dev/disk/'. +SUBSYSTEM=="virtio-ports"KERNEL=="vport*"ATTR{name}=="?*", SYMLINK+="virtio-ports/$attr{name}" 
-See man pages fstab(5)findfs(8)mount(8) and/or blkid(8) for more info. + 
-# +select "system RTC" or just use the first one 
-# After editing this filerun 'systemctl daemon-reload' to update systemd +SUBSYSTEM=="rtc"ATTR{hctosys}=="1"SYMLINK+="rtc" 
-# units generated from this file. +SUBSYSTEM=="rtc", KERNEL=="rtc0", SYMLINK+="rtc", OPTIONS+="link_priority=-100" 
-# + 
-/dev/mapper/cl_centos8-root /                       xfs     defaults        0 0 +SUBSYSTEM=="usb"ENV{DEVTYPE}=="usb_device", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb" 
-UUID=1c04981e-5317-4b73-9695-3ce25246835d /boot                   ext4    defaults        1 2 +ENV{MODALIAS}!="", IMPORT{builtin}="hwdb --subsystem=$env{SUBSYSTEM}" 
-/dev/mapper/cl_centos8-swap swap                    swap    defaults        0 0 + 
-UUID=f76d6b66-985b-4a91-af9c-4987e8c1443c /home     ext4          defaults,usrquota,grpquota            1 2+ACTION!="add", GOTO="default_end" 
 + 
 +SUBSYSTEM=="tty", KERNEL=="ptmx", GROUP="tty", MODE="0666" 
 +SUBSYSTEM=="tty", KERNEL=="tty", GROUP="tty", MODE="0666" 
 +SUBSYSTEM=="tty", KERNEL=="tty[0-9]*", GROUP="tty", MODE="0620" 
 +SUBSYSTEM=="tty", KERNEL=="sclp_line[0-9]*", GROUP="tty", MODE="0620" 
 +SUBSYSTEM=="tty", KERNEL=="ttysclp[0-9]*", GROUP="tty", MODE="0620" 
 +SUBSYSTEM=="tty", KERNEL=="3270/tty[0-9]*", GROUP="tty", MODE="0620" 
 +SUBSYSTEM=="vc", KERNEL=="vcs*|vcsa*", GROUP="tty" 
 +KERNEL=="tty[A-Z]*[0-9]|ttymxc[0-9]*|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="dialout" 
 + 
 +SUBSYSTEM=="mem", KERNEL=="mem|kmem|port", GROUP="kmem", MODE="0640" 
 + 
 +SUBSYSTEM=="input", GROUP="input" 
 +SUBSYSTEM=="input", KERNEL=="js[0-9]*", MODE="0664" 
 + 
 +SUBSYSTEM=="video4linux", GROUP="video" 
 +SUBSYSTEM=="graphics", GROUP="video" 
 +SUBSYSTEM=="drm", KERNEL!="renderD*", GROUP="video" 
 +SUBSYSTEM=="dvb", GROUP="video" 
 +SUBSYSTEM=="media", GROUP="video" 
 +SUBSYSTEM=="cec", GROUP="video" 
 + 
 +SUBSYSTEM=="drm", KERNEL=="renderD*", GROUP="render", MODE="0666" 
 +SUBSYSTEM=="kfd", GROUP="render", MODE="0666" 
 + 
 +SUBSYSTEM=="sound", GROUP="audio",
 +  OPTIONS+="static_node=snd/seq", OPTIONS+="static_node=snd/timer" 
 +--More--
 </code> </code>
  
-Redémarrez la VM :+Chaque règle prend la forme suivante : 
 + 
 +KEY, [KEY, ...] NAME [, SYMLINK] 
 + 
 +Chaque KEY est un champ au format **type=valeur** qui doit correspondre à un périphérique unique. La valeur de type peut prendre plusieurs formes : 
 + 
 +^ Type ^ Description ^ Exemples ^ 
 +| BUS | Type de bus | usb, scsi, ide | 
 +| KERNEL | Le nom par défault du périphérique donné par le noyau | hda, ttyUSB0, lp0 | 
 +| SUBSYSTEM | Le nom noyau du sous-système, généralement identique à la valeur du BUS | usb, scsi | 
 +| DRIVER | Le nom du pilote qui contrôle le périphérique | usb-storage | 
 +| ID | Le numéro du périphérique sur son bus | PCI bus id, USB id | 
 +| PLACE | Ne concerne que les périphériques USB et donne la position topologique du périphérique sur son bus | S/O | 
 +| SYSFS{filename} | Le nom du fichier dans /sys pour le périphérique. Ce fichier contient le fabricant, le label, le numéro de série et UUID du périphérique. La vérification de jusqu'à 5 fichiers est possible par règle | S/O | 
 +| PROGRAM | Ceci permet à Udev d'appeler un programme externe pour nommer un périphérique | S/O | 
 +| RESULT | Valeur à comparer au résultat de PROGRAM | S/O | 
 + 
 +NAME et SYMLINK sont utilisées pour stipuler ce que Udev doit faire avec le périphérique : 
 + 
 +^ Type ^ Description ^ Exemples ^ 
 +| NAME | Le nome du nœud dans /dev | S/O | 
 +| SYMLINK | Le ou les lien(s) symbolique(s) qui pointe(nt) vers le NAME | S/O | 
 + 
 +====La commande udevadm==== 
 + 
 +Pour obtenir de l'information sur un périphérique il convient d'utiliser la commande **udevadm** :
  
 <code> <code>
-[root@centos8 ~]# reboot+[root@centos8 ~]# udevadm info --query=all -n /dev/sda 
 +P: /devices/pci0000:00/0000:00:07.0/ata3/host2/target2:0:0/2:0:0:0/block/sda 
 +N: sda 
 +S: disk/by-id/ata-QEMU_HARDDISK_QM00005 
 +S: disk/by-id/scsi-0ATA_QEMU_HARDDISK_QM00005 
 +S: disk/by-id/scsi-1ATA_QEMU_HARDDISK_QM00005 
 +S: disk/by-id/scsi-SATA_QEMU_HARDDISK_QM00005 
 +S: disk/by-path/pci-0000:00:07.0-ata-1 
 +E: DEVLINKS=/dev/disk/by-path/pci-0000:00:07.0-ata-1 /dev/disk/by-id/scsi-SATA_QEMU_HARDDISK_QM00005 /dev/disk/by-id/ata-QEMU_HARDDISK_QM00005 /dev/disk/by-id/scsi-0ATA_QEMU_HARDDISK_QM00005 /dev/disk/by-id/scsi-1ATA_QEMU_HARDDISK_QM00005 
 +E: DEVNAME=/dev/sda 
 +E: DEVPATH=/devices/pci0000:00/0000:00:07.0/ata3/host2/target2:0:0/2:0:0:0/block/sda 
 +E: DEVTYPE=disk 
 +E: ID_ATA=1 
 +E: ID_ATA_FEATURE_SET_SMART=1 
 +E: ID_ATA_FEATURE_SET_SMART_ENABLED=1 
 +E: ID_ATA_SATA=1 
 +E: ID_ATA_WRITE_CACHE=1 
 +E: ID_ATA_WRITE_CACHE_ENABLED=1 
 +E: ID_BUS=ata 
 +E: ID_MODEL=QEMU_HARDDISK 
 +E: ID_MODEL_ENC=QEMU\x20HARDDISK\x20\x20\x20 
 +E: ID_PART_TABLE_TYPE=dos 
 +E: ID_PART_TABLE_UUID=b39ec5c8 
 +E: ID_PATH=pci-0000:00:07.0-ata-1 
 +E: ID_PATH_TAG=pci-0000_00_07_0-ata-1 
 +E: ID_REVISION=2.5+ 
 +E: ID_SCSI=1 
 +E: ID_SCSI_INQUIRY=1 
 +E: ID_SERIAL=QEMU_HARDDISK_QM00005 
 +E: ID_SERIAL_SHORT=QM00005 
 +E: ID_TYPE=disk 
 +E: ID_VENDOR=ATA 
 +E: ID_VENDOR_ENC=ATA\x20\x20\x20\x20\x20 
 +E: MAJOR=8 
 +E: MINOR=0 
 +E: SCSI_IDENT_LUN_ATA=QEMU_HARDDISK_QM00005 
 +E: SCSI_IDENT_LUN_T10=ATA_QEMU_HARDDISK_QM00005 
 +E: SCSI_IDENT_LUN_VENDOR=QM00005 
 +E: SCSI_IDENT_SERIAL=QM00005 
 +E: SCSI_MODEL=QEMU_HARDDISK 
 +E: SCSI_MODEL_ENC=QEMU\x20HARDDISK\x20\x20\x20 
 +E: SCSI_REVISION=2.5+ 
 +E: SCSI_TPGS=0 
 +E: SCSI_TYPE=disk 
 +E: SCSI_VENDOR=ATA 
 +E: SCSI_VENDOR_ENC=ATA\x20\x20\x20\x20\x20 
 +E: SUBSYSTEM=block 
 +E: TAGS=:systemd: 
 +E: USEC_INITIALIZED=8735808
 </code> </code>
  
-Reconnectez-vous **directement** en tant que root :+===Les options de la commande=== 
 + 
 +Les options de la commande udevadm sont :
  
 <code> <code>
-root@computeXX:~# ssh -l root 10.0.2.45 +[root@centos8 ~]udevadm --help 
-root@10.0.2.45's password: fenestros +udevadm [--help] [--version] [--debug] COMMAND [COMMAND OPTIONS]
-Activate the web console with: systemctl enable --now cockpit.socket+
  
-Last login: Wed Jul 21 11:19:46 2021 +Send control commands or test the device manager. 
-[root@centos8 ~]# + 
 +Commands: 
 +  info          Query sysfs or the udev database 
 +  trigger       Request events from the kernel 
 +  settle        Wait for pending udev events 
 +  control       Control the udev daemon 
 +  monitor       Listen to kernel and udev events 
 +  test          Test an event run 
 +  test-builtin  Test a built-in command 
 + 
 +[root@centos8 ~]# udevadm info --help 
 +udevadm info [OPTIONS] [DEVPATH|FILE] 
 + 
 +Query sysfs or the udev database. 
 + 
 +  -h --help                   Print this message 
 +  -V --version                Print version of the program 
 +  -q --query=TYPE             Query device information: 
 +       name                     Name of device node 
 +       symlink                  Pointing to node 
 +       path                     sysfs device path 
 +       property                 The device properties 
 +       all                      All values 
 +  -p --path=SYSPATH           sysfs device path used for query or attribute walk 
 +  -n --name=NAME              Node or symlink name used for query or attribute walk 
 +  -r --root                   Prepend dev directory to path names 
 +  -a --attribute-walk         Print all key matches walking along the chain 
 +                              of parent devices 
 +  -d --device-id-of-file=FILE Print major:minor of device containing this file 
 +  -x --export                 Export key/value pairs 
 +  -P --export-prefix          Export the key name with a prefix 
 +  -e --export-db              Export the content of the udev database 
 +  -c --cleanup-db             Clean up the udev database
 </code> </code>
  
-Vérifiez ensuite que les options **usrquota** et **grpquota** soient prises en compte :+=====Système de fichiers /sys===== 
 + 
 +Le système de fichiers virtuel **/sys** a été introduit avec le noyau Linux **2.6**. Son rôle est de décrire le matériel pour udev. 
 + 
 +Saisissez la commande suivante :
  
 <code> <code>
-[root@centos8 ~]# cat /etc/mtab | grep /home +[root@centos8 ~]# ls -l /sys 
-/dev/sdc1 /home ext4 rw,seclabel,relatime,quota,usrquota,grpquota 0 0+total 0 
 +drwxr-xr-x.   2 root root 0 Jul 12 08:15 block 
 +drwxr-xr-x.  33 root root 0 Jul 12 08:15 bus 
 +drwxr-xr-x.  57 root root 0 Jul 12 08:15 class 
 +drwxr-xr-x.   4 root root 0 Jul 12 08:15 dev 
 +drwxr-xr-x.  14 root root Jul 12 08:15 devices 
 +drwxr-xr-x.   6 root root 0 Jul 12 08:15 firmware 
 +drwxr-xr-x.   9 root root 0 Jul 12 08:15 fs 
 +drwxr-xr-x.   2 root root 0 Jul 12 08:15 hypervisor 
 +drwxr-xr-x.  15 root root 0 Jul 12 08:15 kernel 
 +drwxr-xr-x. 153 root root 0 Jul 12 08:15 module 
 +drwxr-xr-x.   2 root root Jul 12 08:15 power
 </code> </code>
  
-====3.1 - La Commande quotacheck====+Chaque répertoire contient des informations :
  
-Pour activer les quotas sur /homeil convient d'utiliser la commande **quotacheck** :+  * **block** 
 +    * contient des informations sur les périphériques bloc 
 +  * **bus** 
 +    * contient des informations sur les bus de données 
 +  * **class** 
 +    * contient des informations sur des classes de matériel 
 +  * **devices** 
 +    * contient des informations sur la position des périphériques sur les bus 
 +  * **firmware** 
 +    * contiententre autre, des informations sur l'ACPI 
 +  * **module** 
 +    * contient des informations sur les modules du noyau 
 +  * **power** 
 +    * contient des informations sur la gestion de l'énergie 
 +  * **fs*
 +    * contient des informations sur les systèmes de fichiers 
 + 
 +Pour illustrer ceci, saisissez la commande suivante :
  
 <code> <code>
-[root@centos8 ~]# quotacheck -cugvm -f /dev/sdc1 +[root@centos8 ~]# cat /sys/block/sda/sda1/size 
-quotacheck: Your kernel probably supports journaled quota but you are not using it. Consider switching to journaled quota to avoid running quotacheck after an unclean shutdown. +2097152
-quotacheck: Scanning /dev/sdc1 [/home] done +
-quotacheck: Cannot stat old user quota file /home/aquota.user: No such file or directory. Usage will not be subtracted. +
-quotacheck: Cannot stat old group quota file /home/aquota.group: No such file or directory. Usage will not be subtracted. +
-quotacheck: Cannot stat old user quota file /home/aquota.user: No such file or directory. Usage will not be subtracted. +
-quotacheck: Cannot stat old group quota file /home/aquota.group: No such file or directory. Usage will not be subtracted. +
-quotacheck: Checked 6763 directories and 129772 files +
-quotacheck: Old file not found. +
-quotacheck: Old file not found.+
 </code> </code>
  
-Les options de la commande quotacheck sont :+Ce chiffre correspond aux nombre de secteurs. 
 + 
 +=====LAB #4 - Limitation des ressources===== 
 + 
 +====4.1 - ulimit==== 
 + 
 +Les ressources disponibles aux utilisateurs peuvent être limitées par l'utilisation de la commande **ulimit**.  
 + 
 +La commande **ulimit** gère deux types de limite, la limite //hard// en utilisant l'option **-H** et la limite //soft// en utilisant l'option **-S**. Seul root peut positionner une limite //hard// et ceci à condition que la limite ne dépasse pas les ressources réelles. 
 + 
 +La limite //soft// est la limite imposée à l'utilisateur par défaut tandis que la limite //hard// est la limite que l'utilisateur peut atteindre en utilisant la commande ulimit lui-même. 
 + 
 +L'utilisateur root peut paramétrer les limites accordées en éditant la fichier **/etc/security/limits.conf** :
  
 <code> <code>
-[root@centos8 ~]# quotacheck --help +[root@centos8 ~]# cat /etc/security/limits.conf 
-Utility for checking and repairing quota files. +# /etc/security/limits.conf 
-quotacheck [-gucbfinvdmMR] [-<quota-format>] filesystem|-a+
 +#This file sets the resource limits for the users logged in via PAM. 
 +#It does not affect resource limits of the system services. 
 +
 +#Also note that configuration files in /etc/security/limits.d directory, 
 +#which are read in alphabetical order, override the settings in this 
 +#file in case the domain is the same or more specific. 
 +#That means for example that setting a limit for wildcard domain here 
 +#can be overriden with a wildcard setting in a config file in the 
 +#subdirectory, but a user specific setting here can be overriden only 
 +#with a user specific setting in the subdirectory. 
 +
 +#Each line describes a limit for a user in the form: 
 +
 +#<domain>        <type>  <item>  <value> 
 +
 +#Where: 
 +#<domain> can be: 
 +#        a user name 
 +#        a group name, with @group syntax 
 +#        - the wildcard *, for default entry 
 +#        - the wildcard %, can be also used with %group syntax, 
 +#                 for maxlogin limit 
 +
 +#<type> can have the two values: 
 +#        "soft" for enforcing the soft limits 
 +#        - "hard" for enforcing hard limits 
 +
 +#<itemcan be one of the following: 
 +#        - core - limits the core file size (KB) 
 +#        - data - max data size (KB) 
 +#        - fsize - maximum filesize (KB) 
 +#        - memlock - max locked-in-memory address space (KB) 
 +#        - nofile - max number of open file descriptors 
 +#        - rss - max resident set size (KB) 
 +#        - stack - max stack size (KB) 
 +#        - cpu - max CPU time (MIN) 
 +#        - nproc - max number of processes 
 +#        - as - address space limit (KB) 
 +#        - maxlogins - max number of logins for this user 
 +#        - maxsyslogins - max number of logins on the system 
 +#        - priority - the priority to run user process with 
 +#        - locks - max number of file locks the user can hold 
 +#        - sigpending - max number of pending signals 
 +#        - msgqueue - max memory used by POSIX message queues (bytes) 
 +#        - nice - max nice priority allowed to raise to values: [-20, 19] 
 +#        rtprio - max realtime priority 
 +
 +#<domain>      <type>  <item>         <value> 
 +#
  
--u, --user                check user files +#*               soft    core            0 
--g, --group               check group files +#*               hard    rss             10000 
--c, --create-files        create new quota files +#@student        hard    nproc           20 
--b, --backup              create backups of old quota files +#@faculty        soft    nproc           20 
--f, --force               force check even if quotas are enabled +#@faculty        hard    nproc           50 
--i, --interactive         interactive mode +#ftp             hard    nproc           0 
--n, --use-first-dquot     use the first copy of duplicated structure +#@student              maxlogins       4
--v, --verbose             print more information +
--d, --debug               print even more messages +
--m, --no-remount          do not remount filesystem read-only +
--M, --try-remount         try remounting filesystem read-only, +
-                          continue even if it fails +
--R, --exclude-root        exclude root when checking all filesystems +
--F, --format=formatname   check quota files of specific format +
--a, --all                 check all filesystems +
--h, --help                display this message and exit +
--V, --version             display version information and exit+
  
-Bugs to jack@suse.cz+# End of file 
 +</code>  
 + 
 +<WRAP center round important 60%> 
 +**Important** : La valeur de la limite peut être un **nombre** ou le mot **unlimited**. 
 +</WRAP> 
 + 
 +Par exemple, si root inscrit les deux ligne suivantes dans le fichier /etc/security/limits.conf : 
 + 
 +<file> 
 +... 
 +trainee                soft        nofile          1024 
 +trainee                hard        nofile          4096 
 +... 
 +</file> 
 + 
 +la limite du nombre de fichiers ouverts simultanément par trainee est de 1 024. Par contre, trainee a la possibilité d'augmenter cette limite jusqu'à 4 096 en utilisant la commande suivante : 
 + 
 +<code> 
 +$ ulimit -n 4096
 </code> </code>
  
-Les quotas ont été activés et les fichier **aquota.user** et **aquota.group** ont été créés dans le répertoire /home :+Pour consulter la liste des limites actuelles, il convient d'utiliser la commande ulimit avec l'option **-a** :
  
 <code> <code>
-[root@centos8 ~]# ls -la /home +[root@centos8 ~]# ulimit -a 
-total 40 +core file size          (blocks, -c) unlimited 
-drwxr-xr-x.  4 root    root     4096 Jul 21 11:27 . +data seg size           (kbytes, -d) unlimited 
-dr-xr-xr-x. 17 root    root      224 Jul 19 12:05 .. +scheduling priority             (-e) 0 
--rw-------.  1 root    root     7168 Jul 21 11:27 aquota.group +file size               (blocks, -f) unlimited 
--rw-------.  1 root    root     7168 Jul 21 11:27 aquota.user +pending signals                 (-i) 14702 
-drwx------.  2 root    root    16384 Jul 19 12:02 lost+found +max locked memory       (kbytes, -l) 64 
-drwxr-xr-x. 17 trainee trainee  4096 Jul 21 11:22 trainee +max memory size         (kbytes, -m) unlimited 
 +open files                      (-n) 1024 
 +pipe size            (512 bytes, -p) 8 
 +POSIX message queues     (bytes, -q) 819200 
 +real-time priority              (-r) 0 
 +stack size              (kbytes, -s) 8192 
 +cpu time               (seconds, -t) unlimited 
 +max user processes              (-u) 14702 
 +virtual memory          (kbytes, -v) unlimited 
 +file locks                      (-x) unlimited
 </code> </code>
  
-Créez maintenant un utilisateur **fenestros** avec le mot de passe **fenestros** :+====Options de la commande==== 
 + 
 +Les options de **ulimit** sont :
  
 <code> <code>
-[root@centos8 ~]# groupadd fenestros && useradd fenestros -c FenestrOs -d /home/fenestros -g fenestros -s /bin/bash +[root@centos8 ~]# help ulimit 
-[root@centos8 ~]# passwd fenestros +ulimit: ulimit [-SHabcdefiklmnpqrstuvxPT] [limit] 
-Changing password for user fenestros+    Modify shell resource limits. 
-New password:  +     
-BAD PASSWORD: The password contains the user name in some form +    Provides control over the resources available to the shell and processes 
-Retype new password:  +    it creates, on systems that allow such control. 
-passwdall authentication tokens updated successfully.+     
 +    Options: 
 +      -S        use the `soft' resource limit 
 +      -H        use the `hard' resource limit 
 +      -a        all current limits are reported 
 +      -b        the socket buffer size 
 +      -c        the maximum size of core files created 
 +      -d        the maximum size of a process's data segment 
 +      -e        the maximum scheduling priority (`nice'
 +      -f        the maximum size of files written by the shell and its children 
 +      -i        the maximum number of pending signals 
 +      -k        the maximum number of kqueues allocated for this process 
 +      -l        the maximum size a process may lock into memory 
 +      -m        the maximum resident set size 
 +      -n        the maximum number of open file descriptors 
 +      -p        the pipe buffer size 
 +      -q        the maximum number of bytes in POSIX message queues 
 +      -r        the maximum real-time scheduling priority 
 +      -s        the maximum stack size 
 +      -t        the maximum amount of cpu time in seconds 
 +      -u        the maximum number of user processes 
 +      -v        the size of virtual memory 
 +      -x        the maximum number of file locks 
 +      -P        the maximum number of pseudoterminals 
 +      -T        the maximum number of threads 
 +     
 +    Not all options are available on all platforms
 +     
 +    If LIMIT is given, it is the new value of the specified resource; the 
 +    special LIMIT values `soft', `hard', and `unlimited' stand for the 
 +    current soft limit, the current hard limit, and no limit, respectively. 
 +    Otherwise, the current value of the specified resource is printed.  If 
 +    no option is given, then -f is assumed. 
 +     
 +    Values are in 1024-byte increments, except for -t, which is in seconds, 
 +    -p, which is in increments of 512 bytes, and -u, which is an unscaled 
 +    number of processes. 
 +     
 +    Exit Status: 
 +    Returns success unless an invalid option is supplied or an error occurs.
 </code> </code>
  
-====3.2 - La Commande edquota====+====4.2 - Groupes de Contrôle====
  
-Mettez en place maintenant un quota de 10Mo pour l'utilisateur **fenestros** :+Les **Groupes de Contrôles** (//Control Groups//) aussi appelés **CGroups**, sont une façon de contrôler et de limiter des ressources. Les groupes de contrôle permettent l'allocation de ressources, même d'une manière dynamique pendant que le système fonctionne, telles le temps processeur, la mémoire système, la bande réseau, ou une combinaison de ces ressources parmi des groupes de tâches (processus) définis par l'utilisateur et exécutés sur un système. 
 + 
 +Les groupes de contrôle sont organisés de manière hiérarchique, comme des processus. Par contre, la comparaison entre les deux démontre que tandis que les processus se trouvent dans une arborescence unique descandant tous du processus init et héritant de l'environnement de leurs parents, les contrôles groupes peuvent être multiples donnant lieu à des arborescences ou **hiérarchies** multiples qui héritent de certains attributs de leurs groupes de contrôle parents. 
 + 
 +Ces hiérarchies multiples et séparés sont necéssaires parce que chaque hiérarchie est attaché à un ou plusieurs **sous-système(s)** aussi appelés des **Contrôleurs de Ressources** ou simplement des **Contrôleurs**. Les contrôleurs disponibles sous RHEl/CentOS 7 sont : 
 + 
 +  * **blkio** - utilisé pour établir des limites sur l'accès des entrées/sorties à partir et depuis des périphériques blocs, 
 +  * **cpu** - utilisé pour fournir aux tâches des groupes de contrôle accès au CPU grâce au planificateur, 
 +  * **cpuacct** - utilisé pour produire des rapports automatiques sur les ressources CPU utilisées par les tâches dans un groupe de contrôle, 
 +  * **cpuset** - utilisé pour assigner des CPU individuels sur un système multicoeur et des noeuds de mémoire à des tâches dans un groupe de contrôle, 
 +  * **devices** - utilisé pour autoriser ou pour refuser l'accès des tâches aux périphériques dans un groupe de contrôle, 
 +  * **freezer** - utilisé pour suspendre ou pour réactiver les tâches dans un groupe de contrôle, 
 +  * **memory** - utilisé pour établir les limites d'utilisation de la mémoire par les tâches d'un groupe de contrôle et pour génèrer des rapports automatiques sur les ressources rmémoire utilisées par ces tâches, 
 +  * **net_cls** - utilisé pour repèrer les paquets réseau avec un identifiant de classe (//classid//) afin de permettre au contrôleur de trafic Linux, **tc**,  d'identifier les paquets provenant d'une tâche particulière d'un groupe de contrôle. 
 +  * **perf_event**  - utilisé pour permettre le monitoring des CGroups avec l'outil perf, 
 +  * **hugetlb** - utilisé pour limiter des ressources sur des pages de mémoire virtuelle de grande taille. 
 + 
 +Pour visualiser les hiérarchies, il convient d'utiliser la commande **lssubsys** :
  
 <code> <code>
-[root@centos8 ~]# edquota -u fenestros -/home+[root@centos8 ~]# lssubsys -am 
 +bash: lssubsys: command not found... 
 +Install package 'libcgroup-tools' to provide command 'lssubsys'? [N/y] y 
 + 
 + 
 + * Waiting in queue...  
 +The following packages have to be installed: 
 + libcgroup-0.41-19.el8.x86_64   Library to control and monitor control groups 
 + libcgroup-tools-0.41-19.el8.x86_64     Command-line utility programs, services and daemons for libcgroup 
 +Proceed with changes? [N/y] y 
 + 
 + 
 + * Waiting in queue...  
 + * Waiting for authentication...  
 + * Waiting in queue...  
 + * Downloading packages...  
 + * Requesting data...  
 + * Testing changes...  
 + * Installing packages...  
 +cpuset /sys/fs/cgroup/cpuset 
 +cpu,cpuacct /sys/fs/cgroup/cpu,cpuacct 
 +blkio /sys/fs/cgroup/blkio 
 +memory /sys/fs/cgroup/memory 
 +devices /sys/fs/cgroup/devices 
 +freezer /sys/fs/cgroup/freezer 
 +net_cls,net_prio /sys/fs/cgroup/net_cls,net_prio 
 +perf_event /sys/fs/cgroup/perf_event 
 +hugetlb /sys/fs/cgroup/hugetlb 
 +pids /sys/fs/cgroup/pids 
 +rdma /sys/fs/cgroup/rdma
 </code> </code>
  
-L'éditeur **vi** se lance et vous obtiendrez un résultat similaire à celui-ci :+<code> 
 +[root@centos8 ~]# lssubsys -am 
 +cpuset /sys/fs/cgroup/cpuset 
 +cpu,cpuacct /sys/fs/cgroup/cpu,cpuacct 
 +blkio /sys/fs/cgroup/blkio 
 +memory /sys/fs/cgroup/memory 
 +devices /sys/fs/cgroup/devices 
 +freezer /sys/fs/cgroup/freezer 
 +net_cls,net_prio /sys/fs/cgroup/net_cls,net_prio 
 +perf_event /sys/fs/cgroup/perf_event 
 +hugetlb /sys/fs/cgroup/hugetlb 
 +pids /sys/fs/cgroup/pids 
 +rdma /sys/fs/cgroup/rdma 
 +</code> 
  
-<file> +Sous RHEL/CentOS 8, **Systemd** organise les processus dans chaque CGroup. Par exemple tous les processus démarrés par le serveur Apache se trouveront dans le même CGroup, y compris les scripts CGI. Ceci implique que la gestion des ressources en utilisant des hiérarchies est couplé avec l'arborescence des unités de Systemd.
-Disk quotas for user fenestros (uid 1001): +
-  Filesystem                   blocks       soft       hard     inodes     soft     hard +
-  /dev/sdc1                                  0          0          0        0        0 +
-</file>+
  
-Modifiez ce fichier ainsi :+En haut de l'arborescence des unités de Systemd se trouve la tranche root - **-.slice**, dont dépend :
  
-<file> +  * le **system.slice** - l'emplacement des services système, 
-Disk quotas for user fenestros (uid 1001): +  * le **user.slice** - l'emplacement des sessions des utilisateurs, 
-  Filesystem                   blocks       soft       hard     inodes     soft     hard +  * le **machine.slice** - l'emplacement des machines virtuelles et conteneurs.
-  /dev/sdc1                               8000      10000          0        0        0 +
-</file>+
  
-Sauvegardez et quittez le fichier.+En dessous des tranches peuvent se trouver :
  
-Les options de la commande **edquota** sont :+  des **scopes** - des processus crées par **fork**, 
 +  * des **services** - des processus créés par une **Unité**. 
 + 
 +Les slices peuvent être visualisés avec la commande suivante :
  
 <code> <code>
-[root@centos8 ~]# edquota --help +[root@centos8 ~]# systemctl list-units --type=slice 
-edquota: Usage: +UNIT                                        LOAD   ACTIVE SUB    DESCRIPTION                                 
-        edquota [-rm] [-u] [-F formatname] [-p username] [-f filesystem] username ... +-.slice                                     loaded active active Root Slice                                  
-        edquota [-rm] -g [-F formatname] [-p groupname] [-f filesystem] groupname ..+machine.slice                               loaded active active Virtual Machine and Container Slice         
-        edquota [-rm] -P [-F formatname] [-p projectname] [-f filesystem] projectname ... +system-getty.slice                          loaded active active system-getty.slice                          
-        edquota [-u|g|-P] [-F formatname] [-f filesystem] -t +system-lvm2\x2dpvscan.slice                 loaded active active system-lvm2\x2dpvscan.slice                 
-        edquota [-u|g|-P] [-F formatname] [-f filesystem] -T username|groupname|projectname ...+system-sshd\x2dkeygen.slice                 loaded active active system-sshd\x2dkeygen.slice                 
 +system-systemd\x2dfsck.slice                loaded active active system-systemd\x2dfsck.slice                
 +system-systemd\x2dhibernate\x2dresume.slice loaded active active system-systemd\x2dhibernate\x2dresume.slice 
 +system-user\x2druntime\x2ddir.slice         loaded active active system-user\x2druntime\x2ddir.slice         
 +system-vncserver.slice                      loaded active active system-vncserver.slice                      
 +system.slice                                loaded active active System Slice                                
 +user-1000.slice                             loaded active active User Slice of UID 1000                      
 +user-42.slice                               loaded active active User Slice of UID 42                        
 +user.slice                                  loaded active active User and Session Slice                     
  
--u, --user                    edit user data +LOAD   Reflects whether the unit definition was properly loaded. 
--g, --group                   edit group data +ACTIVE The high-level unit activation statei.e. generalization of SUB. 
--P, --project                 edit project data +SUB    = The low-level unit activation statevalues depend on unit type.
--r, --remote                  edit remote quota (via RPC) +
--m, --no-mixed-pathnames      trim leading slashes from NFSv4 mountpoints +
--F, --format=formatname       edit quotas of a specific format +
--p, --prototype=name          copy data from a prototype user/group +
-    --always-resolve          always try to resolve nameeven if it is +
-                              composed only of digits +
--f--filesystem=filesystem   edit data only on a specific filesystem +
--t, --edit-period             edit grace period +
--T, --edit-times              edit grace time of a user/group +
--h, --help                    display this help text and exit +
--V, --version                 display version information and exit+
  
-Bugs to: jack@suse.cz+13 loaded units listed. Pass --all to see loaded but inactive units, too. 
 +To show all installed unit files use 'systemctl list-unit-files'.
 </code> </code>
 +
 +L'arborescence des unités de Systemd est la suivante :
 +
 +<code>
 +[root@centos8 ~]# systemd-cgls
 +Control group /:
 +-.slice
 +├─user.slice
 +│ ├─user-42.slice
 +│ │ ├─session-c1.scope
 +│ │ │ ├─1317 gdm-session-worker [pam/gdm-launch-environment]
 +│ │ │ ├─1459 /usr/libexec/gdm-wayland-session --register-session gnome-session --autostart /usr/share/gdm/greeter/autostart
 +│ │ │ ├─1856 /usr/libexec/gnome-session-binary --autostart /usr/share/gdm/greeter/autostart
 +│ │ │ ├─1882 /usr/bin/gnome-shell
 +│ │ │ ├─2059 /usr/bin/Xwayland :1024 -rootless -terminate -accessx -core -listen 4 -listen 5 -displayfd 6
 +│ │ │ ├─2132 ibus-daemon --xim --panel disable
 +│ │ │ ├─2135 /usr/libexec/ibus-dconf
 +│ │ │ ├─2138 /usr/libexec/ibus-x11 --kill-daemon
 +│ │ │ ├─2251 /usr/libexec/gsd-xsettings
 +│ │ │ ├─2261 /usr/libexec/gsd-a11y-settings
 +│ │ │ ├─2268 /usr/libexec/gsd-clipboard
 +│ │ │ ├─2271 /usr/libexec/gsd-color
 +│ │ │ ├─2272 /usr/libexec/gsd-datetime
 +│ │ │ ├─2273 /usr/libexec/gsd-housekeeping
 +│ │ │ ├─2274 /usr/libexec/gsd-keyboard
 +│ │ │ ├─2275 /usr/libexec/gsd-media-keys
 +│ │ │ ├─2280 /usr/libexec/gsd-mouse
 +│ │ │ ├─2281 /usr/libexec/gsd-power
 +│ │ │ ├─2283 /usr/libexec/gsd-print-notifications
 +│ │ │ ├─2284 /usr/libexec/gsd-rfkill
 +│ │ │ ├─2285 /usr/libexec/gsd-screensaver-proxy
 +│ │ │ ├─2290 /usr/libexec/gsd-sharing
 +│ │ │ ├─2321 /usr/libexec/gsd-smartcard
 +│ │ │ ├─2328 /usr/libexec/gsd-sound
 +│ │ │ ├─2333 /usr/libexec/gsd-wacom
 +│ │ │ └─2432 /usr/libexec/ibus-engine-simple
 +│ │ └─user@42.service
 +│ │   ├─xdg-permission-store.service
 +│ │   │ └─2170 /usr/libexec/xdg-permission-store
 +│ │   ├─pulseaudio.service
 +│ │   │ └─1455 /usr/bin/pulseaudio --daemonize=no --log-target=journal
 +│ │   ├─init.scope
 +│ │   │ ├─1357 /usr/lib/systemd/systemd --user
 +│ │   │ └─1377 (sd-pam)
 +│ │   ├─at-spi-dbus-bus.service
 +│ │   │ ├─2090 /usr/libexec/at-spi-bus-launcher
 +│ │   │ ├─2095 /usr/bin/dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 3
 +│ │   │ └─2098 /usr/libexec/at-spi2-registryd --use-gnome-session
 +│ │   └─dbus.service
 +│ │     ├─1755 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
 +│ │     └─2143 /usr/libexec/ibus-portal
 +│ └─user-1000.slice
 +│   ├─user@1000.service
 +│   │ ├─gvfs-goa-volume-monitor.service
 +│   │ │ └─2369 /usr/libexec/gvfs-goa-volume-monitor
 +│   │ ├─xdg-permission-store.service
 +│   │ │ └─2191 /usr/libexec/xdg-permission-store
 +│   │ ├─tracker-store.service
 +│   │ │ └─2653 /usr/libexec/tracker-store
 +│   │ ├─evolution-calendar-factory.service
 +│   │ │ ├─2605 /usr/libexec/evolution-calendar-factory
 +│   │ │ └─2706 /usr/libexec/evolution-calendar-factory-subprocess --factory all --bus-name org.gnome.evolution.dataserver.Subprocess.Backend.Calendarx2605x2 --own-path /org/gnome/evolution>
 +│   │ ├─pulseaudio.service
 +│   │ │ └─1456 /usr/bin/pulseaudio --daemonize=no --log-target=journal
 +│   │ ├─gvfs-daemon.service
 +│   │ │ ├─1896 /usr/libexec/gvfsd
 +│   │ │ └─1901 /usr/libexec/gvfsd-fuse /run/user/1000/gvfs -f -o big_writes
 +│   │ ├─evolution-source-registry.service
 +│   │ │ └─2206 /usr/libexec/evolution-source-registry
 +│   │ ├─gvfs-udisks2-volume-monitor.service
 +│   │ │ └─2243 /usr/libexec/gvfs-udisks2-volume-monitor
 +│   │ ├─init.scope
 +│   │ │ ├─1239 /usr/lib/systemd/systemd --user
 +│   │ │ └─1318 (sd-pam)
 +│   │ ├─gvfs-gphoto2-volume-monitor.service
 +│   │ │ └─2269 /usr/libexec/gvfs-gphoto2-volume-monitor
 +│   │ ├─at-spi-dbus-bus.service
 +│   │ │ ├─1964 /usr/libexec/at-spi-bus-launcher
 +│   │ │ ├─1969 /usr/bin/dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 3
 +│   │ │ └─1972 /usr/libexec/at-spi2-registryd --use-gnome-session
 +│   │ ├─dbus.service
 +│   │ │ ├─1786 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
 +│   │ │ ├─2183 /usr/libexec/ibus-portal
 +│   │ │ ├─2201 /usr/libexec/gnome-shell-calendar-server
 +│   │ │ ├─2225 /usr/libexec/goa-daemon
 +│   │ │ ├─2397 /usr/libexec/goa-identity-service
 +│   │ │ └─2721 /usr/libexec/dconf-service
 +│   │ ├─evolution-addressbook-factory.service
 +│   │ │ ├─2727 /usr/libexec/evolution-addressbook-factory
 +│   │ │ └─2771 /usr/libexec/evolution-addressbook-factory-subprocess --factory all --bus-name org.gnome.evolution.dataserver.Subprocess.Backend.AddressBookx2727x2 --own-path /org/gnome/evo>
 +│   │ ├─gvfs-mtp-volume-monitor.service
 +lines 44-86
 +</code>
 +
 +En utilisant Systemd, plusieurs ressources peuvent être limitées :
 +
 +  * **CPUShares** - par défault 1024,
 +  * **MemoryLimit** - limite exprimée en Mo ou en Go. Pas de valeur par défaut,
 +  * **BlockIOWeight** - valeur entre 10 et 1000. Pas de valeur par défaut,
 +  * **StartupCPUShares** - comme CPUShares mais uniquement appliqué pendant le démarrage,
 +  * **StartupBlockIOWeight** - comme BlockIOWeight mais uniquement appliqué pendant le démarrage,
 +  * **CPUQuota** - utilisé pour limiter le temps CPU, même quand le système ne fait rien.
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** - Pour mettre en place un quota par group, la procédure est similaireIl suffit d'utiliser l'option -g de la commande edquota.+**Important** : Consultez le manuel systemd.resource-control(5) pour voir les paramètres CGroup qui peuvent être passés à systemctl.
 </WRAP> </WRAP>
  
-====3.3 - La Commande quotaon====+===Limitation de la Mémoire===
  
-Appliquez maintenant les quotas :+Commencez par créer le script **hello-world.sh** qui servira à générer un processus pour travailler avec les CGroups :
  
 <code> <code>
-[root@centos8 ~]# quotaon -a+[root@centos8 ~]# vi hello-world.sh 
 +[root@centos8 ~]# cat hello-world.sh 
 +#!/bin/bash 
 +while [ 1 ]; do 
 +        echo "hello world" 
 +        sleep 360 
 +done
 </code> </code>
  
-Les options de la commande **quotaon** sont :+Rendez le script exécutable et testez-le :
  
 <code> <code>
-[root@centos8 ~]# quotaon --help +[root@centos8 ~]# chmod u+hello-world.sh 
-quotaon: Usage: +[root@centos8 ~]# ./hello-world.sh 
-        quotaon [-guPvp] [-F quotaformat] [-state] -a +hello world 
-        quotaon [-guPvp[-F quotaformat] [-x state] filesys ..+^C
- +
--a, --all                turn quotas on for all filesystems +
--f, --off                turn quotas off +
--u, --user               operate on user quotas +
--g, --group              operate on group quotas +
--P, --project            operate on project quotas +
--p, --print-state        print whether quotas are on or off +
--x, --xfs-command=cmd    perform XFS quota command +
--F, --format=formatname  operate on specific quota format +
--v, --verbose            print more messages +
--h, --help               display this help text and exit +
--V, --version            display version information and exit+
 </code> </code>
  
-De cette manière vous avez mis en place un quota **souple** pour fenestros de 8 000 Ko et un quota **stricte** de 10 000 Ko. +Créez maintenant un CGroup dans le sous-système **memory** appelé **helloworld** :
  
-Quand l'utilisateur fenestros aura dépassé le quota **souple**, il recevra un message d'avertissement. Quand il dépasse le quota **stricte**, il ne pourra plus enregistrer dans /home, sauf dans le cas où il supprime des fichiers pour retomber en dessous de la limite **stricte**.+<code> 
 +[root@centos8 ~]# mkdir /sys/fs/cgroup/memory/helloworld 
 +</code>
  
-Il est à noter que vous pouvez soit mettre en place un quota en taillesoit mettre en place un quota basé sur le nombre d'inodes utilisés par l'utilisateur.+Par défautce CGroup héritera de l'ensemble de la mémoire disponible. Pour éviter cela, créez maintenant une limite de **40000000** octets pour ce CGroup : 
 + 
 +<code> 
 +[root@centos8 ~]# echo 40000000 > /sys/fs/cgroup/memory/helloworld/memory.limit_in_bytes 
 +[root@centos8 ~]# cat /sys/fs/cgroup/memory/helloworld/memory.limit_in_bytes 
 +39997440 
 +</code>
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**important** - La commande pour désactivez les quotas est **quotaoff**+**Important** - Notez que les 40 000 000 demandés sont devenus 39 997 440 ce qui correspond à un nombre entier de pages mémoire du noyau de 4Ko. ( 39 997 440 / 4096 = 9 765 ).
 </WRAP> </WRAP>
  
-====3.4 - La Commande repquota====+Lancez maintenant le script **helloworld.sh** : 
  
-Pour visualiser les quotas utilisez la commande **repquota** :+<code> 
 +[root@centos8 ~]# ./hello-world.sh & 
 +[1] 35148 
 + 
 +[root@centos8 ~]# hello world 
 +[Entrée] 
 + 
 +[root@centos8 ~]# ps aux | grep hello-world 
 +root       35148  0.0  0.0  12724  2980 pts/1    S    08:48   0:00 /bin/bash ./hello-world.sh 
 +root       35151  0.0  0.0  12136  1044 pts/1    S+   08:48   0:00 grep --color=auto hello-world 
 +</code> 
 + 
 +Notez qu'il n'y a pas de limite de la mémoire, ce qui implique l'héritage par défaut :
  
 <code> <code>
-[root@centos8 ~]# repquota /home +[root@centos8 ~]# ps -ww -o cgroup 35148 
-*** Report for user quotas on device /dev/sdc1 +CGROUP 
-Block grace time7days; Inode grace time7days +12:memory:/user.slice/user-1000.slice/session-7.scope,7:devices:/user.slice,4:pids:/user.slice/user-1000.slice/session-7.scope,2:blkio:/user.slice,1:name=systemd:/user.slice/user-1000.slice/session-7.scope
-                        Block limits                File limits +
-User            used    soft    hard  grace    used  soft  hard  grace +
----------------------------------------------------------------------- +
-root      --      20                              0            +
-trainee   -- 21495888                     136532                      +
-   +
 </code> </code>
  
-<WRAP center round important 60%> +Insérer le PID de notre script dans le CGroup **helloworld** 
-**Important** - Notez que l'utilisateur fenestros ne figure pas dans la liste. Sous RHEL CentOS, le quota n'est pas visible tant que l'utilisateur ne s'est pas connecté pour la première fois.  + 
-</WRAP>+<code> 
 +[root@centos8 ~]# echo 35148 > /sys/fs/cgroup/memory/helloworld/cgroup.procs 
 +</code>
  
-Les options de la commande **repquota** sont :+Notez maintenant l'héritage de la limitation de la mémoire - **12:memory:/helloworld** :
  
 <code> <code>
-[root@centos8 ~]# repquota --help +[root@centos8 ~]# ps -ww -o cgroup 35148 
-repquotaUtility for reporting quotas. +CGROUP 
-Usage: +12:memory:/helloworld,7:devices:/user.slice,4:pids:/user.slice/user-1000.slice/session-7.scope,2:blkio:/user.slice,1:name=systemd:/user.slice/user-1000.slice/session-7.scope 
-repquota [-vugsi] [-c|C] [-t|n] [-F quotaformat] [-O (default | xml | csv)] (-a | mntpoint)+</code>
  
--v, --verbose               display also users/groups without any usage +Constatez ensuite l'occupation mémoire réelle :
--u, --user                  display information about users +
--g, --group                 display information about groups +
--P, --project               display information about projects +
--s, --human-readable        show numbers in human friendly units (MB, GB, ...) +
--t, --truncate-names        truncate names to 9 characters +
--p, --raw-grace             print grace time in seconds since epoch +
--n, --no-names              do not translate uid/gid to name +
--i, --no-autofs             avoid autofs mountpoints +
--c, --cache                 translate big number of ids at once +
--C, --no-cache              translate ids one by one +
--F, --format=formatname     report information for specific format +
--O, --output=format         format output as xml or csv +
--a, --all                   report information for all mount points with quotas +
--h, --help                  display this help message and exit +
--V, --version               display version information and exit+
  
-Bugs to jack@suse.cz+<code> 
 +[root@centos8 ~]# cat /sys/fs/cgroup/memory/helloworld/memory.usage_in_bytes 
 +274432
 </code> </code>
  
-====3.5 La Commande quota====+Tuez le script **hello-world.sh** : 
  
-Pour visualiser les quotas d'un utilisateur spécifique, il convient d'utiliser la commande **quota** :+<code> 
 +[root@centos8 ~]# kill 35148 
 +[root@centos8 ~]# ps aux | grep hello-world 
 +root       35307  0.0  0.0  12136  1112 pts/1    S+   08:55   0:00 grep --color=auto hello-world 
 +[1]+  Terminated              ./hello-world.sh 
 +</code> 
 + 
 +Créez un second CGroup beaucoup plus restrictif :
  
 <code> <code>
-[root@centos8 ~]# quota fenestros +[root@centos8 ~]# mkdir /sys/fs/cgroup/memory/helloworld1 
-Disk quotas for user fenestros (uid 1001): no limited resources used +[root@centos8 ~]# echo 6000 > /sys/fs/cgroup/memory/helloworld1/memory.limit_in_bytes 
-[root@centos8 ~]# su - fenestros +[root@centos8 ~]# cat /sys/fs/cgroup/memory/helloworld1/memory.limit_in_bytes 
-[fenestros@centos8 ~]$ touch test +4096
-[fenestros@centos8 ~]$ exit +
-logout +
-[root@centos8 ~]# quota fenestros +
-Disk quotas for user fenestros (uid 1001):  +
-     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace +
-      /dev/sdc1          8000   10000                                       +
 </code> </code>
  
-Les options de la commande **quota** sont :+Relancez le script **hello-world.sh** et insérez-le dans le nouveau CGroup :
  
 <code> <code>
-[root@centos8 ~]# quota --help +[root@centos8 ~]# ./hello-world.sh & 
-quota: Usage: quota [-guPqvswim] [-l | [-Q | -A]] [-F quotaformat] +[135389
-        quota [-qvswim] [-l | [-Q | -A]] [-F quotaformat] -u username ... +
-        quota [-qvswim] [-l | [-Q | -A]] [-F quotaformat] -g groupname ..+
-        quota [-qvswugPQm[-F quotaformat] -f filesystem ...+
  
--u, --user                display quota for user +[root@centos8 ~]# hello world 
--g, --group               display quota for group +[Entrée]
--P, --project             display quota for project +
--q, --quiet               print more terse message +
--v, --verbose             print more verbose message +
--s, --human-readable      display numbers in human friendly units (MB, GB...) +
-    --always-resolve      always try to translate name to id, even if it is +
-                          composed of only digits +
--w, --no-wrap             do not wrap long lines +
--p, --raw-grace           print grace time in seconds since epoch +
--l, --local-only          do not query NFS filesystems +
--Q, --quiet-refuse        do not print error message when NFS server does +
-                          not respond +
--i, --no-autofs           do not query autofs mountpoints +
--F, --format=formatname   display quota of a specific format +
--f, --filesystem-list     display quota information only for given filesystems +
--A, --all-nfs             display quota for all NFS mountpoints +
--m, --no-mixed-pathnames  trim leading slashes from NFSv4 mountpoints +
-    --show-mntpoint       show mount point of the file system in output +
-    --hide-device         do not show file system device in output +
--h, --help                display this help message and exit +
--V, --version             display version information and exit+
  
-Bugs to: jack@suse.cz+[root@centos8 ~]# echo 35389 > /sys/fs/cgroup/memory/helloworld1/cgroup.procs
 </code> </code>
  
-====3.6 - La Commande warnquota====+Attendez la prochaine sortie de **hello world** sur le canal standard puis constatez que le script s'arrête :
  
-La commande **warnquota** vérifie le ou les disques et envoie un message par mail à tout utilisateur qui a dépassé la limite softElle est enrègle générale appelée par un job cron. Cependant elle peut aussi est appelée d'une manière intéractive.+<code> 
 +[root@centos8 ~]# hello world 
 +[Entrée] 
 +[1]+  Killed                  ./hello-world.sh 
 +</code>
  
-Sous RHEL/CentOS, warnquota n'est pas installé par défaut :+===La Commande cgcreate=== 
 + 
 +Cette commande permet la création d'un CGroup :
  
 <code> <code>
-[root@centos8 ~]# which warnquota +[root@centos8 ~]# cgcreate -g memory:helloworld2 
-/usr/bin/which: no warnquota in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)+[root@centos8 ~]# ls -l /sys/fs/cgroup/memory/helloworld2/ 
 +total 0 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:39 cgroup.clone_children 
 +--w--w----. 1 root root 0 Jul 13 10:39 cgroup.event_control 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:39 cgroup.procs 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.failcnt 
 +--w--w----. 1 root root 0 Jul 13 10:39 memory.force_empty 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.failcnt 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.limit_in_bytes 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.max_usage_in_bytes 
 +-r--r--r--. 1 root root 0 Jul 13 10:39 memory.kmem.slabinfo 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.tcp.failcnt 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.tcp.limit_in_bytes 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.tcp.max_usage_in_bytes 
 +-r--r--r--. 1 root root 0 Jul 13 10:39 memory.kmem.tcp.usage_in_bytes 
 +-r--r--r--. 1 root root 0 Jul 13 10:39 memory.kmem.usage_in_bytes 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.limit_in_bytes 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.max_usage_in_bytes 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.memsw.failcnt 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.memsw.limit_in_bytes 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.memsw.max_usage_in_bytes 
 +-r--r--r--. 1 root root 0 Jul 13 10:39 memory.memsw.usage_in_bytes 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.move_charge_at_immigrate 
 +-r--r--r--. 1 root root 0 Jul 13 10:39 memory.numa_stat 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.oom_control 
 +----------. 1 root root 0 Jul 13 10:39 memory.pressure_level 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.soft_limit_in_bytes 
 +-r--r--r--. 1 root root 0 Jul 13 10:39 memory.stat 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.swappiness 
 +-r--r--r--. 1 root root 0 Jul 13 10:39 memory.usage_in_bytes 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.use_hierarchy 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:39 notify_on_release 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:39 tasks
 </code> </code>
  
-Installez donc le paquet **quota-warnquota** +Il n'existe cependant pas de commande pour affecter une limitation de la mémoire :
  
 <code> <code>
-[root@centos7 ~]# dnf install quota-warnquota +[root@centos8 ~]# echo 40000000 > /sys/fs/cgroup/memory/helloworld2/memory.limit_in_bytes
-...+
 </code> </code>
  
-Les options de la commande **warnquota** sont :+==La Commande cgexec== 
 + 
 +Cette commande permet d'insérer la limitation dans le CGroup **et** de lancer le script en une seule ligne :
  
 <code> <code>
-[root@centos8 ~]# warnquota --help +[root@centos8 ~]# cgexec -g memory:helloworld2 ./hello-world.sh & 
-warnquota: Usage: +[137670
-  warnquota [-ugsid] [-F quotaformat] [-c configfile] [-q quotatabfile] [-a adminsfile] [filesystem...]+
  
--u, --user                      warn users +[root@centos8 ~]# hello world 
--g, --group                     warn groups +[Entrée]
--s, --human-readable            send information in more human friendly units +
--i, --no-autofs                 avoid autofs mountpoints +
--d, --no-details                do not send quota information itself +
--F, --format=formatname         use quotafiles of specific format +
--c, --config=config-file        non-default config file +
--q, --quota-tab=quotatab-file   non-default quotatab +
--a, --admins-file=admins-file   non-default admins file +
--h, --help                      display this help message and exit +
--v, --version                   display version information and exit+
  
-warnquotaBugs to jack@suse.cz+[root@centos8 ~]#  
 +</code> 
 + 
 +==La Commande cgdelete== 
 + 
 +Une fois le script terminé, cette commande permet de supprimer le cgroup : 
 + 
 +<code> 
 +[root@centos8 ~]# ps aux | grep *.sh 
 +root       37670  0.0  0.0  12724  3112 pts/1    S    10:41   0:00 /bin/bash ./hello-world.sh 
 +root       37685  0.0  0.0  12136  1148 pts/1    S+   10:42   0:00 grep --color=auto hello-world.sh 
 + 
 +[root@centos8 ~]# kill 37670 
 + 
 +root@centos8 ~]# ps aux | grep *.sh 
 +root       37726  0.0  0.0  12136  1156 pts/1    R+   10:43   0:00 grep --color=auto hello-world.sh 
 +[1]+  Terminated              cgexec -g memory:helloworld2 ./hello-world.sh 
 + 
 +[root@centos8 ~]# cgdelete memory:helloworld2 
 + 
 +[root@centos8 ~]# ls -l /sys/fs/cgroup/memory/helloworld2/ 
 +ls: cannot access '/sys/fs/cgroup/memory/helloworld2/': No such file or directory 
 +</code> 
 + 
 +==Le Fichier /etc/cgconfig.conf== 
 + 
 +Afin de les rendre persistants, il convient d'éditer le fichier **/etc/cgconfig.conf** : 
 + 
 +<code> 
 +[root@centos8 ~]# vi /etc/cgconfig.conf 
 +[root@centos8 ~]# cat /etc/cgconfig.conf 
 +
 +#  Copyright IBM Corporation. 2007 
 +
 +#  Authors:     Balbir Singh <balbir@linux.vnet.ibm.com> 
 +#  This program is free software; you can redistribute it and/or modify it 
 +#  under the terms of version 2.1 of the GNU Lesser General Public License 
 +#  as published by the Free Software Foundation. 
 +
 +#  This program is distributed in the hope that it would be useful, but 
 +#  WITHOUT ANY WARRANTY; without even the implied warranty of 
 +#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
 +
 +
 +# By default, we expect systemd mounts everything on boot, 
 +# so there is not much to do. 
 +# See man cgconfig.conf for further details, how to create groups 
 +# on system boot using this file. 
 +group helloworld2 { 
 +        cpu { 
 +                cpu.shares = 100; 
 +        } 
 +        memory { 
 +                memory.limit_in_bytes = 40000; 
 +        } 
 +
 +</code> 
 + 
 +<WRAP center round important 60%> 
 +**Important** - Notez la création de **deux** limitations, une de 40 000 octets de mémoire et l'autre de **100** **cpu.shares**. Cette dernière est une valeur exprimée sur 1 024, où 1 024 représente 100% du temps CPU. La limite fixée est donc equivalente à 9,77% du temps CPU. 
 +</WRAP> 
 + 
 +Créez donc les deux CGroups concernés : 
 + 
 +<code> 
 +[root@centos8 ~]# cgcreate -g memory:helloworld2 
 +[root@centos8 ~]# ls -l /sys/fs/cgroup/memory/helloworld2/ 
 +total 0 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:46 cgroup.clone_children 
 +--w--w----. 1 root root 0 Jul 13 10:46 cgroup.event_control 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:46 cgroup.procs 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.failcnt 
 +--w--w----. 1 root root 0 Jul 13 10:46 memory.force_empty 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.failcnt 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.limit_in_bytes 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.max_usage_in_bytes 
 +-r--r--r--. 1 root root 0 Jul 13 10:46 memory.kmem.slabinfo 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.tcp.failcnt 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.tcp.limit_in_bytes 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.tcp.max_usage_in_bytes 
 +-r--r--r--. 1 root root 0 Jul 13 10:46 memory.kmem.tcp.usage_in_bytes 
 +-r--r--r--. 1 root root 0 Jul 13 10:46 memory.kmem.usage_in_bytes 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.limit_in_bytes 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.max_usage_in_bytes 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.memsw.failcnt 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.memsw.limit_in_bytes 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.memsw.max_usage_in_bytes 
 +-r--r--r--. 1 root root 0 Jul 13 10:46 memory.memsw.usage_in_bytes 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.move_charge_at_immigrate 
 +-r--r--r--. 1 root root 0 Jul 13 10:46 memory.numa_stat 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.oom_control 
 +----------. 1 root root 0 Jul 13 10:46 memory.pressure_level 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.soft_limit_in_bytes 
 +-r--r--r--. 1 root root 0 Jul 13 10:46 memory.stat 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.swappiness 
 +-r--r--r--. 1 root root 0 Jul 13 10:46 memory.usage_in_bytes 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.use_hierarchy 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:46 notify_on_release 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:46 tasks 
 +</code> 
 + 
 +<code> 
 +[root@centos8 ~]# cgcreate -g cpu:helloworld2 
 +[root@centos8 ~]# ls -l /sys/fs/cgroup/cpu/helloworld2/ 
 +total 0 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:47 cgroup.clone_children 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:47 cgroup.procs 
 +-r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.stat 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:47 cpuacct.usage 
 +-r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_all 
 +-r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_percpu 
 +-r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_percpu_sys 
 +-r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_percpu_user 
 +-r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_sys 
 +-r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_user 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.cfs_period_us 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.cfs_quota_us 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.rt_period_us 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.rt_runtime_us 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.shares 
 +-r--r--r--. 1 root root 0 Jul 13 10:47 cpu.stat 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:47 notify_on_release 
 +-rw-rw-r--. 1 root root 0 Jul 13 10:47 tasks 
 +</code> 
 + 
 +==La Commande cgconfigparser== 
 + 
 +Appliquez le contenu du fichier **/etc/cgconfig.conf** grâce à l'utilisation de la commande **cgconfigparser** : 
 + 
 +<code> 
 +[root@centos8 ~]# cgconfigparser -l /etc/cgconfig.conf 
 +[root@centos8 ~]# cat /sys/fs/cgroup/memory/helloworld2/memory.limit_in_bytes 
 +36864 
 +[root@centos8 ~]# cat /sys/fs/cgroup/cpu/helloworld2/cpu.shares 
 +100
 </code> </code>
  
 ----- -----
-Copyright © 2023 Hugh Norris.+Copyright © 2024 Hugh Norris.
Menu