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:junior:l121 [2024/10/01 07:37] – created adminelearning:workbooks:centos:8:junior:l121 [2024/10/01 08:01] (Version actuelle) – created admin
Ligne 5: Ligne 5:
 Dernière mise-à-jour : ~~LASTMOD~~ Dernière mise-à-jour : ~~LASTMOD~~
  
-======LCF601 - Gestion des Paramètres du matériel et les Ressources====== +======LCF601 - Gestion des Disques, des Systèmes de Fichiers et du Swap======
- +
-<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=====
  
-  * **LCF601 - Gestion des Paramètres et les Ressources du Matériel**+  * **LCF601 - Gestion des Disques, des Systèmes de Fichiers et du Swap**
     * Contenu du Module     * Contenu du Module
-    * Présentation des Fichiers Spéciaux  +    * Périphériques de stockage 
-    * LAB #1 - Découvrir le Matériel +    * Partitions 
-      * 1.1 - La Commande lspci +    * Partitionnement 
-      * 1.2 - La Commande lsusb +      * LAB #1 - Partitionnement de votre Disque avec fdisk 
-      * 1.3 - La Commande lsblk +      * LAB #2 - Modifier les Drapeaux des Partitions avec fdisk 
-      * 1.4 - La Commande lsscsi +    * Logical Volume Manager (LVM) 
-      * 1.5 - La Commande lscpu +      * LAB #3 - Volumes Logiques Linéaires 
-      * 1.6 - La Commande lshw +        * Physical Volume (PV) 
-      * 1.7 - La Commande dmidecode +        * Volume Group (VG) et Physical Extent (PE) 
-      * 1.8 - La Commande smartctl +        * Logical Volumes (LV) 
-      * 1.9 - Les Commandes accton et dump-acct +      * LAB #4 - Étendre un Volume Logique à Chaud 
-      * 1.10 - La Commande lastcomm +      * LAB #5 - Snapshots 
-      * 1.11 - La Commande sa +      * LAB #6 - Suppression des Volumes 
-      * 1.12 La Commande ac +      * LAB #7 - Volumes Logiques en Miroir 
-    * LAB #La Commande sysctl +      * LAB #8 - Modifier les Attributs LVM 
-      2.1 Répertoire /proc +      * LAB #9 - Volumes Logiques en Bandes 
-        * Fichiers +      * LAB #10 - Gérer les Métadonnées 
-          Processeur +    * Systèmes de Fichiers Journalisés 
-          Interruptions système +      * Présentation 
-          Canaux DMA +      * Ext3 
-          Plages d'entrée/sortie +        * Gestion d'Ext3 
-          Périphériques +        * LAB #11 Convertir un Système de Fichiers Ext3 en Ext2 
-          Modules +        * LAB #12 Convertir un Système de Fichiers Ext2 en Ext3 
-          * Statistiques de l'utilisation des disques +        LAB #13 Placer le Journal sur un autre Partition 
-          Partitions +        * LAB #14 - Modifier la Fréquence de Vérification du Système de Fichiers Ext3 
-          * Espaces de pagination +      Ext4 
-          Statistiques d'utilisation du processeur +        LAB #15 - Créer un Système de Fichiers Ext4 
-          * Statistiques d'utilisation de la mémoire +        LAB #16 - Ajouter une Étiquette au Système de Fichiers Ext4 
-          Version du noyau +        LAB #17 - Convertir un Système de Fichiers Ext3 en Ext4 
-        * Répertoires +      XFS 
-          ide/scsi +        LAB #18 - Créer un Système de Fichiers XFS 
-          * acpi +        LAB #19 - Ajouter une Étiquette au Système de Fichiers XFS 
-          * bus +      Autres Systèmes de Fichiers 
-          * net +        ReiserFS 
-          * sys +        * JFS 
-      * 2.2 - Utilisation de la Commande sysctl        +        Btrfs 
-    * LAB #Interprétation des informations dans /proc +      * Comparaison des Commandes par Système de Fichiers 
-      * 3.1 - free +    * LAB #20 Créer un Système de Fichiers ISO 
-      3.2 - uptime ou w  +      * La Commande mkisofs 
-      * 3.3 iostat +    Systèmes de Fichiers Chiffrés 
-      3.4 - hdparm +      * LAB #21 Créer un Système de Fichiers Chiffré avec LUKS 
-      3.5 - vmstat +        Présentation 
-      3.6 - mpstat +        Mise en Place 
-      3.7 - sar +        Ajouter une deuxième Passphrase 
-    * Modules usb +        Supprimer une Passphrase 
-    * udev +    * Raid Logiciel 
-      * La Commande udevadm +      * LAB #22 Mise en Place du RAID 5 Logiciel 
-    * Système de fichiers /sys +        22.1 - Préparer le disque 
-    * LAB #Limiter les Ressources +        22.2 - Créer une Unité RAID 
-      4.1 - ulimit +        * 22.3 - Remplacer une Unité Défaillante 
-      4.2 - Groupes de Contrôle +    * Le Swap 
-        * La Limitation de la Mémoire +      * Taille du swap 
-        * La Commande cgcreate +      * Partitions de swap 
-        * La Commande cgdelete +      * La Commande swapon 
-        Le Fichier /etc/cgconfig.conf +      * La Commande swapoff 
-        * La Commande cgconfigparser+      LAB #23 - Créer un Fichier de Swap
  
-=====Présentation des Fichiers Spéciaux=====+=====Périphériques de stockage=====
  
-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 Linuxles 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.+Les unités de stockage sous Linux sont référencées par un des fichiers se trouvant dans le répertoire **/dev** 
 + 
 +  * hd[a-d] 
 +    * Les disques IDE et les lecteurs ATAPI 
 +  * sd[a-z] 
 +    * Les disques SCSI et SATA 
 +  * mmcblk[0-7] 
 +    * Les cartes SD/MMC 
 +  * scd[0-7] 
 +    * Les CDRoms SCSI 
 +  * xd[a-d] 
 +    * Les premiers disques sur IBM XT 
 +  * fd[0-7] 
 +    * Les lecteurs de disquettes 
 +  * st[0-7] 
 +    * Les lecteurs de bandes SCSI/SATA qui **supportent** le rembobinage 
 +  * nst[0-7] 
 +    * Les lecteurs de bandes SCSI/SATA qui ne supportent **pas** le rembobinage 
 +  * ht[0-7] 
 +    * Les lecteurs de bandes PATA qui **supportent** le rembobinage 
 +  * nht[0-7] 
 +    * Les lecteurs de bandes PATA qui ne supportent **pas** le rembobinage 
 +  * rmt8, rmt16, tape-d, tape-reset 
 +    * Les lecteurs QIC-80 
 +  * ram[0-15] 
 +    * Les disques virtuels. Ils sont supprimés à l'extinction de la machine. Un de ces disques est utilisé par le système pour monter l'image d'un disque racine défini par le fichier **initrd** au démarrage de la machine 
 +  * Périphériques **loop** 
 +    * Il existe 16 unités loop qui sont utilisés pour accèder en mode bloc à un système de fichiers contenu dans un fichier, par exemple, une image **iso** 
 +  * md[x] 
 +    * Un volume **RAID** logiciel 
 +  * vg[x] 
 +    * Un groupe de volumes 
 +  * lv[x] 
 +    * Un volume logique 
 + 
 +=====Partitions===== 
 + 
 +Un PC comportent en règle générale 2 **contrôleurs** de disque, chacun capable de gérer 2 disques, un **maître** et un **esclave**. Les disques attachés à ces contrôleurs comportent des noms différents pour pouvoir les distinguer : 
 + 
 +  * Contrôleur 0 
 +    * Maître 
 +      * **hda** - disque IDE 
 +      * **sda** - disque SATA ou SCSI 
 +    * Esclave 
 +      * **hdb** - disque IDE 
 +      * **sdb** - disque SATA ou SCSI 
 +  * Contrôleur 1 
 +    * Maître 
 +      * **hdc** - disque IDE 
 +      * **sdc** - disque SATA ou SCSI 
 +    * Esclave 
 +      * **hdd** - disque IDE 
 +      * **sdd** - disque SATA ou SCSI 
 + 
 +Un disque peut comporter trois types de partitions : 
 + 
 +  * **Partitions primaires**, 
 +    * Maximum de **4**. En effet, la Table des Partitions est grande de 64 octetsIl faut 16 octets pour codés une partition. 
 +  * **Partitions Etendues**, 
 +    * Généralement une seule partition étendue par disque. Elle contient des **Lecteurs Logiques** aussi appelés des partitions, 
 +  * **Lecteurs Logiqiques**. 
 + 
 +Les 4 partitions primaires sont numérotées de 1 à 4. Par exemple : 
 + 
 +  * **hda1**, **hda2**, **hda3** et **hda4** pour le premier disque **IDE** sur le premier contrôleur de disque, 
 +  * **sda1**, **sda2**, **sda3** et **sda4** pour le premier disque **SCSI** ou **SATA** sur le premier contrôleur de disque.  
 + 
 +{{free:disque.png|}} 
 + 
 +Une partition étendue prend la place d'une partition primaire et les lecteurs logiques qui s'y trouvent commencent à partir de **hda5** ou de **sda5**. 
 + 
 +Pour clarifier ceci, considérons un disque **SATA** contenant deux partitions primaires, une seule partition étendue et 3 lecteurs logiques. Dans ce cas, les deux premières partitions sont **sda1** et **sda2**, la partition étendue prend la place de la troisième partition primaire, la **sda3** et s'appelle ainsi tandis que la quatrième partition primaire est inexistante.  
 + 
 +Les lecteurs logiques commençant à **sda5**, nous obtenons la liste de partitions suivante : sda1, sda2, sda5, sda6, sda7. Notez que la sda3 ne peut pas être utilisée en tant que partition car elle est cachée par les lecteurs sda5, sda6 et sda7. 
 + 
 +{{free:disques1.png|}} 
 + 
 +Le nombre de partitions sur un disque est limité : 
 + 
 +  * **IDE**, 
 +    * Jusqu'à **63**, 
 +  * **SCSI**, 
 +    * Jusqu'à **15**, 
 +  * **Disques utilisant l'API libata**, 
 +    * Jusqu'à **15**.
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**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**.+**Important** : Ces limites peuvent être dépassées en utilisant la gestion **LVM** (//Logical Volume Management//).
 </WRAP> </WRAP>
  
-Consultez le contenu du répertoire /dev :+=====Partitionnement===== 
 + 
 +====LAB #1 - Partitionnement de votre Disque sous RHEL/CentOS 8 avec fdisk==== 
 + 
 +Pour procéder au partitionnement de votre disque ou de vos disques, RHEL/CentOS 8 possède l'outil dénommé **fdisk**. 
 + 
 +Lancez fdisk en fournissant en argument le fichier de référence de votre premier disque dur, par exemple :
  
 <code> <code>
-[root@centos8 ~]# ls -l /dev | more +[root@centos8 ~]# fdisk /dev/sdb 
-total 0 + 
-crw-r--r--.  1 root root     10, 235 Jun 28 02:04 autofs +Welcome to fdisk (util-linux 2.32.1)
-drwxr-xr-x.  root root         180 Jun 28 02:04 block +Changes will remain in memory onlyuntil you decide to write them
-drwxr-xr-x 2 root root         100 Jun 28 02:04 bsg +Be careful before using the write command
-drwxr-xr-x.  3 root root          60 Jun 28 02:04 bus + 
-lrwxrwxrwx root root           3 Jun 28 02:04 cdrom -> sr0 +Device does not contain a recognized partition table
-drwxr-xr-x 2 root root        2940 Jun 28 02:04 char +Created a new DOS disklabel with disk identifier 0xb0dacb39
-drwxr-xr-x.  2 root root          80 Jun 28 02:04 cl_centos8 + 
-crw-------.  1 root root      5  1 Jun 28 02:04 console +Command (m for help)
-lrwxrwxrwx 1 root root          11 Jun 28 02:04 core -> /proc/kcore +
-drwxr-xr-x10 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>
  
-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**). +Tapez ensuite la lettre **m** puis <key>Entrée</key> pour obtenir le menu :
  
 <code> <code>
-... +Command (m for help)m
-brw-rw----.  1 root disk      8,   1 Jun 28 02:04 sda1 +
-... +
-crw-rw-rw-.  1 root tty       5,   0 Jun 28 02:04 tty +
-... +
-</code>+
  
-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.+Help:
  
-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** :+  DOS (MBR) 
 +     toggle a bootable flag 
 +     edit nested BSD disklabel 
 +     toggle the dos compatibility flag
  
-  * le **majeur** identifie le pilote du périphérique et donc son contrôleur, +  Generic 
-  * le **mineur** identifie le périphérique ou une particularité du périphérique telle une partition d'un disque.+     delete a partition 
 +     list free unpartitioned space 
 +     list known partition types 
 +     add a new partition 
 +     print the partition table 
 +     change a partition type 
 +     verify the partition table 
 +     print information about a partition
  
-=====LAB #1 - Découvrir le Matériel=====+  Misc 
 +     print this menu 
 +     change display/entry units 
 +     extra functionality (experts only)
  
-====1.1 - La Commande lspci====+  Script 
 +     load disk layout from sfdisk script file 
 +     dump disk layout to sfdisk script file
  
-Cette commande vous renseigne sur les adaptateurs reliés aux bus PCI, AGP et PCI express :+  Save & Exit 
 +     write table to disk and exit 
 +     quit without saving changes
  
-<code> +  Create a new label 
-[root@centos8 ~]# lspci +   g   create a new empty GPT partition table 
-00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02+   G   create a new empty SGI (IRIXpartition table 
-00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II] +   o   create a new empty DOS partition table 
-00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II] +   s   create a new empty Sun partition table 
-00:01.2 USB controller: Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II] (rev 01) + 
-00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03) + 
-00:02.0 VGA compatible controller: Device 1234:1111 (rev 02) +Command (m for help):
-00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio 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, Inc. Virtio network device +
-00:1e.0 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge +
-00:1f.0 PCI bridgeRed Hat, Inc. QEMU PCI-PCI bridge+
 </code> </code>
  
-Pour obtenir de l'information sur un adaptateur spécifiqueil convient d'utiliser la même commande avec l'option **-v** en spécifiant l'identifiant concerné :+Pour créer une nouvelle partitionvous devez utiliser la commande **n**
 + 
 +Créez donc les partitions suivantes sur votre disque : 
 + 
 +^ Partition ^ Type ^ Taille de la Partition ^ 
 +| /dev/sdb1 | Primaire |  100 Mo  | 
 +| /dev/sdb2 | Primaire |  100 Mo  | 
 +| /dev/sdb3 | Primaire |  100 Mo  | 
 +| /dev/sdb4 | Extended | Du premier secteur disponible au dernier secteur du disque | 
 +| /dev/sdb5 | Logique |  500 Mo  | 
 +| /dev/sdb6 | Logique |  200 Mo  | 
 +| /dev/sdb7 | Logique |  300 Mo  | 
 +| /dev/sda8 | Logique |  500 Mo  | 
 +| /dev/sdb9 | Logique |  400 Mo  | 
 +| /dev/sdb10 | Logique |  500 Mo  | 
 +| /dev/sdb11 | Logique |  500 Mo  | 
 +| /dev/sdb12 | Logique |  200 Mo  | 
 + 
 +Créez d'abord les partitions primaires :
  
 <code> <code>
-[root@centos8 ~]# lspci -v -s 00:03.+Command (m for help)
-00:03.0 Unclassified device [00ff]: Red HatInc. Virtio memory balloon +Partition type 
-        SubsystemRed HatIncDevice 0005 +     primary (primary, 0 extended, 4 free) 
-        Physical Slot: 3 +   e   extended (container for logical partitions) 
-        Flagsbus masterfast devsellatency 0, IRQ 10 +Select (default p) 
-        I/O ports at e000 [size=64] + 
-        Memory at fe400000 (64-bitprefetchable[size=16K] +Using default response p. 
-        Capabilities[84] Vendor Specific Information: VirtIO: <unknown> +Partition number (1-4default 1):  
-        Capabilities: [70] Vendor Specific Information: VirtIONotify +First sector (2048-8388607, default 2048) 
-        Capabilities: [60] Vendor Specific Information: VirtIO: DeviceCfg +Last sector+sectors or +size{K,M,G,T,P} (2048-8388607, default 8388607): +100M 
-        Capabilities[50] Vendor Specific Information: VirtIOISR + 
-        Capabilities[40] Vendor Specific Information: VirtIO: CommonCfg +Created a new partition 1 of type 'Linux' and of size 100 MiB
-        Kernel driver in usevirtio-pci+ 
 +Command (m for help)
 +Partition type 
 +     primary (1 primary, 0 extended, free) 
 +   e   extended (container for logical partitions) 
 +Select (default p) 
 + 
 +Using default response p. 
 +Partition number (2-4default 2):  
 +First sector (206848-8388607default 206848):  
 +Last sector, +sectors or +size{K,M,G,T,P} (206848-8388607default 8388607): +100M             
 + 
 +Created a new partition 2 of type 'Linux' and of size 100 MiB. 
 + 
 +Command (m for help)n 
 +Partition type 
 +     primary (2 primary, 0 extended, 2 free) 
 +     extended (container for logical partitions) 
 +Select (default p):  
 + 
 +Using default response p. 
 +Partition number (3,4, default 3) 
 +First sector (411648-8388607, default 411648):  
 +Last sector, +sectors or +size{K,M,G,T,P} (411648-8388607, default 8388607)+100M 
 + 
 +Created a new partition 3 of type 'Linux' and of size 100 MiB. 
 + 
 +Command (m for help)
 </code> </code>
  
-ou :+Créez ensuite la partition étendue :
  
 <code> <code>
-[root@centos8 ~]# lspci -vv -s 00:03.0 +Command (m for help)n 
-00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon +Partition type 
-        Subsystem: Red HatInc. Device 0005 +   p   primary (3 primary, 0 extended, 1 free) 
-        Physical Slot: 3 +   e   extended (container for logical partitions) 
-        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx- +Select (default e): e
-        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- +
-        Latency: +
-        Interrupt: pin A routed to IRQ 10 +
-        Region 0: I/O ports at e000 [size=64] +
-        Region 4: Memory at fe400000 (64-bit, prefetchable[size=16K] +
-        Capabilities[84] Vendor Specific Information: VirtIO: <unknown> +
-                BAR=0 offset=00000000 size=00000000 +
-        Capabilities: [70] Vendor Specific Information: VirtIO: Notify +
-                BAR=4 offset=00003000 size=00001000 multiplier=00000004 +
-        Capabilities: [60] Vendor Specific Information: VirtIO: DeviceCfg +
-                BAR=4 offset=00002000 size=00001000 +
-        Capabilities: [50] Vendor Specific Information: VirtIO: ISR +
-                BAR=4 offset=00001000 size=00001000 +
-        Capabilities: [40] Vendor Specific Information: VirtIO: CommonCfg +
-                BAR=4 offset=00000000 size=00001000 +
-        Kernel driver in use: virtio-pci +
-</code>+
  
-===Options de la commande===+Selected partition 4 
 +First sector (616448-8388607, default 616448):  
 +Last sector, +sectors or +size{K,M,G,T,P} (616448-8388607, default 8388607): 
  
-Les options de cette commande sont :+Created a new partition 4 of type 'Extended' and of size 3.7 GiB. 
 + 
 +Command (m for help):   
 +</code> 
 + 
 +Créez maintenant les autres partitions l'une après l'autre :
  
 <code> <code>
-[root@centos8 ~]# lspci --help +Command (m for help)
-lspciinvalid option -- '-' +All primary partitions are in use. 
-Usagelspci [<switches>]+Adding logical partition 5 
 +First sector (618496-8388607, default 618496):  
 +Last sector, +sectors or +size{K,M,G,T,P} (618496-8388607, default 8388607)+500M
  
-Basic display modes: +Created a new partition 5 of type 'Linux' and of size 500 MiB.
--mm             Produce machine-readable output (single -m for an obsolete format) +
--t              Show bus tree+
  
-Display options: +Command (for help): n 
--v              Be verbose (-vv or -vvv for higher verbosity+All primary partitions are in use. 
--k              Show kernel drivers handling each device +Adding logical partition 6 
--x              Show hex-dump of the standard part of the config space +First sector (1644544-8388607, default 1644544) 
--xxx            Show hex-dump of the whole config space (dangerous; root only+Last sector, +sectors or +size{K,M,G,T,P} (1644544-8388607, default 8388607): +200M
--xxxx           Show hex-dump of the 4096-byte extended config space (root only) +
--b              Bus-centric view (addresses and IRQ's as seen by the bus) +
--D              Always show domain numbers +
--P              Display bridge path in addition to bus and device number +
--PP             Display bus path in addition to bus and device number+
  
-Resolving of device ID's to names: +Created a new partition 6 of type 'Linux' and of size 200 MiB.
--n              Show numeric ID'+
--nn             Show both textual and numeric ID's (names & numbers) +
--q              Query the PCI ID database for unknown ID's via DNS +
--qq             As above, but re-query locally cached entries +
--Q              Query the PCI ID database for all ID's via DNS+
  
-Selection of devices+Command (m for help)n 
--s [[[[<domain>]:]<bus>]:][<slot>][.[<func>]]   Show only devices in selected slots +All primary partitions are in use. 
--d [<vendor>]:[<device>][:<class>             Show only devices with specified ID's+Adding logical partition 7 
 +First sector (2056192-8388607, default 2056192) 
 +Last sector, +sectors or +size{K,M,G,T,P} (2056192-8388607, default 8388607)+300M
  
-Other options: +Created a new partition 7 of type 'Linux' and of size 300 MiB.
--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>+
  
-====1.La Commande lsusb====+Command (m for help): n 
 +All primary partitions are in use. 
 +Adding logical partition 8 
 +First sector (2672640-8388607, default 2672640):  
 +Last sector, +sectors or +size{K,M,G,T,P} (2672640-8388607, default 8388607): +500M
  
-Cette commande vous renseigne sur les adaptateurs reliés au bus usb :+Created a new partition 8 of type 'Linux' and of size 500 MiB.
  
-<code> +Command (m for help): n 
-[root@centos8 ~]# lsusb +All primary partitions are in use. 
-Bus 001 Device 002ID 0627:0001 Adomax Technology Co., Ltd  +Adding logical partition 9 
-Bus 001 Device 001ID 1d6b:0001 Linux Foundation 1.1 root hub+First sector (3698688-8388607, default 3698688) 
 +Last sector, +sectors or +size{K,M,G,T,P} (3698688-8388607, default 8388607)+400M 
 + 
 +Created a new partition 9 of type 'Linux' and of size 400 MiB. 
 + 
 + Command (m for help): n 
 +All primary partitions are in use. 
 +Adding logical partition 10 
 +First sector (4519936-8388607default 4519936):  
 +Last sector, +sectors or +size{K,M,G,T,P} (4519936-8388607, default 8388607)+500M 
 + 
 +Created a new partition 10 of type 'Linux' and of size 500 MiB. 
 + 
 +Command (m for help)
 +All primary partitions are in use. 
 +Adding logical partition 11 
 +First sector (5545984-8388607, default 5545984):  
 +Last sector, +sectors or +size{K,M,G,T,P} (5545984-8388607, default 8388607): +500M 
 + 
 +Created a new partition 11 of type 'Linux' and of size 500 MiB. 
 + 
 +Command (m for help): n 
 +All primary partitions are in use. 
 +Adding logical partition 12 
 +First sector (6572032-8388607, default 6572032):  
 +Last sector, +sectors or +size{K,M,G,T,P} (6572032-8388607, default 8388607): +200M 
 + 
 +Created a new partition 12 of type 'Linux' and of size 200 MiB.
  
-[root@centos8 ~]# lsusb -vt +Command (m for help)
-/ Bus 01.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M +
-    |__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 12M+
 </code> </code>
  
-===Options de la commande===+Tapez ensuite la lettre **p** puis <key>Entrée</key> pour visualiser la nouvelle table des partitions. Vous obtiendrez un résultat similaire à celui-ci :
  
-Les options de cette commande sont :+<code> 
 +Command (m for help): p 
 +Disk /dev/sdb: 4 GiB, 4294967296 bytes, 8388608 sectors 
 +Units: sectors of 1 * 512 = 512 bytes 
 +Sector size (logical/physical): 512 bytes / 512 bytes 
 +I/O size (minimum/optimal): 512 bytes / 512 bytes 
 +Disklabel type: dos 
 +Disk identifier: 0xb0dacb39 
 + 
 +Device     Boot   Start     End Sectors  Size Id Type 
 +/dev/sdb1          2048  206847  204800  100M 83 Linux 
 +/dev/sdb2        206848  411647  204800  100M 83 Linux 
 +/dev/sdb3        411648  616447  204800  100M 83 Linux 
 +/dev/sdb4        616448 8388607 7772160  3.7G  5 Extended 
 +/dev/sdb5        618496 1642495 1024000  500M 83 Linux 
 +/dev/sdb6       1644544 2054143  409600  200M 83 Linux 
 +/dev/sdb7       2056192 2670591  614400  300M 83 Linux 
 +/dev/sdb8       2672640 3696639 1024000  500M 83 Linux 
 +/dev/sdb9       3698688 4517887  819200  400M 83 Linux 
 +/dev/sdb10      4519936 5543935 1024000  500M 83 Linux 
 +/dev/sdb11      5545984 6569983 1024000  500M 83 Linux 
 +/dev/sdb12      6572032 6981631  409600  200M 83 Linux 
 + 
 +Command (m for help):  
 +</code> 
 + 
 +Ecrivez la table des partitions sur disque et exécutez la commande **partprobe** :
  
 <code> <code>
-[root@centos8 ~]# lsusb --help +Command (m for help): w 
-Usage: lsusb [options]... +The partition table has been altered
-List USB devices +Calling ioctl() to re-read partition table. 
-  -v, --verbose +Syncing disks. 
-      Increase verbosity (show descriptors) + 
-  -s [[bus]:][devnum] +[root@centos8 ~]# partprobe 
-      Show only devices with specified device and/or +[root@centos8 ~]
-      bus numbers (in decimal) +
-  -d vendor:[product+
-      Show only devices with the specified vendor and +
-      product ID numbers (in hexadecimal) +
- .LAB#+
-  -D device +
-      Selects which device lsusb will examine +
-  -t, --tree +
-      Dump the physical USB device hierarchy as a tree +
-  -V, --version +
-      Show version of program +
-  -h, --help +
-      Show usage and help+
 </code> </code>
  
-====1.3 - La Commande lsblk====+Lancez fdisk puis tapez ensuite la lettre **p** puis <key>Entrée</key> pour visualiser la table des partitions actuelle :
  
-Cette commande vous rensigne sur les partitions des disques :+<code> 
 +[root@centos8 ~]# fdisk /dev/sdb 
 + 
 +Welcome to fdisk (util-linux 2.32.1). 
 +Changes will remain in memory only, until you decide to write them. 
 +Be careful before using the write command. 
 + 
 + 
 +Command (m for help): p 
 +Disk /dev/sdb: 4 GiB, 4294967296 bytes, 8388608 sectors 
 +Units: sectors of 1 * 512 = 512 bytes 
 +Sector size (logical/physical): 512 bytes / 512 bytes 
 +I/O size (minimum/optimal): 512 bytes / 512 bytes 
 +Disklabel type: dos 
 +Disk identifier: 0xb0dacb39 
 + 
 +Device     Boot   Start     End Sectors  Size Id Type 
 +/dev/sdb1          2048  206847  204800  100M 83 Linux 
 +/dev/sdb2        206848  411647  204800  100M 83 Linux 
 +/dev/sdb3        411648  616447  204800  100M 83 Linux 
 +/dev/sdb4        616448 8388607 7772160  3.7G  5 Extended 
 +/dev/sdb5        618496 1642495 1024000  500M 83 Linux 
 +/dev/sdb6       1644544 2054143  409600  200M 83 Linux 
 +/dev/sdb7       2056192 2670591  614400  300M 83 Linux 
 +/dev/sdb8       2672640 3696639 1024000  500M 83 Linux 
 +/dev/sdb9       3698688 4517887  819200  400M 83 Linux 
 +/dev/sdb10      4519936 5543935 1024000  500M 83 Linux 
 +/dev/sdb11      5545984 6569983 1024000  500M 83 Linux 
 +/dev/sdb12      6572032 6981631  409600  200M 83 Linux 
 + 
 +Command (m for help):  
 +</code> 
 + 
 +Pour supprimer une partition, utilisez la commande **d** puis <key>Entrée</key>. fdisk vous demandera le numéro de la partition à supprimer, par exemple :
  
 <code> <code>
-[root@centos8 ~]# lsblk +Command (m for help): d 
-NAME                MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT +Partition number (1-12, default 12)12 
-sda                   8:0    0   32G  0 disk  + 
-├─sda1                8:1       1G  0 part /boot +Partition 12 has been deleted. 
-└─sda2                8:2    0   31G  0 part  + 
-  ├─cl_centos8-root 253:0    0 27.8G  0 lvm  / +Command (m for help)p 
-  └─cl_centos8-swap 253:1    0  3.2G  0 lvm  [SWAP] +Disk /dev/sdb4 GiB, 4294967296 bytes, 8388608 sectors 
-sdb                   8:16      4G  0 disk  +Units: sectors of * 512 = 512 bytes 
-sdc                   8:32     64G  0 disk  +Sector size (logical/physical): 512 bytes / 512 bytes 
-└─sdc1                8:33     64G  0 part /home +I/O size (minimum/optimal)512 bytes / 512 bytes 
-sdd                   8:48     32G  0 disk  +Disklabel type: dos 
-sr0                  11:0    1 1024M  0 rom +Disk identifier: 0xb0dacb39 
 + 
 +Device     Boot   Start     End Sectors  Size Id Type 
 +/dev/sdb1          2048  206847  204800  100M 83 Linux 
 +/dev/sdb2        206848  411647  204800  100M 83 Linux 
 +/dev/sdb3        411648  616447  204800  100M 83 Linux 
 +/dev/sdb4        616448 8388607 7772160  3.7G  5 Extended 
 +/dev/sdb5        618496 1642495 1024000  500M 83 Linux 
 +/dev/sdb6       1644544 2054143  409600  200M 83 Linux 
 +/dev/sdb7       2056192 2670591  614400  300M 83 Linux 
 +/dev/sdb8       2672640 3696639 1024000  500M 83 Linux 
 +/dev/sdb9       3698688 4517887  819200  400M 83 Linux 
 +/dev/sdb10      4519936 5543935 1024000  500M 83 Linux 
 +/dev/sdb11      5545984 6569983 1024000  500M 83 Linux
  
-[root@centos8 ~]# lsblk -l +Command (m for help)
-NAME            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT +
-sda               8:   0   32G  0 disk  +
-sda1              8:1    0    1G  0 part /boot +
-sda2              8:2    0   31G  0 part  +
-sdb               8:16      4G  0 disk  +
-sdc               8:32     64G  0 disk  +
-sdc1              8:33     64G  0 part /home +
-sdd               8:48     32G  0 disk  +
-sr0              11:0    1 1024M  0 rom   +
-cl_centos8-root 253:0    0 27.8G  0 lvm  / +
-cl_centos8-swap 253:1    0  3.2G  0 lvm  [SWAP]+
 </code> </code>
  
-===Options de la commande===+A ce stade, la partition n'a **pas** été réellement supprimée. En effet, vous avez la possibilité de sortir de fdisk en utilisant la commande **q**. 
  
-Les options de cette commande sont :+Tapez donc q pour sortir de fdisk puis relancez fdisk. Vous obtiendrez un résultat similaire à celui-ci :
  
 <code> <code>
-[root@centos8 ~]# lsblk --help+Command (m for help): q
  
-Usage: +[root@centos8 ~]# fdisk /dev/sdb
- lsblk [options] [<device> ...]+
  
-List information about block devices.+Welcome to fdisk (util-linux 2.32.1). 
 +Changes will remain in memory only, until you decide to write them. 
 +Be careful before using the write command.
  
-Options: 
- -a, --all            print all devices 
- -b, --bytes          print SIZE in bytes rather than in human readable format 
- -d, --nodeps         don't print slaves or holders 
- -D, --discard        print discard capabilities 
- -z, --zoned          print zone model 
- -e, --exclude <list> exclude devices by major number (default: RAM disks) 
- -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 +Command (m for help): p 
- -V--version        display version+Disk /dev/sdb: 4 GiB4294967296 bytes, 8388608 sectors 
 +Units: sectors of 1 * 512 = 512 bytes 
 +Sector size (logical/physical): 512 bytes / 512 bytes 
 +I/O size (minimum/optimal): 512 bytes / 512 bytes 
 +Disklabel type: dos 
 +Disk identifier: 0xb0dacb39
  
-Available output columns: +Device     Boot   Start     End Sectors  Size Id Type 
-        NAME  device name +/dev/sdb1          2048  206847  204800  100M 83 Linux 
-       KNAME  internal kernel device name +/dev/sdb2        206848  411647  204800  100M 83 Linux 
-     MAJ:MIN  major:minor device number +/dev/sdb3        411648  616447  204800  100M 83 Linux 
-      FSTYPE  filesystem type +/dev/sdb4        616448 8388607 7772160  3.7G  5 Extended 
-  MOUNTPOINT  where the device is mounted +/dev/sdb5        618496 1642495 1024000  500M 83 Linux 
-       LABEL  filesystem LABEL +/dev/sdb6       1644544 2054143  409600  200M 83 Linux 
-        UUID  filesystem UUID +/dev/sdb7       2056192 2670591  614400  300M 83 Linux 
-    PARTTYPE  partition type UUID +/dev/sdb8       2672640 3696639 1024000  500M 83 Linux 
-   PARTLABEL  partition LABEL +/dev/sdb9       3698688 4517887  819200  400M 83 Linux 
-    PARTUUID  partition UUID +/dev/sdb10      4519936 5543935 1024000  500M 83 Linux 
-   PARTFLAGS  partition flags +/dev/sdb11      5545984 6569983 1024000  500M 83 Linux 
-          RA  read-ahead of the device +/dev/sdb12      6572032 6981631  409600  200M 83 Linux
-          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).+Command (m for help):  
 </code> </code>
  
-====1.4 La Commande lsscsi====+====LAB #2 Modifier les Drapeaux des Partitions avec fdisk====
  
-Cette commmande vous renseigne sur les périphériques SCSI et NVMe :+Afin de mettre en place un RAID logiciel ou un volume logique, il est nécessaire de modifier les types de systèmes de fichiers sur les partitions créées.
  
-<code> +Modifiez donc les nouvelles partitions à l'aide de la commande **t** de **fdisk** selon le tableau ci-dessous :
-[root@centos8 ~]# lsscsi +
-[1:0:0:0]    cd/dvd  QEMU     QEMU DVD-ROM     2.5+  /dev/sr0  +
-[2:0:0:0]    disk    ATA      QEMU HARDDISK    2.5+  /dev/sda  +
-[3:0:0:0]    disk    ATA      QEMU HARDDISK    2.5+  /dev/sdb  +
-[4:0:0:0]    disk    ATA      QEMU HARDDISK    2.5+  /dev/sdc  +
-[5:0:0:0]    disk    ATA      QEMU HARDDISK    2.5+  /dev/sdd  +
-</code>+
  
-===Options de la commande===+^ Taille de la Partition ^ Type de Système de Fichiers ^ 
 +| 500 Mo | RAID (fd) | 
 +| 200 Mo | Linux LVM (8e) | 
 +| 300 Mo | Linux LVM (8e) | 
 +| 500 Mo | RAID (fd) | 
 +| 400 Mo | Linux LVM (8e) | 
 +| 500 Mo | RAID (fd) | 
 +| 500 Mo | RAID (fd) | 
 +| 200 Mo | Inchangé |
  
-Les options de cette commande sont :+Vous obtiendrez un résultat similaire à celui-ci :
  
 <code> <code>
-[root@centos8 ~]# man lsscsi  +Command (m for help): t 
-[root@centos8 ~]# lsscsi --help +Partition number (1-12, default 12)5 
-Usagelsscsi   [--brief] [--classic] [--controllers] [--device] [--generic] +Hex code (type L to list all codes): fd 
-                [--help] [--hosts] [--kname] [--list] [--long] [--long-unit] + 
-                [--lunhex] [--no-nvme] [--pdt] [--protection] [--prot-mode] +Changed type of partition 'Linux' to 'Linux raid autodetect'. 
-                [--scsi_id] [--size] [--sz-lbs] [--sysfsroot=PATH] [--transport] + 
-                [--unit] [--verbose] [--version] [--wwn]  [<h:c:t:l>] +Command (m for help): t 
-  where+Partition number (1-12, default 12)6 
-    --brief|-b        tuple and device name only +Hex code (type L to list all codes)8e 
-    --classic|-c      alternate output similar to 'cat /proc/scsi/scsi+ 
-    --controllers|-C   synonym for --hosts since NVMe controllers treated +Changed type of partition 'Linux' to 'Linux LVM'
-                       like SCSI hosts + 
-    --device|-d       show device node's major + minor numbers +Command (m for help): t 
-    --generic|-g      show scsi generic device name +Partition number (1-12, default 12): 7 
-    --help|-h         this usage information +Hex code (type L to list all codes): 8e 
-    --hosts|-H        lists scsi hosts rather than scsi devices + 
-    --kname|-k        show kernel name instead of device node name +Changed type of partition 'Linuxto 'Linux LVM'. 
-    --list|-L         additional information output one + 
-                      attribute=value per line +Command (m for help): t 
-    --long|-l         additional information output +Partition number (1-12, default 12): 8 
-    --long-unit|-U    print LU name in full, use twice to prefix with +Hex code (type L to list all codes): fd 
-                      '.naa''eui.', 'uuid.' or 't10.' + 
-    --lunhex|-x       show LUN part of tuple as hex number in T10 format; +Changed type of partition 'Linux' to 'Linux raid autodetect'. 
-                      use twice to get full 16 digit hexadecimal LUN + 
-    --no-nvme|-N      exclude NVMe devices from output +Command (for help): t 
-    --pdt|-D          show the peripheral device type in hex +Partition number (1-12default 12): 9 
-    --protection|-p   show target and initiator protection information +Hex code (type L to list all codes)8e 
-    --protmode|-P     show negotiated protection information mode + 
-    --scsi_id|-i      show udev derived /dev/disk/by-id/scsi* entry +Changed type of partition 'Linuxto 'Linux LVM'. 
-    --size|-s         show disk size, (once for decimal (e.g. 3 GB), + 
-                      twice for power of two (e.g. 2.7 GiB), +Command (for help): t 
-                      thrice for number of blocks)+Partition number (1-12, default 12): 10 
-    --sysfsroot=PATH|-y PATH    set sysfs mount point to PATH (def/sys) +Hex code (type L to list all codes)fd 
-    --sz-lbs|-S       show size as a number of logical blocks; if used twice + 
-                      adds comma followed by logical block size in bytes +Changed type of partition 'Linux' to 'Linux raid autodetect'. 
-    --transport|-t    transport information for target or, if '--hosts+ 
-                      given, for initiator +Command (m for help)t 
-    --unit|-u         logical unit (LU) name (aka WWN for ATA/SATA+Partition number (1-12, default 12)11 
-    --verbose|-v      output path names where data is found +Hex code (type L to list all codes)fd
-    --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. +Changed type of partition 'Linux' to 'Linux raid autodetect'.
-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>
  
-====1.5 La Commande lscpu====+A l'issu des modifications, vous obtiendrez un résultat similaire à celui-ci :
  
-Cett commande vous renseigne sur l'architecture des CPUs :+<code> 
 +Command (m for help): p 
 +Disk /dev/sdb: 4 GiB, 4294967296 bytes, 8388608 sectors 
 +Units: sectors of 1 * 512 = 512 bytes 
 +Sector size (logical/physical): 512 bytes / 512 bytes 
 +I/O size (minimum/optimal): 512 bytes / 512 bytes 
 +Disklabel type: dos 
 +Disk identifier: 0xb0dacb39 
 + 
 +Device     Boot   Start     End Sectors  Size Id Type 
 +/dev/sdb1          2048  206847  204800  100M 83 Linux 
 +/dev/sdb2        206848  411647  204800  100M 83 Linux 
 +/dev/sdb3        411648  616447  204800  100M 83 Linux 
 +/dev/sdb4        616448 8388607 7772160  3.7G  5 Extended 
 +/dev/sdb5        618496 1642495 1024000  500M fd Linux raid autodetect 
 +/dev/sdb6       1644544 2054143  409600  200M 8e Linux LVM 
 +/dev/sdb7       2056192 2670591  614400  300M 8e Linux LVM 
 +/dev/sdb8       2672640 3696639 1024000  500M fd Linux raid autodetect 
 +/dev/sdb9       3698688 4517887  819200  400M 8e Linux LVM 
 +/dev/sdb10      4519936 5543935 1024000  500M fd Linux raid autodetect 
 +/dev/sdb11      5545984 6569983 1024000  500M fd Linux raid autodetect 
 +/dev/sdb12      6572032 6981631  409600  200M 83 Linux 
 + 
 +Command (m for help):  
 +</code> 
 + 
 +Pour écrire la nouvelle table des partitions sur disque, vous devez utilisez la commande **w** puis la commande **partprobe** :
  
 <code> <code>
-[root@centos8 ~]# lscpu +Command (m for help): w 
-Architecture:        x86_64 +The partition table has been altered! 
-CPU op-mode(s):      32-bit, 64-bit + 
-Byte Order:          Little Endian +Calling ioctl() to re-read partition table. 
-CPU(s):              8 + 
-On-line CPU(slist: 0-7 +WARNINGRe-reading the partition table failed with error 16Device or resource busy. 
-Thread(s) per core:  1 +The kernel still uses the old table. The new table will be used at 
-Core(s) per socket 4 +the next reboot or after you run partprobe(8or kpartx(8
-Socket(s)          2 +Syncing disks
-NUMA node(s):        1 +[root@centos8 ~]# partprobe
-Vendor ID:           GenuineIntel +
-BIOS Vendor ID:      QEMU +
-CPU family:          6 +
-Model:               158 +
-Model name:          Intel(RXeon(RCPU 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>
  
-===Options de la commande===+====Options de la Commande fdisk====
  
 Les options de cette commande sont : Les options de cette commande sont :
  
 <code> <code>
-[root@centos8 ~]# lscpu --help+[root@centos8 ~]# fdisk --help
  
 Usage: Usage:
- lscpu [options]+ fdisk [options] <disk>      change partition table 
 + fdisk [options] -l [<disk>] list partition table(s)
  
-Display information about the CPU architecture.+Display or manipulate a disk partition table.
  
 Options: Options:
- -a, --all               print both online and offline CPUs (default for -e+ -b, --sector-size <size>      physical and logical sector size 
- -b, --online            print online CPUs only (default for -p) + -B, --protect-boot            don't erase bootbits when creating a new label 
- -c, --offline           print offline CPUs only + -c, --compatibility[=<mode> mode is 'dos' or 'nondos' (default) 
- -J, --json              use JSON for default or extended format + -L, --color[=<when>         colorize output (auto, always or never) 
- -e, --extended[=<list>] print out an extended readable format +                                 colors are enabled by default 
- -p, --parse[=<list>]    print out a parsable format + -l, --list                    display partitions and exit 
- -s, --sysroot <dir    use specified directory as system root + -o, --output <list>           output columns 
- -x, --hex               print hexadecimal masks rather than lists of CPUs + -t, --type <type>             recognize specified partition table type only 
- -y, --physical          print physical instead of logical IDs+ -u, --units[=<unit>]          display units: 'cylinders' or 'sectors' (default) 
 + -s, --getsz                   display device size in 512-byte sectors [DEPRECATED] 
 +     --bytes                   print SIZE in bytes rather than in human readable format 
 + -w, --wipe <mode            wipe signatures (auto, always or never) 
 + -W, --wipe-partitions <mode wipe signatures from new partitions (auto, always or never) 
 + 
 + -C, --cylinders <number>      specify the number of cylinders 
 + -H, --heads <number>          specify the number of heads 
 + -S, --sectors <number>        specify the number of sectors per track
  
- -h, --help              display this help + -h, --help                    display this help 
- -V, --version           display version+ -V, --version                 display version
  
 Available output columns: Available output columns:
-           CPU  logical CPU number + gpt: Device Start End Sectors Size Type Type-UUID Attrs Name UUID 
-          CORE  logical core number + dos: Device Start End Sectors Cylinders Size Type Id Attrs Boot End-C/H/S Start-C/H/S 
-        SOCKET  logical socket number + bsd: Slice Start End Sectors Cylinders Size Type Bsize Cpg Fsize 
-       CLUSTER  logical cluster number + sgi: Device Start End Sectors Cylinders Size Type Id Attrs 
-          NODE  logical NUMA node number + sun: Device Start End Sectors Cylinders Size Type Id Flags
-          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).+For more details see fdisk(8).
 </code> </code>
  
-====1.6 - La Command lshw====+=====Logical Volume Manager (LVM)=====
  
-Cette commande vous renseigne sur le matériel selon la **classe** de celui-ciCommencez par visualiser les périphériques et leurs classes répectives :+====LAB #3 - Volumes Logiques Linéaires==== 
 + 
 +Afin de mettre en place le LVM, vous avez besoin du paquet **lvm2** et du paquet **device-mapper** 
 + 
 +Nous allons travailler sous RHEL/CentOS 8 avec les partitions suivantes :
  
 <code> <code>
-[root@centos8 ~]# lshw -businfo +/dev/sdb6       1644544 2054143  409600  200M 8e Linux LVM 
-Bus info          Device      Class      Description +/dev/sdb7       2056192 2670591  614400  300M 8e Linux LVM 
-==================================================== +/dev/sdb9       3698688 4517887  819200  400M 8e Linux LVM
-                              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> </code>
  
-Consultez maintenant le matériel de la classe **system** :+Pour initialiser le LVM saississez la commande suivante :
  
 <code> <code>
-[root@centos8 ~]# lshw -c system +[root@centos8 ~]# vgscan 
-centos8.ittraining.loc       +  Found volume group "cl_centos8" using metadata type lvm2
-    description: Computer +
-    product: Standard PC (i440FX + PIIX, 1996) +
-    vendor: QEMU +
-    version: pc-i440fx-7.0 +
-    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> </code>
  
-Consultez maintenant le matériel des autres classes principales :+Les options de la commande **vgscan** sont :
  
 <code> <code>
-[root@centos8 ~]# lshw -c memory +[root@centos8 ~]# vgscan --longhelp 
-  *-firmware                 +  vgscan Search for all volume groups
-       description: BIOS +
-       vendor: SeaBIOS +
-       physical id: 0 +
-       version: rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org +
-       date: 04/01/2014 +
-       size: 96KiB +
-  *-memory +
-       description: System Memory +
-       physical id: 1000 +
-       size: 16GiB +
-       capabilities: ecc +
-       configuration: errordetection=multi-bit-ecc +
-     *-bank +
-          description: DIMM RAM [empty] +
-          vendor: QEMU +
-          physical id: 0 +
-          slot: DIMM 0+
  
-[root@centos8 ~]# lshw -c video +  vgscan 
-  *-display                  +    --ignorelockingfailure ] 
-       description: VGA compatible controller + [    --mknodes ] 
-       product: bochs-drmdrmfb + [    --notifydbus ] 
-       physical id: 2 + [    --reportformat basic|json ] 
-       bus info: pci@0000:00:02.0 + [ COMMON_OPTIONS ]
-       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+
  
 +  Common options for lvm:
 + [ -d|--debug ]
 + [ -h|--help ]
 + [ -q|--quiet ]
 + [ -v|--verbose ]
 + [ -y|--yes ]
 + [ -t|--test ]
 + [    --commandprofile String ]
 + [    --config String ]
 + [    --driverloaded y|n ]
 + [    --nolocking ]
 + [    --lockopt String ]
 + [    --longhelp ]
 + [    --profile String ]
 + [    --version ]
  
-[root@centos8 ~]# lshw -c storage +  Common variables for lvm
-  *-pnp00:02                 +        Variables in option or position args are capitalized, 
-       product: PnP device PNP0700 +        e.gPV, VG, LV, Size, Number, String, Tag.
-       physical id: 2 +
-       capabilities: pnp +
-  *-ide +
-       description: IDE interface +
-       product: 82371SB PIIX3 IDE [Natoma/Triton II] +
-       vendor: Intel Corporation +
-       physical id: 1.+
-       bus info: pci@0000:00:01.+
-       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=8) ioport: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.+
-       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=32) memory:fea91000-fea91fff+
  
 +        PV
 +        Physical Volume name, a device path under /dev.
 +        For commands managing physical extents, a PV positional arg
 +        generally accepts a suffix indicating a range (or multiple ranges)
 +        of PEs. When the first PE is omitted, it defaults to the start of
 +        the device, and when the last PE is omitted it defaults to the end.
 +        PV[:PE-PE]... is start and end range (inclusive),
 +        PV[:PE+PE]... is start and length range (counting from 0).
  
-[root@centos8 ~]# lshw -c disk +        LV 
-  *-cdrom                    +        Logical Volume name. See lvm(8for valid namesAn LV positional 
-       description: DVD reader +        arg generally includes the VG name and LV name, e.gVG/LV
-       product: QEMU DVD-ROM +        LV followed by _<type> indicates that an LV of the given type is 
-       vendor: QEMU +        required. (raid represents raid<N> type). 
-       physical id: 0.0.0 +        The _new suffix indicates that the LV name is new.
-       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+
  
 +        Tag
 +        Tag name. See lvm(8) for information about tag names and using
 +        tags in place of a VG, LV or PV.
  
-[root@centos8 ~]# lshw -c volume +        Select 
-  *-volume:                +        Select indicates that a required positional arg can be omitted 
-       description: EXT4 volume +        if the --select option is usedNo arg appears in this position.
-       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,+
-       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 +        Size[UNIT
-  *-network:               +        Size is an input number that accepts an optional unit. 
-       description: Ethernet controller +        Input units are always treated as base two values, regardless of 
-       product: Virtio network device +        capitalizatione.g'k' and 'K' both refer to 1024
-       vendor: Red HatInc. +        The default input unit is specified by letterfollowed by |UNIT
-       physical id: 12 +        UNIT represents other possible input unitsBbBsSkKmMgGtTpPeE
-       bus info: pci@0000:00:12.+        (This should not be confused with the output control --units, where 
-       version: 00 +        capital letters mean multiple of 1000.)
-       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 HatInc+
-       physical id13 +
-       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>
  
-===Options de la commande===+===Physical Volume (PV)===
  
-Les options de cette commande sont :+Pour créer le **PV** il convient d'utiliser la commande **pvcreate** :
  
 <code> <code>
-[root@centos8 ~]# lshw -h +[root@centos8 ~]# pvcreate /dev/sdb6 /dev/sdb7 /dev/sdb9 
-Hardware Lister (lshw) - B.02.19.2 +  Physical volume "/dev/sdb6" successfully created. 
-usage: lshw [-format] [-options ...] +  Physical volume "/dev/sdb7" successfully created
-       lshw -version+  Physical volume "/dev/sdb9" successfully created
 +</code>
  
-        -version        print program version (B.02.19.2)+Les options de la commande **pvcreate** sont :
  
-format can be +<code> 
-        -html           output hardware tree as HTML +[root@centos8 ~]# pvcreate --longhelp 
-        -xml            output hardware tree as XML +  pvcreate Initialize physical volume(s) for use by LVM
-        -json           output hardware tree as a JSON object +
-        -short          output hardware paths +
-        -businfo        output bus information+
  
-options can be +  pvcreate PV ... 
-        -dump filename  displays output and dump collected information into a file (SQLite database) + [ -f|--force ] 
-        -class CLASS    only show a certain class of hardware + -M|--metadatatype lvm2 ] 
-        -C CLASS        same as '-class CLASS' + [ -u|--uuid String ] 
-        -c CLASS        same as '-class CLASS' + [ -Z|--zero y|n ] 
-        -disable TEST   disable a test (like pci, isapnp, cpuid, etc. ) +   --dataalignment Size[k|UNIT] ] 
-        -enable TEST    enable a test (like pci, isapnp, cpuid, etc. ) + [    --dataalignmentoffset Size[k|UNIT] ] 
-        -quiet          don't display status + [    --bootloaderareasize Size[m|UNIT] ] 
-        -sanitize       sanitize output (remove sensitive information like serial numbers, etc.) + [    --labelsector Number ] 
-        -numeric        output numeric IDs (for PCI, USB, etc.) + [    --pvmetadatacopies 0|1|2 ] 
-        -notime         exclude volatile attributes (timestamps) from output +   --metadatasize Size[m|UNIT] ] 
-</code>+ [    --metadataignore y|n ] 
 + [    --norestorefile ] 
 + [    --setphysicalvolumesize Size[m|UNIT] ] 
 + [    --reportformat basic|json ] 
 + [    --restorefile String ] 
 + [ COMMON_OPTIONS ]
  
-====1.7 La Commande dmidecode====+  Common options for lvm: 
 +-d|--debug ] 
 + [ -h|--help ] 
 + [ -q|--quiet ] 
 + [ -v|--verbose ] 
 + [ -y|--yes ] 
 + [ -t|--test ] 
 + [    --commandprofile String ] 
 + [    --config String ] 
 + [    --driverloaded y|n ] 
 + [    --nolocking ] 
 + [    --lockopt String ] 
 + [    --longhelp ] 
 + [    --profile String ] 
 + [    --version ]
  
-La commande **dmidecode** lit la table **DMI** (//Desktop Management Interface//) aussi appelée **SMBIOS** (//System Management BIOS//) et fourni les informations sur :+  Common variables for lvm: 
 +        Variables in option or position args are capitalized, 
 +        e.g. PV, VG, LV, Size, Number, String, Tag.
  
-  * l'état du matériel actuel+        PV 
-  * les extensions possibles.+        Physical Volume name, a device path under /dev. 
 +        For commands managing physical extents, a PV positional arg 
 +        generally accepts a suffix indicating a range (or multiple ranges) 
 +        of PEs. When the first PE is omitted, it defaults to the start of 
 +        the device, and when the last PE is omitted it defaults to the end. 
 +        PV[:PE-PE]... is start and end range (inclusive)
 +        PV[:PE+PE]... is start and length range (counting from 0).
  
-<code> +        LV 
-[root@centos8 ~]# dmidecode +        Logical Volume nameSee lvm(8) for valid namesAn LV positional 
-# dmidecode 3.+        arg generally includes the VG name and LV name, e.g. VG/LV
-Getting SMBIOS data from sysfs+        LV followed by _<type> indicates that an LV of the given type is 
-SMBIOS 2.8 present+        required. (raid represents raid<N> type)
-11 structures occupying 511 bytes+        The _new suffix indicates that the LV name is new.
-Table at 0x000F5870.+
  
-Handle 0x0000, DMI type 0, 24 bytes +        Tag 
-BIOS Information +        Tag nameSee lvm(8) for information about tag names and using 
-        Vendor: SeaBIOS +        tags in place of a VG, LV or PV.
-        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 +        Select 
-System Information +        Select indicates that a required positional arg can be omitted 
-        Manufacturer: QEMU +        if the --select option is used. No arg appears in this position.
-        Product Name: Standard PC (i440FX + PIIX, 1996) +
-        Version: pc-i440fx-5.+
-        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 +        Size[UNIT] 
-Chassis Information +        Size is an input number that accepts an optional unit. 
-        Manufacturer: QEMU +        Input units are always treated as base two values, regardless of 
-        Type: Other +        capitalization, e.g. 'k' and 'K' both refer to 1024. 
-        Lock: Not Present +        The default input unit is specified by letter, followed by |UNIT
-        Version: pc-i440fx-5.2 +        UNIT represents other possible input unitsBbBsSkKmMgGtTpPeE. 
-        Serial NumberNot Specified +        (This should not be confused with the output control --units, where 
-        Asset Tag: Not Specified +        capital letters mean multiple of 1000.) 
-        Boot-up State: Safe +</code>
-        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 +Pour visualiser le PV il convient d'utiliser la commande **pvdisplay** :
-Processor Information +
-        Socket DesignationCPU 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 +<code> 
-Processor Information +[root@centos8 ~]# pvdisplay /dev/sdb6 /dev/sdb7 /dev/sdb9 
-        Socket Designation: CPU 1 +  "/dev/sdb6" is a new physical volume of "200.00 MiB" 
-        Type: Central Processor +  --- NEW Physical volume --- 
-        Family: Other +  PV Name               /dev/sdb6 
-        Manufacturer: QEMU +  VG Name                
-        ID: 61 0F 00 00 FF FB 8B 07 +  PV Size               200.00 MiB 
-        Version: pc-i440fx-5.2 +  Allocatable           NO 
-        Voltage: Unknown +  PE Size                  
-        External Clock: Unknown +  Total PE              0 
-        Max Speed: 2000 MHz +  Free PE               0 
-        Current Speed: 2000 MHz +  Allocated PE          0 
-        Status: Populated, Enabled +  PV UUID               xsAjLA-sUEU-dexm-H7G1-Dsi4-q6qW-8Tqkay 
-        Upgrade: Other +    
-        L1 Cache Handle: Not Provided +  "/dev/sdb7" is a new physical volume of "300.00 MiB" 
-        L2 Cache Handle: Not Provided +  --- NEW Physical volume --- 
-        L3 Cache Handle: Not Provided +  PV Name               /dev/sdb7 
-        Serial Number: Not Specified +  VG Name                
-        Asset Tag: Not Specified +  PV Size               300.00 MiB 
-        Part Number: Not Specified +  Allocatable           NO 
-        Core Count: 4 +  PE Size                  
-        Core Enabled: 4 +  Total PE              0 
-        Thread Count: 1 +  Free PE               0 
-        Characteristics: None+  Allocated PE          0 
 +  PV UUID               WpssK3-sThn-3nS0-80O3-NcW3-23e0-gxejn4 
 +    
 +  "/dev/sdb9" is a new physical volume of "400.00 MiB" 
 +  --- NEW Physical volume --- 
 +  PV Name               /dev/sdb9 
 +  VG Name                
 +  PV Size               400.00 MiB 
 +  Allocatable           NO 
 +  PE Size                  
 +  Total PE              0 
 +  Free PE               0 
 +  Allocated PE          0 
 +  PV UUID               rqaB99-3UdD-pJxE-Z1Eo-h9yv-tZ41-r4UJSY 
 +</code>
  
-Handle 0x1000, DMI type 16, 23 bytes +Les options de la commande **pvdisplay** sont :
-Physical Memory Array +
-        LocationOther +
-        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 +<code> 
-Memory Device +[root@centos8 ~]# pvdisplay --longhelp 
-        Array Handle: 0x1000 +  pvdisplay - Display various attributes of physical volume(s)
-        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 +  pvdisplay 
-Memory Array Mapped Address + [ -a|--all ] 
-        Starting Address: 0x00000000000 + [ -c|--colon ] 
-        Ending Address: 0x000BFFFFFFF + [ -C|--columns ] 
-        Range Size: 3 GB + [ -m|--maps ] 
-        Physical Array Handle: 0x1000 + [ -o|--options String ] 
-        Partition Width: 1+ [ -S|--select String ] 
 + [ -s|--short ] 
 + [ -O|--sort String ] 
 + [    --aligned ] 
 + [    --binary ] 
 + [    --configreport log|vg|lv|pv|pvseg|seg ] 
 + [    --foreign ] 
 + [    --ignorelockingfailure ] 
 + [    --logonly ] 
 + [    --noheadings ] 
 + [    --nosuffix ] 
 + [    --readonly ] 
 + [    --reportformat basic|json ] 
 + [    --separator String ] 
 + [    --shared ] 
 + [    --unbuffered ] 
 + [    --units r|R|h|H|b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E ] 
 + [ COMMON_OPTIONS ] 
 + [ PV|Tag ... ]
  
-Handle 0x1301, DMI type 19, 31 bytes +  Common options for lvm: 
-Memory Array Mapped Address + [ -d|--debug ] 
-        Starting Address: 0x00100000000 + [ -h|--help ] 
-        Ending Address: 0x0013FFFFFFF + [ -q|--quiet ] 
-        Range Size: 1 GB + [ -v|--verbose ] 
-        Physical Array Handle: 0x1000 + [ -y|--yes ] 
-        Partition Width: 1+ [ -t|--test ] 
 + [    --commandprofile String ] 
 + [    --config String ] 
 + [    --driverloaded y|n ] 
 + [    --nolocking ] 
 + [    --lockopt String ] 
 + [    --longhelp ] 
 + [    --profile String ] 
 + [    --version ]
  
-Handle 0x2000DMI type 32, 11 bytes +  Common variables for lvm: 
-System Boot Information +        Variables in option or position args are capitalized
-        Status: No errors detected+        e.g. PV, VG, LV, Size, Number, String, Tag.
  
-Handle 0x7F00DMI type 1274 bytes +        PV 
-End Of Table+        Physical Volume namea device path under /dev. 
 +        For commands managing physical extents, a PV positional arg 
 +        generally accepts a suffix indicating a range (or multiple ranges) 
 +        of PEs. When the first PE is omitted, it defaults to the start of 
 +        the device, and when the last PE is omitted it defaults to the end. 
 +        PV[:PE-PE]... is start and end range (inclusive), 
 +        PV[:PE+PE]... is start and length range (counting from 0). 
 + 
 +        LV 
 +        Logical Volume name. See lvm(8) for valid names. An LV positional 
 +        arg generally includes the VG name and LV name, e.g. VG/LV. 
 +        LV followed by _<type> indicates that an LV of the given type is 
 +        required. (raid represents raid<N> type). 
 +        The _new suffix indicates that the LV name is new. 
 + 
 +        Tag 
 +        Tag name. See lvm(8) for information about tag names and using 
 +        tags in place of a VG, LV or PV. 
 + 
 +        Select 
 +        Select indicates that a required positional arg can be omitted 
 +        if the --select option is used. No arg appears in this position. 
 + 
 +        Size[UNIT] 
 +        Size is an input number that accepts an optional unit. 
 +        Input units are always treated as base two values, regardless of 
 +        capitalization, e.g. 'k' and 'K' both refer to 1024. 
 +        The default input unit is specified by letter, followed by |UNIT. 
 +        UNIT represents other possible input units: BbBsSkKmMgGtTpPeE. 
 +        (This should not be confused with the output control --unitswhere 
 +        capital letters mean multiple of 1000.)
 </code> </code>
  
-===Options de la commande===+===Volume Group (VG) et Physical Extent (PE)===
  
-Les options de cette commande sont :+Pour créer un Volume Group dénommé **vg0**, il convient d'utiliser la commande **vgcreate** :
  
 <code> <code>
-[root@centos7 ~]# dmidecode --help +[root@centos8 ~]# vgcreate -s 8M vg0 /dev/sdb6 /dev/sdb7 /dev/sdb9 
-Usage: dmidecode [OPTIONS] +  Volume group "vg0" successfully created
-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>
  
-====1.8 - La Commande smartctl==== +Les options de la commande **vgcreate** sont :
- +
-**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 ~]# smartctl --smart=on --saveauto=on --offlineauto=on /dev/sdb+[root@centos8 ~]# vgcreate --help 
 +  vgcreate Create a volume group
  
-[root@centos8 ~]# smartctl -a /dev/sdb +  vgcreate VG_new PV ... 
-smartctl 7.1 2020-04-05 r5049 [x86_64-linux-4.18.0-305.7.1.el8_4.x86_64(local build) + -A|--autobackup y|n ] 
-Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org+-c|--clustered y|n ] 
 + -l|--maxlogicalvolumes Number ] 
 + [ -p|--maxphysicalvolumes Number ] 
 + [ -M|--metadatatype lvm2 ] 
 + [ -s|--physicalextentsize Size[m|UNIT] ] 
 + [ -f|--force ] 
 + [ -Z|--zero y|n ] 
 + [    --addtag Tag ] 
 + [    --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit ] 
 + [    --metadataprofile String ] 
 + [    --labelsector Number ] 
 + [    --metadatasize Size[m|UNIT] ] 
 + [    --pvmetadatacopies 0|1|2 
 + [    --vgmetadatacopies all|unmanaged|Number ] 
 + [    --reportformat basic|json ] 
 + [    --dataalignment Size[k|UNIT] ] 
 + [    --dataalignmentoffset Size[k|UNIT] ] 
 + [    --shared ] 
 + [    --systemid String ] 
 + [    --locktype sanlock|dlm|none ] 
 + [ COMMON_OPTIONS ]
  
-=== START OF INFORMATION SECTION === +  Common options for lvm
-Device Model    QEMU HARDDISK + [ -d|--debug ] 
-Serial Number:    QM00007 + [ -h|--help ] 
-Firmware Version: 2.5+ +-q|--quiet 
-User Capacity:    4,294,967,296 bytes [4.29 GB+ [ -v|--verbose ] 
-Sector Size:      512 bytes logical/physical + [ -y|--yes 
-Device is:        Not in smartctl database [for details use: -P showall+ -t|--test ] 
-ATA Version is:   ATA/ATAPI-7, ATA/ATAPI-5 published, ANSI NCITS 340-2000 +    --commandprofile String ] 
-Local Time is:    Sun Nov 13 09:12:18 2022 CET + [    --config String ] 
-SMART support is: Available device has SMART capability. + [    --driverloaded y|n ] 
-SMART support is: Enabled+ [    --nolocking ] 
 + [    --lockopt String ] 
 + [    --longhelp ] 
 + [    --profile String ] 
 + [    --version ]
  
-=== START OF READ SMART DATA SECTION === +  Use --longhelp to show all options and advanced commands. 
-SMART overall-health self-assessment test result: PASSED+</code>
  
-General SMART Values: +Pour afficher les informations concernant **vg0**, il convient d'utiliser la commande **vgdisplay** :
-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 +<code> 
-Vendor Specific SMART Attributes with Thresholds: +[root@centos8 ~]# vgdisplay vg0 
-ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE +  --- Volume group --- 
-  1 Raw_Read_Error_Rate     0x0003   100   100   006    Pre-fail  Always             +  VG Name               vg0 
-  3 Spin_Up_Time            0x0003   100   100   000    Pre-fail  Always             16 +  System ID              
-  4 Start_Stop_Count        0x0002   100   100   020    Old_age   Always             100 +  Format                lvm2 
-  5 Reallocated_Sector_Ct   0x0003   100   100   036    Pre-fail  Always             0 +  Metadata Areas        3 
-  9 Power_On_Hours          0x0003   100   100   000    Pre-fail  Always       -       1 +  Metadata Sequence No  1 
- 12 Power_Cycle_Count       0x0003   100   100   000    Pre-fail  Always             0 +  VG Access             read/write 
-190 Airflow_Temperature_Cel 0x0003   069   069   050    Pre-fail  Always             31 (Min/Max 31/31)+  VG Status             resizable 
 +  MAX LV                
 +  Cur LV                0 
 +  Open LV               0 
 +  Max PV                0 
 +  Cur PV                3 
 +  Act PV                3 
 +  VG Size               880.00 MiB 
 +  PE Size               8.00 MiB 
 +  Total PE              110 
 +  Alloc PE / Size       0 / 0    
 +  Free  PE / Size       110 / 880.00 MiB 
 +  VG UUID               6cO8IX-xhvn-5J4z-Em2t-7RAq-u3y8-1cVZln 
 +</code>
  
-SMART Error Log Version+Les options de la commande **vgdisplay** sont :
-No Errors Logged+
  
-SMART Self-test log structure revision number 1 +<code> 
-No self-tests have been logged.  [To run self-tests, use: smartctl -t]+[root@centos8 ~]# vgdisplay --help 
 +  vgdisplay - Display volume group information
  
-Selective Self-tests/Logging not supported+  vgdisplay 
 +-A|--activevolumegroups ] 
 + [ -c|--colon ] 
 + [ -C|--columns ] 
 + [ -o|--options String ] 
 + [ -S|--select String ] 
 + [ -s|--short ] 
 + [ -O|--sort String ] 
 + [    --aligned ] 
 + [    --binary ] 
 + [    --configreport log|vg|lv|pv|pvseg|seg ] 
 + [    --foreign ] 
 + [    --ignorelockingfailure ] 
 + [    --logonly ] 
 + [    --noheadings ] 
 + [    --nosuffix ] 
 + [    --readonly ] 
 + [    --reportformat basic|json ] 
 + [    --shared ] 
 + [    --separator String ] 
 + [    --unbuffered ] 
 + [    --units r|R|h|H|b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E ] 
 + [ COMMON_OPTIONS ] 
 + [ VG|Tag ... ] 
 + 
 +  Common options for lvm: 
 + [ -d|--debug ] 
 + [ -h|--help ] 
 + [ -q|--quiet ] 
 + [ -v|--verbose ] 
 + [ -y|--yes ] 
 + [ -t|--test ] 
 + [    --commandprofile String ] 
 + [    --config String ] 
 + [    --driverloaded y|n ] 
 + [    --nolocking ] 
 + [    --lockopt String ] 
 + [    --longhelp ] 
 + [    --profile String ] 
 + [    --version ] 
 + 
 +  Use --longhelp to show all options and advanced commands.
 </code> </code>
  
-===Options de la commande===+===Logical Volumes (LV)===
  
-Les options de cette commande sont :+Pour créer un **Logical Volume** dénommé **lv0** dans le **Volume Group** **vg0**, il convient d'utiliser la commande **lvcreate** :
  
 <code> <code>
-[root@centos8 ~]# smartctl --help +[root@centos8 ~]# lvcreate -L 350 -n lv0 vg0 
-smartctl 7.1 2020-04-05 r5049 [x86_64-linux-4.18.0-305.7.1.el8_4.x86_64] (local build) +  Rounding up size to full physical extent 352.00 MiB 
-Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org+  Logical volume "lv0" created
 +</code>
  
-Usage: smartctl [options] device+<WRAP center round important 60%> 
 +**Important** -Notez que la taille du LV est un multiple du PE. 
 +</WRAP>
  
-============================================ SHOW INFORMATION OPTIONS =====+Les options de la commande **lvcreate** sont :
  
-  -h, --help--usage +<code> 
-         Display this help and exit+[root@centos8 ~]# lvcreate --help 
 +  lvcreate Create a logical volume
  
-  -V, --version, --copyright, --license +  Create a linear LV. 
-         Print license, copyright, and version information and exit+  lvcreate -L|--size Size[m|UNIT] VG 
 +-l|--extents Number[PERCENT] ] 
 + [    --type linear ] 
 + [ COMMON_OPTIONS ] 
 + [ PV ... ]
  
-  -i--info +  Create a striped LV (infers --type striped). 
-         Show identity information for device+  lvcreate -i|--stripes Number -L|--size Size[m|UNIT] VG 
 + [ -l|--extents Number[PERCENT] ] 
 + [ -I|--stripesize Size[k|UNIT] ] 
 + [ COMMON_OPTIONS ] 
 + [ PV ... ]
  
-  --identify[=[w][nvb]] +  Create a raid1 or mirror LV (infers --type raid1|mirror). 
-         Show words and bits from IDENTIFY DEVICE data                (ATA)+  lvcreate -m|--mirrors Number -L|--size Size[m|UNIT] VG 
 + [ -l|--extents Number[PERCENT
 + -R|--regionsize Size[m|UNIT] ] 
 + [    --mirrorlog core|disk ] 
 + [    --minrecoveryrate Size[k|UNIT] ] 
 + [    --maxrecoveryrate Size[k|UNIT] ] 
 + [ COMMON_OPTIONS ] 
 + [ PV ... ]
  
-  -g NAME, --get=NAME +  Create a raid LV (a specific raid level must be usede.g. raid1). 
-        Get device setting: all, aam, apm, dsn, lookahead, security, +  lvcreate --type raid -L|--size Size[m|UNIT] VG 
-        wcache, rcache, wcreorder, wcache-sct+ [ -l|--extents Number[PERCENT] ] 
 + -m|--mirrors Number ] 
 + [ -i|--stripes Number ] 
 + [ -I|--stripesize Size[k|UNIT] ] 
 + [ -R|--regionsize Size[m|UNIT] ] 
 + [    --minrecoveryrate Size[k|UNIT] ] 
 + [    --maxrecoveryrate Size[k|UNIT] ] 
 + [    --raidintegrity y|n ] 
 + [    --raidintegritymode String ] 
 + [    --raidintegrityblocksize Number ] 
 + [ COMMON_OPTIONS ] 
 + [ PV ... ]
  
-  -a--all +  Create raid10 LV. 
-         Show all SMART information for device+  lvcreate -m|--mirrors Number -i|--stripes Number -L|--size Size[m|UNIT] VG 
 + [ -l|--extents Number[PERCENT] ] 
 + [ -I|--stripesize Size[k|UNIT] ] 
 + [ -R|--regionsize Size[m|UNIT] ] 
 + [    --minrecoveryrate Size[k|UNIT] ] 
 + [    --maxrecoveryrate Size[k|UNIT] ] 
 + [ COMMON_OPTIONS ] 
 + [ PV ... ]
  
-  -x, --xall +  Create a COW snapshot LV of an origin LV. 
-         Show all information for device+  lvcreate -s|--snapshot -L|--size Size[m|UNIT] LV 
 + [ -l|--extents Number[PERCENT] ] 
 + [ -i|--stripes Number ] 
 + [ -I|--stripesize Size[k|UNIT] ] 
 + [ -c|--chunksize Size[k|UNIT] ] 
 + [    --type snapshot ] 
 + [ COMMON_OPTIONS ] 
 + [ PV ... ]
  
-  --scan +  Create a thin pool. 
-         Scan for devices+  lvcreate --type thin-pool -L|--size Size[m|UNIT] VG 
 + [ -l|--extents Number[PERCENT] ] 
 + [ -c|--chunksize Size[k|UNIT] ] 
 + [ -i|--stripes Number ] 
 + [ -I|--stripesize Size[k|UNIT] ] 
 + [    --thinpool LV_new ] 
 + [    --poolmetadatasize Size[m|UNIT] ] 
 + [    --poolmetadataspare y|n ] 
 + [    --discards passdown|nopassdown|ignore ] 
 + [    --errorwhenfull y|n ] 
 + [ COMMON_OPTIONS ] 
 + [ PV ... ]
  
-  --scan-open +  Create a cache pool. 
-         Scan for devices and try to open each device+  lvcreate --type cache-pool -L|--size Size[m|UNIT] VG 
 + [ -l|--extents Number[PERCENT] ] 
 + [ -H|--cache ] 
 + [ -c|--chunksize Size[k|UNIT] ] 
 + [    --poolmetadatasize Size[m|UNIT] ] 
 + [    --poolmetadataspare y|n ] 
 + [    --cachemode writethrough|writeback|passthrough ] 
 + [    --cachepolicy String ] 
 + [    --cachesettings String ] 
 + [    --cachemetadataformat auto|1|2 ] 
 + [ COMMON_OPTIONS ] 
 + [ PV ... ]
  
-================================== SMARTCTL RUN-TIME BEHAVIOR OPTIONS =====+  Create a thin LV in a thin pool (infers --type thin). 
 +  lvcreate -V|--virtualsize Size[m|UNIT] --thinpool LV_thinpool VG 
 + [ -T|--thin ] 
 + [    --type thin ] 
 + [    --discards passdown|nopassdown|ignore ] 
 + [    --errorwhenfull y|n ] 
 + [ COMMON_OPTIONS ]
  
-  -j, --json[=[cgiosuv]] +  Create a thin LV that is a snapshot of an existing thin LV  
-         Print output in JSON format+  (infers --type thin). 
 +  lvcreate -s|--snapshot LV_thin 
 +    --type thin ] 
 +    --discards passdown|nopassdown|ignore ] 
 + [    --errorwhenfull y|n 
 + [ COMMON_OPTIONS ]
  
-  -q TYPE, --quietmode=TYPE                                           (ATA) +  Create a thin LV that is a snapshot of an external origin LV. 
-         Set smartctl quiet mode to one of: errorsonly, silent, noserial+  lvcreate --type thin --thinpool LV_thinpool LV 
 + [ -T|--thin ] 
 + [ -c|--chunksize Size[k|UNIT] ] 
 + [    --poolmetadatasize Size[m|UNIT] ] 
 + [    --poolmetadataspare y|n ] 
 + [    --discards passdown|nopassdown|ignore ] 
 + [    --errorwhenfull y|n ] 
 + [ COMMON_OPTIONS ]
  
-  -d TYPE, --device=TYPE +  Create a LV that returns VDO when used. 
-         Specify device type to one of: +  lvcreate --type vdo -L|--size Size[m|UNITVG 
-         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+ -l|--extents Number[PERCENT] ] 
 + -V|--virtualsize Size[m|UNIT
 + -i|--stripes Number ] 
 + -I|--stripesize Size[k|UNIT
 +    --vdo ] 
 +    --vdopool LV_new ] 
 +    --compression y|n ] 
 +    --deduplication y|n ] 
 + COMMON_OPTIONS ] 
 + PV ... ]
  
-  -T TYPE, --tolerance=TYPE                                           (ATA) +  Create a thin LV, first creating a thin pool for it,  
-         Tolerance: normal, conservative, permissive, verypermissive+  where the new thin pool is named by the --thinpool arg. 
 +  lvcreate --type thin -V|--virtualsize Size[m|UNIT] -L|--size Size[m|UNIT] --thinpool LV_new 
 + [ -l|--extents Number[PERCENT] ] 
 +-T|--thin ] 
 + [ -c|--chunksize Size[k|UNIT] ] 
 + [ -i|--stripes Number ] 
 + [ -I|--stripesize Size[k|UNIT] ] 
 + [    --poolmetadatasize Size[m|UNIT] ] 
 + [    --poolmetadataspare y|n ] 
 + [    --discards passdown|nopassdown|ignore ] 
 + [    --errorwhenfull y|n ] 
 + [ COMMON_OPTIONS ] 
 + [ PV ... ]
  
-  -b TYPE, --badsum=TYPE                                              (ATA) +  Create a new LVthen attach the specified cachepool  
-         Set action on bad checksum to one of: warn, exit, ignore+  which converts the new LV to type cache. 
 +  lvcreate --type cache -L|--size Size[m|UNIT] --cachepool LV_cachepool VG 
 + [ -l|--extents Number[PERCENT] ] 
 + [ -H|--cache ] 
 + [ -c|--chunksize Size[k|UNIT] ] 
 + [ -i|--stripes Number ] 
 + [ -I|--stripesize Size[k|UNIT] ] 
 + [    --poolmetadatasize Size[m|UNIT] ] 
 + [    --poolmetadataspare y|n ] 
 + [    --cachemode writethrough|writeback|passthrough ] 
 + [    --cachepolicy String ] 
 + [    --cachesettings String ] 
 + [    --cachemetadataformat auto|1|2 ] 
 + [ COMMON_OPTIONS ] 
 + [ PV ... ]
  
-  -r TYPE, --report=TYPE +  Create a new LVthen attach the specified cachevol  
-         Report transactions (see man page)+  which converts the new LV to type cache. 
 +  lvcreate --type cache -L|--size Size[m|UNIT] --cachevol LV VG 
 + [ -l|--extents Number[PERCENT] ] 
 + [ -c|--chunksize Size[k|UNIT] ] 
 + [ -i|--stripes Number ] 
 + [ -I|--stripesize Size[k|UNIT] ] 
 + [    --cachemode writethrough|writeback|passthrough ] 
 + [    --cachepolicy String ] 
 + [    --cachesettings String ] 
 + [    --cachemetadataformat auto|1|2 ] 
 + [ COMMON_OPTIONS ] 
 + [ PV ... ]
  
-  -n MODE[,STATUS]--nocheck=MODE[,STATUS                          (ATA) +  Create a new LV, then attach a cachevol created from  
-         No check if: never, sleep, standby, idle (see man page)+  the specified cache device, which converts the  
 +  new LV to type cache. 
 +  lvcreate --type cache -L|--size Size[m|UNIT] --cachedevice PV VG 
 + -l|--extents Number[PERCENT] 
 + [ -c|--chunksize Size[k|UNIT] ] 
 + [ -i|--stripes Number ] 
 + [ -I|--stripesize Size[k|UNIT] ] 
 + [    --cachemode writethrough|writeback|passthrough ] 
 + [    --cachepolicy String ] 
 + [    --cachesettings String ] 
 + [    --cachemetadataformat auto|1|2 ] 
 + [    --cachesize Size[m|UNIT] ] 
 + [ COMMON_OPTIONS ] 
 + [ PV ... ]
  
-============================== DEVICE FEATURE ENABLE/DISABLE COMMANDS =====+  Create a new LV, then attach the specified cachevol  
 +  which converts the new LV to type writecache. 
 +  lvcreate --type writecache -L|--size Size[m|UNIT] --cachevol LV VG 
 + [ -l|--extents Number[PERCENT] ] 
 + [ -i|--stripes Number ] 
 + [ -I|--stripesize Size[k|UNIT] ] 
 + [    --cachesettings String ] 
 + [ COMMON_OPTIONS ] 
 + [ PV ... ]
  
-  -s VALUE, --smart=VALUE +  Create a new LVthen attach a cachevol created from  
-        Enable/disable SMART on device (on/off)+  the specified cache device, which converts the  
 +  new LV to type writecache. 
 +  lvcreate --type writecache -L|--size Size[m|UNIT] --cachedevice PV VG 
 + [ -l|--extents Number[PERCENT] ] 
 + [ -i|--stripes Number ] 
 + [ -I|--stripesize Size[k|UNIT] ] 
 + [    --cachesize Size[m|UNIT] ] 
 + [    --cachesettings String ] 
 + [ COMMON_OPTIONS ] 
 + [ PV ... ]
  
-  -o VALUE, --offlineauto=VALUE                                       (ATA) +  Common options for command: 
-        Enable/disable automatic offline testing on device (on/off)+-a|--activate y|n|ay ] 
 + [ -A|--autobackup y|n ] 
 + [ -C|--contiguous y|n ] 
 + [ -M|--persistent y|n ] 
 + [ -j|--major Number ] 
 + [ -k|--setactivationskip y|n ] 
 + [ -K|--ignoreactivationskip ] 
 + [ -n|--name String ] 
 + [ -p|--permission rw|r ] 
 + [ -r|--readahead auto|none|Number ] 
 + [ -W|--wipesignatures y|n ] 
 + [ -Z|--zero y|n ] 
 + [    --addtag Tag ] 
 + [    --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit ] 
 + [    --ignoremonitoring ] 
 + [    --metadataprofile String ] 
 + [    --minor Number ] 
 + [    --monitor y|n ] 
 + [    --nosync ] 
 + [    --noudevsync ] 
 + [    --reportformat basic|json ]
  
-  -S VALUE, --saveauto=VALUE                                          (ATA) +  Common options for lvm: 
-        Enable/disable Attribute autosave on device (on/off)+-d|--debug ] 
 + [ -h|--help ] 
 + [ -q|--quiet ] 
 + [ -v|--verbose ] 
 + [ -y|--yes ] 
 + [ -t|--test ] 
 + [    --commandprofile String ] 
 + [    --config String ] 
 + [    --driverloaded y|n ] 
 + [    --nolocking ] 
 + [    --lockopt String ] 
 + [    --longhelp ] 
 + [    --profile String ] 
 + [    --version ]
  
-  -s NAME[,VALUE], --set=NAME[,VALUE] +  Use --longhelp to show all options and advanced commands. 
-        Enable/disable/change device setting: aam,[N|off], apm,[N|off], +</code>
-        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 =====+Créez maintenant un répertoire dans /mnt pour monter lv0 :
  
-  -H, --health +<code> 
-        Show device SMART health status+[root@centos8 ~]# mkdir /mnt/lvm 
 +</code>
  
-  -c, --capabilities                                            (ATA, NVMe) +Créez un système de fichiers en **ext3** sur /dev/vg0/lv0 :
-        Show device SMART capabilities+
  
-  -A, --attributes +<code> 
-        Show device SMART vendor-specific Attributes and values+[root@centos8 ~]# mke2fs -j /dev/vg0/lv0 
 +mke2fs 1.45.6 (20-Mar-2020) 
 +Creating filesystem with 360448 1k blocks and 90112 inodes 
 +Filesystem UUID: 87b6d526-d379-4e0c-8984-94811f1cee33 
 +Superblock backups stored on blocks:  
 + 8193, 24577, 40961, 57345, 73729, 204801, 221185
  
-  -f FORMAT, --format=FORMAT                                          (ATA+Allocating group tables: done                             
-        Set output format for attributesold, brief, hex[,id|val]+Writing inode tables: done                             
 +Creating journal (8192 blocks): done 
 +Writing superblocks and filesystem accounting informationdone 
 +</code>
  
-  -l TYPE, --log=TYPE +Montez votre lv0 :
-        Show device log. TYPEerror, 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) +<code> 
-        Set display OPTION for vendor Attribute N (see man page)+[root@centos8 ~]# mount -t ext3 /dev/vg0/lv0 /mnt/lvm 
 +</code>
  
-  -F TYPE, --firmwarebug=TYPE                                         (ATA) +Vous allez maintenant copier le contenu de votre répertoire /home vers /mnt/lvm.
-        Use firmware bug workaround: +
-        none, nologdir, samsung, samsung2, samsung3, xerrorlba, swapid+
  
-  -P TYPE, --presets=TYPE                                             (ATA) +Saisissez donc la commande pour copier le contenu de /home :
-        Drive-specific presetsuse, ignore, show, showall+
  
-  -B [+]FILE, --drivedb=[+]FILE                                       (ATA) +<code> 
-        Read and replace [add] drive database from FILE +[root@centos8 ~]# cp -/home /mnt/lvm 
-        [default is +/etc/smartmontools/smart_drivedb.h +</code>
-         and then    /usr/share/smartmontools/drivedb.h]+
  
-============================================ DEVICE SELF-TEST OPTIONS =====+Constatez ensuite le contenu de /mnt/lvm :
  
-  -t TEST, --test=TEST +<code> 
-        Run testTESToffline, short, long, conveyance, force, vendor,N, +[root@centos8 ~]# ls -l /mnt/lvm 
-                        select,M-N, pending,N, afterselect,[on|off]+total 14 
 +drwxr-xr-x5 root root  1024 Apr 20 14:35 home 
 +drwx------. 2 root root 12288 May 26 17:00 lost+found 
 +</code>
  
-  -C, --captive +Une particularité du volume logique est la capacité de d'être aggrandi ou réduit sans pertes de données. Commencez par constater la taille totale du volume :
-        Do test in captive mode (along with -t)+
  
-  -X, --abort +<code> 
-        Abort any non-captive test on device+[root@centos8 ~]# df -h /mnt/lvm 
 +Filesystem           Size  Used Avail Use% Mounted on 
 +/dev/mapper/vg0-lv0  333M  17M  314M   1% /mnt/lvm 
 +</code>
  
-=================================================== SMARTCTL EXAMPLES =====+Dans la cas de notre exemple, la taille est de **333 Mo** avec **17 Mo** occupé.
  
-  smartctl --all /dev/sda                    (Prints all SMART information)+====LAB #4 Etendre un Volume Logique à Chaud====
  
-  smartctl --smart=on --offlineauto=on --saveauto=on /dev/sda +Pour agrandir un volume logique, le paquet **lvm2** contient les commandes **lvextend** et **resize2fs** :
-                                              (Enables SMART on first disk)+
  
-  smartctl --test=long /dev/sda          (Executes extended disk self-test) +<code> 
- +[root@centos8 ~]# lvextend -L +100M /dev/vg0/lv0 
-  smartctl --attributes --log=selftest --quietmode=errorsonly /dev/sda +  Rounding size to boundary between physical extents: 104.00 MiB. 
-                                      (Prints Self-Test & Attribute errors) +  Size of logical volume vg0/lv0 changed from 352.00 MiB (44 extentsto 456.00 MiB (57 extents). 
-  smartctl --all --device=3ware,/dev/sda +  Logical volume vg0/lv0 successfully resized.
-  smartctl --all --device=3ware,2 /dev/twe0 +
-  smartctl --all --device=3ware,/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>
  
-====1.9 - Les Commandes accton et dump-acct====+<WRAP center round important 60%> 
 +**Important** - Notez que l'agrandissement du volume est un multiple du PE. 
 +</WRAP>
  
-Cette commande permet d'activer ou désactiver la comptabilisation des processus :+Les options de la commande **lvextend** sont :
  
 <code> <code>
-[root@centos8 ~]# accton on +[root@centos8 ~]# lvextend --help 
-Turning on process accounting, file set to the default '/var/account/pacct'+  lvextend Add space to a logical volume
-[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 +  Extend an LV by a specified size. 
-Created symlink /etc/systemd/system/multi-user.target.wants/psacct.service → /usr/lib/systemd/system/psacct.service.+  lvextend -L|--size [+]Size[m|UNIT] LV 
 + -l|--extents [+]Number[PERCENT] ] 
 + [ -r|--resizefs ] 
 + [ -i|--stripes Number ] 
 + [ -I|--stripesize Size[k|UNIT] ] 
 + [    --poolmetadatasize [+]Size[m|UNIT] ] 
 + [ COMMON_OPTIONS ] 
 + [ PV ... ]
  
-[root@centos8 ~]# systemctl start psacct+  Extend an LV by specified PV extents. 
 +  lvextend LV PV ... 
 + -r|--resizefs ] 
 + [ -i|--stripes Number ] 
 + [ -I|--stripesize Size[k|UNIT] ] 
 + [ COMMON_OPTIONS ]
  
-[root@centos8 ~]# systemctl status psacct +  Extend a pool metadata SubLV by a specified size. 
-● psacct.service Kernel process accounting +  lvextend --poolmetadatasize [+]Size[m|UNITLV_thinpool 
-   Loaded: loaded (/usr/lib/systemd/system/psacct.service; enabled; vendor preset: di> + -i|--stripes Number ] 
-   Active: active (exited) since Sun 2022-11-13 09:35:16 CET; 4s ago + -I|--stripesize Size[k|UNIT] ] 
-  Process: 39765 ExecStart=/usr/sbin/accton /var/account/pacct (code=exited, status=0> + [ COMMON_OPTIONS ] 
-  Process: 39763 ExecStartPre=/usr/libexec/psacct/accton-create (code=exited, status=> + [ PV ... ]
- Main PID: 39765 (code=exited, status=0/SUCCESS)+
  
-Nov 13 09:35:16 centos8.ittraining.loc systemd[1]: Starting Kernel process accounting> +  Extend an LV according to a predefined policy. 
-Nov 13 09:35:16 centos8.ittraining.loc accton[39765]: Turning on process accounting, > +  lvextend --usepolicies LV_snapshot_thinpool 
-Nov 13 09:35:16 centos8.ittraining.loc systemd[1]: Started Kernel process accounting. + -r|--resizefs 
-</code>+COMMON_OPTIONS 
 + [ PV ... ]
  
-Par contre le fichier **/var/account/pacct** ne peut pas être lu avec les utilitaires de consultation de fichiers texte :+  Common options for command: 
 + [ -A|--autobackup y|n ] 
 + [ -f|--force ] 
 + [ -m|--mirrors Number ] 
 + [ -n|--nofsck ] 
 + [    --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit ] 
 + [    --nosync ] 
 + [    --noudevsync ] 
 + [    --reportformat basic|json ] 
 + [    --type linear|striped|snapshot|mirror|raid|thin|cache|vdo|thin-pool|cache-pool|vdo-pool ]
  
-<code> +  Common options for lvm: 
-[root@centos8 ~]# cat /var/account/pacct + [ -d|--debug ] 
-#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 ~]#+-h|--help ] 
 +-q|--quiet ] 
 +-v|--verbose ] 
 +-y|--yes ] 
 +-t|--test ] 
 + [    --commandprofile String ] 
 + [    --config String ] 
 + [    --driverloaded y|n ] 
 + [    --nolocking ] 
 + [    --lockopt String ] 
 + [    --longhelp ] 
 + [    --profile String ] 
 + [    --version ] 
 + 
 +  Use --longhelp to show all options and advanced commands.
 </code> </code>
  
-La commande **dump-acct** permet de voir son contenu mais pas de l'exploiter :+Le volume ayant été agrandi, il est necessaire maintenant d'agrandir le filesystem qui s'y trouve :
  
 <code> <code>
-[root@centos8 ~]# dump-acct /var/account/pacct +[root@centos8 ~]# resize2fs /dev/vg0/lv0 
-accton          |v3|     0.00|     0.00|     1.00|     0|     0|  4360.00|     0.00|   39715|   37763|S    |       0|pts/  |Sun Nov 13 09:33:52 2022 +resize2fs 1.45.6 (20-Mar-2020) 
-sleep           |v3|     0.00|     0.00|  6000.00|     0|     0|  7308.00|     0.00|   39712|    1022|           0|__      |Sun Nov 13 09:33:03 2022 +Filesystem at /dev/vg0/lv0 is mounted on /mnt/lvm; on-line resizing required 
-awk             |v3|     0.00|     0.00|     0.00|     0|     0| 25512.00|     0.00|   39717|   39716|           0|__      |Sun Nov 13 09:34:03 2022 +old_desc_blocks = 2, new_desc_blocks = 2 
-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 +The filesystem on /dev/vg0/lv0 is now 466944 (1k) blocks long.
-pgrep           |v3|     0.00|     0.00|     0.00|     0|     0| 45104.00|     0.00|   39720|   39719|           1|__      |Sun Nov 13 09:34:03 2022 +
-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 +
-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 +
-awk             |v3|     0.00|     0.00|     0.00|     0|     0| 25376.00|     0.00|   39722|   39718|           0|__      |Sun Nov 13 09:34:03 2022 +
-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 +
-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 +
-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 +
-sleep           |v3|     0.00|     0.00|  6000.00|     0|     0|  7308.00|     0.00|   39723|    1022|           0|__      |Sun Nov 13 09:34:03 2022 +
-awk             |v3|     0.00|     0.00|     0.00|     0|     0| 25512.00|     0.00|   39729|   39728|           0|__      |Sun Nov 13 09:35:03 2022 +
-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 +
-pgrep           |v3|     0.00|     0.00|     0.00|     0|     0| 45104.00|     0.00|   39732|   39731|           1|__      |Sun Nov 13 09:35:03 2022 +
-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 +
-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 +
-awk             |v3|     0.00|     0.00|     0.00|     0|     0| 25376.00|     0.00|   39734|   39730|           0|__      |Sun Nov 13 09:35:03 2022 +
-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 +
-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 +
-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 +
-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 +
-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 +
-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 +
-...+
 </code> </code>
  
-===Options de la commande=== +Constatez maintenant la modification de la taille du volume :
- +
-Les options de cette commande sont :+
  
 <code> <code>
-[root@centos8 ~]# dump-acct --help +[root@centos8 ~]# df -h /mnt/lvm 
-Usage: dump-acct [-hrR] [-n <recs>] <files> +Filesystem           Size  Used Avail Use% Mounted on 
-          [--num <recs>] [--raw] [--reverse] [--help] +/dev/mapper/vg0-lv0  434M   17M  395M   5% /mnt/lvm
-          [--format <version>] [--byteswap] +
-          [--ahz <freq>+
- +
-The system's default process accounting file is /var/account/pacct.+
 </code> </code>
  
-====1.10 - La Commande lastcomm====+Vous noterez que la taille a augmentée mais que les données sont toujours présentes.
  
-Cette commande vous renseigne sur l'historique et les statistiques des commandes par utilisateur :+====LAB #5 - Snapshots====
  
-<code> +Un snapshot est un instantané d'un système de fichiersDans cet exemple, vous allez créer un snapshot de votre lv0 :
-[root@centos8 ~]# lastcomm +
-bash              F    root     pts/     0.00 secs Sun Nov 13 09:41 +
-gdbus                X root     pts/     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 +Avant de commencer, créez un fichier de 10Mo dans le volume : 
-grep                   root     pts/0      0.00 secs Sun Nov 13 09:46 + 
-grep                   root     pts/     0.00 secs Sun Nov 13 09:45 +<code> 
-grep                   root     __         0.00 secs Sun Nov 13 09:35 +[root@centos8 ~]# dd if=/dev/zero of=/mnt/lvm/10M bs=1048576 count=10 
-grep                   root     __         0.00 secs Sun Nov 13 09:35+10+records in 
 +10+records out 
 +10485760 bytes (10 MB, 10 MiB) copied, 0.0281282 s, 373 MB/s
 </code> </code>
  
-===Options de la commande=== +Créez maintenant un snapshot :
- +
-Les options de cette commande sont :+
  
 <code> <code>
-[root@centos8 ~]# lastcomm --help +[root@centos8 ~]# lvcreate --L 18M -n testsnap /dev/vg0/lv0 
-Usage: lastcomm [-hpV] [-f file] [command] ... [user] ... [terminal] ... +  Rounding up size to full physical extent 24.00 MiB 
-       [--forwards] [--file <file>] [--strict-match] [--print-controls] +  Logical volume "testsnap" created.
-       [--user <name>] [--tty <name>] [--command <name>] [--debug] +
-       [--show-paging] [--pid] [--ahz <freq>] [--version] [--help] +
- +
-The system's default process accounting file is /var/account/pacct.+
 </code> </code>
  
-====1.11 - La Commande sa==== +Pour avoir une confirmation de la création du snapshot, utilisez la commande **lvs** :
- +
-Cette commande vous renseigne sur les statistiques sur les processus lancés et leurs ressources systèmes:+
  
 <code> <code>
-[root@centos8 ~]# sa -u | egrep "root" +[root@centos8 ~]# lvs 
-root       0.00 cpu     1090k mem      0 io accton           +  LV       VG         Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert 
-root       0.00 cpu     1827k mem      0 io sleep            +  root     cl_centos8 -wi-ao----  27.79g                                                     
-root       0.00 cpu     6378k mem      0 io awk              +  swap     cl_centos8 -wi-ao----   3.20g                                                     
-root       0.00 cpu     6658k mem      0 io ksmtuned        * +  lv0      vg0        owi-aos--- 456.00m                                                     
-root       0.00 cpu    11276k mem      0 io pgrep            +  testsnap vg0        swi-a-s---  24.00m      lv0    0.05  
-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> </code>
  
-===Options de la commande===+<WRAP center round important 60%> 
 +**Important** - Notez que le snapshot est créé dans le même VG que le LV d'origine. 
 +</WRAP>
  
-Les options de cette commande sont :+Les options de la commande **lvs** sont :
  
 <code> <code>
-[root@centos8 ~]# sa --help+[root@centos8 ~]# lvs --help 
 +  lvs - Display information about logical volumes
  
-                Usage: sa [ options ] [ file ] +  lvs 
-                 + [ -H|--history 
-                options: [-abcdfiljkmnprstuDKP] [-v <num>] [--version] [--help+ [ -a|--all ] 
-                [--other-acct-file <name>] [--other-usracct-file <name>+ [ -o|--options String 
-                [--print-seconds] [--dont-read-summary-files] [--debug+ [ -S|--select String ] 
-                 [--separate-times] [--other-savacct-file <name>] [--percentages+ [ -O|--sort String ] 
-                 [--print-ratio] [--print-users] [--merge] [--user-summary] [--group-summary+    --segments 
-                [--list-all-names] [--not-interactive] [--threshold <num>+   --aligned ] 
-                 [--sort-ksec] [--sort-tio] [--sort-sys-user-div-calls] [--sort-avio+    --binary ] 
-                 [--sort-cpu-avmem] [--sort-num-calls] [--sort-real-time] [--ahz hz+    --configreport log|vg|lv|pv|pvseg|seg 
-       [--show-paging] [--show-paging-avg]+   --foreign ] 
 +    --ignorelockingfailure ] 
 +    --logonly ] 
 +    --nameprefixes ] 
 +    --noheadings 
 +   --nosuffix ] 
 +    --readonly ] 
 +    --reportformat basic|json 
 +   --rows ] 
 +    --separator String ] 
 +    --shared ] 
 +    --unbuffered 
 +   --units r|R|h|H|b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E ] 
 +    --unquoted ] 
 + COMMON_OPTIONS 
 +VG|LV|Tag ... ]
  
-The system's default process accounting files are:+  Common options for lvm: 
 + [ -d|--debug ] 
 + [ -h|--help ] 
 + [ -q|--quiet ] 
 + [ -v|--verbose ] 
 + [ -y|--yes ] 
 + [ -t|--test ] 
 + [    --commandprofile String ] 
 + [    --config String ] 
 + [    --driverloaded y|n ] 
 + [    --nolocking ] 
 + [    --lockopt String ] 
 + [    --longhelp ] 
 + [    --profile String ] 
 + [    --version ]
  
-  raw process accounting data: /var/account/pacct +  Use --longhelp to show all options and advanced commands.
-      summary by command name: /var/account/savacct +
-          summary by username: /var/account/usracct+
 </code> </code>
  
-====1.12 - La Commande ac==== +Créez maintenant un répertoire pour monter le snapshot :
- +
-Cette commande vous renseigne sur les statistiques des temps de connexion des utilisateurs :+
  
 <code> <code>
-[root@centos8 ~]# ac -p +[root@centos8 ~]# mkdir /mnt/testsnap 
-        trainee                            247.51 +</code>
-        total      247.51+
  
-[root@centos8 ~]# ac -d +Montez le snapshot : 
-Jun 16  total        6.41 + 
-Jun 17  total       12.09 +<code> 
-Jul 19  total        6.94 +[root@centos8 ~]# mount /dev/vg0/testsnap /mnt/testsnap
-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> </code>
  
-===Options de la commande===+Comparez le volume d'origine et le snapshot :
  
-Les options de cette commande sont :+<code> 
 +[root@centos8 ~]# ls -l /mnt/lvm 
 +total 10296 
 +-rw-r--r--. 1 root root 10485760 Jun 24 04:41 10M 
 +drwxr-xr-x. 3 root root     1024 Jun 16 06:39 home 
 +drwx------. 2 root root    12288 Jun 24 04:20 lost+found 
 +[root@centos8 ~]# ls -l /mnt/testsnap/ 
 +total 10296 
 +-rw-r--r--. 1 root root 10485760 Jun 24 04:41 10M 
 +drwxr-xr-x. 3 root root     1024 Jun 16 06:39 home 
 +drwx------. 2 root root    12288 Jun 24 04:20 lost+found 
 +</code> 
 + 
 +Supprimez maintenant le fichier **10M** de votre volume d'origine :
  
 <code> <code>
-[root@centos8 ~]# ac --help+[root@centos8 ~]# rm /mnt/lvm/10M 
 +rm: remove regular file '/mnt/lvm/10M'?
 +</code>
  
-Usageac [OPTION] ...+Constatez le résultat de cette suppression :
  
-OPTIONS: +<code
-  -d, --daily-totals        Print totals for each day +[root@centos8 ~]# df -Ph /mnt/lvm 
-  -p, --individual-totals   Print time totals for each user +Filesystem           Size  Used Avail Use% Mounted on 
-  -f, --file <file>         Read from <file+/dev/mapper/vg0-lv0  434M   17M  395M   5% /mnt/lvm
-  --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+
  
-The system's default login accounting file is /var/log/wtmp.+[root@centos8 ~]# df -Ph /mnt/testsnap/ 
 +Filesystem                Size  Used Avail Use% Mounted on 
 +/dev/mapper/vg0-testsnap  434M   27M  385M   7% /mnt/testsnap 
 + 
 +[root@centos8 ~]# lvs 
 +  LV       VG         Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert 
 +  root     cl_centos8 -wi-ao----  27.79g                                                     
 +  swap     cl_centos8 -wi-ao----   3.20g                                                     
 +  lv0      vg0        owi-aos--- 456.00m                                                     
 +  testsnap vg0        swi-aos---  24.00m      lv0    0.24     
 </code> </code>
  
-=====LAB #2 La commande sysctl=====+<WRAP center round todo 60%> 
 +**A Faire** Restaurez le fichier 10M à partir du snapshot. 
 +</WRAP>
  
-====2.1 Répertoire /proc====+====LAB #6 Suppression des Volumes====
  
-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.+La suppression d'un volume logique se fait grace à la commande **lvremove** :
  
 <code> <code>
-[root@centos8 ~]# ls /proc +[root@centos8 ~]# umount /mnt/testsnap
-1      16391  19    2212  2427  2622  431   59    84    999          mdstat +[root@centos8 ~]# lvremove /dev/vg0/testsnap 
-10     16476  1931  2215  2428  2659  432       842   acpi         meminfo +Do you really want to remove active logical volume vg0/testsnap? [y/n]: y 
-1007   16534  1956  2222  2431  2667  433   60    8465  buddyinfo    misc +  Logical volume "testsnap" successfully removed 
-11     16576  1960  2226  2432  2686  434   61    866   bus          modules +[root@centos8 ~]# umount /mnt/lvm  
-11805  16593  2     2230  2435  27    435   63    867   cgroups      mounts +[root@centos8 ~]# lvremove /dev/vg0/lv0 
-12     16598  20    2237  2439  28    436   64    868   cmdline      mtrr +Do you really want to remove active logical volume vg0/lv0? [y/n]: y 
-1219   16600  2007  2238  244   29    437   65    869   consoles     net +  Logical volume "lv0" successfully removed
-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> </code>
  
-===Fichiers===+<WRAP center round important 60%> 
 +**Important** - Notez que cette opération necéssite à ce que le volume logique soit démonté. 
 +</WRAP>
  
-==Processeur==+Les options de la commande **lvremove** sont :
  
 <code> <code>
-[root@centos8 ~]# cat /proc/cpuinfo +[root@centos8 ~]# lvremove --help 
-processor       : 0 +  lvremove - Remove logical volume(s) from the system
-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 +  lvremove VG|LV|Tag|Select ..
-vendor_id       : GenuineIntel + [ -A|--autobackup y|n ] 
-cpu family      : 15 + [ -f|--force ] 
-model           : 6 + [ -S|--select String ] 
-model name      : Common KVM processor + [    --nohistory ] 
-stepping        : 1 + [    --noudevsync ] 
-microcode       : 0x1 +    --reportformat basic|json ] 
-cpu MHz         : 1999.987 + [ COMMON_OPTIONS ]
-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 +  Common options for lvm
-vendor_id       : GenuineIntel + [ -d|--debug ] 
-cpu family      : 15 + [ -h|--help ] 
-model           : 6 + [ -q|--quiet ] 
-model name      : Common KVM processor + [ -v|--verbose ] 
-stepping        1 + [ -y|--yes ] 
-microcode       : 0x1 + [ -t|--test ] 
-cpu MHz         : 1999.987 + [    --commandprofile String ] 
-cache size      : 16384 KB + [    --config String ] 
-physical id     : 0 + [    --driverloaded y|n ] 
-siblings        : 4 + [    --nolocking ] 
-core id         : 2 + [    --lockopt String ] 
-cpu cores       : 4 +    --longhelp ] 
-apicid          : 2 + [    --profile String ] 
-initial apicid  : 2 + [    --version ]
-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 +  Use --longhelp to show all options and advanced commands 
-vendor_id       : GenuineIntel +</code>
-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 +Le Volume Group peut aussi être supprimé :
-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 +<code> 
-vendor_id       : GenuineIntel +[root@centos8 ~]# vgremove vg0 
-cpu family      : 15 +  Volume group "vg0" successfully removed
-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>
  
-==Interruptions système==+Les options de la commande **vgremove** sont :
  
 <code> <code>
-[root@centos8 ~]# cat /proc/interrupts +[root@centos8 ~]# vgremove --help 
-           CPU0       CPU1       CPU2       CPU3       CPU4       CPU5       CPU6       CPU7        +  vgremove Remove volume group(s)
-  0:        109          0          0          0          0          0          0          0   IO-APIC   2-edge      timer +
-  1:          0          0          0          0          9          0          0          0   IO-APIC   1-edge      i8042 +
-  8:          0          0          0          0          0          1          0          0   IO-APIC   8-edge      rtc0 +
-  9:          0          0          0          0          0          0          0          0   IO-APIC   9-fasteoi   acpi +
- 10:          0          0          0          0      47098          0          0          0   IO-APIC  10-fasteoi   virtio0 +
- 11:          0          0         31          0          0          0          0          0   IO-APIC  11-fasteoi   uhci_hcd:usb1 +
- 12:          0          0          0         15          0          0          0          0   IO-APIC  12-edge      i8042 +
- 14:          0          0          0          0          0          0          0          0   IO-APIC  14-edge      ata_piix +
- 15:       7376          0        144          0          0          0          0      84588   IO-APIC  15-edge      ata_piix +
- 24:          0          0          0          0          0          0          0          0   PCI-MSI 294912-edge      virtio1-config +
- 25:          0          0          0          0          0       5640          0         16   PCI-MSI 294913-edge      virtio1-input.0 +
- 26:         36          0          0       5058          0          0          0          0   PCI-MSI 294914-edge      virtio1-output.0 +
- 27:          0      16008          0       9431          0          0          0          0   PCI-MSI 114688-edge      ahci[0000:00:07.0] +
-NMI:          0          0          0          0          0          0          0          0   Non-maskable interrupts +
-LOC:     870537     771900    1117711     288839     833717     502365     758229     405110   Local timer interrupts +
-SPU:          0          0          0          0          0          0          0          0   Spurious interrupts +
-PMI:          0          0          0          0          0          0          0          0   Performance monitoring interrupts +
-IWI:          0          0          0          0          2          0          0          0   IRQ work interrupts +
-RTR:          0          0          0          0          0          0          0          0   APIC ICR read retries +
-RES:     178171      67749      43116      65994      71361     118585      54139      53452   Rescheduling interrupts +
-CAL:      11095      11007      10841      10343      14679       9998      12165      12443   Function call interrupts +
-TLB:       2295       2297       2000       1728       2330       2338       1991       1861   TLB shootdowns +
-TRM:          0          0          0          0          0          0          0          0   Thermal event interrupts +
-THR:          0          0          0          0          0          0          0          0   Threshold APIC interrupts +
-DFR:          0          0          0          0          0          0          0          0   Deferred Error APIC interrupts +
-MCE:          0          0          0          0          0          0          0          0   Machine check exceptions +
-MCP:        288        288        288        288        288        288        288        288   Machine check polls +
-HYP:          0          0          0          0          0          0          0          0   Hypervisor callback interrupts +
-HRE:          0          0          0          0          0          0          0          0   Hyper-V reenlightenment interrupts +
-HVS:          0          0          0          0          0          0          0          0   Hyper-V stimer0 interrupts +
-ERR:          0 +
-MIS:          0 +
-PIN:          0          0          0          0          0          0          0          0   Posted-interrupt notification event +
-NPI:          0          0          0          0          0          0          0          0   Nested posted-interrupt event +
-PIW:          0          0          0          0          0          0          0          0   Posted-interrupt wakeup event +
-</code>+
  
-<WRAP center round important 60%> +  vgremove VG|Tag|Select ... 
-**Important** : Un pilote de périphérique demande au processeur de fournir un service en utilisant un IRQQuand la demande est faite, le processeur interrompe ses activités et passe le contrôle au pilote identifié par l'IRQTechniquement l'attribution d'un IRQ à un périphérique doit être exclusiveDans 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+ [ -f|--force ] 
-</WRAP+ [ -S|--select String ] 
 + [    --noudevsync ] 
 + [    --reportformat basic|json ] 
 + [ COMMON_OPTIONS ] 
 + 
 +  Common options for lvm: 
 + [ -d|--debug ] 
 + [ -h|--help ] 
 + [ -q|--quiet ] 
 + [ -v|--verbose ] 
 + [ -y|--yes ] 
 + [ -t|--test ] 
 + [    --commandprofile String ] 
 + [    --config String ] 
 + [    --driverloaded y|n ] 
 + [    --nolocking ] 
 + [    --lockopt String ] 
 + [    --longhelp ] 
 + [    --profile String ] 
 + [    --version ] 
 + 
 +  Use --longhelp to show all options and advanced commands
 +</code>
  
-==Canaux DMA==+Ainsi que le volume physique :
  
 <code> <code>
-[root@centos8 ~]# cat /proc/dma +[root@centos8 ~]# pvremove /dev/sdb6 /dev/sdb7 /dev/sdb9 
- 4: cascade+  Labels on physical volume "/dev/sdb6" successfully wiped. 
 +  Labels on physical volume "/dev/sdb7" successfully wiped. 
 +  Labels on physical volume "/dev/sdb9" successfully wiped.
 </code> </code>
  
-==Plages d'entrée/sortie==+Les options de la commande **pvremove** sont :
  
 <code> <code>
-root@centos8 ~]# cat /proc/ioports | more +[root@centos8 ~]# pvremove --help 
-0000-0cf7 : PCI Bus 0000:00 +  pvremove Remove LVM label(s) from physical volume(s) 
-  0000-001f : dma1 + 
-  0020-0021 : pic1 +  pvremove PV ... 
-  0040-0043 : timer0 +-f|--force ] 
-  0050-0053 : timer1 + [    --reportformat basic|json ] 
-  0060-0060 : keyboard + [ COMMON_OPTIONS ] 
-  0064-0064 keyboard + 
-  0070-0077 : rtc0 +  Common options for lvm
-  0080-008f : dma page reg + -d|--debug ] 
-  00a0-00a1 : pic2 + -h|--help ] 
-  00c0-00df : dma2 + -q|--quiet ] 
-  00f0-00ff : fpu + -v|--verbose ] 
-  0170-0177 : 0000:00:01.1 + -y|--yes ] 
-    0170-0177 : ata_piix + -t|--test ] 
-  01f0-01f7 : 0000:00:01.1 +    --commandprofile String ] 
-    01f0-01f7 : ata_piix +    --config String ] 
-  0376-0376 : 0000:00:01.1 + [    --driverloaded y|n ] 
-    0376-0376 : ata_piix +    --nolocking ] 
-  03c0-03df : vga+ + [    --lockopt String ] 
-  03f6-03f6 : 0000:00:01.1 + [    --longhelp ] 
-    03f6-03f6 : ata_piix +    --profile String ] 
---More--+ [    --version ] 
 + 
 +  Use --longhelp to show all options and advanced commands.
 </code> </code>
  
-<WRAP center round alert 60%> +====LAB #7 Volumes Logiques en Miroir====
-**Important** Si deux périphériques ont le même port, les **deux** périphériques seront inutilisables. +
-</WRAP>+
  
-==Périphériques==+Re-créez maintenant votre Volume Group :
  
 <code> <code>
-[root@centos8 ~]# cat /proc/devices +[root@centos8 ~]# pvcreate /dev/sdb6 /dev/sdb7 /dev/sdb9 
-Character devices: +  Physical volume "/dev/sdb6" successfully created. 
-  1 mem +  Physical volume "/dev/sdb7" successfully created. 
-  4 /dev/vc/0 +  Physical volume "/dev/sdb9" successfully created.
-  4 tty +
-  4 ttyS +
-  5 /dev/tty +
-  /dev/console +
-  /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: +[root@centos8 ~]# vgcreate -s 8M vg0 /dev/sdb6 /dev/sdb7 /dev/sdb9 
-  8 sd +  Volume group "vg0" successfully created
-  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> </code>
  
-==Modules==+Créez maintenant un Logical Volume en miroir grâce à l'option **-m** de la commande **lvcreate**, suivi du nombre de miroirs :
  
 <code> <code>
-[root@centos8 ~]# cat /proc/modules | more +[root@centos8 ~]# lvcreate -1 -L 100M -n lv1 vg0 
-xt_CHECKSUM 16384 1 Live 0xffffffffc09a8000 +  Rounding up size to full physical extent 104.00 MiB 
-ipt_MASQUERADE 16384 3 - Live 0xffffffffc09a3000 +  Logical volume "lv1" created.
-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>
  
-==Statistiques de l'utilisation  des disques==+Constatez maintenant la présence du miroir :
  
 <code> <code>
-[root@centos8 ~]# cat /proc/diskstats +[root@centos8 ~]# lvdisplay -m /dev/vg0/lv1 
-   8       0 sda 15481 112 1445637 154103 10272 2377 277530 890611 0 237219 1044714 0 0 0 0 +  --- Logical volume --- 
-   8       1 sda1 402 3 66754 13349 31 18 392 4632 0 2824 17981 0 0 0 0 +  LV Path                /dev/vg0/lv1 
-   8       2 sda2 14915 109 1375516 140528 8450 2359 277138 869788 0 225416 1010316 0 0 0 0 +  LV Name                lv1 
-   8      16 sdb 230 0 5991 36 0 0 0 0 0 110 36 0 0 0 +  VG Name                vg0 
-  11       0 sr0 10 0 4 0 0 0 0 0 9 2 0 0 0 0 +  LV UUID                lJQQWs-n05T-pxzi-Zq2R-UzRI-kYZf-hsNPYQ 
- 253       0 dm-0 11651 0 1364532 72138 12121 0 288727 1208138 0 227630 1280276 0 0 0 0 +  LV Write Access        read/write 
- 253       1 dm-104 0 4440 79 0 0 0 0 0 71 79 0 0 0 0+  LV Creation host, time centos8.ittraining.loc, 2021-06-02 07:37:28 -0400 
 +  LV Status              available 
 +  # open                 
 +  LV Size                104.00 MiB 
 +  Current LE             13 
 +  Mirrored volumes       2 
 +  Segments               1 
 +  Allocation             inherit 
 +  Read ahead sectors     auto 
 +  - currently set to     8192 
 +  Block device           253:4 
 +    
 +  --- Segments --- 
 +  Logical extents to 12: 
 +    Type raid1 
 +    Monitoring monitored 
 +    Raid Data LV 0 
 +      Logical volume lv1_rimage_0 
 +      Logical extents to 12 
 +    Raid Data LV 1 
 +      Logical volume lv1_rimage_1 
 +      Logical extents to 12 
 +    Raid Metadata LV 0 lv1_rmeta_0 
 +    Raid Metadata LV 1 lv1_rmeta_1
 </code> </code>
  
-==Partitions==+Le miroir s'étend sur plusieurs volumes physiques :
  
 <code> <code>
-[root@centos8 ~]# cat /proc/partitions +[root@centos8 ~]# pvdisplay -m /dev/sdb6 /dev/sdb7 /dev/sdb9 
-major minor  #blocks  name +  --- Physical volume --- 
- +  PV Name               /dev/sdb6 
-            33554432 sda +  VG Name               vg0 
-          1    1048576 sda1 +  PV Size               200.00 MiB / not usable 8.00 MiB 
-            32504832 sda2 +  Allocatable           yes  
-   8       16    4194304 sdb +  PE Size               8.00 MiB 
-  11        0    1048575 sr0 +  Total PE              24 
- 253        0   29143040 dm-0 +  Free PE               10 
- 253        1    3358720 dm-1+  Allocated PE          14 
 +  PV UUID               lxuKRI-l3Dd-jhsv-OWtw-au2c-0ti0-XGnt1E 
 +    
 +  --- Physical Segments --- 
 +  Physical extent 0 to 0: 
 +    Logical volume /dev/vg0/lv1_rmeta_0 
 +    Logical extents 0 to 0 
 +  Physical extent to 13: 
 +    Logical volume /dev/vg0/lv1_rimage_0 
 +    Logical extents 0 to 12 
 +  Physical extent 14 to 23: 
 +    FREE 
 +    
 +  --- Physical volume --- 
 +  PV Name               /dev/sdb7 
 +  VG Name               vg0 
 +  PV Size               300.00 MiB / not usable 4.00 MiB 
 +  Allocatable           yes  
 +  PE Size               8.00 MiB 
 +  Total PE              37 
 +  Free PE               23 
 +  Allocated PE          14 
 +  PV UUID               QDmfcX-Pv8o-hapq-TJOI-RaPH-qecT-VUMY4v 
 +    
 +  --- Physical Segments --- 
 +  Physical extent 0 to 0: 
 +    Logical volume /dev/vg0/lv1_rmeta_1 
 +    Logical extents 0 to 0 
 +  Physical extent 1 to 13: 
 +    Logical volume /dev/vg0/lv1_rimage_1 
 +    Logical extents to 12 
 +  Physical extent 14 to 36: 
 +    FREE 
 +    
 +  --- Physical volume --- 
 +  PV Name               /dev/sdb9 
 +  VG Name               vg0 
 +  PV Size               400.00 MiB / not usable 8.00 MiB 
 +  Allocatable           yes  
 +  PE Size               8.00 MiB 
 +  Total PE              49 
 +  Free PE               49 
 +  Allocated PE          0 
 +  PV UUID               ZTQV1b-Ha76-BQtB-zJEU-kfyK-ausJ-CxnRwg 
 +    
 +  --- Physical Segments --- 
 +  Physical extent to 48: 
 +    FREE
 </code> </code>
  
-==Espaces de pagination==+La suppression du miroir se fait en utilisant la commande **lvconvert** en indiquant quel volume physique doit être vidé de son contenu :
  
 <code> <code>
-[root@centos8 ~]# cat /proc/swaps +[root@centos8 ~]# lvconvert -m 0 /dev/vg0/lv1 /dev/sdb7 
-Filename                                Type            Size    Used    Priority +Are you sure you want to convert raid1 LV vg0/lv1 to type linear losing all resilience? [y/n]: y 
-/dev/dm-1                               partition       3358716 0       -2+  Logical volume vg0/lv1 successfully converted.
 </code> </code>
  
-==Statistiques d'utilisation du processeur==+De même, il est possible de créer un miroir pour un volume logique existant :
  
 <code> <code>
-[root@centos8 ~]# cat /proc/loadavg +[root@centos8 ~]# lvconvert -m 1 /dev/vg0/lv1 
-0.00 0.00 0.00 1/697 16936+Are you sure you want to convert linear LV vg0/lv1 to raid1 with 2 images enhancing resilience? [y/n]: y 
 +  Logical volume vg0/lv1 successfully converted.
 </code> </code>
  
-==Statistiques d'utilisation de la mémoire==+Supprimez de nouveau votre miroir :
  
 <code> <code>
-[root@centos8 ~]# cat /proc/meminfo +[root@centos8 ~]# lvconvert -m 0 /dev/vg0/lv1 /dev/sdb7 
-MemTotal       3825032 kB +Are you sure you want to convert raid1 LV vg0/lv1 to type linear losing all resilience? [y/n]y 
-MemFree:         1862116 kB +  Logical volume vg0/lv1 successfully converted.
-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>
  
-==Version du noyau==+Les options de la commande **lvconvert** sont :
  
 <code> <code>
-[root@centos8 ~]# cat /proc/version +[root@centos8 ~]# lvconvert --help 
-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 +  lvconvert - Change logical volume layout
-</code>+
  
-===Répertoires===+  Convert LV to linear. 
 +  lvconvert --type linear LV 
 + [ COMMON_OPTIONS ] 
 + [ PV ... ]
  
-==ide/scsi==+  Convert LV to striped. 
 +  lvconvert --type striped LV 
 + [ -I|--stripesize Size[k|UNIT] ] 
 + [ -R|--regionsize Size[m|UNIT] ] 
 + [ -i|--interval Number ] 
 + [    --stripes Number ] 
 + [ COMMON_OPTIONS ] 
 + [ PV ... ]
  
-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.+  Convert LV to type mirror (also see type raid1), 
 +  lvconvert --type mirror LV 
 + [ -m|--mirrors [+|-]Number ] 
 + [ -I|--stripesize Size[k|UNIT] ] 
 + [ -R|--regionsize Size[m|UNIT] ] 
 + [ -i|--interval Number ] 
 + [    --stripes Number ] 
 + [    --mirrorlog core|disk ] 
 + [ COMMON_OPTIONS ] 
 + [ PV ..]
  
-==acpi==+  Convert LV to raid or change raid layout  
 +  (a specific raid level must be used, e.g. raid1). 
 +  lvconvert --type raid LV 
 + [ -m|--mirrors [+|-]Number ] 
 + [ -I|--stripesize Size[k|UNIT] ] 
 + [ -R|--regionsize Size[m|UNIT] ] 
 + [ -i|--interval Number ] 
 + [    --stripes Number ] 
 + [ COMMON_OPTIONS ] 
 + [ PV ... ]
  
-Ce répertoire contient des informations sur la gestion de l'énérgieles températures, les vitesses de ventilateurs, la charge des batteries.+  Convert LV to raid1 or mirroror change number of mirror images. 
 +  lvconvert -m|--mirrors [+|-]Number LV 
 + [ -R|--regionsize Size[m|UNIT] ] 
 + [ -i|--interval Number ] 
 + [    --mirrorlog core|disk ] 
 + [ COMMON_OPTIONS ] 
 + [ PV ..]
  
-==bus==+  Convert raid LV to change number of stripe images. 
 +  lvconvert --stripes Number LV_raid 
 + [ -i|--interval Number ] 
 + [ -R|--regionsize Size[m|UNIT] ] 
 + [ -I|--stripesize Size[k|UNIT] ] 
 + [ COMMON_OPTIONS ] 
 + [ PV ... ]
  
-Ce répertoire contient un sous-répertoire par bus.+  Convert raid LV to change the stripe size. 
 +  lvconvert -I|--stripesize Size[k|UNIT] LV_raid 
 + [ -i|--interval Number ] 
 + [ -R|--regionsize Size[m|UNIT] ] 
 + [ COMMON_OPTIONS ]
  
-==net==+  Split images from a raid1 or mirror LV and use them to create a new LV. 
 +  lvconvert --splitmirrors Number -n|--name LV_new LV_cache_mirror_raid1 
 + [ COMMON_OPTIONS ] 
 + [ PV ... ]
  
-Ce répertoire contient des informations sur le réseau.+  Split images from a raid1 LV and track changes to origin for later merge. 
 +  lvconvert --splitmirrors Number --trackchanges LV_cache_raid1 
 + [ COMMON_OPTIONS ] 
 + [ PV ... ]
  
-==sys==+  Merge LV images that were split from a raid1 LV. 
 +  lvconvert --mergemirrors VG|LV_linear_raid|Tag ... 
 + [ COMMON_OPTIONS ]
  
-Ce répertoire contient des paramètres du noyauCertains 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 :+  Convert LV to a thin LV, using the original LV as an external origin. 
 +  lvconvert --type thin --thinpool LV LV_linear_striped_thin_cache_raid 
 + [ -T|--thin ] 
 + [ -r|--readahead auto|none|Number ] 
 + [ -c|--chunksize Size[k|UNIT] ] 
 + [ -Z|--zero y|n ] 
 + [    --originname LV_new ] 
 + [    --poolmetadata LV ] 
 + [    --poolmetadatasize Size[m|UNIT] ] 
 + [    --poolmetadataspare y|n ] 
 + [    --metadataprofile String ] 
 + [ COMMON_OPTIONS ]
  
-  # echo > /proc/sys/net/ipv4/icmp_echo_ignore_all [Entrée]+  Attach a cache pool to an LV, converts the LV to type cache. 
 +  lvconvert --type cache --cachepool LV LV_linear_striped_thinpool_vdo_vdopool_vdopooldata_raid 
 + [ -H|--cache ] 
 + [ -Z|--zero y|n ] 
 + [ -r|--readahead auto|none|Number ] 
 + [ -c|--chunksize Size[k|UNIT] ] 
 + [    --cachemetadataformat auto|1|2 ] 
 + [    --cachemode writethrough|writeback|passthrough ] 
 + [    --cachepolicy String ] 
 + [    --cachesettings String ] 
 + [    --poolmetadata LV ] 
 + [    --poolmetadatasize Size[m|UNIT] ] 
 + [    --poolmetadataspare y|n ] 
 + [    --metadataprofile String ] 
 + COMMON_OPTIONS ]
  
-Cette commande pour résultat d'ignorer les reqûetes ping.+  Attach writecache to an LV, converts the LV to type writecache. 
 +  lvconvert --type writecache --cachevol LV LV_linear_striped_raid 
 + [    --cachesettings String ] 
 + [ COMMON_OPTIONS ]
  
-====2.2 - Utilisation de la Commande sysctl====+  Attach a cache to an LV, converts the LV to type cache. 
 +  lvconvert --type cache --cachevol LV LV_linear_striped_thinpool_raid 
 + [ -H|--cache ] 
 + [ -Z|--zero y|n ] 
 + [ -c|--chunksize Size[k|UNIT] ] 
 + [    --cachemetadataformat auto|1|
 + [    --cachemode writethrough|writeback|passthrough ] 
 + [    --cachepolicy String ] 
 + [    --cachesettings String ] 
 + [    --poolmetadatasize Size[m|UNIT] ] 
 + [ COMMON_OPTIONS ]
  
-Les fichiers dans le répertoire **/proc/sys** peuvent être administrés par la commande **sysctl** en temps réel+  Add a writecache to an LV, using a specified cache device. 
 +  lvconvert --type writecache --cachedevice PV LV_linear_striped_raid 
 + [    --cachesize Size[m|UNIT] ] 
 + [    --cachesettings String ] 
 + [ COMMON_OPTIONS ]
  
-La commande **sysctl** applique les règles consignés dans le fichier **/etc/sysctl.conf** au démarrage de la machine.+  Add a cache to an LV, using a specified cache device. 
 +  lvconvert --type cache --cachedevice PV LV_linear_striped_thinpool_raid 
 + [    --cachesize Size[m|UNIT] ] 
 + [    --cachesettings String ] 
 + [ COMMON_OPTIONS ]
  
-Saisissez la commande :+  Convert LV to type thin-pool. 
 +  lvconvert --type thin-pool LV_linear_striped_cache_raid 
 + [ -I|--stripesize Size[k|UNIT] ] 
 + [ -r|--readahead auto|none|Number ] 
 + [ -c|--chunksize Size[k|UNIT] ] 
 + [ -Z|--zero y|n ] 
 + [    --stripes Number ] 
 + [    --discards passdown|nopassdown|ignore ] 
 + [    --poolmetadata LV ] 
 + [    --poolmetadatasize Size[m|UNIT] ] 
 + [    --poolmetadataspare y|n ] 
 + [    --metadataprofile String ] 
 + [ COMMON_OPTIONS ] 
 + [ PV ... ]
  
-<code> +  Convert LV to type cache-pool. 
-[root@centos8 ~]# cat /etc/sysctl.conf +  lvconvert --type cache-pool LV_linear_striped_raid 
-# sysctl settings are defined through files in +-Z|--zero y|n 
-# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/. + [ -r|--readahead auto|none|Number ] 
-# + [ -c|--chunksize Size[k|UNIT] ] 
-# Vendors settings live in /usr/lib/sysctl.d/. + [    --cachemetadataformat auto|1|2 ] 
-# To override a whole file, create a new file with the same in + [    --cachemode writethrough|writeback|passthrough ] 
-# /etc/sysctl.d/ and put new settings there. To override + [    --cachepolicy String ] 
-# only specific settings, add a file with a lexically later + [    --cachesettings String ] 
-# name in /etc/sysctl.d/ and put new settings there. + [    --poolmetadata LV ] 
-# + [    --poolmetadatasize Size[m|UNIT] ] 
-# For more information, see sysctl.conf(5) and sysctl.d(5).+ [    --poolmetadataspare y|n ] 
 + [    --metadataprofile String ] 
 + [ COMMON_OPTIONS ] 
 + [ PV ... ]
  
-[root@centos8 ~]# ls -l /etc/sysctl.d/ +  Convert LV to type vdopool
-total 0 +  lvconvert --type vdo-pool LV_linear_striped_cache_raid 
-lrwxrwxrwx. 1 root root 14 Mar 16 15:42 99-sysctl.conf -> ../sysctl.conf + -n|--name LV_new ] 
-[root@centos8 ~]# ls -l /usr/lib/sysctl.d/ + -V|--virtualsize Size[m|UNIT] ] 
-total 24 + [    --compression y|n ] 
--rw-r--r--. 1 root root 1810 Dec 22  2020 10-default-yama-scope.conf + [    --deduplication y|n ] 
--rw-r--r--. 1 root root  524 Mar 16 15:42 50-coredump.conf + [ COMMON_OPTIONS ]
--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  +  Detach a cache from an LV
- This file is part of systemd. +  lvconvert --splitcache LV_thinpool_cache_cachepool_vdopool_writecache 
-+ [ COMMON_OPTIONS ]
-#  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.+  Merge thin LV into its origin LV. 
 +  lvconvert --mergethin LV_thin ... 
 + [ COMMON_OPTIONS ]
  
-# To override settings in this file, create a local file in /etc +  Merge COW snapshot LV into its origin. 
-# (e.g/etc/sysctl.d/90-override.conf), and put any assignments +  lvconvert --mergesnapshot LV_snapshot ... 
-# there.+-i|--interval Number ] 
 + [ COMMON_OPTIONS ]
  
-# System Request functionality of the kernel (SYNC+  Combine a former COW snapshot (second argwith a former  
-+  origin LV (first arg) to reverse a splitsnapshot command
-# Use kernel.sysrq = 1 to allow all keys+  lvconvert --type snapshot LV LV_linear_striped 
-# See https://www.kernel.org/doc/html/latest/admin-guide/sysrq.html for a list + [ -s|--snapshot ] 
-# of values and keys. + [ -c|--chunksize Size[k|UNIT] ] 
-kernel.sysrq = 16+ [ -Z|--zero y|n ] 
 + [ COMMON_OPTIONS ]
  
-# Append the PID to the core filename +  Replace failed PVs in a raid or mirror LV.  
-kernel.core_uses_pid = 1+  Repair a thin pool.  
 +  Repair a cache pool. 
 +  lvconvert --repair LV_thinpool_cache_cachepool_mirror_raid 
 + [ -i|--interval Number ] 
 + [    --usepolicies ] 
 + [    --poolmetadataspare y|n ] 
 + [ COMMON_OPTIONS ] 
 + [ PV ..]
  
-# https://bugzilla.redhat.com/show_bug.cgi?id=1689346 +  Replace specific PV(s) in a raid LV with another PV. 
-kernel.kptr_restrict = 1+  lvconvert --replace PV LV_raid 
 + [ COMMON_OPTIONS ] 
 + [ PV ... ]
  
-# Source route verification +  Poll LV to continue conversion. 
-net.ipv4.conf.all.rp_filter = 1+  lvconvert --startpoll LV_mirror_raid 
 + [ COMMON_OPTIONS ]
  
-# Do not accept source routing +  Add or remove data integrity checksums to raid images. 
-net.ipv4.conf.all.accept_source_route = 0+  lvconvert --raidintegrity y|n LV_raid 
 + [    --raidintegritymode String ] 
 + [    --raidintegrityblocksize Number ] 
 + [ COMMON_OPTIONS ] 
 + [ PV ... ]
  
-# Promote secondary addresses when the primary address is removed +  Common options for command: 
-net.ipv4.conf.all.promote_secondaries = 1+ [ -b|--background ] 
 + [ -f|--force ] 
 + [    --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit ] 
 + [    --noudevsync ]
  
-# Fair Queue CoDel packet scheduler to fight bufferbloat +  Common options for lvm: 
-net.core.default_qdisc = fq_codel+ [ -d|--debug ] 
 + [ -h|--help ] 
 + [ -q|--quiet ] 
 + [ -v|--verbose ] 
 + [ -y|--yes ] 
 + [ -t|--test ] 
 + [    --commandprofile String ] 
 + [    --config String ] 
 + [    --driverloaded y|n ] 
 + [    --nolocking ] 
 + [    --lockopt String ] 
 + [    --longhelp ] 
 + [    --profile String ] 
 + [    --version ]
  
-# Enable hard and soft link protection +  Use --longhelp to show all options and advanced commands.
-fs.protected_hardlinks = 1 +
-fs.protected_symlinks = 1+
 </code> </code>
  
-Les options de la commande **sysctl** sont :+====LAB #8 - Modifier les Attributs LVM==== 
 + 
 +En cas de présence d'un miroir, la commande **lvs** indique la présence du miroir dans la colonne **Attr** avec la lettre **m** :
  
 <code> <code>
-[root@centos8 ~]# sysctl --help+[root@centos8 ~]# lvs 
 +  LV   VG         Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert 
 +  root cl_centos8 -wi-ao----  27.79g                                                     
 +  swap cl_centos8 -wi-ao----   3.20g                                                     
 +  lv1  vg0        -wi-a----- 104.00m                                                                                                  
 +</code>
  
-Usage: +<WRAP center round important 60%> 
- sysctl [options] [variable[=value] ...]+Consultez **[[http://www.unixarena.com/2013/08/redhat-linux-lvm-volume-attributes.html|cette page]]** pour comprendre les attributs. 
 +</WRAP>
  
-Options: +La commande equivalente pour les Volume Groups est **vgs** :
-  -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 +<code> 
- -V, --version  output version information and exit +[root@centos8 ~]# vgs 
- +  VG         #PV #LV #SN Attr   VSize   VFree   
-For more details see sysctl(8).+  cl_centos8       0 wz--n<31.00g      0  
 +  vg0          3     0 wz--n880.00m 776.00m
 </code> </code>
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**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.+Consultez **[[http://www.unixarena.com/2013/08/redhat-linux-lvm-volume-attributes.html|cette page]]** pour comprendre les attributs.
 </WRAP> </WRAP>
  
-=====LAB#3 - Interprétation des informations dans /proc=====+La commande equivalente pour les Physical Volumes est **pvs** :
  
-Les informations brutes stockées dans /proc peuvent être interprétées grâce à l'utilisation des commandes dites de //gestion des performances// :+<code> 
 +[root@centos8 ~]# pvs 
 +  PV         VG         Fmt  Attr PSize   PFree   
 +  /dev/sda2  cl_centos8 lvm2 a--  <31.00g      0  
 +  /dev/sdb6  vg0        lvm2 a--  192.00m  88.00m 
 +  /dev/sdb7  vg0        lvm2 a--  296.00m 296.00m 
 +  /dev/sdb9  vg0        lvm2 a--  392.00m 392.00m     
 +</code>
  
-  * free, +<WRAP center round important 60%> 
-  uptime et w, +Consultez **[[http://www.unixarena.com/2013/08/redhat-linux-lvm-volume-attributes.html|cette page]]** pour comprendre les attributs. 
-  iostat, +</WRAP>
-  hdparm, +
-  vmstat, +
-  * mpstat, +
-  * sar.+
  
-====3.1 - La Commande free====+Les commandes **lvchange**, **vgchange** et **pvchange** permettent de modifier les attributs des Logical Volumes, Volume Groups et Physical Volumes respectivement.
  
-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 :+Par exemple, pour rendre inutilisable un Logical Volume, il convient d'enlever l'attribut **a** :
  
 <code> <code>
-[root@centos8 ~]# free -+[root@centos8 ~]# lvchange -a n /dev/vg0/lv1
-              total        used        free      shared  buff/cache   available +
-Mem:           3735        1135        1818          14         782        2363 +
-Swap:          3279                  3279+
 </code> </code>
  
-Dans le cas de cet exemple, nous pouvons constater que l’affichage montre :+Pour faire l'inverse il convient de saisir la commande suivante :
  
-  * 3735 Mo de mémoire physique totale, +<code> 
-  * 1135 Mo de mémoire physique utilisée et 1818 Mo de mémoire physique libre, +[root@centos8 ~]# lvchange -a y /dev/vg0/lv1 
-  * 3279 Mo de mémoire swap totale et 0 Mo de swap utilisé+</code>
  
-Les options de cette commande sont :+Les options de la commande **lvchange** sont :
  
 <code> <code>
-[root@centos8 ~]# free --help+[root@centos8 ~]# lvchange --help 
 +  lvchange - Change the attributes of logical volume(s)
  
-Usage+  Change a general LV attribute.  
- free [options]+  For options listed in parentheses, any one is  
 +  required, after which the others are optional. 
 +  lvchange 
 + ( -C|--contiguous y|n, 
 +   -p|--permission rw|r, 
 +   -r|--readahead auto|none|Number, 
 +   -k|--setactivationskip y|n, 
 +   -Z|--zero y|n, 
 +   -M|--persistent n, 
 +      --addtag Tag, 
 +      --deltag Tag, 
 +      --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit, 
 +      --compression y|n, 
 +      --deduplication y|n, 
 +      --detachprofile, 
 +      --metadataprofile String, 
 +      --profile String, 
 +      --errorwhenfull y|n, 
 +      --discards passdown|nopassdown|ignore, 
 +      --cachemode writethrough|writeback|passthrough, 
 +      --cachepolicy String, 
 +      --cachesettings String, 
 +      --minrecoveryrate Size[k|UNIT], 
 +      --maxrecoveryrate Size[k|UNIT], 
 +      --writebehind Number, 
 +      --writemostly PV[:t|n|y] ) 
 + VG|LV|Tag|Select ... 
 +-a|--activate y|n|ay ] 
 + [    --poll y|n ] 
 + [    --monitor y|n ] 
 + [ COMMON_OPTIONS ]
  
-Options: +  Resyncronize a mirror or raid LV.  
- -b, --bytes         show output in bytes +  Use to reset 'R' attribute on a not initially synchronized LV. 
-     --kilo          show output in kilobytes +  lvchange --resync VG|LV_mirror_raid|Tag|Select ... 
-     --mega          show output in megabytes + -a|--activate y|n|ay ] 
-     --giga          show output in gigabytes + [ COMMON_OPTIONS ]
-     --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 +  Resynchronize or check a raid LV. 
- -V, --version  output version information and exit+  lvchange --syncaction check|repair VG|LV_raid|Tag|Select ... 
 + [ COMMON_OPTIONS ]
  
-For more details see free(1).+  Reconstruct data on specific PVs of a raid LV. 
 +  lvchange --rebuild PV VG|LV_raid|Tag|Select ... 
 + [ COMMON_OPTIONS ] 
 + 
 +  Activate or deactivate an LV. 
 +  lvchange -a|--activate y|n|ay VG|LV|Tag|Select ... 
 + [ -P|--partial ] 
 + [ -K|--ignoreactivationskip ] 
 + [    --activationmode partial|degraded|complete ] 
 + [    --poll y|n ] 
 + [    --monitor y|n ] 
 + [    --ignorelockingfailure ] 
 + [    --sysinit ] 
 + [    --readonly ] 
 + [ COMMON_OPTIONS ] 
 + 
 +  Reactivate an LV using the latest metadata. 
 +  lvchange --refresh VG|LV|Tag|Select ... 
 + [ -P|--partial ] 
 + [    --activationmode partial|degraded|complete ] 
 + [    --poll y|n ] 
 + [    --monitor y|n ] 
 + [ COMMON_OPTIONS ] 
 + 
 +  Start or stop monitoring an LV from dmeventd. 
 +  lvchange --monitor y|n VG|LV|Tag|Select ... 
 + [ COMMON_OPTIONS ] 
 + 
 +  Start or stop processing an LV conversion. 
 +  lvchange --poll y|n VG|LV|Tag|Select ... 
 + [    --monitor y|n ] 
 + [ COMMON_OPTIONS ] 
 + 
 +  Make the minor device number persistent for an LV. 
 +  lvchange -M|--persistent y --minor Number LV 
 + [ -j|--major Number ] 
 + [ -a|--activate y|n|ay ] 
 + [    --poll y|n ] 
 + [    --monitor y|n ] 
 + [ COMMON_OPTIONS ] 
 + 
 +  Common options for command: 
 + [ -A|--autobackup y|n ] 
 + [ -f|--force ] 
 + [ -S|--select String ] 
 + [    --ignoremonitoring ] 
 + [    --noudevsync ] 
 + [    --reportformat basic|json ] 
 + 
 +  Common options for lvm: 
 + [ -d|--debug ] 
 + [ -h|--help ] 
 + [ -q|--quiet ] 
 + [ -v|--verbose ] 
 + [ -y|--yes ] 
 + [ -t|--test ] 
 + [    --commandprofile String ] 
 + [    --config String ] 
 + [    --driverloaded y|n ] 
 + [    --nolocking ] 
 + [    --lockopt String ] 
 + [    --longhelp ] 
 + [    --profile String ] 
 + [    --version ] 
 + 
 +  Use --longhelp to show all options and advanced commands.
 </code> </code>
  
-====3.2 Les Commandes uptime et w====+====LAB #9 Volumes Logiques en Bandes==== 
 + 
 +Un volume logique en bandes est créé pour augmenter, comme dans le cas du RAID, les performances des entrées et sorties. Pour créer ce volume, la commande **lvcreate** prend deux option supplémentaires : 
 + 
 +  * **-i** - indique le nombre de volumes de bandes, 
 +  * **-I** - indique la taille en Ko de chaque bande.
  
-Chacune des ces commandes indique la charge moyenne du ou des processeurs depuis 1 minute, 5 minutes et 15 minutes :+Saisissez donc la commande suivante :
  
 <code> <code>
-[root@centos8 ~]# uptime +[root@centos8 ~]# lvcreate -i2 -I64 -n lv2 -L 100M vg0 /dev/sdb7 /dev/sdb9 
- 04:39:03 up 1 day,  2:34,  1 user,  load average: 0.00, 0.00, 0.00 +  Rounding up size to full physical extent 104.00 MiB 
-  +  Rounding size 104.00 MiB (13 extents) up to stripe boundary size 112.00 MiB(14 extents)
-[root@centos8 ~]# w +  Logical volume "lv2" created.
- 04:39:04 up 1 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> </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.+Constatez la présence de vos bandes sur /dev/sda7 et sur /dev/sda9 :
  
-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 :+<code> 
 +[root@centos8 ~]# lvdisplay -m /dev/vg0/lv2 
 +  --- Logical volume --- 
 +  LV Path                /dev/vg0/lv2 
 +  LV Name                lv2 
 +  VG Name                vg0 
 +  LV UUID                MmXbPt-ZF8u-rnIv-3YU9-m64J-RCz2-6NzAuG 
 +  LV Write Access        read/write 
 +  LV Creation hosttime centos8.ittraining.loc, 2021-06-02 07:47:38 -0400 
 +  LV Status              available 
 +  # open                 0 
 +  LV Size                112.00 MiB 
 +  Current LE             14 
 +  Segments               1 
 +  Allocation             inherit 
 +  Read ahead sectors     auto 
 +  - currently set to     8192 
 +  Block device           253:
 +    
 +  --- Segments --- 
 +  Logical extents 0 to 13: 
 +    Type striped 
 +    Stripes 2 
 +    Stripe size 64.00 KiB 
 +    Stripe 0: 
 +      Physical volume /dev/sdb7 
 +      Physical extents 0 to 6 
 +    Stripe 1: 
 +      Physical volume /dev/sdb9 
 +      Physical extents 0 to 6
  
-  * 2,48 processus en attente dans la dernière minute, +</code>
-  * 3,00 processus en attente dans les dernières 5 minutes, +
-  * 2,85 processus en attente dans les dernières 15 minutes.+
  
-Les options de ces commandes sont :+Utilisez maintenant la commande **lvs** pour visualiser les volumes physiques utilisés par le volume logique :
  
 <code> <code>
-[root@centos8 ~]# uptime --help+[root@centos8 ~]# lvs -o +devices 
 +  LV   VG         Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices                   
 +  root cl_centos8 -wi-ao----  27.79g                                                     /dev/sda2(820)            
 +  swap cl_centos8 -wi-ao----   3.20g                                                     /dev/sda2(0)              
 +  lv1  vg0        -wi-a----- 104.00m                                                     /dev/sdb6(1)              
 +  lv2  vg0        -wi-a----- 112.00m                                                     /dev/sdb7(0),/dev/sdb9(0) 
 +</code>
  
-Usage: +====LAB #10 - Gérer les Métadonnées====
- uptime [options]+
  
-Options: +Les métadonnées pour chaque Volume Group sont stockés dans un fichier texte au nom du Volume Group dans le répertoire **/etc/lvm/backup** :
- -p, --pretty   show uptime in pretty format +
- -h, --help     display this help and exit +
- -s, --since    system up since +
- -V, --version  output version information and exit+
  
-For more details see uptime(1).+<code> 
 +[root@centos8 ~]# cat /etc/lvm/backup/vg0 
 +# Generated by LVM2 version 2.03.09(2)-RHEL8 (2020-05-28): Wed Jun  2 07:47:38 2021
  
-[root@centos8 ~]# w --help+contents = "Text Format Volume Group" 
 +version = 1
  
-Usage: +description = "Created *after* executing 'lvcreate -i2 -I64 -n lv2 -L 100M vg0 /dev/sdb7 /dev/sdb9'"
- w [options]+
  
-Options+creation_host = "centos8.ittraining.loc" # Linux centos8.ittraining.loc 4.18.0-240.22.1.el8_3.x86_64 #1 SMP Thu Apr 8 19:01:30 UTC 2021 x86_64 
- -h, --no-header     do not print header +creation_time = 1622634458 # Wed Jun  2 07:47:38 2021
- -u, --no-current    ignore current process username +
- -s, --short         short format +
- -f, --from          show remote hostname field +
- -o, --old-style     old style output +
- -i, --ip-addr       display IP address instead of hostname (if possible)+
  
-     --help     display this help and exit +vg0 { 
- -V, --version  output version information and exit+ id = "TDXUip-c3yg-J83l-Z30x-zcsJ-Rbvl-gjFvfd" 
 + seqno = 11 
 + format = "lvm2" # informational 
 + status = ["RESIZEABLE", "READ", "WRITE"
 + flags = [] 
 + extent_size = 16384 # 8 Megabytes 
 + max_lv = 0 
 + max_pv = 0 
 + metadata_copies = 0
  
-For more details see w(1). + physical_volumes {
-</code>+
  
-====3.3 La Commande iostat====+ pv0 { 
 + id "lxuKRI-l3Dd-jhsv-OWtw-au2c-0ti0-XGnt1E" 
 + device "/dev/sdb6" # Hint only
  
-La commande **iostat** affiche des statistiques sur l'utilisation des disques, des terminaux et des lecteurs de cartouche :+ status = ["ALLOCATABLE"
 + flags = [] 
 + dev_size = 409600 # 200 Megabytes 
 + pe_start = 2048 
 + pe_count = 24 # 192 Megabytes 
 + }
  
-<code> + pv1 { 
-[root@centos8 ~]# iostat + id = "QDmfcX-Pv8o-hapq-TJOI-RaPH-qecT-VUMY4v" 
-bash: iostat: command not found... + device = "/dev/sdb7" # Hint only
-Install package 'sysstat' to provide command 'iostat'? [N/y] y+
  
 + status = ["ALLOCATABLE"]
 + flags = []
 + dev_size = 614400 # 300 Megabytes
 + pe_start = 2048
 + pe_count = 37 # 296 Megabytes
 + }
  
- * Waiting in queue...  + pv2 { 
-The following packages have to be installed: + id = "ZTQV1b-Ha76-BQtB-zJEU-kfyK-ausJ-CxnRwg" 
- lm_sensors-libs-3.4.0-22.20180522git70f7e08.el8.x86_64 Lm_sensors core libraries + device = "/dev/sdb9" # Hint only
- sysstat-11.7.3-5.el8.x86_64    Collection of performance monitoring tools for Linux +
-Proceed with changes? [N/y] y+
  
 + status = ["ALLOCATABLE"]
 + flags = []
 + dev_size = 819200 # 400 Megabytes
 + pe_start = 2048
 + pe_count = 49 # 392 Megabytes
 + }
 + }
  
- * Waiting in queue...  + logical_volumes {
- * 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 + lv1 { 
-           0.03    0.00    0.03    0.01    0.00   99.93+ id = "lJQQWs-n05T-pxzi-Zq2R-UzRI-kYZf-hsNPYQ" 
 + status = ["READ", "WRITE", "VISIBLE"
 + flags = [] 
 + creation_time = 1622633848 # 2021-06-02 07:37:28 -0400 
 + creation_host = "centos8.ittraining.loc" 
 + segment_count = 1
  
-Device             tps    kB_read/   kB_wrtn/   kB_read    kB_wrtn + segment1 { 
-sda               0.28         7.67         1.49     735338     142510 + start_extent = 
-sdb               0.00         0.03         0.00       2995          0 + extent_count = 13 # 104 Megabytes
-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 :+ type = "striped" 
 + stripe_count = 1 # linear
  
-  * **%user** - Pourcentage de temps passé en mode utilisateur (exécutant des applicationsetc.) + stripes = [ 
-  * **%nice** - Pourcentage de temps passé en mode utilisateur (pour les processus qui ont modifié leur priorité de programmation à l'aide de la commande nice) + "pv0"1 
-  * **%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.+ lv2 { 
 + id = "MmXbPt-ZF8u-rnIv-3YU9-m64J-RCz2-6NzAuG" 
 + status = ["READ""WRITE", "VISIBLE"
 + flags = [] 
 + creation_time = 1622634458 # 2021-06-02 07:47:38 -0400 
 + creation_host = "centos8.ittraining.loc" 
 + segment_count = 1
  
-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 :+ segment1 { 
 + start_extent = 0 
 + extent_count = 14 # 112 Megabytes
  
-  * La spécification du périphérique. + type = "striped" 
-  * Le nombre de transferts (ou opérations d'E/S) par seconde. + stripe_count = 2 
-  * Le nombre de blocs de KB lus par seconde. + stripe_size = 128 # 64 Kilobytes
-  * 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> + stripes = 
-[root@centos8 ~]# iostat -d -x + "pv1", 0
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        30/06/21        _x86_64_        (8 CPU)+ "pv2",
 +
 +
 +
 + }
  
-Device            r/s     w/    rkB/    wkB/  rrqm/  wrqm/ %rrqm  %wrqm r_await w_await aqu-sz rareq-sz wareq-sz  svctm  %util +}
-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 +
-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 +
-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 +
-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> </code>
  
-Les options de cette commande sont :+Des archives sont créées lors de chaque modification d'un groupe de volumes et elles sont placés dans le répertoire **/etc/lvm/archives** :
  
 <code> <code>
-[root@centos8 ~]# iostat --help +[root@centos8 ~]# ls /etc/lvm/archive/ 
-Usage: iostat [ options ] [ <interval> [ <count> ] ] +vg0_00000-427117660.vg   vg0_00002-2064899457.vg  vg0_00004-5061041.vg    vg0_00006-1956284179.vg  vg0_00008-708301076.vg   vg0_00010-1200598227.vg  vg0_00012-854342401.vg 
-Options are: +vg0_00001-1993147316.vg  vg0_00003-1757437978.vg  vg0_00005-116946854.vg  vg0_00007-1006758937.vg  vg0_00009-1054420117.vg  vg0_00011-973084311.vg
--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> </code>
  
-====3.4 - La Commande hdparm====+La commande **vgcfgbackup** est utilisée pour sauvegarder les métadonnées manuellement dans le fichier **/etc/lvm/backup/nom_du_volume_group** :
  
-Pour surveiller la vitesse des entrées et des sorties du disque, vous pouvez utiliser la commande **hdparm** :+La commande **vgcfgrestore** permet de restaurer une sauvegarde. Sans l'option **-f** pour spécifier la sauvegarde à restaurer, cette commande renvoie la liste des sauvegardes disponibles :
  
 <code> <code>
-[root@centos8 ~]# hdparm -t /dev/sda +[root@centos8 ~]# vgcfgbackup vg0 
- +  Volume group "vg0" successfully backed up.
-/dev/sda: +
- Timing buffered disk reads: 1410 MB in  3.00 seconds = 469.98 MB/sec+
 </code> </code>
  
-====3.5 - La Commande vmstat==== +Il est aussi possible de modifier l'emplacement de la sauvegarde avec l'option **-f** de la commande :
- +
-La commande **vmstat** affiche des statistiques sur la mémoire, la pagination et la charge ponctuelle du processeur :+
  
 <code> <code>
-[root@centos8 ~]# vmstat 1 10 +[root@centos8 ~]# vgcfgbackup -f /tmp/vg0_backup vg0 
-procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----+  Volume group "vg0" successfully backed up.
- r  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> </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.+Par contre, toute sauvegarde en dehors des répertoires par défaut n'est pas visible dans la sortie de la commande **vgcfgrestore --list** :
  
-Les champs relatifs aux processus sont les suivants :+<code> 
 +[root@centos8 ~]# vgcfgrestore --list vg0 
 +    
 +  File: /etc/lvm/archive/vg0_00000-427117660.vg 
 +  VG name:    vg0 
 +  Description: Created *before* executing 'vgcreate -s 8M vg0 /dev/sdb6 /dev/sdb7 /dev/sdb9' 
 +  Backup Time: Wed May 26 10:43:14 2021
  
-  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+  File: /etc/lvm/archive/vg0_00001-1993147316.vg 
 +  VG name:    vg0 
 +  Description: Created *before* executing 'lvcreate -L 350 -n lv0 vg0
 +  Backup Time: Wed May 26 16:56:31 2021
  
-Les champs relatifs à la mémoire sont les suivants :+    
 +  File: /etc/lvm/archive/vg0_00002-2064899457.vg 
 +  VG name:    vg0 
 +  Description: Created *before* executing 'lvextend -L +100M /dev/vg0/lv0' 
 +  Backup Time: Wed May 26 22:12:15 2021
  
-  * swpd — La quantité de mémoire virtuelle utilisée +    
-  * free — La quantité de mémoire libre +  File: /etc/lvm/archive/vg0_00003-1757437978.vg 
-  * buff — La quantité de mémoire utilisée par les tampons (ou buffers) +  VG name:    vg0 
-  * cache — La quantité de mémoire utilisée comme cache de pages+  Description: Created *before* executing 'lvcreate -s -L 13M -n testsnap /dev/vg0/lv0' 
 +  Backup Time: Wed May 26 22:19:25 2021
  
-Les champs relatifs au swap sont les suivants :+    
 +  File: /etc/lvm/archive/vg0_00004-5061041.vg 
 +  VG name:    vg0 
 +  Description: Created *before* executing 'lvremove /dev/vg0/testsnap' 
 +  Backup Time: Wed May 26 22:38:37 2021
  
-  * si — La quantité de mémoire chargée depuis le disque +    
-  * so — La quantité de mémoire déchargée sur le disque+  File: /etc/lvm/archive/vg0_00005-116946854.vg 
 +  VG name:    vg0 
 +  Description: Created *before* executing 'lvremove /dev/vg0/lv0' 
 +  Backup Time: Wed May 26 22:42:18 2021
  
-Les champs relatifs aux Entrées/Sorties (E/S) sont les suivants :+    
 +  File: /etc/lvm/archive/vg0_00006-1956284179.vg 
 +  VG name:    vg0 
 +  Description: Created *before* executing 'vgremove vg0' 
 +  Backup Time: Wed May 26 22:43:49 2021
  
-  * bi — Blocs envoyés vers un périphérique blocs +    
-  * bo— Blocs reçus d'un périphérique blocs +  File: /etc/lvm/archive/vg0_00007-1006758937.vg 
 +  VG name:    vg0 
 +  Description: Created *before* executing 'vgcreate -s 8M vg0 /dev/sdb6 /dev/sdb7 /dev/sdb9' 
 +  Backup Time: Wed Jun  2 07:37:07 2021
  
-Les champs relatifs au système sont les suivants :+    
 +  File: /etc/lvm/archive/vg0_00008-708301076.vg 
 +  VG name:    vg0 
 +  Description: Created *before* executing 'lvcreate -m 1 -L 100M -n lv1 vg0' 
 +  Backup Time: Wed Jun  2 07:37:28 2021
  
-  in — Nombre d'interruptions par seconde +    
-  * cs — Nombre de changements de contexte par seconde+  File: /etc/lvm/archive/vg0_00009-1054420117.vg 
 +  VG name:    vg0 
 +  Description: Created *before* executing 'lvconvert -m 0 /dev/vg0/lv1 /dev/sdb7
 +  Backup Time: Wed Jun  2 07:41:04 2021
  
-Les champs relatifs au CPU sont les suivants :+    
 +  File: /etc/lvm/archive/vg0_00010-1200598227.vg 
 +  VG name:    vg0 
 +  Description: Created *before* executing 'lvconvert -m 1 /dev/vg0/lv1' 
 +  Backup Time: Wed Jun  2 07:41:53 2021
  
-  * 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 +  File: /etc/lvm/archive/vg0_00011-973084311.vg 
-  * id — Le pourcentage de temps pendant lequel le CPU était inoccupé +  VG name:    vg0 
-  * wa — Attente d'E/S+  Description: Created *before* executing 'lvconvert -m 0 /dev/vg0/lv1 /dev/sdb7' 
 +  Backup Time: Wed Jun  2 07:42:23 2021
  
-Les options de cette commande sont :+    
 +  File: /etc/lvm/archive/vg0_00012-854342401.vg 
 +  VG name:    vg0 
 +  Description: Created *before* executing 'lvcreate -i2 -I64 -n lv2 -L 100M vg0 /dev/sdb7 /dev/sdb9' 
 +  Backup Time: Wed Jun  2 07:47:38 2021
  
-<code> +    
-[root@centos8 ~]# vmstat --help+  File: /etc/lvm/backup/vg0 
 +  VG name:    vg0 
 +  Description: Created *after* executing 'vgcfgbackup vg0' 
 +  Backup Time: Wed Jun  2 07:50:57 2021 
 +</code>
  
-Usage: +=====Systèmes de Fichiers Journalisés=====
- vmstat [options] [delay [count]]+
  
-Options: +====Présentation====
- -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 +Un journal est la partie d'un système de fichiers journalisé qui trace les opérations d'écriture tant qu'elles ne sont pas terminées et cela en vue de garantir l'intégrité des données en cas d'arrêt brutal.
- -V, --version  output version information and exit+
  
-For more details see vmstat(8). +L'intérêt est de pouvoir plus facilement et plus rapidement récupérer les données en cas d'arrêt brutal du système d'exploitation (coupure d'alimentation, plantage du système, etc.), alors que les partitions n'ont pas été correctement synchronisées et démontées.
-</code>+
  
-<WRAP center round important 60%> +Sans un tel fichier journal, un outil de récupération de données après un arrêt brutal doit parcourir l'intégralité du système de fichier pour vérifier sa cohérence. Lorsque la taille du système de fichiers est importante, cela peut durer très longtemps pour un résultat moins efficace car entraînant des pertes de données. 
-**Important** : Par défaut la commande vmstat affiche des informations depuis le démarrage du système.+ 
 +Linux peut utiliser un des systèmes de fichiers journalisés suivants : 
 + 
 +^ Système de fichier ^ Taille maximum - fichier ^ Taille maximum - système de fichier ^ 
 +| **[[http://en.wikipedia.org/wiki/Ext3|Ext3]]** | 2 [[http://fr.wikipedia.org/wiki/Octet|To]] | 32 [[http://fr.wikipedia.org/wiki/Octet|To]] | 
 +| **[[http://fr.wikipedia.org/wiki/Ext4|Ext4]]** | 16 [[http://fr.wikipedia.org/wiki/Octet|To]] | 1 [[http://fr.wikipedia.org/wiki/Exbibyte|EiB]] | 
 +| **[[http://en.wikipedia.org/wiki/XFS|XFS]]** | 8 [[http://fr.wikipedia.org/wiki/Exbibyte|EiB]] | 16 [[http://fr.wikipedia.org/wiki/Exbibyte|EiB]] | 
 +| **[[http://en.wikipedia.org/wiki/ReiserFS|ReiserFS v3]]** | 8 [[http://fr.wikipedia.org/wiki/Octet|To]] | 16 [[http://fr.wikipedia.org/wiki/Octet|To]] | 
 +| **[[http://en.wikipedia.org/wiki/JFS_(file_system)|JFS]]** | 4 [[http://fr.wikipedia.org/wiki/Octet|Po]] | 32 [[http://fr.wikipedia.org/wiki/Octet|Po]] | 
 +| **[[https://fr.wikipedia.org/wiki/Btrfs|Btrfs]]** | 16 [[http://fr.wikipedia.org/wiki/Exbibyte|EiB]] | 16 [[http://fr.wikipedia.org/wiki/Exbibyte|EiB]] | 
 + 
 +<WRAP center round todo 60%> 
 +**A faire** : Pour comparer ces six systèmes de fichier, veuillez consulter **[[http://en.wikipedia.org/wiki/Comparison_of_file_systems|cette page]]**
 </WRAP> </WRAP>
  
-====3.6 - La Commande mpstat====+====Ext3====
  
-La commande **mpstat** affiche des statistiques détaillées sur le CPU :+Ext3 est une évolution de Ext2 et a pour principale différence d'utiliser un fichier journal. Il peut : 
 + 
 +  être utilisé à partir d'une partition Ext2, sans avoir à sauvegarder et à restaurer des données, 
 +  utiliser tous les utilitaires de maintenance pour les systèmes de fichiers ext2, comme fsck, 
 +  utiliser le logiciel dump, ce qui n'est pas le cas avec %%ReiserFS%%. 
 + 
 +Pour plus d'information concernant Ext3, consultez **[[http://en.wikipedia.org/wiki/Ext3|cette page]]** 
 + 
 +===Gestion d'Ext3=== 
 + 
 +Notez maintenant le numéro de la dernière partition que vous avez précédemment créée :
  
 <code> <code>
-[root@centos8 ~]# mpstat +[root@centos8 ~]# fdisk -l 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc       29/06/21        _x86_64_(8 CPU)+Disk /dev/sdb: GiB, 4294967296 bytes, 8388608 sectors 
 +Units: sectors of * 512 = 512 bytes 
 +Sector size (logical/physical): 512 bytes 512 bytes 
 +I/O size (minimum/optimal): 512 bytes / 512 bytes 
 +Disklabel type: dos 
 +Disk identifier: 0xb0dacb39
  
-04:53:22     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle +Device     Boot   Start     End Sectors  Size Id Type 
-04:53:22     all    0.03    0.00    0.01    0.02    0.01    0.01    0.00    0.00    0.00   99.92+/dev/sdb1          2048  206847  204800  100M 83 Linux 
 +/dev/sdb2        206848  411647  204800  100M 83 Linux 
 +/dev/sdb3        411648  616447  204800  100M 83 Linux 
 +/dev/sdb4        616448 8388607 7772160  3.7G  5 Extended 
 +/dev/sdb5        618496 1642495 1024000  500M fd Linux raid autodetect 
 +/dev/sdb6       1644544 2054143  409600  200M 8e Linux LVM 
 +/dev/sdb7       2056192 2670591  614400  300M 8e Linux LVM 
 +/dev/sdb8       2672640 3696639 1024000  500M fd Linux raid autodetect 
 +/dev/sdb9       3698688 4517887  819200  400M 8e Linux LVM 
 +/dev/sdb10      4519936 5543935 1024000  500M fd Linux raid autodetect 
 +/dev/sdb11      5545984 6569983 1024000  500M fd Linux raid autodetect 
 +/dev/sdb12      6572032 6981631  409600  200M 83 Linux 
 + 
 + 
 +Disk /dev/sda20 GiB, 21474836480 bytes, 41943040 sectors 
 +Unitssectors of 1 * 512 = 512 bytes 
 +Sector size (logical/physical): 512 bytes / 512 bytes 
 +I/O size (minimum/optimal): 512 bytes / 512 bytes 
 +Disklabel type: dos 
 +Disk identifier: 0x70b17285 
 + 
 +Device     Boot   Start      End  Sectors  Size Id Type 
 +/dev/sda1  *       2048   616447   614400  300M 83 Linux 
 +/dev/sda2        616448  4712447  4096000    2G 82 Linux swap / Solaris 
 +/dev/sda3       4712448 35432447 30720000 14.7G 83 Linux 
 + 
 + 
 + 
 + 
 +Disk /dev/mapper/vg0-lv1: 104 MiB, 109051904 bytes, 212992 sectors 
 +Units: sectors of 1 * 512 = 512 bytes 
 +Sector size (logical/physical): 512 bytes / 512 bytes 
 +I/O size (minimum/optimal): 512 bytes / 512 bytes 
 + 
 + 
 +Disk /dev/mapper/vg0-lv2: 112 MiB, 117440512 bytes, 229376 sectors 
 +Units: sectors of 1 * 512 = 512 bytes 
 +Sector size (logical/physical): 512 bytes / 512 bytes 
 +I/O size (minimum/optimal): 65536 bytes / 131072 bytes
 </code> </code>
  
-Dans le cas où vous avez plusieurs processeurs ou coeurs, vous pouvez visualiser ces mêmes informations par unité de traitement :+Créez un filesystem Ext3 sur /dev/sdb12 en utilisant la commande **mke2fs -j** :
  
 <code> <code>
-[root@centos8 ~]# mpstat -P ALL +[root@centos8 ~]# mke2fs -j /dev/sdb12 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_(8 CPU)+mke2fs 1.45.(20-Mar-2020) 
 +Creating filesystem with 204800 1k blocks and 51200 inodes 
 +Filesystem UUID: a2515f45-a32a-4e87-b7e6-170448f3f803 
 +Superblock backups stored on blocks:  
 + 8193, 24577, 40961, 57345, 73729
  
-04:54:28     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle +Allocating group tablesdone                             
-04:54:28     all    0.03    0.00    0.01    0.02    0.01    0.01    0.00    0.00    0.00   99.92 +Writing inode tablesdone                             
-04:54:28          0.03    0.00    0.01    0.00    0.01    0.00    0.00    0.00    0.00   99.94 +Creating journal (4096 blocks)done 
-04:54:28          0.02    0.00    0.02    0.03    0.02    0.00    0.00    0.00    0.00   99.91 +Writing superblocks and filesystem accounting informationdone 
-04:54:28          0.02    0.00    0.01    0.01    0.01    0.04    0.00    0.00    0.00   99.90 +
-04:54:28          0.01    0.00    0.01    0.02    0.00    0.00    0.00    0.00    0.00   99.95 +
-04:54:28          0.05    0.00    0.02    0.03    0.01    0.00    0.00    0.00    0.00   99.88 +
-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>
  
-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 :+Les options de la commande **mke2fs** sont :
  
 <code> <code>
-[root@centos8 ~]# mpstat -P ALL 2 5 +[root@centos8 ~]# mke2fs --help 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_        (8 CPU)+mke2fs: invalid option -- '-' 
 +Usage: mke2fs [-c|-l filename] [-b block-size] [-C cluster-size] 
 + [-i bytes-per-inode] [-I inode-size] [-J journal-options] 
 + [-G flex-group-size] [-N number-of-inodes] [-d root-directory] 
 + [-m reserved-blocks-percentage] [-o creator-os] 
 + [-g blocks-per-group] [-L volume-label] [-M last-mounted-directory] 
 + [-O feature[,...]] [-r fs-revision] [-E extended-option[,...]] 
 + [-t fs-type] [-T usage-type ] [-U UUID] [-e errors_behavior][-z undo_file] 
 + [-jnqvDFSV] device [blocks-count] 
 +</code>
  
-04:55:11     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle +<WRAP center round important 60%> 
-04:55:13     all    0.00    0.00    0.00    0.00    0.00    0.00    0.06    0.00    0.00   99.94 +**Important** Lors de la mise en place d'un filesystem ext2/ext3/ext4, le système réserve 5% de l'espace disque pour rootSur des disques de grande taille il est parfois préférable de récupérer une partie de cet espace en utilisant la commande **tune2fs -m n /dev/sdXY** ou **n** est le nouveau pourcentage à réserver
-04:55:13          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +</WRAP>
-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 +===LAB #11 - Convertir un Système de Fichiers Ext3 en Ext2===
-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 +Pour vérifier si un système de fichiers Ext2 est journalisé, utilisez la commande **dumpe2fs** :
-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 +<code> 
-04:55:19     all    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +[root@centos8 ~]# dumpe2fs -h /dev/sdb12 
-04:55:19       0    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +dumpe2fs 1.45.6 (20-Mar-2020) 
-04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +Filesystem volume name:   <none> 
-04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +Last mounted on:          <not available> 
-04:55:19       3    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +Filesystem UUID:          a2515f45-a32a-4e87-b7e6-170448f3f803 
-04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +Filesystem magic number:  0xEF53 
-04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +Filesystem revision #   1 (dynamic) 
-04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +Filesystem features:      has_journal ext_attr resize_inode dir_index filetype sparse_super large_file 
-04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00+Filesystem flags:         signed_directory_hash  
 +Default mount options:    user_xattr acl 
 +Filesystem state        clean 
 +Errors behavior:          Continue 
 +Filesystem OS type:       Linux 
 +Inode count             51200 
 +Block count             204800 
 +Reserved block count:     10240 
 +Free blocks:              192674 
 +Free inodes:              51189 
 +First block:              
 +Block size              1024 
 +Fragment size           1024 
 +Reserved GDT blocks     256 
 +Blocks per group:         8192 
 +Fragments per group:      8192 
 +Inodes per group:         2048 
 +Inode blocks per group:   256 
 +Filesystem created:       Wed Jun  2 07:55:24 2021 
 +Last mount time:          n/a 
 +Last write time:          Wed Jun  2 07:55:24 2021 
 +Mount count:              
 +Maximum mount count:      -1 
 +Last checked:             Wed Jun  2 07:55:24 2021 
 +Check interval:           (<none>
 +Reserved blocks uid:      (user root) 
 +Reserved blocks gid:      (group root) 
 +First inode             11 
 +Inode size:           128 
 +Journal inode:            8 
 +Default directory hash:   half_md4 
 +Directory Hash Seed:      faee0b81-0538-4c06-8d86-468bc0c760ac 
 +Journal backup:           inode blocks 
 +Journal features:         (none) 
 +Journal size:             4096k 
 +Journal length:           4096 
 +Journal sequence:         0x00000001 
 +Journal start:            0 
 +</code>
  
-04:55:19     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle +<WRAP center round important 60%> 
-04:55:21     all    0.06    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00   99.94 +**Important** Le drapeau **Filesystem features     has_journal ...** démontre que Ext3 est utilisé sur cette partition
-04:55:21          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +</WRAP>
-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 +Les options de cette commande sont 
-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 +<code> 
-Average:          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +[root@centos8 ~]# dumpe2fs --help 
-Average      2    0.00    0.00    0.00    0.00    0.10    0.00    0.00    0.00    0.00   99.90 +dumpe2fs 1.45.6 (20-Mar-2020) 
-Average      3    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +dumpe2fsinvalid option -- '-' 
-Average:          0.00    0.00    0.00    0.00    0.00    0.00    0.10    0.00    0.00   99.90 +Usagedumpe2fs [-bfghimxV] [-o superblock=<num>] [-o blocksize=<num>] device
-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>
  
-Les options de cette commande sont :+Pour supprimer le journal du système de fichier Ext3 sur cette partition, il convient d'utiliser la commande **tune2fs**
  
 <code> <code>
-[root@centos8 ~]# mpstat --help +[root@centos8 ~]# tune2fs -O ^has_journal /dev/sdb12 
-Usage: mpstat [ options ] [ <interval> [ <count> ] ] +tune2fs 1.45.6 (20-Mar-2020)
-Options are: +
-[ -A ] [ -n ] [ -u ] [ -V ] [ -I { SUM | CPU | SCPU | ALL } ] +
-[ -N { <node_list> | ALL } ] [ -o JSON ] [ -P { <cpu_list> | ALL } ]+
 </code> </code>
  
-====3.7 - La Commande sar====+Les options de cette commande sont :
  
-La commande **sar** (**S**ystem **A**ctivity **R**eporterpermet de surveiller toutes les ressources du système selon l'option qui est passée en argument à la commande+<code> 
 +[root@centos8 ~]# tune2fs --help 
 +tune2fs 1.45.6 (20-Mar-2020) 
 +tune2fs: invalid option -- '-' 
 +Usage: tune2fs [-c max_mounts_count] [-e errors_behavior] [-f] [-g group] 
 + [-i interval[d|m|w]] [-j] [-J journal_options] [-l] 
 + [-m reserved_blocks_percent] [-o [^]mount_options[,...]] 
 + [-r reserved_blocks_count] [-u user] [-C mount_count] 
 + [-L volume_label] [-M last_mounted_dir] 
 + [-O [^]feature[,...]] [-Q quota_options] 
 + [-E extended-option[,...]] [-T last_check_time] [-U UUID] 
 + [-I new_inode_size] [-z undo_file] device 
 +</code>
  
-Sous RHEL/CentOS 8 la commande **/usr/lib64/sa/sadc** permet de collecter les informations :+Constatez le résultat de cette commande :
  
 <code> <code>
-[root@centos8 ~]# ls /usr/lib64/sa +[root@centos8 ~]# dumpe2fs -h /dev/sdb12 
-sa1  sa2  sadc+dumpe2fs 1.45.6 (20-Mar-2020) 
 +Filesystem volume name:   <none> 
 +Last mounted on:          <not available> 
 +Filesystem UUID:          a2515f45-a32a-4e87-b7e6-170448f3f803 
 +Filesystem magic number:  0xEF53 
 +Filesystem revision #:    1 (dynamic) 
 +Filesystem features:      ext_attr resize_inode dir_index filetype sparse_super large_file 
 +Filesystem flags:         signed_directory_hash  
 +Default mount options:    user_xattr acl 
 +Filesystem state:         clean 
 +Errors behavior:          Continue 
 +Filesystem OS type:       Linux 
 +Inode count:              51200 
 +Block count:              204800 
 +Reserved block count:     10240 
 +Free blocks:              196787 
 +Free inodes:              51189 
 +First block:              1 
 +Block size:               1024 
 +Fragment size:            1024 
 +Reserved GDT blocks:      256 
 +Blocks per group:         8192 
 +Fragments per group:      8192 
 +Inodes per group:         2048 
 +Inode blocks per group:   256 
 +Filesystem created:       Wed Jun  2 07:55:24 2021 
 +Last mount time:          n/a 
 +Last write time:          Wed Jun  2 07:59:01 2021 
 +Mount count:              0 
 +Maximum mount count:      -1 
 +Last checked:             Wed Jun  2 07:55:24 2021 
 +Check interval:           0 (<none>
 +Reserved blocks uid:      0 (user root) 
 +Reserved blocks gid:      0 (group root) 
 +First inode:              11 
 +Inode size:           128 
 +Default directory hash:   half_md4 
 +Directory Hash Seed:      faee0b81-0538-4c06-8d86-468bc0c760ac 
 +Journal backup:           inode blocks
 </code> </code>
  
-Le script **/usr/lib64/sa/sa1** exécute la commande **sadc**. Ce script prend deux options :+<WRAP center round important 60%> 
 +**Important** : Notez que le drapeau **Filesystem features:      has_journal ...** a été supprimé. 
 +</WRAP>
  
-^ Option ^ Description ^ +Supprimez maintenant l'inode du journal :
-| -t | L'intervalle entre les collectes | +
-| -n | Nombre de collectes |+
  
-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>** :+<code> 
 +[root@centos8 ~]# fsck /dev/sdb12 
 +fsck from util-linux 2.32.1 
 +e2fsck 1.45.6 (20-Mar-2020) 
 +/dev/sdb12: clean, 11/51200 files, 8013/204800 blocks 
 +</code> 
 + 
 +Créez maintenant un point de montage pour /dev/sdb12 :
  
 <code> <code>
-[root@centos8 ~]# ls /var/log/sa/ +[root@centos8 ~]# mkdir /mnt/sdb12 
-sa29  s+</code>
  
 +Essayez de monter /dev/sdb12 en tant que système de fichiers Ext3. Vous obtiendrez un résultat similaire à celui-ci :
  
-ar29+<code> 
 +[root@centos8 ~]# mount -t ext3 /dev/sdb12 /mnt/sdb12 
 +mount: /mnt/sdb12: wrong fs type, bad option, bad superblock on /dev/sdb12, missing codepage or helper program, or other error.
 </code> </code>
  
-Sous CentOS / RHEL 8, l'intervalle entre les collectes des informations est configuré par les **timers** de systemd au lieu des cron jobs :+<WRAP center round important 60%> 
 +**Important** : Notez l'erreur due au mauvais système de fichiers qui suit l'option **-t**
 +</WRAP> 
 + 
 +Montez maintenant le système de fichiers en tant que Ext2 :
  
 <code> <code>
-[root@centos8 ~]# cat /usr/lib/systemd/system/sysstat-collect.timer +[root@centos8 ~]# mount -t ext2 /dev/sdb12 /mnt/sdb12 
-/usr/lib/systemd/system/sysstat-collect.timer +</code>
-# (C) 2014 Tomasz Torcz <tomek@pipebreaker.pl> +
-+
-# sysstat-11.7.3 systemd unit file: +
-#        Activates activity collector every 10 minutes+
  
-[Unit] +===LAB #12 - Convertir un Système de Fichiers Ext2 en Ext3===
-Description=Run system activity accounting tool every 10 minutes+
  
-[Timer] +Pour replacer le journal sur /dev/sdb12, il convient d'utiliser la commande **tune2fs** :
-OnCalendar=*:00/10+
  
-[Install+<code> 
-WantedBy=sysstat.service+[root@centos8 ~]# umount /mnt/sdb12 
 + 
 +[root@centos8 ~]# tune2fs -j /dev/sdb12 
 +tune2fs 1.45.6 (20-Mar-2020) 
 +Creating journal inode: done
 </code> </code>
  
-La valeur de **OnCalendar** indique un collecte toutes les dix minutes.+<WRAP center round important 60%> 
 +**Important** : Notez que vous avez du démonter la partition avant d'exécuter la commande **tune2fs**. 
 +</WRAP> 
 + 
 +===LAB #13 - Placer le Journal sur un autre Partition=== 
 + 
 +Le journal d'un système de fichiers peut être placé sur un autre périphérique bloc.
  
-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** :+Créez un système de fichiers sur /dev/sdb11 :
  
 <code> <code>
-[root@centos8 ~]# systemctl edit sysstat-collect.timer +[root@centos8 ~]# mke2fs -O journal_dev /dev/sdb11 
-[root@centos8 ~]# cat /etc/systemd/system/sysstat-collect.timer.d/override.conf  +mke2fs 1.45.6 (20-Mar-2020) 
-[Unit] +Creating filesystem with 512000 1k blocks and 0 inodes 
-Description=Run system activity accounting tool every 2 minutes+Filesystem UUID: 23327281-e88a-4da0-bafa-50ee10c52937 
 +Superblock backups stored on blocks: 
  
-[Timer] +Zeroing journal device  
-OnCalendar= +
-OnCalendar=*:00/2 +
-AccuracySec=0+
 </code> </code>
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** : Notez la ligne **OnCalendar=** qui est necessaire afin de surcharger la valeur par défaut.+**Important** : Notez l'utilisation de l'option **-O**.
 </WRAP> </WRAP>
  
-Vérifiez ensuite la prise en compte de la configuration :+Créez maintenant un système de fichiers Ext3 sur /dev/sdb12 en plaçant le journal sur /dev/sdb11 :
  
 <code> <code>
-[root@centos8 ~]# systemctl status sysstat-collect.timer +[root@centos8 ~]# mke2fs --J device=/dev/sdb11 /dev/sdb12 
-● sysstat-collect.timer - Run system activity accounting tool every 2 minutes +mke2fs 1.45.6 (20-Mar-2020
-   Loaded: loaded (/usr/lib/systemd/system/sysstat-collect.timer; enabled; vendor preset: disabled+Using journal device's blocksize1024 
-  Drop-In: /etc/systemd/system/sysstat-collect.timer.d +/dev/sdb12 contains a ext3 file system 
-           └─override.conf + last mounted on Wed Jun  2 08:03:11 2021 
-   Active: active (waitingsince Tue 2021-06-29 06:16:04 EDT; 3h 2min ago +Proceed anyway? (y,Ny 
-  TriggerTue 2021-06-29 09:20:00 EDT; 1min 19s left+Creating filesystem with 204800 1k blocks and 51200 inodes 
 +Filesystem UUID0e783411-6407-4cba-8db5-0e2729000c9e 
 +Superblock backups stored on blocks 
 + 8193, 24577, 40961, 57345, 73729
  
-Jun 29 06:16:04 centos8.ittraining.loc systemd[1]Started Run system activity accounting tool every 10 minutes.+Allocating group tablesdone                             
 +Writing inode tablesdone                             
 +Adding journal to device /dev/sdb11done 
 +Writing superblocks and filesystem accounting information: done 
 </code> </code>
 +
 +<WRAP center round important 60%>
 +**Important** : Notez que le journal a été placé sur /dev/sdb11 graĉe à l'utilisation de l'option **-J**.
 +</WRAP>
 +
 +===LAB #14 - Modifier la Fréquence de Vérification du Système de Fichiers Ext3===
 +
 +Pour modifier la fréquence de vérification du système de fichiers sur /dev/sdb12, il convient d'utiliser soit l'option **-c**, soit l'option **-i** :
  
 <code> <code>
-[root@centos8 ~]# journalctl -g sysstat-collect.service +[root@centos8 ~]# tune2fs -i 100d /dev/sdb12 
--- Logs begin at Mon 2021-06-28 02:04:10 EDT, end at Tue 2021-06-29 09:18:00 EDT. -- +tune2fs 1.45.6 (20-Mar-2020) 
-Jun 29 06:20:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. +Setting interval between checks to 8640000 seconds
-Jun 29 06:26:29 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. +
-Jun 29 06:30:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. +
-Jun 29 06:40:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. +
-Jun 29 06:50:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. +
-Jun 29 07:00:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. +
-Jun 29 07:10:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. +
-Jun 29 07:20:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. +
-Jun 29 07:30:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. +
-Jun 29 07:40:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. +
-Jun 29 07:50:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. +
-Jun 29 07:53:56 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. +
-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>
  
-Saisissez la commande suivante :+Dernièrement, pour obtenir seul l'UUID du système de fichiers, utilisez les commandes **dumpe2fs** et **grep** :
  
 <code> <code>
-[root@centos8 ~]# sar +[root@centos8 ~]# dumpe2fs /dev/sdb12 | grep UUID 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc       29/06/21        _x86_64_        (8 CPU)+dumpe2fs 1.45.(20-Mar-2020) 
 +Filesystem UUID:          0e783411-6407-4cba-8db5-0e2729000c9e 
 +Journal UUID:             23327281-e88a-4da0-bafa-50ee10c52937 
 +</code>
  
-06:16:04     LINUX RESTART      (8 CPU)+====Ext4====
  
-06:20:33        CPU     %user     %nice   %system   %iowait    %steal     %idle +Le système de fichiers **Ext4** a été introduit dans le noyau **2.6.19** en mode expérimental et est devenu stable dans le noyau **2.6.28**.
-06:26:29        all      0.03      0.00      0.03      0.00      0.00     99.94 +
-06:30:33        all      0.02      0.00      0.03      0.00      0.00     99.95 +
-06:40:33        all      0.02      0.00      0.03      0.00      0.00     99.94 +
-06:50:33        all      0.02      0.00      0.02      0.00      0.00     99.95 +
-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)+Ext4 n'est pas une évolution de Ext3. Cependant il a une compatibilité ascendante avec Ext3.
  
-07:56:00        CPU     %user     %nice   %system   %iowait    %steal     %idle +Les fonctionnalités majeures d'Ext4 sont :
-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 +  * la gestion des volumes d'une taille allant jusqu'à **1 024 pébioctets**, 
-09:14:00        all      0.02      0.00      0.03      0.00      0.00     99.95 +  * l'allocation par **extents** qui permettent la pré-allocation d'une zone contiguë pour un fichier afin de minimiser la fragmentation.
-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>+
  
-===Statistiques d'Utilisation du CPU===+L'option **extents** est activée par défaut depuis le noyau **2.6.23**.
  
-Visualisez maintenant les statistiques d'utilisation du CPU+La compatibilité ascendante avec ext3 comprend :
  
-<code> +  * la possibilité de monter une partition Ext3 en tant que partition Ext4, 
-[root@centos8 ~]# sar -u 5 3 +  * la possibilité de monter une partition Ext4 en tant que partition Ext3 mais **uniquement** dans le cas où la partition Ext4 n'ait jamais utilisé l'allocation par **extents** pour enregistrer des fichiers, mais l'allocation binaire comprise par ext3.
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_        (8 CPU)+
  
-09:22:52        CPU     %user     %nice   %system   %iowait    %steal     %idle +Pour plus d'informations concernant %%Ext4%%, consultez **[[http://fr.wikipedia.org/wiki/Ext4|cette page]]**.
-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>+
  
-D'avantage de statistiques peuvent être obtenues en utilisant l'option **ALL** :+===LAB #15 - Créer un Système de Fichiers Ext4=== 
 + 
 +Créez un système de fichiers Ext4 sur **/dev/sdb11** :
  
 <code> <code>
-[root@centos8 ~]# sar -u ALL 5 3 +[root@centos8 ~]# mkfs.ext4 /dev/sdb11 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc       29/06/21        _x86_64_(8 CPU)+mke2fs 1.45.(20-Mar-2020) 
 +/dev/sdb11 contains a jbd file system 
 +Proceed anyway? (y,N
 +Creating filesystem with 512000 1k blocks and 128016 inodes 
 +Filesystem UUID: 72a6ad08-7023-4561-adcb-d434e00afed1 
 +Superblock backups stored on blocks:  
 + 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409
  
-01:49:14        CPU      %usr     %nice      %sys   %iowait    %steal      %irq     %soft    %guest    %gnice     %idle +Allocating group tablesdone                             
-01:49:19        all      0.03      0.00      0.00      0.00      0.00      0.03      0.00      0.00      0.00     99.95 +Writing inode tablesdone                             
-01:49:24        all      0.03      0.00      0.03      0.00      0.00      0.10      0.05      0.00      0.00     99.80 +Creating journal (8192 blocks)done 
-01:49:29        all      0.00      0.00      0.00      0.25      0.00      0.10      0.05      0.00      0.00     99.60 +Writing superblocks and filesystem accounting informationdone 
-Average       all      0.02      0.00      0.01      0.08      0.00      0.08      0.03      0.00      0.00     99.78+
 </code> </code>
  
-Pour consulter les statistiques d'un coeur spécifique, utilisez l'option **-P** :+Les options de cette commande sont :
  
 <code> <code>
-[root@centos8 ~]# sar --P 1 5 3 +[root@centos8 ~]# mkfs.ext4 --help 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_        (8 CPU)+mkfs.ext4: invalid option -- '-' 
 +Usage: mkfs.ext4 [-c|-l filename] [-b block-size] [-C cluster-size] 
 + [-i bytes-per-inode] [-I inode-size] [-J journal-options] 
 + [-G flex-group-size] [-N number-of-inodes] [-d root-directory] 
 + [-m reserved-blocks-percentage] [-o creator-os] 
 + [-g blocks-per-group] [-L volume-label] [-M last-mounted-directory] 
 + [-O feature[,...]] [-r fs-revision] [-E extended-option[,...]] 
 + [-t fs-type] [-T usage-type ] [-U UUID] [-e errors_behavior][-z undo_file] 
 + [-jnqvDFSV] device [blocks-count] 
 +</code>
  
-01:51:52        CPU     %user     %nice   %system   %iowait    %steal     %idle +Consultez maintenant les caractéristiques du système de fichier :
-01:51:57          1      0.00      0.00      0.00      0.00      0.00    100.00 +
-01:52:02          1      0.20      0.00      0.00      0.00      0.00     99.80 +
-01:52:07          1      0.00      0.00      0.00      0.00      0.00    100.00 +
-Average:          1      0.07      0.00      0.00      0.00      0.00     99.93 +
-[root@centos8 ~]# sar -u -P 5 5 3 +
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_        (8 CPU)+
  
-01:52:16        CPU     %user     %nice   %system   %iowait    %steal     %idle +<code> 
-01:52:21               0.00      0.00      0.00      0.00      0.00    100.00 +[root@centos8 ~]# dumpe2fs /dev/sdb11 | more 
-01:52:26          5      0.00      0.00      0.00      0.00      0.00    100.00 +dumpe2fs 1.45.6 (20-Mar-2020) 
-01:52:31          5      0.00      0.00      0.00      0.00      0.00    100.00 +Filesystem volume name:   <none> 
-Average              0.00      0.00      0.00      0.00      0.00    100.00+Last mounted on         <not available> 
 +Filesystem UUID:          72a6ad08-7023-4561-adcb-d434e00afed1 
 +Filesystem magic number:  0xEF53 
 +Filesystem revision #:    1 (dynamic) 
 +Filesystem features:      has_journal ext_attr resize_inode dir_index filetype e 
 +xtent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize meta 
 +data_csum 
 +Filesystem flags:         signed_directory_hash  
 +Default mount options:    user_xattr acl 
 +Filesystem state        clean 
 +Errors behavior:          Continue 
 +Filesystem OS type      Linux 
 +Inode count:              128016 
 +Block count:              512000 
 +Reserved block count:     25600 
 +Free blocks:              485316 
 +Free inodes:              128005 
 +First block:              1 
 +Block size:               1024 
 +Fragment size:            1024 
 +Group descriptor size:    64 
 +Reserved GDT blocks:      256 
 +--More--
 </code> </code>
  
-===Statistiques d'Utilisation de la Mémoire et du Swap===+===LAB #16 - Ajouter une Etiquette au Système de Fichiers Ext4===
  
-Utilisez l'option **-r** pour visualiser les statistiques concernant la mémoire :+Utilisez la commande **e2label** pour associer une étiquette au système de fichiers :
  
 <code> <code>
-[root@centos8 ~]# sar -r 5 3 +[root@centos8 ~]# e2label /dev/sdb11 my_ext4 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        30/06/21        _x86_64_(8 CPU+[root@centos8 ~]# dumpe2fs /dev/sdb11 | more 
- +dumpe2fs 1.45.(20-Mar-2020
-07:33:32    kbmemfree   kbavail kbmemused  %memused kbbuffers  kbcached  kbcommit   %commit  kbactive   kbinact   kbdirty +Filesystem volume name:   my_ext4 
-07:33:37      1647240   2297232   2177792     56.94      3356    827396   5096432     70.94    359072   1486368         0 +Last mounted on         <not available> 
-07:33:42      1647232   2297224   2177800     56.94      3356    827396   5095788     70.93    359072   1486300         0 +Filesystem UUID:          72a6ad08-7023-4561-adcb-d434e00afed1 
-07:33:47      1647232   2297224   2177800     56.94      3356    827396   5095788     70.93    359072   1486376         0 +Filesystem magic number:  0xEF53 
-Average:      1647235   2297227   2177797     56.94      3356    827396   5096003     70.94    359072   1486348         0+Filesystem revision #   1 (dynamic) 
 +Filesystem features:      has_journal ext_attr resize_inode dir_index filetype e 
 +xtent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize meta 
 +data_csum 
 +Filesystem flags:         signed_directory_hash  
 +Default mount options:    user_xattr acl 
 +Filesystem state:         clean 
 +Errors behavior         Continue 
 +Filesystem OS type:       Linux 
 +Inode count:              128016 
 +Block count:              512000 
 +Reserved block count:     25600 
 +Free blocks             485316 
 +Free inodes:              128005 
 +First block:              1 
 +Block size:               1024 
 +Fragment size:            1024 
 +Group descriptor size:    64 
 +Reserved GDT blocks:      256 
 +--More--
 </code> </code>
  
-Utilisez l'option **-S** pour visualiser les statistiques concernant le Swap :+<WRAP center round important 60%> 
 +**Important** - Notez que l'étiquette doit être de 16 caractères maximum. 
 +</WRAP> 
 + 
 +Créez un point de montage dans **/mnt** et essayez de monter **/dev/sdb11** en tant qu'Ext3 :
  
 <code> <code>
-[root@centos8 ~]# sar -S 5 3 +[root@centos8 ~]# mkdir /mnt/sdb11
-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 +[root@centos8 ~]# mount -t ext3 /dev/sdb11 /mnt/sdb11 
-07:32:03      3358716              0.00              0.00 +mount/mnt/sdb11wrong fs type, bad option, bad superblock on /dev/sdb11, missing codepage or helper program, or other error..
-07:32:08      3358716              0.00              0.00 +
-07:32:13      3358716              0.00              0.00 +
-Average     3358716              0.00              0.00+
 </code> </code>
  
-===Statistiques des E/S===+<WRAP center round important 60%> 
 +**Important** - Notez l'erreur qui est signalée. 
 +</WRAP>
  
-Utilisez l'option **-b** pour visualiser les statistiques concernant les E/S  :+Montez de nouveau la partition **sans** stipuler le type de système de fichiers :
  
 <code> <code>
-[root@centos8 ~]# sar -b 5 3 +[root@centos8 ~]# mount /dev/sdb11 /mnt/sdb11
-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/s   bwrtn/+[root@centos8 ~]# mount | grep sdb11 
-09:24:54         0.00      0.00      0.00      0.00      0.00 +/dev/sdb11 on /mnt/sdb11 type ext4 (rw,relatime,seclabel)
-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> </code>
  
-===Statistiques des E/S par Disque===+<WRAP center round important 60%> 
 +**Important** - Constatez que la partition a été monté en tant qu'Ext4. 
 +</WRAP>
  
-Utilisez l'option **-d** pour visualiser les statistiques concernant les E/S par disque :+===LAB #17 Convertir un Système de Fichiers Ext3 en Ext4=== 
 + 
 +Créez un système de fichiers ext3 sur /dev/sdb12 :
  
 <code> <code>
-[root@centos8 ~]# sar -d 5 3 +[root@centos8 ~]# mkfs.ext3 /dev/sdb12 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc       29/06/21        _x86_64_        (8 CPU)+mke2fs 1.45.(20-Mar-2020) 
 +/dev/sdb12 contains a ext3 file system 
 + created on Wed Jun  2 08:10:40 2021 
 +Proceed anyway? (y,N
 +Creating filesystem with 204800 1k blocks and 51200 inodes 
 +Filesystem UUID: b73322d4-f2e4-43bc-96ae-422d4584f3de 
 +Superblock backups stored on blocks:  
 + 8193, 24577, 40961, 57345, 73729
  
-09:25:45          DEV       tps     rkB/    wkB/  areq-sz    aqu-sz     await     svctm     %util +Allocating group tablesdone                             
-09:25:50       dev8-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +Writing inode tablesdone                             
-09:25:50      dev8-16      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +Creating journal (4096 blocks)done 
-09:25:50      dev11-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +Writing superblocks and filesystem accounting informationdone  
-09:25:50     dev253-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +</code>
-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/s     wkB/s   areq-sz    aqu-sz     await     svctm     %util +Montez maintenant **/dev/sdb12** sur /mnt/sdb12 :
-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/s     wkB/s   areq-sz    aqu-sz     await     svctm     %util +<code> 
-09:26:00       dev8-0      0.60      0.00      0.30      0.50      0.01     13.00     13.00      0.78 +[root@centos8 ~]# mount /dev/sdb12 /mnt/sdb12
-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/s     wkB/s   areq-sz    aqu-sz     await     svctm     %util +[root@centos8 ~]# ls -l /mnt/sdb12 
-Average:       dev8-0      0.20      0.00      0.10      0.50      0.00     13.00     13.00      0.26 +total 12 
-Average:      dev8-16      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +drwx------. 2 root root 12288 Jun  2 08:42 lost+found
-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>
  
-La colonne **DEV** indentifie les disques par leurs majeurs et mineurs. Pour voir les informations avec les noms des disques, ajoutez l'option **-p** :+Créez le fichier **/mnt/sdb12/check_file** :
  
 <code> <code>
-[root@centos8 ~]# sar -p -d 5 3 +[root@centos8 ~]# touch /mnt/sdb12/check_file 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        30/06/21        _x86_64_        (8 CPU)+</code>
  
-07:48:32          DEV       tps     rkB/s     wkB/s   areq-sz    aqu-sz     await     svctm     %util +Injectez la chaine **check file** dans le fichier /mnt/sdb12/check_file puis démontez /dev/sdb12 :
-07:48:37          sda      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +
-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/s     wkB/s   areq-sz    aqu-sz     await     svctm     %util +<code> 
-07:48:42          sda      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +[root@centos8 ~]# echo "check file" > /mnt/sdb12/check_file
-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/s     wkB/s   areq-sz    aqu-sz     await     svctm     %util +[root@centos8 ~]# umount /dev/sdb12 
-07:48:47          sda      0.40      0.00      0.40      1.00      0.02     56.00     56.50      2.26 +</code>
-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/s     wkB/s   areq-sz    aqu-sz     await     svctm     %util +Exécutez e2fsck sur /dev/sda12 
-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 +<code> 
-Average:          sr0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +[root@centos8 ~]# e2fsck /dev/sdb12 
-Average:    cl_centos8-root      0.13      0.00      0.27      2.00      0.01     56.00     56.50      0.75 +e2fsck 1.45.6 (20-Mar-2020) 
-Average   cl_centos8-swap      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00+/dev/sdb12clean, 12/51200 files, 12128/204800 blocks
 </code> </code>
  
-Les options de la commande sar sont :+Convertissez /dev/sdb12 en Ext4 :
  
 <code> <code>
-[root@centos8 ~]# sar --help +[root@centos8 ~]# tune2fs -O extents,uninit_bg,dir_index /dev/sdb12 
-Usage: sar [ options ] [ <interval> [ <count> ] ] +tune2fs 1.45.(20-Mar-2020)
-Main options and reports (report name between square brackets): +
-        -B      Paging statistics [A_PAGE] +
-        -b      I/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> </code>
  
-=====Modules usb=====+Optimisez le système de fichiers :
  
-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.et jusqu'à 4.8 Gb/s sous la version 3.0. Les modules nécessaires pour les contrôleurs USB sont :+<code> 
 +[root@centos8 ~]# e2fsck -fDC0 /dev/sdb12 
 +e2fsck 1.45.6 (20-Mar-2020) 
 +Pass 1: Checking inodes, blocks, and sizes 
 +Pass 2: Checking directory structure                                            
 +Pass 3: Checking directory connectivity 
 +Pass 3A: Optimizing directories 
 +Pass 4: Checking reference counts                                               
 +Pass 5: Checking group summary information 
 +                                                                                 
 +/dev/sdb12: ***** FILE SYSTEM WAS MODIFIED ***** 
 +/dev/sdb12: 12/51200 files (0.0% non-contiguous), 12128/204800 blocks 
 +</code>
  
-^ Version USB ^ Module ^ Nom Complet ^ +Essayez de monter **/dev/sdb12** en tant qu'Ext3 :
-|  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é :+<code> 
 +[root@centos8 ~]# mount -t ext3 /dev/sdb12 /mnt/sdb12 
 +mount/mnt/sdb12: wrong fs type, bad option, bad superblock on /dev/sdb12, missing codepage or helper program, or other error. 
 +</code>
  
-^ Module ^ Type de Périphérique ^  +Montez /dev/sdb12 sans spécifier le type de fichiers Ext3 et vérifiez le contenu du fichier **check_file** :
-|  **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 :+<code> 
 +[root@centos8 ~]# mount /dev/sdb12 /mnt/sdb12
  
-  * INITrd, +[root@centos8 ~]# ls -l /mnt/sdb12 
-  * Le processus init (systemd), +total 14 
-  * kmod, d'une manière dynamique et transparente lors du branchement du périphérique, +-rw-r--r--. 1 root root    11 Jun  2 08:45 check_file 
-  * udev, +drwx------. 2 root root 12288 Jun  2 08:42 lost+found
-  * manuellement.+
  
-=====udev=====+[root@centos8 ~]# cat /mnt/sdb12/check_file 
 +check file 
 +</code>
  
-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 :+Dernièrement, pour obtenir seul l'UUID du système de fichiers, utilisez les commandes **dumpe2fs** et **grep** :
  
-  * Udev, +<code> 
-  * HAL, +[root@centos8 ~]# dumpe2fs /dev/sdb11 | grep UUID 
-  * Dbus.+dumpe2fs 1.45.6 (20-Mar-2020) 
 +Filesystem UUID:          72a6ad08-7023-4561-adcb-d434e00afed1
  
-Les rôles de chaque composant sont les suivants :+[root@centos8 ~]# dumpe2fs /dev/sdb12 | grep UUID 
 +dumpe2fs 1.45.6 (20-Mar-2020) 
 +Filesystem UUID         b73322d4-f2e4-43bc-96ae-422d4584f3de 
 +</code>
  
-  * Udev se charge de créer et supprimer d'une manière dynamique les nœuds dans le répertoire **/dev**, +====XFS====
-  * 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 :+XFS est un système de fichiers 64-bit journalisé de haute performance crée par SGI pour son système d'exploitation IRIX. XFS est inclus par défaut avec les versions du noyau Linux 2.5.xx et 2.6.xx. XFS est le système de fichiers par défaut de RHEL/CentOS 8.
  
-  Au démarrage **tmpfs** est monté sur /dev, +<WRAP center round important 60%> 
-  * Udev copie les éventuels nœuds statiques de **/lib/udev/devices** vers /dev, +**Important** : Le système de fichiers XFS permet l'augmentation de sa taille à chaudPar contre, la taille d'un système de fichiers XFS ne peut pas être réduite
-  * 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/**, +</WRAP>
-  * 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é USBUdev 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 :+Pour plus d'informations concernant XFSconsultez **[[http://en.wikipedia.org/wiki/XFS|cette page]]**.
  
-Le fichier de configuration principal d'Udev est **/etc/udev/udev.conf** :+===LAB #18 - Créer un Système de Fichiers XFS===
  
-<code> +Démontez **/dev/sdb12** :
-[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> 
 +[root@centos8 ~]umount /dev/sdb12
 </code> </code>
  
-Les fichiers de règles se trouvent dans **/lib/udev/rules.d/** :+Créez un système de fichiers XFS sur la partition **/dev/sdb12** :
  
 <code> <code>
-[root@centos8 ~]# ls /lib/udev/rules.d+[root@centos8 ~]# mkfs.xfs -f /dev/sdb12 
-01-md-raid-creating.rules              70-uaccess.rules +meta-data=/dev/sdb12             isize=512    agcount=4, agsize=12800 blks 
-10-dm.rules                            70-wacom.rules +         =                       sectsz=512   attr=2, projid32bit=1 
-11-dm-lvm.rules                        71-biosdevname.rules +         =                       crc=1        finobt=1, sparse=1, rmapbt=0 
-11-dm-mpath.rules                      71-nvmf-iopolicy-netapp.rules +         =                       reflink=1 
-11-dm-parts.rules                      71-prefixdevname.rules +data                           bsize=4096   blocks=51200, imaxpct=25 
-13-dm-disk.rules                       71-seat.rules +         =                       sunit=0      swidth=0 blks 
-39-usbmuxd.rules                       73-idrac.rules +naming   =version 2              bsize=4096   ascii-ci=0, ftype=1 
-40-elevator.rules                      73-seat-late.rules +log      =internal log           bsize=4096   blocks=1368, version=2 
-40-libgphoto2.rules                    75-net-description.rules +         =                       sectsz=512   sunit=0 blks, lazy-count=1 
-40-redhat.rules                        75-probe_mtd.rules +realtime =none                   extsz=4096   blocks=0, rtextents=0
-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>
  
 <WRAP center round important 60%> <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.+**Important** - Notez l'utilisation de l'option **-f** afin d'écraser le système de fichiers Ext4 existant.
 </WRAP> </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** :+Les options de cette commande sont :
  
 <code> <code>
-[root@centos8 ~]# cat /lib/udev/rules.d/50-udev-default.rules more +[root@centos8 ~]# mkfs.xfs --help 
-# do not edit this file, it will be overwritten on update+mkfs.xfs: invalid option -- '-' 
 +unknown option --  
 +Usage: mkfs.xfs 
 +/* blocksize */ [-b size=num] 
 +/* metadata */ [-m crc=0|1,finobt=0|1,uuid=xxx,rmapbt=0|1,reflink=0|1] 
 +/* data subvol */ [-agcount=n,agsize=n,file,name=xxx,size=num, 
 +     (sunit=value,swidth=value|su=num,sw=num|noalign), 
 +     sectsize=num 
 +/* force overwrite */ [-f] 
 +/* inode size */ [-i log=n|perblock=n|size=num,maxpct=n,attr=0|1|2, 
 +     projid32bit=0|1,sparse=0|1] 
 +/* no discard */ [-K] 
 +/* log subvol */ [-l agnum=n,internal,size=num,logdev=xxx,version=n 
 +     sunit=value|su=num,sectsize=num,lazy-count=0|1] 
 +/* label */ [-L label (maximum 12 characters)] 
 +/* naming */ [-n size=num,version=2|ci,ftype=0|1] 
 +/* no-op info only */ [-N] 
 +/* prototype file */ [-p fname] 
 +/* quiet */ [-q] 
 +/* realtime subvol */ [-r extsize=num,size=num,rtdev=xxx] 
 +/* sectorsize */ [-s size=num] 
 +/* version */ [-V] 
 + devicename 
 +<devicename> is required unless -d name=xxx is given. 
 +<num> is xxx (bytes), xxxs (sectors), xxxb (fs blocks), xxxk (xxx KiB), 
 +      xxxm (xxx MiB), xxxg (xxx GiB), xxxt (xxx TiB) or xxxp (xxx PiB). 
 +<value> is xxx (512 byte blocks). 
 +</code>
  
-# run a command on remove events +Consultez maintenant les caractéristiques du système de fichier :
-ACTION=="remove", ENV{REMOVE_CMD}!="", RUN+="$env{REMOVE_CMD}" +
-ACTION=="remove", GOTO="default_end"+
  
-SUBSYSTEM=="virtio-ports"KERNEL=="vport*"ATTR{name}=="?*"SYMLINK+="virtio-ports/$attr{name}"+<code> 
 +[root@centos8 ~]# xfs_info /dev/sdb12 
 +meta-data=/dev/sdb12             isize=512    agcount=4agsize=12800 blks 
 +                               sectsz=512   attr=2projid32bit=
 +                               crc=1        finobt=1sparse=1, rmapbt=0 
 +                               reflink=1 
 +data                           bsize=4096   blocks=51200, imaxpct=25 
 +                               sunit=0      swidth=0 blks 
 +naming   =version 2              bsize=4096   ascii-ci=0, ftype=1 
 +log      =internal log           bsize=4096   blocks=1368, version=2 
 +                               sectsz=512   sunit=0 blks, lazy-count=1 
 +realtime =none                   extsz=4096   blocks=0, rtextents=0 
 +</code>
  
-# select "system RTC" or just use the first one +Les options de cette commande sont :
-SUBSYSTEM=="rtc", ATTR{hctosys}=="1", SYMLINK+="rtc" +
-SUBSYSTEM=="rtc", KERNEL=="rtc0", SYMLINK+="rtc", OPTIONS+="link_priority=-100"+
  
-SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb" +<code> 
-ENV{MODALIAS}!="", IMPORT{builtin}="hwdb --subsystem=$env{SUBSYSTEM}"+[root@centos8 ~]# xfs_info --help 
 +/usr/sbin/xfs_info: illegal option -- 
 +Usage: xfs_info [-V] [-t mtab] [mountpoint|device|file] 
 +</code>
  
-ACTION!="add", GOTO="default_end"+===LAB #19 - Ajouter une Etiquette au Système de Fichiers XFS===
  
-SUBSYSTEM=="tty", KERNEL=="ptmx", GROUP="tty", MODE="0666" +Utilisez la commande **xfs_admin** pour associer une étiquette au système de fichiers :
-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"+<code> 
 +[root@centos8 ~]# xfs_admin -L my_xfs /dev/sdb12 
 +xfs_admin: /dev/sdb12 contains a mounted filesystem
  
-SUBSYSTEM=="input", GROUP="input" +fatal error -- couldn't initialize XFS library
-SUBSYSTEM=="input", KERNEL=="js[0-9]*", MODE="0664"+
  
-SUBSYSTEM=="video4linux", GROUP="video" +[root@centos8 ~]# umount /dev/sdb12
-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" +[root@centos8 ~]# xfs_admin -L my_xfs /dev/sdb12 
-SUBSYSTEM=="kfd", GROUP="render", MODE="0666" +writing all SBs 
- +new label = "my_xfs"
-SUBSYSTEM=="sound", GROUP="audio",+
-  OPTIONS+="static_node=snd/seq", OPTIONS+="static_node=snd/timer" +
---More--+
 </code> </code>
  
-Chaque règle prend la forme suivante :+<WRAP center round important 60%> 
 +**Important** - Notez que la partition XFS doit être démonté pour pouvoir utiliser la commande **xfs_admin**. 
 +</WRAP>
  
-KEY, [KEY, ...] NAME [, SYMLINK] +Pour voir l'étiquette, utilisez la commande suivante :
- +
-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 ~]# udevadm info --query=all -n /dev/sda +[root@centos8 ~]# xfs_admin -/dev/sdb12 
-P: /devices/pci0000:00/0000:00:07.0/ata3/host2/target2:0:0/2:0:0:0/block/sda +label "my_xfs"
-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>
  
-===Les options de la commande===+<WRAP center round important 60%> 
 +**Important** - Notez que l'étiquette doit être de 12 caractères maximum. 
 +</WRAP>
  
-Les options de la commande udevadm sont :+Les options de cette commande sont :
  
 <code> <code>
-[root@centos8 ~]# udevadm --help +[root@centos8 ~]# xfs_admin --help 
-udevadm [--help] [--version] [--debugCOMMAND [COMMAND OPTIONS] +/usr/sbin/xfs_admin: illegal option -- 
- +Usage: xfs_admin [-efjlpuV] [-c 0|1] [-L label] [-U uuid] device
-Send control commands or test the device manager. +
- +
-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>
  
-=====Système de fichiers /sys===== +Dernièrement, pour obtenir seul l'UUID du système de fichiers, utilisez la commande **xfs-admin** et l'option **-u** :
- +
-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 ~]# ls -/sys +[root@centos8 ~]# xfs_admin -/dev/sdb12 
-total 0 +UUID = 15db1b62-0866-4aa4-9ac1-3ac325a4e20f
-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 0 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 0 Jul 12 08:15 power+
 </code> </code>
  
-Chaque répertoire contient des informations :+<WRAP center round important 60%> 
 +**Important** - La commande **xfs_metadump** est utilisée pour sauvegarder les méta-données du système de fichiers, tandis que la commande **xfs_mdrestore** est utilisée pour restaurer les les méta-données du système de fichiers. 
 +</WRAP>
  
-  * **block** +=====Autres Systèmes de Fichiers=====
-    * 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** +
-    * contient, entre 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 cecisaisissez la commande suivante :+<WRAP center round important 60%> 
 +**Important** - Veuillez noter que le support des systèmes de fichiers **ReiserFS****JFS** et **Btrfs** est **absent** du noyau des distributions de Red Hat. 
 +</WRAP>
  
-<code> +====ReiserFS====
-[root@centos8 ~]# cat /sys/block/sda/sda1/size +
-2097152 +
-</code>+
  
-Ce chiffre correspond aux nombre de secteurs.+%%ReiserFS%% permet :
  
-=====LAB #4 Limitation des ressources=====+  * de meilleurs temps d'accès à des sous-répertoires que Ext3, même ceux contenant des dizaines de milliers de fichiers, 
 +  * une plus grande efficacité pour ce qui concerne le stockage des fichiers moins de quelques ko. Le gain d'espace peut aller jusqu'à 10% par rapport à Ext2/Ext3.
  
-====4.1 - ulimit====+Pour plus d'informations concernant %%ReiserFS%%, consultez **[[http://en.wikipedia.org/wiki/ReiserFS|cette page]]**.
  
-Les ressources disponibles aux utilisateurs peuvent être limitées par l'utilisation de la commande **ulimit**. +====JFS====
  
-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.+JFS //Journaled File System// est un système de fichiers journalisé mis au point par IBM et disponible sous licence GPL.
  
-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.+Pour plus d'informations concernant JFS, consultez **[[http://en.wikipedia.org/wiki/JFS_(file_system)|cette page]]**.
  
-L'utilisateur root peut paramétrer les limites accordées en éditant la fichier **/etc/security/limits.conf** :+====Btrfs====
  
-<code> +**[[https://btrfs.wiki.kernel.org/|Btrfs]]**, (B-tree file system, prononcé ButterFSest un système de fichiers expérimental basé sur la copie sur écriture sous licence GNU GPL, développé principalement par Oracle, Red Hat, FujitsuIntel, SUSE et STRATO AG, qui s'inspire grandement du système de fichiers ZFS utilisé par Solaris.
-[root@centos8 ~]# cat /etc/security/limits.conf +
-# /etc/security/limits.conf +
-+
-#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 +
-+
-#<item> can 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: [-2019] +
-#        - rtprio - max realtime priority +
-+
-#<domain>      <type>  <item>         <value> +
-#+
  
-#*               soft    core            0 +A noter sont les points suivants :
-#*               hard    rss             10000 +
-#@student        hard    nproc           20 +
-#@faculty        soft    nproc           20 +
-#@faculty        hard    nproc           50 +
-#ftp             hard    nproc           0 +
-#@student        -       maxlogins       4+
  
-# End of file +  * Btrfs utilise des extents, 
-</code> +  * Btrfs stocke les données des très petits fichiers directement dans l'extent du fichier répertoire, et non dans un extent séparé, 
 +  * Btrfs gère une notion de « sous-volumes » permettant ainsi des snapshots, 
 +  * Btrfs possède ses techniques propres de protection des données, 
 +  * Btrfs permet de redimensionner à chaud la taille du système de fichiers, 
 +  * Btrfs gère le RAID 0 ainsi que le RAID 1 logiciel, 
 +  * Btrfs gère la comprssion du système de fichiers.
  
-<WRAP center round important 60%> +=====Comparaison des Commandes par Système de Fichiers===== 
-**Important** : La valeur de la limite peut être un **nombre** ou le mot **unlimited**+ 
-</WRAP>+^ Description ^ Ext3 ^ Ext4 ^ XFS ^ ReiserFS ^ JFS ^ Btrfs ^ 
 +| Build a Linux filesystem | mkfs.ext3 (mke2fs -j) | mkfs.ext4 (mke4fs) | mkfs.xfs | mkfs.reiserfs (mkreiserfs) | mkfs.jfs (jfs_mkfs) | mkfs.btrfs | 
 +| Check a Linux filesystem | e2fsck | e2fsck | xfs_check xfs_repair | reiserfsck | jfs_fsck | btrfsck | 
 +| Adjust tunable filesystem parameters Linux filesystems | tune2fs | tune2fs | xfs_admin | reiserfstune | jfs_tune | btrfs-show-super, btrfs filesystem show, et btrfs filesystem df | 
 +| File system resizer | resize2fs | resize2fs | xfs_growfs | resize_reiserfs | S/O | btrfs filesystem resize | 
 +| Dump filesystem information | dumpe2fs | dumpe2fs | xfs_info / xfs_metadump | debugreiserfs | jfs_tune | btrfstune | 
 +| File system debugger | debugfs | debugfs | xfs_db | debugreiserfs | jfs_debugfs | btrfs-debug-tree | 
 +| Change the label on a filesystem | e2label | e2label | xfs_admin | reiserfstune | jfs_tune | btrfs filesystem label |
  
-Par exemple, si root inscrit les deux ligne suivantes dans le fichier /etc/security/limits.conf :+=====LAB #20 - Créer un Système de Fichiers ISO=====
  
-<file> +====La Commande mkisofs====
-... +
-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 contretrainee a la possibilité d'augmenter cette limite jusqu'à 4 096 en utilisant la commande suivante :+Pour créer un fichier ISO à partir d'une arborescence de fichiers, il convient d'utiliser la commande **mkisofs** :
  
 <code> <code>
-$ ulimit -n 4096+[root@centos8 ~]# cd /tmp 
 +[root@centos8 tmp]# mkisofs -r -T -o tmp.iso . 
 +I: -input-charset not specified, using utf-8 (detected in locale settings) 
 +Total translation table size: 1827 
 +Total rockridge attributes bytes: 1976 
 +Total directory bytes: 14336 
 +Path table size(bytes): 122 
 +Max brk space used 1c000 
 +186 extents written (0 MB)
 </code> </code>
  
-Pour consulter la liste des limites actuelles, il convient d'utiliser la commande ulimit avec l'option **-a** :+Le fichier ISO peut être monter en utilisant un périphérique de type **loop** :
  
 <code> <code>
-[root@centos8 ~]# ulimit -a +[root@centos8 tmp]# mount tmp.iso /mnt -o loop 
-core file size          (blocks, -c) unlimited +mount: /mnt: WARNING: device write-protectedmounted read-only. 
-data seg size           (kbytes, -d) unlimited +[root@centos8 tmp]# ls /mnt 
-scheduling priority             (-e) 0 +systemd-private-192104a9224f499286f5adb5754e9e04-chronyd.service-FI2YXs  TRANS.TBL  vg0_backup 
-file size               (blocks, -f) unlimited +[root@centos8 tmp]# ls  
-pending signals                 (-i) 14702 +systemd-private-192104a9224f499286f5adb5754e9e04-chronyd.service-FI2YXs  tmp.iso  vg0_backup
-max locked memory       (kbytes, -l) 64 +
-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>
  
-====Options de la commande==== +Démontez maintenant le fichier ISO :
- +
-Les options de **ulimit** sont :+
  
 <code> <code>
-[root@centos8 ~]# help ulimit +[root@centos8 tmp]# cd ~ 
-ulimit: ulimit [-SHabcdefiklmnpqrstuvxPT[limit] +[root@centos8 ~]# umount /tmp/tmp.iso
-    Modify shell resource limits. +
-     +
-    Provides control over the resources available to the shell and processes +
-    it creates, on systems that allow such control. +
-     +
-    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>
  
-====4.2 - Groupes de Contrôle====+====Options de la Commande mkisofs====
  
-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 options de cette commande sont :
  
-Les groupes de contrôle sont organisés de manière hiérarchique, comme des processusPar contrela 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 parentsles 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.+<code> 
 +[root@centos8 ~]# mkisofs --help 
 +Usage: genisoimage [options] file... 
 +Options: 
 +  -nobak                      Do not include backup files 
 +  -no-bak                     Do not include backup files 
 +  -abstract FILE              Set Abstract filename 
 +  -A ID-appid ID            Set Application ID 
 +  -biblio FILE                Set Bibliographic filename 
 +  -cache-inodes               Cache inodes (needed to detect hard links) 
 +  -no-cache-inodes            Do not cache inodes (if filesystem has no unique unides) 
 +  -check-oldnames             Check all imported ISO9660 names from old session 
 +  -check-session FILE         Check all ISO9660 names from previous session 
 +  -copyright FILE             Set Copyright filename 
 +  -debug                      Set debug flag 
 +  -b FILE, -eltorito-boot FILE 
 +                              Set El Torito boot image name 
 +  -e FILE, -efi-boot FILE     Set EFI boot image name 
 +  -eltorito-alt-boot          Start specifying alternative El Torito boot parameters 
 +  -B FILES, -sparc-boot FILES Set sparc boot image names 
 +  -sunx86-boot FILES          Set sunx86 boot image names 
 +  -G FILE, -generic-boot FILE Set generic boot image name 
 +  -sparc-label label text     Set sparc boot disk label 
 +  -sunx86-label label text    Set sunx86 boot disk label 
 +  -c FILE, -eltorito-catalog FILE 
 +                              Set El Torito boot catalog name 
 +  -C PARAMS, -cdrecord-params PARAMS 
 +                              Magic paramters from cdrecord 
 +  -d, -omit-period            Omit trailing periods from filenames (violates ISO9660) 
 +  -dir-mode mode              Make the mode of all directories this mode. 
 +  -D, -disable-deep-relocation 
 +                              Disable deep directory relocation (violates ISO9660) 
 +  -file-mode mode             Make the mode of all plain files this mode. 
 +  -f, -follow-links           Follow symbolic links 
 +  -gid gid                    Make the group owner of all files this gid. 
 +  -graft-points               Allow to use graft points for filenames 
 +  -root DIR                   Set root directory for all new files and directories 
 +  -old-root DIR               Set root directory in previous session that is searched for files 
 +  -help                       Print option help 
 +  -hide GLOBFILE              Hide ISO9660/RR file 
 +  -hide-list FILE             File with list of ISO9660/RR files to hide 
 +  -hidden GLOBFILE            Set hidden attribute on ISO9660 file 
 +  -hidden-list FILE           File with list of ISO9660 files with hidden attribute 
 +  -hide-joliet GLOBFILE       Hide Joliet file 
 +  -hide-joliet-list FILE      File with list of Joliet files to hide 
 +  -hide-joliet-trans-tbl      Hide TRANS.TBL from Joliet tree 
 +  -hide-rr-moved              Rename RR_MOVED to .rr_moved in Rock Ridge tree 
 +  -gui                        Switch behaviour for GUI 
 +  -i ADD_FILES                No longer supported 
 +  -input-charset CHARSET      Local input charset for file name conversion 
 +  -output-charset CHARSET     Output charset for file name conversion 
 +  -iso-level LEVEL            Set ISO9660 conformance level (1..3) or 4 for ISO9660 version 2 
 +  -J, -joliet                 Generate Joliet directory information 
 +  -joliet-long                Allow Joliet file names to be 103 Unicode characters 
 +  -jcharset CHARSET           Local charset for Joliet directory information 
 +  -l, -full-iso9660-filenames Allow full 31 character filenames for ISO9660 names 
 +  -max-iso9660-filenames      Allow 37 character filenames for ISO9660 names (violates ISO9660) 
 +  -allow-limited-size         Allow different file sizes in ISO9660/UDF on large files 
 +  -allow-leading-dots         Allow ISO9660 filenames to start with '.' (violates ISO9660) 
 +  -ldots                      Allow ISO9660 filenames to start with '.' (violates ISO9660) 
 +  -L-allow-leading-dots     Allow ISO9660 filenames to start with '.' (violates ISO9660) 
 +  -log-file LOG_FILE          Re-direct messages to LOG_FILE 
 +  -m GLOBFILE, -exclude GLOBFILE 
 +                              Exclude file name 
 +  -exclude-list FILE          File with list of file names to exclude 
 +  -pad                        Pad output to a multiple of 32k (default) 
 +  -no-pad                     Do not pad output to a multiple of 32k 
 +  -M FILE, -prev-session FILE Set path to previous session to merge 
 +  -dev SCSIdev                Set path to previous session to merge 
 +  -N, -omit-version-number    Omit version number from ISO9660 filename (violates ISO9660) 
 +  -new-dir-mode mode          Mode used when creating new directories. 
 +  -force-rr                   Inhibit automatic Rock Ridge detection for previous session 
 +  -no-rr                      Inhibit reading of Rock Ridge attributes from previous session 
 +  -no-split-symlink-components 
 +                              Inhibit splitting symlink components 
 +  -no-split-symlink-fields    Inhibit splitting symlink fields 
 +  -o FILE, -output FILE       Set output file name 
 +  -path-list FILE             File with list of pathnames to process 
 +  -p PREP, -preparer PREP     Set Volume preparer 
 +  -print-size                 Print estimated filesystem size and exit 
 +  -publisher PUB              Set Volume publisher 
 +  -P PUB, -publisher PUB      Set Volume publisher 
 +  -quiet                      Run quietly 
 +  -r, -rational-rock          Generate rationalized Rock Ridge directory information 
 +  -R, -rock                   Generate Rock Ridge directory information 
 +  -s TYPE, -sectype TYPE      Set output sector type to e.g. data/xa1/raw 
 +  -alpha-boot FILE            Set alpha boot image name (relative to image root) 
 +  -hppa-cmdline CMDLINE       Set hppa boot command line (relative to image root) 
 +  -hppa-kernel-32 FILE        Set hppa 32-bit image name (relative to image root) 
 +  -hppa-kernel-64 FILE        Set hppa 64-bit image name (relative to image root) 
 +  -hppa-bootloader FILE       Set hppa boot loader file name (relative to image root) 
 +  -hppa-ramdisk FILE          Set hppa ramdisk file name (relative to image root) 
 +  -mips-boot FILE             Set mips boot image name (relative to image root) 
 +  -mipsel-boot FILE           Set mipsel boot image name (relative to image root) 
 +  -jigdo-jigdo FILE           Produce a jigdo .jigdo file as well as the .iso 
 +  -jigdo-template FILE        Produce a jigdo .template file as well as the .iso 
 +  -jigdo-min-file-size SIZE   Minimum size for a file to be listed in the jigdo file 
 +  -jigdo-force-md5 PATTERN    Pattern(s) where files MUST match an externally-supplied MD5sum 
 +  -jigdo-exclude PATTERN      Pattern(s) to exclude from the jigdo file 
 +  -jigdo-map PATTERN1=PATTERN2 
 +                              Pattern(s) to map paths (e.g. Debian=/mirror/debian) 
 +  -md5-list FILE              File containing MD5 sums of the files that should be checked 
 +  -jigdo-template-compress ALGORITHM 
 +                              Choose to use gzip or bzip2 compression for template data; default is gzip 
 +  -checksum_algorithm_iso alg1,alg2,... 
 +                              Specify the checksum types desired for the output image 
 +  -checksum_algorithm_template alg1,alg2,... 
 +                              Specify the checksum types desired for the output jigdo template 
 +  -sort FILE                  Sort file content locations according to rules in FILE 
 +  -split-output               Split output into files of approx. 1GB size 
 +  -stream-file-name FILE_NAME Set the stream file ISO9660 name (incl. version) 
 +  -stream-media-size #        Set the size of your CD media in sectors 
 +  -sysid ID                   Set System ID 
 +  -T, -translation-table      Generate translation tables for systems that don't understand long filenames 
 +  -table-name TABLE_NAME      Translation table file name 
 +  -ucs-level LEVEL            Set Joliet UCS level (1..3) 
 +  -udf                        Generate UDF file system 
 +  -dvd-video                  Generate DVD-Video compliant UDF file system 
 +  -uid uid                    Make the owner of all files this uid. 
 +  -U, -untranslated-filenames Allow Untranslated filenames (for HPUX & AIX - violates ISO9660). Forces -l, -d, -N, -allow-leading-dots, -relaxed-filenames, -allow-lowercase, -allow-multidot 
 +  -relaxed-filenames          Allow 7 bit ASCII except lower case characters (violates ISO9660) 
 +  -no-iso-translate           Do not translate illegal ISO characters '~', '-' and '#' (violates ISO9660) 
 +  -allow-lowercase            Allow lower case characters in addition to the current character set (violates ISO9660) 
 +  -allow-multidot             Allow more than one dot in filenames (e.g. .tar.gz) (violates ISO9660) 
 +  -use-fileversion LEVEL      Use file version # from filesystem 
 +  -v, -verbose                Verbose 
 +  -version                    Print the current version 
 +  -V ID, -volid ID            Set Volume ID 
 +  -volset ID                  Set Volume set ID 
 +  -volset-size #              Set Volume set size 
 +  -volset-seqno #             Set Volume set sequence number 
 +  -x FILE, -old-exclude FILE  Exclude file name(depreciated) 
 +  -hard-disk-boot             Boot image is a hard disk image 
 +  -no-emul-boot               Boot image is 'no emulation' image 
 +  -no-boot                    Boot image is not bootable 
 +  -boot-load-seg #            Set load segment for boot image 
 +  -boot-load-size #           Set numbers of load sectors 
 +  -boot-info-table            Patch boot image with info table 
 +  -XA                         Generate XA directory attruibutes 
 +  -xa                         Generate rationalized XA directory attruibutes 
 +  -z, -transparent-compression 
 +                              Enable transparent compression of files 
 +  -hfs-type TYPE              Set HFS default TYPE 
 +  -hfs-creator CREATOR        Set HFS default CREATOR 
 +  -g, -apple                  Add Apple ISO9660 extensions 
 +  -h, -hfs                    Create ISO9660/HFS hybrid 
 +  -map MAPPING_FILE           Map file extensions to HFS TYPE/CREATOR 
 +  -H MAPPING_FILE, -map MAPPING_FILE 
 +                              Map file extensions to HFS TYPE/CREATOR 
 +  -magic FILE                 Magic file for HFS TYPE/CREATOR 
 +  -probe                      Probe all files for Apple/Unix file types 
 +  -mac-name                   Use Macintosh name for ISO9660/Joliet/RockRidge file name 
 +  -no-mac-files               Do not look for Unix/Mac files (depreciated) 
 +  -boot-hfs-file FILE         Set HFS boot image name 
 +  -part                       Generate HFS partition table 
 +  -cluster-size SIZE          Cluster size for PC Exchange Macintosh files 
 +  -auto FILE                  Set HFS AutoStart file name 
 +  -no-desktop                 Do not create the HFS (empty) Desktop files 
 +  -hide-hfs GLOBFILE          Hide HFS file 
 +  -hide-hfs-list FILE         List of HFS files to hide 
 +  -hfs-volid HFS_VOLID        Volume name for the HFS partition 
 +  -icon-position              Keep HFS icon position 
 +  -root-info FILE             finderinfo for root folder 
 +  -input-hfs-charset CHARSET  Local input charset for HFS file name conversion 
 +  -output-hfs-charset CHARSET Output charset for HFS file name conversion 
 +  -hfs-unlock                 Leave HFS Volume unlocked 
 +  -hfs-bless FOLDER_NAME      Name of Folder to be blessed 
 +  -hfs-parms PARAMETERS       Comma separated list of HFS parameters 
 +  -prep-boot FILE             PReP boot image file -- up to 4 are allowed 
 +  -chrp-boot                  Add CHRP boot header 
 +  --cap                       Look for AUFS CAP Macintosh files 
 +  --netatalk                  Look for NETATALK Macintosh files 
 +  --double                    Look for AppleDouble Macintosh files 
 +  --ethershare                Look for Helios EtherShare Macintosh files 
 +  --exchange                  Look for PC Exchange Macintosh files 
 +  --sgi                       Look for SGI Macintosh files 
 +  --macbin                    Look for MacBinary Macintosh files 
 +  --single                    Look for AppleSingle Macintosh files 
 +  --ushare                    Look for IPT UShare Macintosh files 
 +  --xinet                     Look for XINET Macintosh files 
 +  --dave                      Look for DAVE Macintosh files 
 +  --sfm                       Look for SFM Macintosh files 
 +  --osx-double                Look for MacOS X AppleDouble Macintosh files 
 +  --osx-hfs                   Look for MacOS X HFS Macintosh files
  
-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 :+Report problems to debburn-devel@lists.alioth.debian.org. 
 +</code>
  
-  * **blkio** - utilisé pour établir des limites sur l'accès des entrées/sorties à partir et depuis des périphériques blocs, +=====Systèmes de Fichiers Chiffrés sous RHEL/CentOS 8=====
-  * **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** :+====LAB #21 - Créer un Système de Fichiers Chiffré avec LUKS sous RHEL/CentOS 8=====
  
-<code> +===Présentation===
-[root@centos8 ~]# lssubsys -am +
-bash: lssubsys: command not found... +
-Install package 'libcgroup-tools' to provide command 'lssubsys'? [N/y] y+
  
 +**LUKS** ( Linux Unified Key Setup ) permet de chiffrer l'intégralité d'un disque de telle sorte que celui-ci soit utilisable sur d'autres plates-formes et distributions de Linux (voire d'autres systèmes d'exploitation). Il supporte jusqu'à 8 mots de passe, afin que plusieurs utilisateurs soient en mesure de déchiffrer le même volume sans partager leur mot de passe.
  
- * Waiting in queue...  +===Mise en Place===
-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+
  
 +Remplissez la partition /dev/sdb12 avec des données aléatoires :
  
- * Waiting in queue...  +<code> 
- * Waiting for authentication...  +[root@centos8 ~]# shred -v --iterations=1 /dev/sdb12 
- * Waiting in queue...  +shred: /dev/sdb12: pass 1/1 (random)...
- * 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>
  
-<code+<WRAP center round important 60%
-[root@centos8 ~]# lssubsys -am +**Important** : L'étape ci-dessus est très importante parce que elle permet de s'assurer qu'aucune donnée ne reste sur la partition. 
-cpuset /sys/fs/cgroup/cpuset +</WRAP>
-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+
  
-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.+Initialisez la partition avec LUKS :
  
-En haut de l'arborescence des unités de Systemd se trouve la tranche root - **-.slice**, dont dépend :+<code> 
 +[root@centos8 ~]# cryptsetup --verbose --verify-passphrase luksFormat /dev/sdb12
  
-  * le **system.slice** - l'emplacement des services système, +WARNING! 
-  * le **user.slice** - l'emplacement des sessions des utilisateurs, +======== 
-  * le **machine.slice** - l'emplacement des machines virtuelles et conteneurs.+This will overwrite data on /dev/sdb12 irrevocably.
  
-En dessous des tranches peuvent se trouver :+Are you sure? (Type 'yes' in capital letters)YES 
 +Enter passphrase for /dev/sdb12: fenestros123456789 
 +Verify passphrase: fenestros123456789 
 +Key slot 0 created. 
 +Command successful. 
 +</code>
  
-  * des **scopes** - des processus crées par **fork**, +<WRAP center round important 60%> 
-  des **services** - des processus créés par une **Unité**.+**Important** : La passphrase ne sera pas en claireElle l'est ici pour vous montrer un mot de passe acceptable pour LUKS. 
 +</WRAP>
  
-Les slices peuvent être visualisés avec la commande suivante :+Ouvrez la partition LUKS en lui donnant le nom **sdb12** :
  
 <code> <code>
-[root@centos8 ~]# systemctl list-units --type=slice +[root@centos8 ~]# cryptsetup luksOpen /dev/sdb12 sdb12 
-UNIT                                        LOAD   ACTIVE SUB    DESCRIPTION                                 +Enter passphrase for /dev/sdb12: fenestros123456789 
--.slice                                     loaded active active Root Slice                                  +</code>
-machine.slice                               loaded active active Virtual Machine and Container Slice         +
-system-getty.slice                          loaded active active system-getty.slice                          +
-system-lvm2\x2dpvscan.slice                 loaded active active system-lvm2\x2dpvscan.slice                 +
-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                     +
  
-LOAD   = Reflects whether the unit definition was properly loaded. +Vérifiez que le système voit la partition :
-ACTIVE = The high-level unit activation state, i.e. generalization of SUB. +
-SUB    = The low-level unit activation state, values depend on unit type.+
  
-13 loaded units listed. Pass --all to see loaded but inactive units, too. +<code> 
-To show all installed unit files use 'systemctl list-unit-files'.+[root@centos8 ~]# ls -l /dev/mapper | grep sdb12 
 +lrwxrwxrwx. 1 root root       7 Jun  2 10:03 sdb12 -../dm-2
 </code> </code>
  
-L'arborescence des unités de Systemd est la suivante :+Créez maintenant un système de fichiers sur **/dev/mapper/sdb12** :
  
 <code> <code>
-[root@centos8 ~]# systemd-cgls +[root@centos8 ~]# mkfs.xfs /dev/mapper/sdb12 
-Control group /: +meta-data=/dev/mapper/sdb12      isize=512    agcount=4, agsize=11776 blks 
--.slice +         =                       sectsz=512   attr=2, projid32bit=1 
-├─user.slice +                               crc=1        finobt=1, sparse=1, rmapbt=0 
-│ ├─user-42.slice +                               reflink=1 
-│ │ ├─session-c1.scope +data     =                       bsize=4096   blocks=47104, imaxpct=25 
-│ │ │ ├─1317 gdm-session-worker [pam/gdm-launch-environment] +         =                       sunit=0      swidth=0 blks 
-│ │ │ ├─1459 /usr/libexec/gdm-wayland-session --register-session gnome-session --autostart /usr/share/gdm/greeter/autostart +naming   =version 2              bsize=4096   ascii-ci=0, ftype=1 
-│ │ │ ├─1856 /usr/libexec/gnome-session-binary --autostart /usr/share/gdm/greeter/autostart +log      =internal log           bsize=4096   blocks=1368, version=2 
-│ │ │ ├─1882 /usr/bin/gnome-shell +         =                       sectsz=512   sunit=0 blks, lazy-count=1 
-│ │ │ ├─2059 /usr/bin/Xwayland :1024 -rootless -terminate -accessx -core -listen -listen 5 -displayfd 6 +realtime =none                   extsz=4096   blocks=0, rtextents=0
-│ │ │ ├─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> </code>
  
-En utilisant Systemd, plusieurs ressources peuvent être limitées :+Montez la partition LUKS :
  
-  * **CPUShares** - par défault 1024, +<code> 
-  * **MemoryLimit** - limite exprimée en Mo ou en Go. Pas de valeur par défaut, +[root@centos8 ~]# mount /dev/mapper/sdb12 /mnt/sdb12 
-  * **BlockIOWeight** - valeur entre 10 et 1000. Pas de valeur par défaut, +</code>
-  * **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%> +Vérifiez la présence du montage :
-**Important** Consultez le manuel systemd.resource-control(5) pour voir les paramètres CGroup qui peuvent être passés à systemctl. +
-</WRAP>+
  
-===Limitation de la Mémoire===+<code> 
 +[root@centos8 ~]# df -h | grep sdb12 
 +/dev/mapper/sdb12  179M   11M  168M   6% /mnt/sdb12 
 +</code>
  
-Commencez par créer le script **hello-world.sh** qui servira à générer un processus pour travailler avec les CGroups :+Editez le fichier **/etc/crypttab/** :
  
 <code> <code>
-[root@centos8 ~]# vi hello-world.sh +[root@centos8 ~]# vi /etc/crypttab 
-[root@centos8 ~]# cat hello-world.sh +[root@centos8 ~]# cat /etc/crypttab 
-#!/bin/bash +sdb12 /dev/sdb12 none
-while [ 1 ]; do +
-        echo "hello world" +
-        sleep 360 +
-done+
 </code> </code>
  
-Rendez le script exécutable et testez-le :+Modifiez le fichier **/etc/fstab** :
  
 <code> <code>
-[root@centos8 ~]# chmod u+x hello-world.sh +[root@centos8 ~]# vi /etc/fstab 
-[root@centos8 ~]# ./hello-world.sh +[root@centos8 ~]# cat /etc/fstab 
-hello world + 
-^C+
 +# /etc/fstab 
 +# Created by anaconda on Fri May  8 07:35:23 2020 
 +
 +# 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. 
 +
 +# After editing this file, run 'systemctl daemon-reload' to update systemd 
 +# units generated from this file
 +# 
 +UUID=4c0cc28c-0d59-45be-bd73-d292b80be33c /                       xfs     defaults        0 0 
 +UUID=2ae4c035-9244-458c-82c5-a49ae169cdb6 /boot                   ext4    defaults        1 2 
 +UUID=c8bb3f47-d67f-4b21-b781-766899dc83d4 swap                    swap    defaults        0 0 
 +/dev/mapper/sdb12   /mnt/sdb12   xfs   defaults   0 0
 </code> </code>
  
-Créez maintenant un CGroup dans le sous-système **memory** appelé **helloworld** :+Restaurer les SC par défaut de SELinux :
  
 <code> <code>
-[root@centos8 ~]# mkdir /sys/fs/cgroup/memory/helloworld+[root@centos8 ~]# /sbin/restorecon -v -R /mnt/sdb12 
 +Relabeled /mnt/sdb12 from system_u:object_r:unlabeled_t:s0 to system_u:object_r:mnt_t:s0
 </code> </code>
  
-Par défaut, ce 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 :+Redémarrez votre machine virtuelle :
  
 <code> <code>
-[root@centos8 ~]# echo 40000000 > /sys/fs/cgroup/memory/helloworld/memory.limit_in_bytes +[root@centos8 ~]# shutdown -r now
-[root@centos8 ~]# cat /sys/fs/cgroup/memory/helloworld/memory.limit_in_bytes +
-39997440+
 </code> </code>
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**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 ).+**Important** : Lors du démarrage de la machine virtuelle, le système devrait vous demander d'entrer la passphrase **fenestros123456789** pour permettre le montage de /dev/sda12.
 </WRAP> </WRAP>
  
-Lancez maintenant le script **helloworld.sh** : +===Ajouter une deuxième Passphrase=== 
 + 
 +Pour ajouter une deuxième passphrase, utilisez la commande cryptsetup avec la sous-commande **luksAddKey** :
  
 <code> <code>
-[root@centos8 ~]# ./hello-world.sh & +[trainee@centos8 ~]$ su - 
-[135148+Password: fenestros 
 +[root@centos8 ~]# cryptsetup luksAddKey /dev/sdb12 
 +Enter any existing passphrase: fenestros123456789 
 +Enter new passphrase for key slot: redhat123456789 
 +Verify passphrase: redhat123456789 
 +</code>
  
-[root@centos8 ~]# hello world +<WRAP center round important 60%> 
-[Entrée]+**Important** : Les passphrases ne seront pas en claire. Elle le sont ici pour vous montrer des mots de passe acceptables pour LUKS. 
 +</WRAP>
  
-[root@centos8 ~]# ps aux | grep hello-world +===Supprimer une Passphrase===
-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émoirece qui implique l'héritage par défaut :+Pour supprimer une passphraseutilisez la commande cryptsetup avec la sous-commande **luksRemoveKey** :
  
 <code> <code>
-[root@centos8 ~]# ps -ww -o cgroup 35148 +[root@centos8 ~]# cryptsetup luksRemoveKey /dev/sdb12 
-CGROUP +Enter passphrase to be deletedredhat123456789
-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+
 </code> </code>
  
-Insérer le PID de notre script dans le CGroup **helloworld** :+Avant de poursuivre, éditez les fichiers **/etc/fstab** et **/etc/crypttab** :
  
 <code> <code>
-[root@centos8 ~]# echo 35148 > /sys/fs/cgroup/memory/helloworld/cgroup.procs +[root@centos8 ~]# vi /etc/fstab 
-</code>+[root@centos8 ~]# cat /etc/fstab
  
-Notez maintenant l'héritage de la limitation de la mémoire - **12:memory:/helloworld** :+
 +# /etc/fstab 
 +# Created by anaconda on Fri May  8 07:35:23 2020 
 +
 +# 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. 
 +
 +# After editing this file, run 'systemctl daemon-reload' to update systemd 
 +# units generated from this file. 
 +
 +UUID=4c0cc28c-0d59-45be-bd73-d292b80be33c /                       xfs     defaults        0 0 
 +UUID=2ae4c035-9244-458c-82c5-a49ae169cdb6 /boot                   ext4    defaults        1 2 
 +UUID=c8bb3f47-d67f-4b21-b781-766899dc83d4 swap                    swap    defaults        0 0
  
-<code> +[root@centos8 ~]# vi /etc/crypttab 
-[root@centos8 ~]# ps -ww -o cgroup 35148 +[root@centos8 ~]# cat /etc/crypttab 
-CGROUP +[root@centos8 ~]# 
-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+
 </code> </code>
  
-Constatez ensuite l'occupation mémoire réelle :+=====Le Swap=====
  
-<code> +====Taille du swap====
-[root@centos8 ~]# cat /sys/fs/cgroup/memory/helloworld/memory.usage_in_bytes +
-274432 +
-</code>+
  
-Tuez le script **hello-world.sh** +Le tableau suivant résume la taille du swap recommandée en fonction de la mémoire de la machine :
  
-<code> +^ Mémoire ^ Taille du swap ^ 
-[root@centos8 ~]# kill 35148 +| 4 Go ou moins | 2 Go | 
-[root@centos8 ~]# ps aux grep hello-world +4 Go à 16 Go | 4 Go | 
-root       35307  0.0  0.0  12136  1112 pts/1    S+   08:55   0:00 grep --color=auto hello-world +| 16 Go à 64 Go | 8 Go | 
-[1]+  Terminated              ./hello-world.sh +| 64 Go à 256 Go | 16 Go |
-</code>+
  
-Créez un second CGroup beaucoup plus restrictif :+====Partitions de swap==== 
 + 
 +Une partition de swap peut être créée sur : 
 + 
 +  * une partition du disque dur 
 +  * un RAID logiciel 
 +  * un Volume Logique 
 + 
 +====La Commande swapon==== 
 + 
 +Pour préparer un espace de swap, il convient d'utiliser la commande **mkswap**. Pour activer une partition de swap, il convient d'utiliser la commande **swapon**. Pour consulter la liste des partitions swap, il convient d'utiliser la commande **swapon** avec l'option **-s**.
  
 <code> <code>
-[root@centos8 ~]# mkdir /sys/fs/cgroup/memory/helloworld1 +[root@centos8 ~]# swapon -s 
-[root@centos8 ~]# echo 6000 > /sys/fs/cgroup/memory/helloworld1/memory.limit_in_bytes +Filename Type Size Used Priority 
-[root@centos8 ~]# cat /sys/fs/cgroup/memory/helloworld1/memory.limit_in_bytes +/dev/dm-1                               partition       3358716 0       -2
-4096+
 </code> </code>
  
-Relancez le script **hello-world.sh** et insérez-le dans le nouveau CGroup :+<WRAP center round important 60%> 
 +**Important** : Vous noterez que dans l'exemple ci-dessus, le swap n'est pas utilisé. Notez aussi qu'il existe une notion de **priorité** pour les partions de swap. 
 +</WRAP> 
 + 
 +===Options de la Commande=== 
 + 
 +Les options de la commande swapon sont :
  
 <code> <code>
-[root@centos8 ~]# ./hello-world.sh & +[root@centos8 ~]# swapon --help
-[1] 35389+
  
-[root@centos8 ~]# hello world +Usage: 
-[Entrée]+ swapon [options] [<spec>]
  
-[root@centos8 ~]# echo 35389 > /sys/fs/cgroup/memory/helloworld1/cgroup.procs +Enable devices and files for paging and swapping.
-</code>+
  
-Attendez la prochaine sortie de **hello world** sur le canal standard puis constatez que le script s'arrête :+Options: 
 + -a, --all                enable all swaps from /etc/fstab 
 + -d, --discard[=<policy>] enable swap discards, if supported by device 
 + -e, --ifexists           silently skip devices that do not exist 
 + -f, --fixpgsz            reinitialize the swap space if necessary 
 + -o, --options <list>     comma-separated list of swap options 
 + -p, --priority <prio>    specify the priority of the swap device 
 + -s, --summary            display summary about used swap devices (DEPRECATED) 
 +     --show[=<columns>  display summary in definable table 
 +     --noheadings         don't print table heading (with --show) 
 +     --raw                use the raw output format (with --show) 
 +     --bytes              display swap size in bytes in --show output 
 + -v, --verbose            verbose mode
  
-<code+ -h, --help               display this help 
-[root@centos8 ~]# hello world + -V, --version            display version 
-[Entrée] + 
-[1]+  Killed                  ./hello-world.sh+The <specparameter: 
 + -L <label>             synonym for LABEL=<label> 
 + -U <uuid>              synonym for UUID=<uuid> 
 + LABEL=<label>          specifies device by swap area label 
 + UUID=<uuid>            specifies device by swap area UUID 
 + PARTLABEL=<label>      specifies device by partition label 
 + PARTUUID=<uuid>        specifies device by partition UUID 
 + <device>               name of device to be used 
 + <file>                 name of file to be used 
 + 
 +Available discard policy types (for --discard): 
 + once    : only single-time area discards are issued 
 + pages   : freed pages are discarded before they are reused 
 +If no policy is selected, both discard types are enabled (default). 
 + 
 +Available output columns: 
 + NAME   device file or partition path 
 + TYPE   type of the device 
 + SIZE   size of the swap area 
 + USED   bytes in use 
 + PRIO   swap priority 
 + UUID   swap uuid 
 + LABEL  swap label 
 + 
 +For more details see swapon(8).
 </code> </code>
  
-===La Commande cgcreate===+<WRAP center round important 60%> 
 +**Important** : L'option **-p** de la commande **swapon** permet de régler la priorité. 
 +</WRAP>
  
-Cette commande permet la création d'un CGroup :+====La Commande swapoff==== 
 + 
 +Dans le cas de notre exemple, la partition de swap se trouve sur **/dev/dm-1**. Pour la désactiver, il convient de saisir la commande suivante :
  
 <code> <code>
-[root@centos8 ~]# cgcreate -g memory:helloworld2 +[root@centos8 ~]# swapoff /dev/dm-1 
-[root@centos8 ~]# ls -l /sys/fs/cgroup/memory/helloworld2/ +[root@centos8 ~]# swapon -s 
-total 0 +[root@centos8 ~]# 
--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>
  
-Il n'existe cependant pas de commande pour affecter une limitation de la mémoire :+===Options de la Commande===
  
 <code> <code>
-[root@centos8 ~]# echo 40000000 > /sys/fs/cgroup/memory/helloworld2/memory.limit_in_bytes +[root@centos8 ~]# swapoff --help
-</code>+
  
-==La Commande cgexec==+Usage: 
 + swapoff [options] [<spec>]
  
-Cette commande permet d'insérer la limitation dans le CGroup **et** de lancer le script en une seule ligne :+Disable devices and files for paging and swapping.
  
-<code> +Options: 
-[root@centos8 ~]# cgexec -g memory:helloworld2 ./hello-world.sh & + -a, --all              disable all swaps from /proc/swaps 
-[1] 37670+ -v, --verbose          verbose mode
  
-[root@centos8 ~]# hello world + -h, --help             display this help 
-[Entrée]+ -V, --version          display version
  
-[root@centos8 ~]# +The <spec> parameter: 
 + -L <label>             LABEL of device to be used 
 + -U <uuid>              UUID of device to be used 
 + LABEL=<label>          LABEL of device to be used 
 + UUID=<uuid>            UUID of device to be used 
 + <device>               name of device to be used 
 + <file>                 name of file to be used 
 + 
 +For more details see swapoff(8).
 </code> </code>
  
-==La Commande cgdelete==+====LAB #22 - Créer un Fichier de Swap====
  
-Une fois le script terminécette commande permet de supprimer le cgroup :+Sous Linuxvous pouvez aussi bien utiliser un fichier de swap qu'une partition. La mise en place de ce fichier est faite en utilisant la commande **dd**. 
  
-<code> +La commande **dd** copie le fichier passé en entrée dans le fichier de sortie en limitant le nombre d'octets copiés par l'utilisation de deux options :
-[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+  * **count** 
 +    * le nombre 
 +  * **bs** 
 +    * la taille du bloc à copier
  
-root@centos8 ~]# ps aux | grep *.sh +Dans le cas du fichier swap il convient d'utiliser le fichier spécial **/dev/zero** en tant que fichier d'entréeLe fichier **/dev/zero** contient une valeur **null**.
-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+Pour créer votre fichier de swap de 268Mo, appelé **swap**, saisissez la commande suivante :
  
-[root@centos8 ~]# ls -l /sys/fs/cgroup/memory/helloworld2+<code> 
-ls: cannot access '/sys/fs/cgroup/memory/helloworld2/': No such file or directory+[root@centos8 ~]# dd if=/dev/zero of=/swap bs=1024k count=256 
 +256+0 records in 
 +256+0 records out 
 +268435456 bytes (268 MB, 256 MiB) copied, 0.103048 s, 2.6 GB/s
 </code> </code>
  
-==Le Fichier /etc/cgconfig.conf==+Pour préparer le fichier en tant qu'espace de swap, saisissez la commande suivante :
  
-Afin de les rendre persistantsil convient d'éditer le fichier **/etc/cgconfig.conf** :+<code> 
 +[root@centos8 ~]# mkswap /swap 
 +mkswap: /swap: insecure permissions 06440600 suggested. 
 +Setting up swapspace version 1, size = 256 MiB (268431360 bytes) 
 +no label, UUID=ee6c9e3f-0712-47b1-8f97-17ba215959d7 
 +</code> 
 + 
 +Pour activer le fichier avec une priorité de **1**, saisissez la commande suivante :
  
 <code> <code>
-[root@centos8 ~]# vi /etc/cgconfig.conf +[root@centos8 ~]# swapon -p1 /swap 
-[root@centos8 ~]# cat /etc/cgconfig.conf +swapon: /swap: insecure permissions 0644, 0600 suggested
-+</code
-#  Copyright IBM Corporation. 2007 + 
-+Pour visualiser les éspaces swapsaisissez la commande suivante : 
-#  Authors:     Balbir Singh <balbir@linux.vnet.ibm.com+ 
-#  This program is free software; you can redistribute it and/or modify it +<code> 
-#  under the terms of version 2.1 of the GNU Lesser General Public License +[root@centos8 ~]swapon -s 
-#  as published by the Free Software Foundation. +Filename Type Size Used Priority 
-+/swap                                  file     262140 0 1 
-#  This program is distributed in the hope that it would be usefulbut +/dev/dm-1                               partition       3358716 0       -2
-#  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> </code>
  
 <WRAP center round important 60%> <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.+**Important** : Le fichier de swap ayant une priorité de 1 sera utilisé avant la partition de swap ayant une priorité de -2.
 </WRAP> </WRAP>
  
-Créez donc les deux CGroups concernés :+<WRAP center round important 60%> 
 +**Important** Pour activer le fichier swap d'une manière permanente, il convient d'ajouter une ligne au fichier **/etc/fstab**. Ne modifiez pas votre fichier **/etc/fstab** car vous allez supprimer le fichier de swap. 
 +</WRAP>
  
-<code> +Désactivez maintenant le fichier swap :
-[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> <code>
-[root@centos8 ~]# cgcreate -g cpu:helloworld2 +[root@centos8 ~]# swapoff /swap 
-[root@centos8 ~]# ls -/sys/fs/cgroup/cpu/helloworld2/ +[root@centos8 ~]# swapon -
-total 0 +Filename Type Size Used Priority 
--rw-rw-r--root root Jul 13 10:47 cgroup.clone_children +/dev/dm-1                               partition       3358716       -2
--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> </code>
  
-==La Commande cgconfigparser== +Supprimez maintenant le fichier de swap :
- +
-Appliquez le contenu du fichier **/etc/cgconfig.conf** grâce à l'utilisation de la commande **cgconfigparser** :+
  
 <code> <code>
-[root@centos8 ~]# cgconfigparser -l /etc/cgconfig.conf +[root@centos8 ~]# rm /swap 
-[root@centos8 ~]# cat /sys/fs/cgroup/memory/helloworld2/memory.limit_in_bytes +rm: remove regular file '/swap'? y
-36864 +
-[root@centos8 ~]# cat /sys/fs/cgroup/cpu/helloworld2/cpu.shares +
-100+
 </code> </code>
  
 ----- -----
 Copyright © 2024 Hugh Norris. Copyright © 2024 Hugh Norris.
Menu