Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
elearning:workbooks:debian:10:junior:l117 [2022/07/07 06:13] – admin | elearning:workbooks:debian:10:junior:l117 [2024/03/08 13:10] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
~~PDF: | ~~PDF: | ||
- | Version : **2022.02** | + | Version : **2024.01** |
Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
- | ======LDF511 | + | ======LDF516 |
=====Contenu du Module===== | =====Contenu du Module===== | ||
+ | |||
+ | * **LDF517 - Validation de la Formation** | ||
+ | * Contenu du Module | ||
+ | * Rappel du Programme de la Formation | ||
+ | * Certification | ||
+ | |||
+ | =====Rappel du Programme de la Formation===== | ||
+ | |||
+ | * **LDF500 - Présentation de la Formation**. | ||
+ | * Prérequis | ||
+ | * Matériel | ||
+ | * Logiciels | ||
+ | * Internet | ||
+ | * Programme de la Formation | ||
+ | * Évaluation des Connaissances en Amont | ||
+ | |||
+ | * **LDF501 - Gestion des Utilisateurs**. | ||
+ | * Présentation | ||
+ | * / | ||
+ | * Interrogation des Bases de Données | ||
+ | * Les Fichiers /etc/group et / | ||
+ | * Les Fichiers /etc/passwd et /etc/shadow | ||
+ | * Commandes | ||
+ | * Groupes | ||
+ | * groupadd | ||
+ | * groupdel | ||
+ | * groupmod | ||
+ | * newgrp | ||
+ | * gpasswd | ||
+ | * Utilisateurs | ||
+ | * useradd | ||
+ | * userdel | ||
+ | * usermod | ||
+ | * passwd | ||
+ | * chage | ||
+ | * Configuration | ||
+ | * LAB #1 - Gérer les Utilisateurs et les Groupes | ||
+ | * LAB #2 - Forcer l' | ||
+ | * 2.1 - Présentation de PAM | ||
+ | * 2.2 - Configuration des modules | ||
+ | * 2.3 - Utiliser des Mots de Passe Complexe | ||
+ | * LAB #3 - su et su - | ||
+ | * LAB #4 - sudo | ||
+ | |||
+ | * **LDF502 - Gestion des Paquets**. | ||
+ | * LAB #1 - Compiler à partir des sources | ||
+ | * 1.1 - ./configure | ||
+ | * 1.2 - make | ||
+ | * 1.3 - make check | ||
+ | * 1.4 - make install | ||
+ | * LAB#2 - Utilisation de la Commande dpkg | ||
+ | * 2.1 - Configuration | ||
+ | * 2.2 - Utilisation | ||
+ | * LAB#3 - Utilisation de la Commande dselect | ||
+ | * LAB#4 - Utilisation de la Commande apt-get | ||
+ | * 4.1 - Configuration | ||
+ | * 4.2 - Dépôts | ||
+ | * 4.3 - Utilisation | ||
+ | * LAB #5 - Utilisation de la Commande apt-cache | ||
+ | * Les Bibliothèques Partagées | ||
+ | * Présentation | ||
+ | * Introduction | ||
+ | * Stockage | ||
+ | * ld-linux.so.2 | ||
+ | * La Commande ldd | ||
+ | * Le fichier / | ||
+ | * La Commande ldconfig | ||
+ | |||
+ | * **LDF503 - Gestion des Droits**. | ||
+ | * Présentation | ||
+ | * Préparation | ||
+ | * LAB #1 - Les Droits Unix Simples | ||
+ | * 1.1 - La Modification des Droits | ||
+ | * La Commande chmod | ||
+ | * Mode Symbolique | ||
+ | * Mode Octal | ||
+ | * La Commande umask | ||
+ | * 1.2 - Modifier le propriétaire ou le groupe | ||
+ | * La Commande chown | ||
+ | * La Commande chgrp | ||
+ | * LAB #2 - Les Droits Unix Étendus | ||
+ | * 2.1 - SUID/SGID bit | ||
+ | * 2.2 - Inheritance Flag | ||
+ | * 2.3 - Sticky bit | ||
+ | * LAB #3 - Les Droits Unix Avancés | ||
+ | * 3.1 - Les ACL | ||
+ | * 3.2 - Les Attributs Étendus | ||
+ | |||
+ | * **LDF504 - Gestion des Disques, des Systèmes de Fichiers et du Swap**. | ||
+ | * Périphériques de stockage | ||
+ | * Partitions | ||
+ | * Partitionnement | ||
+ | * LAB #1 - Partitionnement de votre Disque avec fdisk | ||
+ | * Logical Volume Manager (LVM) | ||
+ | * LAB #2 - Volumes Logiques Linéaires | ||
+ | * LAB #3 - Étendre un Volume Logique à Chaud | ||
+ | * LAB #4 - Snapshots | ||
+ | * LAB #5 - Suppression des Volumes | ||
+ | * LAB #6 - Volumes Logiques en Miroir | ||
+ | * LAB #7 - Modifier les Attributs LVM | ||
+ | * LAB #8 - Volumes Logiques en Bandes | ||
+ | * LAB #9 - Gérer les Métadonnées | ||
+ | * Systèmes de Fichiers Journalisés | ||
+ | * Présentation | ||
+ | * Ext3 | ||
+ | * Gestion d'Ext3 | ||
+ | * LAB #10 - Convertir un Système de Fichiers Ext3 en Ext2 | ||
+ | * LAB #11 - Convertir un Système de Fichiers Ext2 en Ext3 | ||
+ | * LAB #12 - Placer le Journal sur un autre Partition | ||
+ | * LAB #13 - Modifier la Fréquence de Vérification du Système de Fichiers Ext3 | ||
+ | * Ext4 | ||
+ | * LAB #14 - Créer un Système de Fichiers Ext4 | ||
+ | * LAB #15 - Ajouter une Étiquette au Système de Fichiers Ext4 | ||
+ | * LAB #16 - Convertir un Système de Fichiers Ext3 en Ext4 | ||
+ | * XFS | ||
+ | * LAB #17 - Créer un Système de Fichiers XFS | ||
+ | * LAB #18 - Ajouter une Étiquette au Système de Fichiers XFS | ||
+ | * ReiserFS | ||
+ | * LAB #19 - Créer un Système de Fichiers ReiserFS | ||
+ | * LAB #20 - Ajouter une Étiquette au Système de Fichiers ReiserFS | ||
+ | * JFS | ||
+ | * LAB #21 - Créer un Système de Fichiers JFS | ||
+ | * LAB #22 - Ajouter une Étiquette au Système de Fichiers JFS | ||
+ | * Btrfs | ||
+ | * LAB #23 - Créer un Système de Fichiers Btrfs | ||
+ | * LAB #24 - Convertir un Système de Fichiers Ext4 en Brtfs | ||
+ | * LAB #25 - Créer un Snapshot | ||
+ | * LAB #26 - Ajouter une Étiquette au Système de Fichiers Btrfs | ||
+ | * Comparaison des Commandes par Système de Fichiers | ||
+ | * Systèmes de Fichiers Chiffrés | ||
+ | * LAB #27 - Créer un Système de Fichiers Chiffré avec encryptfs | ||
+ | * LAB #28 - Créer un Système de Fichiers Chiffré avec LUKS | ||
+ | * Raid Logiciel | ||
+ | * LAB #29 - Mise en Place du RAID 5 Logiciel | ||
+ | * 29.1 - Préparer le disque | ||
+ | * 29.2 - Créer une Unité RAID | ||
+ | * 29.3 - Remplacer une Unité Défaillante | ||
+ | * Le Swap | ||
+ | * Taille du swap | ||
+ | * Partitions de swap | ||
+ | * La Commande swapon | ||
+ | * La Commande swapoff | ||
+ | * LAB #30 - Créer un Fichier de Swap | ||
+ | |||
+ | * **LDF505 - Gestion des Tâches**. | ||
+ | * LAB #1 - cron | ||
+ | * 1.1 - Le Fichier / | ||
+ | * 1.2 - Les Champs Temporels | ||
+ | * 1.3 - Les crontabs Utilisateurs | ||
+ | * 1.4 - Les Fichiers / | ||
+ | * LAB #2 - anacron | ||
+ | * 2.1 - Le Fichier / | ||
+ | * 2.2 - Les Fichiers cron.daily, cron.weekly et cron.monthly | ||
+ | * LAB #3 - at | ||
+ | * 3.1 - Les Fichiers / | ||
+ | * 3.2 - Le Répertoire / | ||
+ | |||
+ | * **LDF506 - Gestion de l' | ||
+ | * Types de Sauvegardes | ||
+ | * Sauvegarde complète | ||
+ | * Sauvegarde différentielle | ||
+ | * Sauvegarde incrémentale | ||
+ | * Sauvegarde décrémentale | ||
+ | * Outils Classiques de Sauvegarde | ||
+ | * Préparation | ||
+ | * LAB #1 - La Commande tar | ||
+ | * 1.1 - Présentation | ||
+ | * 1.2 - Travailler avec la Commande tar | ||
+ | * 1.2 - La Commande GPL tar et la Compression | ||
+ | * LAB #2 - La Commande cpio | ||
+ | * 2.1 - Présentation | ||
+ | * 2.2 - Travailler avec la Commande cpio | ||
+ | * LAB #3 - La Commande dd | ||
+ | * 3.1 - Présentation | ||
+ | * 3.2 - Travailler avec la Commande dd | ||
+ | * Les Commandes dump et restore | ||
+ | * Présentation | ||
+ | * Outils Avancés de Sauvegarde | ||
+ | * Outils de Sauvegarde Unidirectionnelle | ||
+ | * Outils de Sauvegarde Multidirectionnelle | ||
+ | * Outils de Sauvegarde des Partitions | ||
+ | * LAB #4 - Que Sauvegarder en Priorité ? | ||
+ | * 4.1 - Sauvegarde de la Liste des Paquets | ||
+ | * 4.2 - Sauvegarde d'un Mémo sur la Structure du Disque Dur Système | ||
+ | * 4.3 - Sauvegarde d'un Mémo sur les Points de Montage du Disque Dur Système | ||
+ | * 4.4 - Sauvegarde du Chargeur de Démarrage | ||
+ | * GRUB Legacy | ||
+ | * GRUB 2 avec BIOS | ||
+ | * GRUB 2 avec EFI | ||
+ | * 4.5 - Sauvegarde des Dossiers Utilisateurs | ||
+ | * LAB #5 - Rsync | ||
+ | * 5.1 - Présentation | ||
+ | * 5.2 - Travailler avec la Commande rsync | ||
+ | * Compression | ||
+ | * LAB #6 - La Commande gzip | ||
+ | * 6.1 - Présentation | ||
+ | * 6.2 - Travaller avec la Commande gzip | ||
+ | * LAB #7 - La Commande bzip2 | ||
+ | * 7.1 - Présentation | ||
+ | * 7.2 - Travailler avec la Commande bzip2 | ||
+ | * LAB #8 - La Commande xz | ||
+ | * 8.1 - Présentation | ||
+ | * 8.2 - Travailler avec la Commande xz | ||
+ | * Autres Utilitaires | ||
+ | |||
+ | * **LDF507 - Gestion des Processus**. | ||
+ | * Présentation | ||
+ | * Les Types de Processus | ||
+ | * LAB #1 - Les Commandes relatives aux Processus | ||
+ | * 1.1 - La Commande ps | ||
+ | * 1.2 - La Commande pgrep | ||
+ | * 1.3 - La Commande pstree | ||
+ | * 1.4 - La Commande top | ||
+ | * 1.5 - Les Commandes fg, bg et jobs | ||
+ | * 1.6 - La Commande wait | ||
+ | * 1.7 - La Commande nice | ||
+ | * 1.8 - La Commande renice | ||
+ | * 1.9 - La Commande nohup | ||
+ | * 1.10 - La Commande kill | ||
+ | * 1.11 - La Commande pkill | ||
+ | |||
+ | * **LDF508 - Gestion de la Journalisation**. | ||
+ | * Présentation | ||
+ | * La Commande dmesg | ||
+ | * LAB #1 - Surveillance Sécuritaire | ||
+ | * 1.1 - La Commande last | ||
+ | * 1.2 - La Commande lastlog | ||
+ | * 1.3 - La Commande lastb | ||
+ | * 1.4 - Le fichier / | ||
+ | * 1.5 - Gestion des évènements audit | ||
+ | * Le fichier / | ||
+ | * auditd | ||
+ | * auditctl | ||
+ | * audispd | ||
+ | * La consultation des événements audit | ||
+ | * La Commande aureport | ||
+ | * La Commande ausearch | ||
+ | * Le fichier / | ||
+ | * Applications | ||
+ | * LAB #2 - rsyslog | ||
+ | * 2.1 - Priorités | ||
+ | * 2.2 - Sous-systèmes applicatifs | ||
+ | * 2.3 - / | ||
+ | * Modules | ||
+ | * Directives Globales | ||
+ | * Règles | ||
+ | * Sous-système applicatif.Priorité | ||
+ | * Sous-système applicatif!Priorité | ||
+ | * Sous-système applicatif=Priorité | ||
+ | * L' | ||
+ | * n Sous-systèmes avec la même priorité | ||
+ | * n Sélecteurs avec la même Action | ||
+ | * LAB #3 - La Commande logger | ||
+ | * LAB #4 - La Commande logrotate | ||
+ | * LAB #5 - La Journalisation avec journald | ||
+ | * 5.1 - Consultation des Journaux | ||
+ | * 5.2 - Consultation des Journaux d'une Application Spécifique | ||
+ | * 5.3 - Consultation des Journaux depuis le Dernier Démarrage | ||
+ | * 5.4 - Consultation des Journaux d'une Priorité Spécifique | ||
+ | * 5.5 - Consultation des Journaux d'une Plage de Dates ou d' | ||
+ | * 5.6 - Consultation des Journaux en Live | ||
+ | |||
+ | * **LDF509 - Gestion des Impressions**. | ||
+ | * Présentation de Cups | ||
+ | * Protocoles | ||
+ | * Paquets | ||
+ | * Daemon | ||
+ | * Le fichier / | ||
+ | * Filtres | ||
+ | * Backends | ||
+ | * Journaux | ||
+ | * Imprimantes | ||
+ | * LAB #1 - Administration de Cups | ||
+ | * 1.1 - La Commande lpstat | ||
+ | * 1.2 - La Commande lpadmin | ||
+ | * 1.3 - Les Commandes accept et cupsenable | ||
+ | * 1.4 - Classe d' | ||
+ | * 1.5 - Le fichier / | ||
+ | * 1.6 - Le fichier / | ||
+ | * 1.7 - La Commande cancel | ||
+ | * 1.8 - La Commande lpmove | ||
+ | * 1.9 - L' | ||
+ | |||
+ | * **LDF510 - Gestion du Démarrage et de l' | ||
+ | * Présentation | ||
+ | * BIOS, EFI et OpenFirmware | ||
+ | * Systèmes à base du BIOS | ||
+ | * Charger de Démarrage | ||
+ | * Systèmes à base de l'EFI | ||
+ | * Autres Systèmes | ||
+ | * Gestionnaire d' | ||
+ | * LILO | ||
+ | * La Commande LILO | ||
+ | * Codes Erreur de LILO | ||
+ | * GRUB 2 | ||
+ | * Le fichier / | ||
+ | * Le fichier / | ||
+ | * Les fichiers du répertoire /etc/grub.d | ||
+ | * Modifier la Configuration de GRUB 2 en Ligne de Commande | ||
+ | * Gestionnaires de Démarrages Alternatifs | ||
+ | * Systemd-boot | ||
+ | * U-boot | ||
+ | * Le Projet Syslinux | ||
+ | * SYSLINUX | ||
+ | * EXTLINUX | ||
+ | * ISOLINUX | ||
+ | * PXELINUX | ||
+ | * Isodhpfx | ||
+ | * Initramfs | ||
+ | * LAB #1 - Travailler avec Initramfs | ||
+ | * 1.1 - Examiner l' | ||
+ | * 1.2 - La Commande mkinitramfs | ||
+ | * Processus de Démarrage du Noyau Linux | ||
+ | * systemd | ||
+ | * LAB #2 - La Commande systemctl | ||
+ | * LAB #3 - Fichiers de Configuration | ||
+ | * 3.1 - Fichiers de Configuration par Défaut | ||
+ | * 3.2 - Surchargement des Fichiers par Défaut | ||
+ | * 3.3 - Les Fichiers d' | ||
+ | * LAB #4 - La Commande systemd-analyze | ||
+ | * LAB #5 - Les Cibles | ||
+ | * 5.1 - Contrôler les dépendances d'une Cible | ||
+ | * 5.2 - La Cible par Défaut | ||
+ | * LAB #6 - Gestion des Services | ||
+ | * 6.1 - Gestion des Instances Uniques | ||
+ | * 6.2 - Gestion d' | ||
+ | * 6.3 - Interdire la Modification du Statut d'un Service | ||
+ | * Arrêt Système du Système | ||
+ | * La Commande shutdown | ||
+ | * La Commande reboot | ||
+ | * La Commande halt | ||
+ | * La Commande poweroff | ||
* **LDF511 - Gestion des Paramètres et les Ressources du Matériel** | * **LDF511 - Gestion des Paramètres et les Ressources du Matériel** | ||
- | * Contenu du Module | ||
* Présentation des Fichiers Spéciaux | * Présentation des Fichiers Spéciaux | ||
* LAB #1 - Commandes | * LAB #1 - Commandes | ||
Ligne 16: | Ligne 347: | ||
* 1.2 - La Commande lsusb | * 1.2 - La Commande lsusb | ||
* 1.3 - La Commande lsblk | * 1.3 - La Commande lsblk | ||
- | * 1.4 - La Commande dmidecode | + | * 1.4 - La Commande lsscsi |
+ | * 1.5 - La Commande lscpu | ||
+ | * 1.6 - La Commande lshw | ||
+ | * 1.7 - La Commande dmidecode | ||
+ | * 1.8 - La Commande smartctl | ||
+ | * 1.9 - Les Commandes accton et dump-acct | ||
+ | * 1.10 - La Commande lastcomm | ||
+ | * 1.11 - La Commande sa | ||
+ | * 1.12 - La Commande ac | ||
* LAB #2 - La Commande sysctl | * LAB #2 - La Commande sysctl | ||
* 2.1 - Répertoire /proc | * 2.1 - Répertoire /proc | ||
Ligne 67: | Ligne 406: | ||
* 6.4 - La Commande systemctl set-property | * 6.4 - La Commande systemctl set-property | ||
- | =====Présentation des Fichiers Spéciaux===== | + | * **LDF512 |
- | + | | |
- | Dans l' | + | * Disques en miroir |
- | + | * Bandes | |
- | <WRAP center round important > | + | * Types de RAID |
- | **Important** : Les périphériques qui nécessitent à ce que l' | + | * RAID 0 - Concaténation |
- | </ | + | * RAID 0 - Striping |
- | + | * RAID 1 - Miroir | |
- | Consultez le contenu du répertoire /dev : | + | * RAID 1+0 - Striping |
- | + | * RAID 2 - Miroir avec Contrôle | |
- | < | + | * RAID 3 et 4 - Striping avec Parité |
- | root@debian11: | + | * RAID 5 - Striping avec Parité Distribuée |
- | total 0 | + | * Au délà |
- | crw-r--r-- | + | * RAID Logiciel |
- | drwxr-xr-x | + | * Préparation |
- | drwxr-xr-x | + | * Partitionnement |
- | crw-rw---- | + | * Mise en Place du RAID 5 Logiciel |
- | drwxr-xr-x | + | |
- | lrwxrwxrwx | + | |
- | drwxr-xr-x | + | |
- | crw--w---- | + | |
- | lrwxrwxrwx | + | |
- | crw------- | + | |
- | crw------- | + | |
- | drwxr-xr-x | + | |
- | brw-rw---- | + | |
- | brw-rw---- | + | |
- | brw-rw---- | + | |
- | drwxr-xr-x | + | |
- | lrwxrwxrwx | + | |
- | crw------- | + | |
- | crw-rw---- | + | |
- | lrwxrwxrwx | + | |
- | crw-rw-rw- | + | |
- | crw-rw-rw- | + | |
- | crw------- | + | |
- | crw------- | + | |
- | drwxr-xr-x | + | |
- | lrwxrwxrwx | + | |
- | drwxr-xr-x | + | |
- | crw-r--r-- | + | |
- | lrwxrwxrwx | + | |
- | crw-rw---- | + | |
- | drwxr-xr-x | + | |
- | crw-r----- | + | |
- | drwxrwxrwt | + | |
- | drwxr-xr-x | + | |
- | crw-rw-rw- | + | |
- | crw------- | + | |
- | crw-r----- | + | |
- | crw------- | + | |
- | crw------- | + | |
- | crw-rw-rw- | + | |
- | drwxr-xr-x | + | |
- | crw-rw-rw- | + | |
- | crw-rw-r-- | + | |
- | lrwxrwxrwx | + | |
- | crw------- | + | |
- | --More-- | + | |
- | [q] | + | |
- | </ | + | |
- | + | ||
- | On peut noter dans la sortie de la commande que certains fichiers sont de type **bloc** (**b**), tandis que d' | + | |
- | + | ||
- | < | + | |
- | ... | + | |
- | brw-rw---- | + | |
- | ... | + | |
- | crw--w---- | + | |
- | ... | + | |
- | </ | + | |
- | + | ||
- | 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' | + | |
- | + | ||
- | Les deux informations clefs du fichier spécial sont situées à la place de la taille d'un fichier normal et se nomment le **majeur** et le **mineur** : | + | |
- | + | ||
- | * le **majeur** identifie le pilote du périphérique et donc son contrôleur, | + | |
- | * le **mineur** identifie le périphérique ou une particularité du périphérique telle une partition d'un disque. | + | |
- | + | ||
- | =====LAB #1 - Commandes===== | + | |
- | + | ||
- | ====1.1 - La Commande lspci==== | + | |
- | + | ||
- | Cette commande vous renseigne sur les adaptateurs reliés aux bus PCI, AGP et PCI express : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | 00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02) | + | |
- | 00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/ | + | |
- | 00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/ | + | |
- | 00:01.2 USB controller: Intel Corporation 82371SB PIIX3 USB [Natoma/ | + | |
- | 00:01.3 Bridge: Intel Corporation 82371AB/ | + | |
- | 00:02.0 VGA compatible controller: Device 1234:1111 (rev 02) | + | |
- | 00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon | + | |
- | 00:05.0 SCSI storage controller: Red Hat, Inc. Virtio SCSI | + | |
- | 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 bridge: Red Hat, Inc. QEMU PCI-PCI bridge | + | |
- | </ | + | |
- | + | ||
- | Pour obtenir de l' | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | 00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon | + | |
- | Subsystem: Red Hat, Inc. Virtio memory balloon | + | |
- | Physical Slot: 3 | + | |
- | Flags: bus master, fast devsel, latency 0, IRQ 10 | + | |
- | I/O ports at e000 [size=64] | + | |
- | Memory at fe400000 (64-bit, prefetchable) [size=16K] | + | |
- | Capabilities: | + | |
- | Capabilities: | + | |
- | Capabilities: | + | |
- | Capabilities: | + | |
- | Capabilities: | + | |
- | Kernel driver in use: virtio-pci | + | |
- | Kernel modules: virtio_pci | + | |
- | </ | + | |
- | + | ||
- | ou : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | 00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon | + | |
- | Subsystem: Red Hat, Inc. Virtio memory balloon | + | |
- | Physical Slot: 3 | + | |
- | Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx- | + | |
- | Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- | + | |
- | Latency: 0 | + | |
- | 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: | + | |
- | BAR=0 offset=00000000 size=00000000 | + | |
- | Capabilities: | + | |
- | BAR=4 offset=00003000 size=00001000 multiplier=00000004 | + | |
- | Capabilities: | + | |
- | BAR=4 offset=00002000 size=00001000 | + | |
- | Capabilities: | + | |
- | BAR=4 offset=00001000 size=00001000 | + | |
- | Capabilities: | + | |
- | BAR=4 offset=00000000 size=00001000 | + | |
- | Kernel driver in use: virtio-pci | + | |
- | Kernel modules: virtio_pci | + | |
- | </ | + | |
- | + | ||
- | Les options de cette commande sont : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | lspci: invalid option -- ' | + | |
- | Usage: lspci [< | + | |
- | + | ||
- | Basic display modes: | + | |
- | -mm | + | |
- | -t Show bus tree | + | |
- | + | ||
- | Display options: | + | |
- | -v Be verbose (-vv or -vvv for higher verbosity) | + | |
- | -k Show kernel drivers handling each device | + | |
- | -x Show hex-dump of the standard part of the config space | + | |
- | -xxx Show hex-dump of the whole config space (dangerous; root only) | + | |
- | -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 | + | |
- | + | ||
- | Resolving of device ID's to names: | + | |
- | -n Show numeric ID's | + | |
- | -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: | + | |
- | -s [[[[< | + | |
- | -d [< | + | |
- | + | ||
- | Other options: | + | |
- | -i < | + | |
- | -p < | + | |
- | -M Enable `bus mapping' | + | |
- | + | ||
- | PCI access options: | + | |
- | -A < | + | |
- | -O < | + | |
- | -G Enable PCI access debugging | + | |
- | -H < | + | |
- | -F < | + | |
- | </ | + | |
- | + | ||
- | ====1.2 - La Commande lsusb==== | + | |
- | + | ||
- | Cette commande vous renseigne sur les adaptateurs reliés au bus usb : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd QEMU USB Tablet | + | |
- | Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub | + | |
- | + | ||
- | root@debian11: | + | |
- | /: Bus 01.Port 1: Dev 1, Class=root_hub, | + | |
- | | + | |
- | |__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, | + | |
- | ID 0627:0001 Adomax Technology Co., Ltd | + | |
- | </ | + | |
- | + | ||
- | Les options de cette commande sont : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | Usage: lsusb [options]... | + | |
- | List USB devices | + | |
- | -v, --verbose | + | |
- | | + | |
- | -s [[bus]: | + | |
- | Show only devices with specified device and/or | + | |
- | bus numbers (in decimal) | + | |
- | -d vendor: | + | |
- | Show only devices with the specified vendor and | + | |
- | product ID numbers (in hexadecimal) | + | |
- | -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 | + | |
- | </ | + | |
- | + | ||
- | ====1.3 - La Commande lsblk==== | + | |
- | + | ||
- | Cette commande vous renseigne sur les périphériques de type bloc : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT | + | |
- | sda | + | |
- | ├─sda1 | + | |
- | ├─sda2 | + | |
- | └─sda5 | + | |
- | sdb | + | |
- | sdc | + | |
- | ├─sdc1 | + | |
- | ├─sdc2 | + | |
- | ├─sdc3 | + | |
- | ├─sdc4 | + | |
- | ├─sdc5 | + | |
- | ├─sdc6 | + | |
- | │ └─vg0-lv1 254:0 0 104M 0 lvm | + | |
- | ├─sdc7 | + | |
- | │ └─vg0-lv2 254:1 0 112M 0 lvm | + | |
- | ├─sdc8 | + | |
- | │ └─md1 | + | |
- | ├─sdc9 | + | |
- | │ └─vg0-lv2 254:1 0 112M 0 lvm | + | |
- | ├─sdc10 | + | |
- | │ └─md1 | + | |
- | ├─sdc11 | + | |
- | │ └─md1 | + | |
- | └─sdc12 | + | |
- | sr0 11:0 1 378M 0 rom | + | |
- | </ | + | |
- | + | ||
- | Les options de cette commande sont : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | + | ||
- | Usage: | + | |
- | lsblk [options] [< | + | |
- | + | ||
- | List information about block devices. | + | |
- | + | ||
- | Options: | + | |
- | -D, --discard | + | |
- | -E, --dedup < | + | |
- | -I, --include < | + | |
- | -J, --json | + | |
- | -O, --output-all | + | |
- | -P, --pairs | + | |
- | -S, --scsi | + | |
- | -T, --tree[=< | + | |
- | -a, --all print all devices | + | |
- | -b, --bytes | + | |
- | -d, --nodeps | + | |
- | -e, --exclude < | + | |
- | -f, --fs | + | |
- | -i, --ascii | + | |
- | -l, --list | + | |
- | -M, --merge | + | |
- | -m, --perms | + | |
- | -n, --noheadings | + | |
- | -o, --output < | + | |
- | -p, --paths | + | |
- | -r, --raw use raw output format | + | |
- | -s, --inverse | + | |
- | -t, --topology | + | |
- | -z, --zoned | + | |
- | -x, --sort < | + | |
- | | + | |
- | + | ||
- | -h, --help | + | |
- | -V, --version | + | |
- | + | ||
- | Available output columns: | + | |
- | NAME device name | + | |
- | | + | |
- | PATH path to the device node | + | |
- | | + | |
- | | + | |
- | FSSIZE | + | |
- | FSTYPE | + | |
- | FSUSED | + | |
- | FSUSE% | + | |
- | | + | |
- | MOUNTPOINT | + | |
- | | + | |
- | UUID filesystem UUID | + | |
- | PTUUID | + | |
- | PTTYPE | + | |
- | PARTTYPE | + | |
- | | + | |
- | | + | |
- | PARTUUID | + | |
- | | + | |
- | RA read-ahead of the device | + | |
- | RO read-only device | + | |
- | RM removable device | + | |
- | | + | |
- | | + | |
- | SERIAL | + | |
- | SIZE size of the device | + | |
- | | + | |
- | | + | |
- | | + | |
- | MODE device node permissions | + | |
- | | + | |
- | MIN-IO | + | |
- | OPT-IO | + | |
- | | + | |
- | | + | |
- | ROTA rotational device | + | |
- | | + | |
- | | + | |
- | TYPE device type | + | |
- | DISC-ALN | + | |
- | | + | |
- | DISC-MAX | + | |
- | | + | |
- | | + | |
- | | + | |
- | RAND adds randomness | + | |
- | PKNAME | + | |
- | HCTL Host: | + | |
- | TRAN device transport type | + | |
- | SUBSYSTEMS | + | |
- | | + | |
- | VENDOR | + | |
- | | + | |
- | | + | |
- | + | ||
- | For more details see lsblk(8). | + | |
- | </ | + | |
- | + | ||
- | ====1.4 - La Commande dmidecode==== | + | |
- | + | ||
- | La commande | + | |
- | + | ||
- | * l' | + | |
- | * les extensions possibles. | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | # dmidecode 3.3 | + | |
- | Getting SMBIOS data from sysfs. | + | |
- | SMBIOS 2.8 present. | + | |
- | 10 structures occupying 443 bytes. | + | |
- | Table at 0x000F58C0. | + | |
- | + | ||
- | Handle 0x0000, DMI type 0, 24 bytes | + | |
- | BIOS Information | + | |
- | Vendor: SeaBIOS | + | |
- | Version: rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org | + | |
- | Release Date: 04/ | + | |
- | Address: 0xE8000 | + | |
- | Runtime Size: 96 kB | + | |
- | ROM Size: 64 kB | + | |
- | Characteristics: | + | |
- | BIOS characteristics not supported | + | |
- | Targeted content distribution is supported | + | |
- | BIOS Revision: 0.0 | + | |
- | + | ||
- | Handle 0x0100, DMI type 1, 27 bytes | + | |
- | System Information | + | |
- | Manufacturer: | + | |
- | Product Name: Standard PC (i440FX + PIIX, 1996) | + | |
- | Version: pc-i440fx-5.2 | + | |
- | Serial Number: Not Specified | + | |
- | UUID: ce816e48-faa4-4cb9-a03e-f0f58040c52b | + | |
- | Wake-up Type: Power Switch | + | |
- | SKU Number: Not Specified | + | |
- | Family: Not Specified | + | |
- | + | ||
- | Handle 0x0300, DMI type 3, 22 bytes | + | |
- | Chassis Information | + | |
- | Manufacturer: | + | |
- | Type: Other | + | |
- | Lock: Not Present | + | |
- | Version: pc-i440fx-5.2 | + | |
- | Serial Number: Not Specified | + | |
- | Asset Tag: Not Specified | + | |
- | Boot-up State: Safe | + | |
- | Power Supply State: Safe | + | |
- | Thermal State: Safe | + | |
- | Security Status: Unknown | + | |
- | OEM Information: | + | |
- | Height: Unspecified | + | |
- | Number Of Power Cords: Unspecified | + | |
- | Contained Elements: 0 | + | |
- | SKU Number: Not Specified | + | |
- | + | ||
- | Handle 0x0400, DMI type 4, 42 bytes | + | |
- | Processor Information | + | |
- | Socket Designation: | + | |
- | Type: Central Processor | + | |
- | Family: Other | + | |
- | Manufacturer: | + | |
- | 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: 2 | + | |
- | Core Enabled: 2 | + | |
- | Thread Count: 1 | + | |
- | Characteristics: | + | |
- | + | ||
- | Handle 0x1000, DMI type 16, 23 bytes | + | |
- | Physical Memory Array | + | |
- | Location: Other | + | |
- | Use: System Memory | + | |
- | Error Correction Type: Multi-bit ECC | + | |
- | Maximum Capacity: 4 GB | + | |
- | Error Information Handle: Not Provided | + | |
- | Number Of Devices: 1 | + | |
- | + | ||
- | Handle 0x1100, DMI type 17, 40 bytes | + | |
- | Memory Device | + | |
- | Array Handle: 0x1000 | + | |
- | Error Information Handle: Not Provided | + | |
- | Total Width: Unknown | + | |
- | Data Width: Unknown | + | |
- | Size: 4 GB | + | |
- | Form Factor: DIMM | + | |
- | Set: None | + | |
- | Locator: DIMM 0 | + | |
- | Bank Locator: Not Specified | + | |
- | Type: RAM | + | |
- | Type Detail: Other | + | |
- | Speed: Unknown | + | |
- | Manufacturer: | + | |
- | Serial Number: Not Specified | + | |
- | Asset Tag: Not Specified | + | |
- | Part Number: Not Specified | + | |
- | Rank: Unknown | + | |
- | Configured Memory Speed: Unknown | + | |
- | Minimum Voltage: Unknown | + | |
- | Maximum Voltage: Unknown | + | |
- | Configured Voltage: Unknown | + | |
- | + | ||
- | Handle 0x1300, DMI type 19, 31 bytes | + | |
- | Memory Array Mapped Address | + | |
- | Starting Address: 0x00000000000 | + | |
- | Ending Address: 0x000BFFFFFFF | + | |
- | Range Size: 3 GB | + | |
- | Physical Array Handle: 0x1000 | + | |
- | Partition Width: 1 | + | |
- | + | ||
- | Handle 0x1301, DMI type 19, 31 bytes | + | |
- | Memory Array Mapped Address | + | |
- | Starting Address: 0x00100000000 | + | |
- | Ending Address: 0x0013FFFFFFF | + | |
- | Range Size: 1 GB | + | |
- | Physical Array Handle: 0x1000 | + | |
- | Partition Width: 1 | + | |
- | + | ||
- | Handle 0x2000, DMI type 32, 11 bytes | + | |
- | System Boot Information | + | |
- | Status: No errors detected | + | |
- | + | ||
- | Handle 0x7F00, DMI type 127, 4 bytes | + | |
- | End Of Table | + | |
- | </ | + | |
- | + | ||
- | Les options de cette commande sont : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | Usage: dmidecode [OPTIONS] | + | |
- | Options are: | + | |
- | -d, --dev-mem FILE Read memory from device FILE (default: /dev/mem) | + | |
- | -h, --help | + | |
- | -q, --quiet | + | |
- | -s, --string KEYWORD | + | |
- | -t, --type TYPE Only display the entries of given type | + | |
- | -H, --handle HANDLE | + | |
- | -u, --dump | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | -V, --version | + | |
- | </ | + | |
- | + | ||
- | =====LAB #2 - La commande sysctl===== | + | |
- | + | ||
- | ====2.1 - Répertoire /proc==== | + | |
- | + | ||
- | Le répertoire /proc contient des fichiers et des répertoires virtuels. Le contenu de ces fichiers est créé dynamiquement lors de la consultation. Seul root peut consulter la totalité des informations dans le répertoire /proc. | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | 1 128 24 | + | |
- | 10 | + | |
- | 11 | + | |
- | 116 16 | + | |
- | 119 17 | + | |
- | 12 | + | |
- | 120 177 29 | + | |
- | 121 18 | + | |
- | 122 2 30 | + | |
- | 123 20 | + | |
- | 126 214 32 | + | |
- | 127 23 | + | |
- | </ | + | |
- | + | ||
- | ===Fichiers=== | + | |
- | + | ||
- | ==Processeur== | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | processor | + | |
- | vendor_id | + | |
- | cpu family | + | |
- | model : 6 | + | |
- | model name : Common KVM processor | + | |
- | stepping | + | |
- | microcode | + | |
- | cpu MHz : 2399.982 | + | |
- | cache size : 16384 KB | + | |
- | physical id : 0 | + | |
- | siblings | + | |
- | core id : 0 | + | |
- | cpu cores : 2 | + | |
- | apicid | + | |
- | initial apicid | + | |
- | fpu : yes | + | |
- | fpu_exception | + | |
- | 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 | + | |
- | clflush size : 64 | + | |
- | cache_alignment : 128 | + | |
- | address sizes : 40 bits physical, 48 bits virtual | + | |
- | power management: | + | |
- | + | ||
- | processor | + | |
- | vendor_id | + | |
- | cpu family | + | |
- | model : 6 | + | |
- | model name : Common KVM processor | + | |
- | stepping | + | |
- | microcode | + | |
- | cpu MHz : 2399.982 | + | |
- | cache size : 16384 KB | + | |
- | physical id : 0 | + | |
- | siblings | + | |
- | core id : 1 | + | |
- | cpu cores : 2 | + | |
- | apicid | + | |
- | initial apicid | + | |
- | fpu : yes | + | |
- | fpu_exception | + | |
- | 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 | + | |
- | clflush size : 64 | + | |
- | cache_alignment : 128 | + | |
- | address sizes : 40 bits physical, 48 bits virtual | + | |
- | power management: | + | |
- | </ | + | |
- | + | ||
- | ==Interruptions système== | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | | + | |
- | 0: | + | |
- | 1: 0 9 | + | |
- | 6: 0 3 | + | |
- | 8: 1 0 | + | |
- | 9: 0 0 | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | NMI: 0 0 | + | |
- | LOC: 1701175 | + | |
- | SPU: 0 0 | + | |
- | PMI: 0 0 | + | |
- | IWI: 1 0 IRQ work interrupts | + | |
- | RTR: 0 0 APIC ICR read retries | + | |
- | RES: | + | |
- | CAL: 47419 21994 | + | |
- | TLB: 23047 13223 TLB shootdowns | + | |
- | TRM: 0 0 | + | |
- | THR: 0 0 | + | |
- | DFR: 0 0 | + | |
- | MCE: 0 0 | + | |
- | MCP: | + | |
- | ERR: 0 | + | |
- | MIS: 0 | + | |
- | PIN: 0 0 | + | |
- | NPI: 0 0 | + | |
- | PIW: 0 0 | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round important > | + | |
- | **Important** : Un pilote | + | |
- | </ | + | |
- | + | ||
- | ==Canaux DMA== | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | 2: floppy | + | |
- | 4: cascade | + | |
- | </ | + | |
- | + | ||
- | ==Plages d' | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | 0000-0cf7 : PCI Bus 0000:00 | + | |
- | 0000-001f : dma1 | + | |
- | 0020-0021 : pic1 | + | |
- | 0040-0043 : timer0 | + | |
- | 0050-0053 : timer1 | + | |
- | 0060-0060 : keyboard | + | |
- | 0064-0064 : keyboard | + | |
- | 0070-0077 : rtc0 | + | |
- | 0080-008f : dma page reg | + | |
- | 00a0-00a1 : pic2 | + | |
- | 00c0-00df : dma2 | + | |
- | 00f0-00ff : fpu | + | |
- | 0170-0177 : 0000: | + | |
- | | + | |
- | 01f0-01f7 : 0000: | + | |
- | 01f0-01f7 : ata_piix | + | |
- | 0376-0376 : 0000: | + | |
- | 0376-0376 : ata_piix | + | |
- | 03c0-03df : vga+ | + | |
- | 03f2-03f2 : floppy | + | |
- | 03f4-03f5 : floppy | + | |
- | 03f6-03f6 : 0000: | + | |
- | 03f6-03f6 : ata_piix | + | |
- | 03f7-03f7 : floppy | + | |
- | 0510-051b : QEMU0002: | + | |
- | 0510-051b : fw_cfg_io | + | |
- | 0600-063f : 0000: | + | |
- | 0600-0603 : ACPI PM1a_EVT_BLK | + | |
- | 0604-0605 : ACPI PM1a_CNT_BLK | + | |
- | 0608-060b : ACPI PM_TMR | + | |
- | 0700-070f : 0000: | + | |
- | 0700-0708 : piix4_smbus | + | |
- | 0cf8-0cff : PCI conf1 | + | |
- | 0d00-ffff : PCI Bus 0000:00 | + | |
- | afe0-afe3 : ACPI GPE0_BLK | + | |
- | c000-cfff : PCI Bus 0000:02 | + | |
- | d000-dfff : PCI Bus 0000:01 | + | |
- | e000-e03f : 0000: | + | |
- | e040-e07f : 0000: | + | |
- | e080-e09f : 0000: | + | |
- | e080-e09f : uhci_hcd | + | |
- | e0a0-e0bf : 0000: | + | |
- | e0c0-e0cf : 0000: | + | |
- | e0c0-e0cf : ata_piix | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round alert > | + | |
- | **Important** - Si deux périphériques ont le même port, les **deux** périphériques seront inutilisables. | + | |
- | </ | + | |
- | + | ||
- | ==Périphériques== | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | Character devices: | + | |
- | 1 mem | + | |
- | 4 /dev/vc/0 | + | |
- | 4 tty | + | |
- | 4 ttyS | + | |
- | 5 /dev/tty | + | |
- | 5 / | + | |
- | 5 /dev/ptmx | + | |
- | 6 lp | + | |
- | 7 vcs | + | |
- | 10 misc | + | |
- | 13 input | + | |
- | 21 sg | + | |
- | 29 fb | + | |
- | 99 ppdev | + | |
- | 128 ptm | + | |
- | 136 pts | + | |
- | 153 spi | + | |
- | 180 usb | + | |
- | 189 usb_device | + | |
- | 226 drm | + | |
- | 248 hidraw | + | |
- | 249 aux | + | |
- | 250 cec | + | |
- | 251 bsg | + | |
- | 252 rtc | + | |
- | 253 dax | + | |
- | 254 gpiochip | + | |
- | + | ||
- | Block devices: | + | |
- | 2 fd | + | |
- | 8 sd | + | |
- | 9 md | + | |
- | 11 sr | + | |
- | 65 sd | + | |
- | 66 sd | + | |
- | 67 sd | + | |
- | 68 sd | + | |
- | 69 sd | + | |
- | 70 sd | + | |
- | 71 sd | + | |
- | 128 sd | + | |
- | 129 sd | + | |
- | 130 sd | + | |
- | 131 sd | + | |
- | 132 sd | + | |
- | 133 sd | + | |
- | 134 sd | + | |
- | 135 sd | + | |
- | 253 mdp | + | |
- | 254 device-mapper | + | |
- | 259 blkext | + | |
- | </ | + | |
- | + | ||
- | ==Modules== | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | ufs 94208 0 - Live 0xffffffffc0cde000 | + | |
- | qnx4 16384 0 - Live 0xffffffffc07a3000 | + | |
- | hfsplus 126976 0 - Live 0xffffffffc0d2b000 | + | |
- | hfs 73728 0 - Live 0xffffffffc0cc4000 | + | |
- | minix 45056 0 - Live 0xffffffffc0cb8000 | + | |
- | vfat 20480 0 - Live 0xffffffffc0cb2000 | + | |
- | msdos 20480 0 - Live 0xffffffffc0cac000 | + | |
- | fat 86016 2 vfat,msdos, Live 0xffffffffc0c8f000 | + | |
- | jfs 212992 0 - Live 0xffffffffc0cf6000 | + | |
- | xfs 1773568 0 - Live 0xffffffffc0add000 | + | |
- | xts 16384 1 - Live 0xffffffffc0ad2000 | + | |
- | dm_crypt 53248 1 - Live 0xffffffffc0ac4000 | + | |
- | cbc 16384 0 - Live 0xffffffffc0abf000 | + | |
- | aes_generic 36864 3 - Live 0xffffffffc0ab5000 | + | |
- | libaes 16384 1 aes_generic, | + | |
- | crypto_simd 16384 0 - Live 0xffffffffc0aab000 | + | |
- | cryptd 24576 1 crypto_simd, | + | |
- | glue_helper 16384 0 - Live 0xffffffffc08dd000 | + | |
- | ecb 16384 2 - Live 0xffffffffc0883000 | + | |
- | ecryptfs 122880 0 - Live 0xffffffffc0a80000 | + | |
- | btrfs 1568768 0 - Live 0xffffffffc0900000 | + | |
- | blake2b_generic 20480 0 - Live 0xffffffffc087d000 | + | |
- | raid1 53248 0 - Live 0xffffffffc08f2000 | + | |
- | dm_raid 45056 0 - Live 0xffffffffc08e6000 | + | |
- | raid456 180224 1 dm_raid, Live 0xffffffffc08b0000 | + | |
- | async_raid6_recov 24576 1 raid456, Live 0xffffffffc08a7000 | + | |
- | async_memcpy 20480 2 raid456, | + | |
- | async_pq 20480 2 raid456, | + | |
- | async_xor 20480 3 raid456, | + | |
- | async_tx 20480 5 raid456, | + | |
- | md_mod 180224 3 raid1, | + | |
- | xor 24576 2 btrfs, | + | |
- | raid6_pq 122880 4 btrfs, | + | |
- | libcrc32c 16384 3 xfs, | + | |
- | dm_snapshot 53248 0 - Live 0xffffffffc07b9000 | + | |
- | dm_bufio 36864 1 dm_snapshot, | + | |
- | dm_mod 163840 10 dm_crypt, | + | |
- | rfkill 28672 0 - Live 0xffffffffc07cb000 | + | |
- | joydev 28672 0 - Live 0xffffffffc0725000 | + | |
- | evdev 28672 2 - Live 0xffffffffc071d000 | + | |
- | virtio_balloon 24576 0 - Live 0xffffffffc06f7000 | + | |
- | sg 36864 0 - Live 0xffffffffc06cc000 | + | |
- | serio_raw 20480 0 - Live 0xffffffffc06ba000 | + | |
- | pcspkr 16384 0 - Live 0xffffffffc06b0000 | + | |
- | qemu_fw_cfg 20480 0 - Live 0xffffffffc06aa000 | + | |
- | parport_pc 40960 0 - Live 0xffffffffc0679000 | + | |
- | ppdev 24576 0 - Live 0xffffffffc0664000 | + | |
- | lp 20480 0 - Live 0xffffffffc066b000 | + | |
- | parport 69632 3 parport_pc, | + | |
- | fuse 167936 1 - Live 0xffffffffc0628000 | + | |
- | --More-- | + | |
- | [q] | + | |
- | </ | + | |
- | + | ||
- | ==Statistiques | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | 11 0 sr0 77 0 4235 23 0 0 0 0 0 68 23 0 0 0 0 0 0 | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | </ | + | |
- | + | ||
- | ==Partitions== | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | major minor # | + | |
- | + | ||
- | 11 0 | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | </ | + | |
- | + | ||
- | ==Espaces de pagination== | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | Filename | + | |
- | / | + | |
- | </ | + | |
- | + | ||
- | ==Statistiques d' | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | 0.00 0.00 0.00 1/292 57813 | + | |
- | </ | + | |
- | + | ||
- | ==Statistiques d' | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | MemTotal: | + | |
- | MemFree: | + | |
- | MemAvailable: | + | |
- | Buffers: | + | |
- | Cached: | + | |
- | SwapCached: | + | |
- | Active: | + | |
- | Inactive: | + | |
- | Active(anon): | + | |
- | Inactive(anon): | + | |
- | Active(file): | + | |
- | Inactive(file): | + | |
- | Unevictable: | + | |
- | Mlocked: | + | |
- | SwapTotal: | + | |
- | SwapFree: | + | |
- | Dirty: | + | |
- | Writeback: | + | |
- | AnonPages: | + | |
- | Mapped: | + | |
- | Shmem: | + | |
- | KReclaimable: | + | |
- | Slab: | + | |
- | SReclaimable: | + | |
- | SUnreclaim: | + | |
- | KernelStack: | + | |
- | PageTables: | + | |
- | NFS_Unstable: | + | |
- | Bounce: | + | |
- | WritebackTmp: | + | |
- | CommitLimit: | + | |
- | Committed_AS: | + | |
- | VmallocTotal: | + | |
- | VmallocUsed: | + | |
- | VmallocChunk: | + | |
- | Percpu: | + | |
- | HardwareCorrupted: | + | |
- | AnonHugePages: | + | |
- | ShmemHugePages: | + | |
- | ShmemPmdMapped: | + | |
- | FileHugePages: | + | |
- | FilePmdMapped: | + | |
- | HugePages_Total: | + | |
- | HugePages_Free: | + | |
- | HugePages_Rsvd: | + | |
- | HugePages_Surp: | + | |
- | Hugepagesize: | + | |
- | Hugetlb: | + | |
- | DirectMap4k: | + | |
- | DirectMap2M: | + | |
- | </ | + | |
- | + | ||
- | ==Version du noyau== | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | Linux version 5.10.0-13-amd64 (debian-kernel@lists.debian.org) (gcc-10 (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2) #1 SMP Debian 5.10.106-1 (2022-03-17) | + | |
- | </ | + | |
- | + | ||
- | ===Répertoires=== | + | |
- | + | ||
- | ==ide/ | + | |
- | + | ||
- | Ce répertoire contient des répertoires dans lesquels se trouvent des informations sur la capacité, le type et la géométrie des disques. | + | |
- | + | ||
- | ==acpi== | + | |
- | + | ||
- | Ce répertoire contient des informations sur la gestion de l' | + | |
- | + | ||
- | ==bus== | + | |
- | + | ||
- | Ce répertoire contient un sous-répertoire par bus. | + | |
- | + | ||
- | ==net== | + | |
- | + | ||
- | Ce répertoire contient des informations sur le réseau. | + | |
- | + | ||
- | ==sys== | + | |
- | + | ||
- | Ce répertoire contient des paramètres du noyau. Certains des fichiers dans ce répertoire sont accessibles en écriture par root en temps réel. Par exemple pour éviter des attaques réseau | + | |
- | + | ||
- | # echo 1 > / | + | |
- | + | ||
- | Cette commande a pour résultat d' | + | |
- | + | ||
- | ====2.2 - Utilisation de la Commande sysctl==== | + | |
- | + | ||
- | Les fichiers dans le répertoire **/ | + | |
- | + | ||
- | La commande **sysctl** applique les règles consignés dans le fichier **/ | + | |
- | + | ||
- | Saisissez la commande : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | # | + | |
- | # / | + | |
- | # See / | + | |
- | # See sysctl.conf (5) for information. | + | |
- | # | + | |
- | + | ||
- | # | + | |
- | + | ||
- | # Uncomment the following to stop low-level messages on console | + | |
- | # | + | |
- | + | ||
- | ################################################################### | + | |
- | # Functions previously found in netbase | + | |
- | # | + | |
- | + | ||
- | # Uncomment the next two lines to enable Spoof protection (reverse-path filter) | + | |
- | # Turn on Source Address Verification in all interfaces to | + | |
- | # prevent some spoofing attacks | + | |
- | # | + | |
- | # | + | |
- | + | ||
- | # Uncomment the next line to enable TCP/IP SYN cookies | + | |
- | # See http:// | + | |
- | # Note: This may impact IPv6 TCP sessions too | + | |
- | # | + | |
- | + | ||
- | # Uncomment the next line to enable packet forwarding for IPv4 | + | |
- | # | + | |
- | + | ||
- | # Uncomment the next line to enable packet forwarding for IPv6 | + | |
- | # Enabling this option disables Stateless Address Autoconfiguration | + | |
- | # based on Router Advertisements for this host | + | |
- | # | + | |
- | + | ||
- | + | ||
- | ################################################################### | + | |
- | # Additional settings - these settings can improve the network | + | |
- | # security of the host and prevent against some network attacks | + | |
- | # including spoofing attacks and man in the middle attacks through | + | |
- | # redirection. Some network environments, | + | |
- | # settings are disabled so review and enable them as needed. | + | |
- | # | + | |
- | # Do not accept ICMP redirects (prevent MITM attacks) | + | |
- | # | + | |
- | # | + | |
- | # _or_ | + | |
- | # Accept ICMP redirects only for gateways listed in our default | + | |
- | # gateway list (enabled by default) | + | |
- | # net.ipv4.conf.all.secure_redirects = 1 | + | |
- | # | + | |
- | # Do not send ICMP redirects (we are not a router) | + | |
- | # | + | |
- | # | + | |
- | # Do not accept IP source route packets (we are not a router) | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # Log Martian Packets | + | |
- | # | + | |
- | # | + | |
- | + | ||
- | ################################################################### | + | |
- | # Magic system request Key | + | |
- | # 0=disable, 1=enable all, >1 bitmask of sysrq functions | + | |
- | # See https:// | + | |
- | # for what other values do | + | |
- | # | + | |
- | + | ||
- | root@debian11: | + | |
- | total 4 | + | |
- | lrwxrwxrwx 1 root root 14 Mar 20 20:55 99-sysctl.conf -> ../ | + | |
- | -rw-r--r-- 1 root root 639 Apr 6 2021 README.sysctl | + | |
- | </ | + | |
- | + | ||
- | Les options de la commande **sysctl** sont : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | + | ||
- | Usage: | + | |
- | | + | |
- | + | ||
- | Options: | + | |
- | -a, --all display all variables | + | |
- | -A alias of -a | + | |
- | -X alias of -a | + | |
- | | + | |
- | -b, --binary | + | |
- | -e, --ignore | + | |
- | -N, --names | + | |
- | -n, --values | + | |
- | -p, --load[=< | + | |
- | -f alias of -p | + | |
- | --system | + | |
- | -r, --pattern < | + | |
- | | + | |
- | -q, --quiet | + | |
- | -w, --write | + | |
- | -o does nothing | + | |
- | -x does nothing | + | |
- | -d alias of -h | + | |
- | + | ||
- | -h, --help | + | |
- | -V, --version | + | |
- | + | ||
- | For more details see sysctl(8). | + | |
- | </ | + | |
- | + | ||
- | =====LAB#3 - Interprétation des informations dans / | + | |
- | + | ||
- | Les informations brutes stockées dans /proc peuvent être interprétées grâce à l' | + | |
- | + | ||
- | | + | |
- | * uptime et w, | + | |
- | * iostat, | + | |
- | * hdparm, | + | |
- | * vmstat, | + | |
- | * mpstat, | + | |
- | * sar. | + | |
- | + | ||
- | ====3.1 - La Commande free==== | + | |
- | + | ||
- | La commande **free** permet de donner l’état de la mémoire totale, libre, partagée, swap et bufferisée. Saisissez donc la commande suivante : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | | + | |
- | Mem: 3931 | + | |
- | Swap: 974 0 974 | + | |
- | </ | + | |
- | + | ||
- | Dans le cas de cet exemple, nous pouvons constater que l’affichage montre : | + | |
- | + | ||
- | * 3931 Mo de mémoire physique totale, | + | |
- | * 147 Mo de mémoire physique utilisée et 2543 Mo de mémoire physique libre, | + | |
- | * 974 Mo de mémoire swap totale et 0 Mo de swap utilisé | + | |
- | + | ||
- | Les options de cette commande sont : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | + | ||
- | Usage: | + | |
- | free [options] | + | |
- | + | ||
- | Options: | + | |
- | -b, --bytes | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | -k, --kibi | + | |
- | -m, --mebi | + | |
- | -g, --gibi | + | |
- | | + | |
- | | + | |
- | -h, --human | + | |
- | | + | |
- | -l, --lohi | + | |
- | -t, --total | + | |
- | -s N, --seconds N | + | |
- | -c N, --count N | + | |
- | -w, --wide | + | |
- | + | ||
- | | + | |
- | -V, --version | + | |
- | + | ||
- | For more details see free(1). | + | |
- | </ | + | |
- | + | ||
- | ====3.2 - Les Commandes uptime et w==== | + | |
- | + | ||
- | Chacune des ces commandes indique la charge moyenne du ou des processeurs depuis 1 minute, 5 minutes et 15 minutes : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | | + | |
- | + | ||
- | root@debian11: | + | |
- | | + | |
- | USER | + | |
- | trainee | + | |
- | </ | + | |
- | + | ||
- | Les valeurs | + | |
- | + | ||
- | Par exemple si les valeurs sur un système muni d'un seul processeur étaient **3, | + | |
- | + | ||
- | * 2,48 processus en attente dans la dernière minute, | + | |
- | * 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 : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | + | ||
- | Usage: | + | |
- | | + | |
- | + | ||
- | Options: | + | |
- | -p, --pretty | + | |
- | -h, --help | + | |
- | -s, --since | + | |
- | -V, --version | + | |
- | + | ||
- | For more details see uptime(1). | + | |
- | + | ||
- | root@debian11: | + | |
- | + | ||
- | Usage: | + | |
- | w [options] | + | |
- | + | ||
- | Options: | + | |
- | -h, --no-header | + | |
- | -u, --no-current | + | |
- | -s, --short | + | |
- | -f, --from | + | |
- | -o, --old-style | + | |
- | -i, --ip-addr | + | |
- | + | ||
- | | + | |
- | -V, --version | + | |
- | + | ||
- | For more details see w(1). | + | |
- | </ | + | |
- | + | ||
- | ====3.3 - La Commande iostat==== | + | |
- | + | ||
- | La commande **iostat** affiche des statistiques sur l' | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | -bash: iostat: command not found | + | |
- | root@debian11: | + | |
- | </ | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | Linux 5.10.0-13-amd64 (debian11) | + | |
- | + | ||
- | avg-cpu: | + | |
- | | + | |
- | + | ||
- | Device | + | |
- | dm-0 0.01 | + | |
- | dm-1 0.02 | + | |
- | md1 | + | |
- | sda | + | |
- | sdb | + | |
- | sdc | + | |
- | sr0 | + | |
- | </ | + | |
- | + | ||
- | Au-dessous de la première ligne indiquant la version du noyau du système et son nom d' | + | |
- | + | ||
- | | + | |
- | * **%nice** - Pourcentage de temps passé en mode utilisateur (pour les processus qui ont modifié leur priorité de programmation à l'aide de la commande nice) | + | |
- | * **%system** - Pourcentage de temps passé en mode noyau | + | |
- | * **%steal** - Pourcentage du temps passé par des CPU virtuels en attendant que l' | + | |
- | * **%iowait** - Pourcentage du temps passé à attendre les entrées et les sorties des disques. | + | |
- | * **%idle** - Pourcentage de temps passé en inactivité | + | |
- | + | ||
- | Notez la valeur de **%iowait**. Dans le cas où ce pourcentage est trop élévé, ceci indique que le processeur passe son temps à attendre les entrées et les sorties de disque. | + | |
- | + | ||
- | Au-dessous du rapport d' | + | |
- | + | ||
- | * La spécification du périphérique. | + | |
- | * Le nombre de transferts (ou opérations d'E/S) par seconde. | + | |
- | * Le nombre de blocs de KB lus par seconde. | + | |
- | * Le nombre de blocs de KB écrits par seconde. | + | |
- | * Le nombre de blocs de KB jetés par seconde. | + | |
- | * Le nombre total de KB lus. | + | |
- | * Le nombre total de KB écrits. | + | |
- | * Le nombre total de KB jetés. | + | |
- | + | ||
- | Dernièrement, | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | Linux 5.10.0-13-amd64 (debian11) | + | |
- | + | ||
- | Device | + | |
- | dm-0 | + | |
- | dm-1 0.02 0.29 | + | |
- | md1 0.00 0.08 | + | |
- | sda 0.84 | + | |
- | sdb 0.02 0.31 | + | |
- | sdc 0.34 145.15 | + | |
- | sr0 0.01 0.14 | + | |
- | </ | + | |
- | + | ||
- | Les options de cette commande sont : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | Usage: iostat [ options ] [ < | + | |
- | Options are: | + | |
- | [ -c ] [ -d ] [ -h ] [ -k | -m ] [ -N ] [ -s ] [ -t ] [ -V ] [ -x ] [ -y ] [ -z ] | + | |
- | [ { -f | +f } < | + | |
- | [ --dec={ | + | |
- | [ [ -H ] -g < | + | |
- | [ < | + | |
- | </ | + | |
- | + | ||
- | ====3.4 - La Commande hdparm==== | + | |
- | + | ||
- | Pour surveiller la vitesse des entrées et des sorties du disque, vous pouvez utiliser la commande **hdparm** : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | + | ||
- | root@debian11: | + | |
- | + | ||
- | root@debian11: | + | |
- | + | ||
- | /dev/sdc: | + | |
- | | + | |
- | </ | + | |
- | + | ||
- | ====3.5 - La Commande vmstat==== | + | |
- | + | ||
- | La commande **vmstat** affiche des statistiques sur la mémoire, la pagination et la charge ponctuelle du processeur : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----- | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | </ | + | |
- | + | ||
- | 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' | + | |
- | + | ||
- | Les champs relatifs aux processus sont les suivants : | + | |
- | + | ||
- | * r — Le nombre de processus exécutables attendant d' | + | |
- | * b — Le nombre de processus exécutables dans un état de veille qui ne peut être interrompu | + | |
- | + | ||
- | Les champs relatifs à la mémoire sont les suivants : | + | |
- | + | ||
- | * swpd — La quantité de mémoire virtuelle utilisée | + | |
- | * free — La quantité de mémoire libre | + | |
- | * buff — La quantité de mémoire utilisée par les tampons (ou buffers) | + | |
- | * cache — La quantité de mémoire utilisée comme cache de pages | + | |
- | + | ||
- | Les champs relatifs au swap sont les suivants : | + | |
- | + | ||
- | * si — La quantité de mémoire chargée depuis le disque | + | |
- | * so — La quantité de mémoire déchargée sur le disque | + | |
- | + | ||
- | Les champs relatifs aux Entrées/ | + | |
- | + | ||
- | * bi — Blocs envoyés vers un périphérique blocs | + | |
- | * bo— Blocs reçus d'un périphérique blocs | + | |
- | + | ||
- | Les champs relatifs au système sont les suivants : | + | |
- | + | ||
- | * in — Nombre d' | + | |
- | * cs — Nombre de changements de contexte par seconde | + | |
- | + | ||
- | Les champs relatifs au CPU sont les suivants : | + | |
- | + | ||
- | * us — Le pourcentage de temps pendant lequel le CPU exécute un code de niveau utilisateur | + | |
- | * sy — Le pourcentage de temps pendant lequel le CPU exécute un code de niveau système | + | |
- | * id — Le pourcentage de temps pendant lequel le CPU était inoccupé | + | |
- | * wa — Attente d' | + | |
- | + | ||
- | Les options de cette commande sont : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | + | ||
- | Usage: | + | |
- | | + | |
- | + | ||
- | Options: | + | |
- | -a, --active | + | |
- | -f, --forks | + | |
- | -m, --slabs | + | |
- | -n, --one-header | + | |
- | -s, --stats | + | |
- | -d, --disk | + | |
- | -D, --disk-sum | + | |
- | -p, --partition < | + | |
- | -S, --unit < | + | |
- | -w, --wide | + | |
- | -t, --timestamp | + | |
- | + | ||
- | -h, --help | + | |
- | -V, --version | + | |
- | + | ||
- | For more details see vmstat(8). | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round important > | + | |
- | **Important** : Par défaut la commande vmstat affiche des informations depuis le démarrage du système. | + | |
- | </ | + | |
- | + | ||
- | ====3.6 - La Commande mpstat==== | + | |
- | + | ||
- | La commande **mpstat** affiche des statistiques détaillées sur le CPU : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | Linux 5.10.0-13-amd64 (debian11) | + | |
- | + | ||
- | 04:10:45 PM CPU %usr | + | |
- | 04:10:45 PM all 0.04 0.00 0.02 0.12 0.00 0.00 0.00 0.00 0.00 | + | |
- | </ | + | |
- | + | ||
- | Dans le cas où vous avez plusieurs processeurs ou coeurs, vous pouvez visualiser ces mêmes informations par unité de traitement : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | Linux 5.10.0-13-amd64 (debian11) | + | |
- | + | ||
- | 04:11:05 PM CPU %usr | + | |
- | 04:11:05 PM all 0.04 0.00 0.02 0.12 0.00 0.00 0.00 0.00 0.00 | + | |
- | 04:11:05 PM 0 0.04 0.00 0.02 0.13 0.00 0.00 0.00 0.00 0.00 | + | |
- | 04:11:05 PM 1 0.04 0.00 0.02 0.10 0.00 0.00 0.00 0.00 0.00 | + | |
- | </ | + | |
- | + | ||
- | Pour afficher 5 jeux de statistiques à des intervales de 2 secondes pour tous les unités de traitement, il convient | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | Linux 5.10.0-13-amd64 (debian11) | + | |
- | + | ||
- | 04:11:24 PM CPU %usr | + | |
- | 04:11:26 PM all 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | + | |
- | 04:11:26 PM 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | + | |
- | 04:11:26 PM 1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | + | |
- | + | ||
- | 04:11:26 PM CPU %usr | + | |
- | 04:11:28 PM all 0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00 0.00 | + | |
- | 04:11:28 PM 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | + | |
- | 04:11:28 PM 1 0.00 0.00 0.50 0.00 0.00 0.00 0.00 0.00 0.00 | + | |
- | + | ||
- | 04:11:28 PM CPU %usr | + | |
- | 04:11:30 PM all 0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00 0.00 | + | |
- | 04:11:30 PM 0 0.00 0.00 0.50 0.00 0.00 0.00 0.00 0.00 0.00 | + | |
- | 04:11:30 PM 1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | + | |
- | + | ||
- | 04:11:30 PM CPU %usr | + | |
- | 04:11:32 PM all 0.25 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 | + | |
- | 04:11:32 PM 0 0.50 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 | + | |
- | 04:11:32 PM 1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | + | |
- | + | ||
- | 04:11:32 PM CPU %usr | + | |
- | 04:11:34 PM all 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | + | |
- | 04:11:34 PM 0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | + | |
- | 04:11:34 PM 1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | + | |
- | + | ||
- | Average: | + | |
- | Average: | + | |
- | Average: | + | |
- | Average: | + | |
- | </ | + | |
- | + | ||
- | Les options de cette commande sont : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | Usage: mpstat [ options ] [ < | + | |
- | Options are: | + | |
- | [ -A ] [ -n ] [ -T ] [ -u ] [ -V ] | + | |
- | [ -I { SUM | CPU | SCPU | ALL } ] [ -N { < | + | |
- | [ --dec={ 0 | 1 | 2 } ] [ -o JSON ] [ -P { < | + | |
- | </ | + | |
- | + | ||
- | ====3.7 - La Commande sar==== | + | |
- | + | ||
- | La commande | + | |
- | + | ||
- | ^ Option ^ Description ^ | + | |
- | | -u | Pourcentage d' | + | |
- | | -q | Nombre de processus en attente | | + | |
- | | -r | Utilisation de la mémoire centrale | | + | |
- | | -w | Surveillance du swapping | | + | |
- | | -p | Surveillance de la pagination | | + | |
- | | -b | Utilisation des tampons | | + | |
- | | -d | Utilisation des disques | | + | |
- | + | ||
- | Sous Debian 11 la commande **/ | + | |
- | + | ||
- | < | + | |
- | root@debian8: | + | |
- | debian-sa1 | + | |
- | </ | + | |
- | + | ||
- | Le script **/ | + | |
- | + | ||
- | ^ Option ^ Description ^ | + | |
- | | -t | L' | + | |
- | | -n | Nombre de collectes | | + | |
- | + | ||
- | Le script **/ | + | |
- | + | ||
- | Sous Debian 11, l' | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | # / | + | |
- | # (C) 2014 Tomasz Torcz < | + | |
- | # | + | |
- | # sysstat-12.5.2 systemd unit file: | + | |
- | # Activates activity collector every 10 minutes | + | |
- | + | ||
- | [Unit] | + | |
- | Description=Run system activity accounting tool every 10 minutes | + | |
- | + | ||
- | [Timer] | + | |
- | OnCalendar=*: | + | |
- | + | ||
- | [Install] | + | |
- | WantedBy=sysstat.service | + | |
- | </ | + | |
- | + | ||
- | La valeur de **OnCalendar** indique un collecte toutes les dix minutes. | + | |
- | + | ||
- | Pour modifier l' | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | root@debian11: | + | |
- | root@debian11: | + | |
- | ### Editing / | + | |
- | ### Anything between here and the comment below will become the new contents of the file | + | |
- | + | ||
- | [Unit] | + | |
- | Description=Run system activity accounting tool every 2 minutes | + | |
- | + | ||
- | [Timer] | + | |
- | OnCalendar= | + | |
- | OnCalendar=*: | + | |
- | + | ||
- | [Install] | + | |
- | WantedBy=sysstat.service | + | |
- | + | ||
- | ### Lines below this comment will be discarded | + | |
- | + | ||
- | ### / | + | |
- | # # / | + | |
- | # # (C) 2014 Tomasz Torcz < | + | |
- | # # | + | |
- | # # sysstat-12.5.2 systemd unit file: | + | |
- | # # Activates activity collector every 10 minutes | + | |
- | # | + | |
- | # [Unit] | + | |
- | # Description=Run system activity accounting tool every 10 minutes | + | |
- | # | + | |
- | # [Timer] | + | |
- | # OnCalendar=*: | + | |
- | # | + | |
- | # [Install] | + | |
- | # WantedBy=sysstat.service | + | |
- | [Escape] [:] [x] <<<<<<<<<<<<<<<<<<<<<<<< | + | |
- | + | ||
- | + | ||
- | root@debian11: | + | |
- | [Unit] | + | |
- | Description=Run system activity accounting tool every 2 minutes | + | |
- | + | ||
- | [Timer] | + | |
- | OnCalendar= | + | |
- | OnCalendar=*: | + | |
- | + | ||
- | [Install] | + | |
- | WantedBy=sysstat.serviceroot@debian11: | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round important > | + | |
- | **Important** : Notez la ligne **OnCalendar=** qui est necessaire afin de surcharger la valeur par défaut. | + | |
- | </ | + | |
- | + | ||
- | Vérifiez ensuite la prise en compte de la configuration : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | ● sysstat-collect.timer - Run system activity accounting tool every 2 minutes | + | |
- | | + | |
- | Drop-In: / | + | |
- | | + | |
- | | + | |
- | Trigger: n/a | + | |
- | | + | |
- | root@debian11: | + | |
- | root@debian11: | + | |
- | ● sysstat-collect.timer - Run system activity accounting tool every 2 minutes | + | |
- | | + | |
- | Drop-In: / | + | |
- | | + | |
- | | + | |
- | Trigger: Sat 2022-04-30 16:32:00 CEST; 1min 2s left | + | |
- | | + | |
- | + | ||
- | Apr 30 16:30:54 debian11 systemd[1]: Started Run system activity accounting tool every 2 minutes. <<<<<<<<<<<<< | + | |
- | </ | + | |
- | + | ||
- | < | + | |
- | + | ||
- | Saisissez la commande suivante : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | Linux 5.10.0-13-amd64 (debian11) | + | |
- | </ | + | |
- | + | ||
- | ===Statistiques d' | + | |
- | + | ||
- | Visualisez maintenant les statistiques d' | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | Linux 5.10.0-13-amd64 (debian11) | + | |
- | + | ||
- | 04:33:15 PM | + | |
- | 04:33:20 PM | + | |
- | 04:33:25 PM | + | |
- | 04:33:30 PM | + | |
- | Average: | + | |
- | </ | + | |
- | + | ||
- | D' | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | Linux 5.10.0-13-amd64 (debian11) | + | |
- | + | ||
- | 04:33:53 PM | + | |
- | 04:33:58 PM | + | |
- | 04:34:03 PM | + | |
- | 04:34:08 PM | + | |
- | Average: | + | |
- | </ | + | |
- | + | ||
- | Pour consulter les statistiques d'un coeur spécifique, | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | Linux 5.10.0-13-amd64 (debian11) | + | |
- | + | ||
- | 04:35:14 PM | + | |
- | 04:35:19 PM | + | |
- | 04:35:24 PM | + | |
- | 04:35:29 PM | + | |
- | Average: | + | |
- | + | ||
- | root@debian11: | + | |
- | Linux 5.10.0-13-amd64 (debian11) | + | |
- | + | ||
- | 04:34:39 PM | + | |
- | 04:34:44 PM | + | |
- | 04:34:49 PM | + | |
- | 04:34:54 PM | + | |
- | Average: | + | |
- | </ | + | |
- | + | ||
- | ===Statistiques d' | + | |
- | + | ||
- | Utilisez l' | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | Linux 5.10.0-13-amd64 (debian11) | + | |
- | + | ||
- | 04:35:58 PM kbmemfree | + | |
- | 04:36:03 PM | + | |
- | 04:36:08 PM | + | |
- | 04:36:13 PM | + | |
- | Average: | + | |
- | </ | + | |
- | + | ||
- | HERE | + | |
- | + | ||
- | Utilisez l' | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | Linux 5.10.0-13-amd64 (debian11) | + | |
- | + | ||
- | 04:39:41 PM kbswpfree kbswpused | + | |
- | 04:39:46 PM 998396 | + | |
- | 04:39:51 PM 998396 | + | |
- | 04:39:56 PM 998396 | + | |
- | Average: | + | |
- | </ | + | |
- | + | ||
- | ===Statistiques des E/S=== | + | |
- | + | ||
- | Utilisez l' | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | Linux 5.10.0-13-amd64 (debian11) | + | |
- | + | ||
- | 04:40:19 PM | + | |
- | 04:40:24 PM 0.40 0.00 0.40 0.00 0.00 | + | |
- | 04:40:29 PM 0.00 0.00 0.00 0.00 0.00 0.00 0.00 | + | |
- | 04:40:34 PM 0.00 0.00 0.00 0.00 0.00 0.00 0.00 | + | |
- | Average: | + | |
- | </ | + | |
- | + | ||
- | ===Statistiques des E/S par Disque=== | + | |
- | + | ||
- | Utilisez l' | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | Linux 5.10.0-13-amd64 (debian11) | + | |
- | + | ||
- | 02:48:27 PM | + | |
- | 02:48:32 PM | + | |
- | 02:48:32 PM | + | |
- | 02:48:32 PM | + | |
- | 02:48:32 PM | + | |
- | 02:48:32 PM dm-0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 | + | |
- | 02:48:32 PM dm-1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 | + | |
- | 02:48:32 PM | + | |
- | + | ||
- | 02:48:32 PM | + | |
- | 02:48:37 PM | + | |
- | 02:48:37 PM | + | |
- | 02:48:37 PM | + | |
- | 02:48:37 PM | + | |
- | 02:48:37 PM dm-0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 | + | |
- | 02:48:37 PM dm-1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 | + | |
- | 02:48:37 PM | + | |
- | + | ||
- | 02:48:37 PM | + | |
- | 02:48:42 PM | + | |
- | 02:48:42 PM | + | |
- | 02:48:42 PM | + | |
- | 02:48:42 PM | + | |
- | 02:48:42 PM dm-0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 | + | |
- | 02:48:42 PM dm-1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 | + | |
- | 02:48:42 PM | + | |
- | + | ||
- | Average: | + | |
- | Average: | + | |
- | Average: | + | |
- | Average: | + | |
- | Average: | + | |
- | Average: | + | |
- | Average: | + | |
- | Average: | + | |
- | </ | + | |
- | + | ||
- | Dernièrement, | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | total 16 | + | |
- | -rw-r--r-- 1 root root 14284 Apr 30 16:44 sa30 | + | |
- | </ | + | |
- | + | ||
- | Les options de la commande sar sont : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | Usage: sar [ options ] [ < | + | |
- | Main options and reports (report name between square brackets): | + | |
- | -B Paging statistics [A_PAGE] | + | |
- | -b I/O and transfer rate statistics [A_IO] | + | |
- | -d Block devices statistics [A_DISK] | + | |
- | -F [ MOUNT ] | + | |
- | Filesystems statistics [A_FS] | + | |
- | -H Hugepages utilization statistics [A_HUGE] | + | |
- | -I { < | + | |
- | Interrupts statistics [A_IRQ] | + | |
- | -m { < | + | |
- | 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 { < | + | |
- | Network statistics [A_NET_...] | + | |
- | Keywords are: | + | |
- | DEV | + | |
- | EDEV Network interfaces (errors) | + | |
- | NFS NFS client | + | |
- | NFSD NFS server | + | |
- | SOCK Sockets (v4) | + | |
- | IP IP traffic | + | |
- | EIP IP traffic | + | |
- | ICMP ICMP traffic | + | |
- | EICMP ICMP traffic | + | |
- | TCP TCP traffic | + | |
- | ETCP TCP traffic | + | |
- | UDP UDP traffic | + | |
- | SOCK6 | + | |
- | IP6 IP traffic | + | |
- | EIP6 IP traffic | + | |
- | ICMP6 ICMP traffic | + | |
- | EICMP6 | + | |
- | UDP6 UDP traffic | + | |
- | FC Fibre channel HBAs | + | |
- | SOFT Software-based network processing | + | |
- | -q [ < | + | |
- | System load and pressure-stall statistics | + | |
- | Keywords are: | + | |
- | LOAD Queue length and load average statistics [A_QUEUE] | + | |
- | CPU | + | |
- | IO Pressure-stall I/O statistics [A_PSI_IO] | + | |
- | MEM | + | |
- | -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] | + | |
- | </ | + | |
- | + | ||
- | =====Modules usb===== | + | |
- | + | ||
- | L' | + | |
- | + | ||
- | ^ Version USB ^ Module ^ Nom Complet ^ | + | |
- | | 1.0\1.1 | + | |
- | | ::: | **OHCI** | //Open Controller Host Interface// | | + | |
- | | 2.0 | **EHCI** | //Enhanced Host Controller Interface// | | + | |
- | | 3.0 | **XHCI** | // | + | |
- | + | ||
- | Le tableau suivant liste les modules courrament chargés en fonction du périphérique utilisé : | + | |
- | + | ||
- | ^ Module ^ Type de Périphérique ^ | + | |
- | | **usb_storage** | + | |
- | | **usbhid** | + | |
- | | **snd-usb-audio** | + | |
- | | **usbvidéo** | + | |
- | | **irda-usb** | + | |
- | | **usbnet** | + | |
- | + | ||
- | Les modules peuvent être chargés par un des moyens suivants : | + | |
- | + | ||
- | * INITrd, | + | |
- | * Le processus init (systemd), | + | |
- | * kmod, d'une manière dynamique et transparente lors du branchement du périphérique, | + | |
- | * udev, | + | |
- | * manuellement. | + | |
- | + | ||
- | =====udev===== | + | |
- | + | ||
- | Depuis le noyau Linux 2.6 Linux est capable de détecter des périphériques branchés à chaud. Cette technologie s' | + | |
- | + | ||
- | * Udev, | + | |
- | * HAL, | + | |
- | * Dbus. | + | |
- | + | ||
- | Les rôles de chaque composant sont les suivants : | + | |
- | + | ||
- | * Udev se charge de créer et supprimer d'une manière dynamique les nœuds dans le répertoire **/dev**, | + | |
- | * HAL obtient des informations à partir d'Udev et créé un fichier au format XML représentant le périphérique branché. Il informe ensuite Nautilus en utilisant le Dbus, | + | |
- | * Dbus joue le rôle d'un bus système qui est utilisé pour la communication inter-processus. | + | |
- | + | ||
- | Lors de démarrage de Linux, Udev joue un rôle important : | + | |
- | + | ||
- | | + | |
- | * Udev copie les éventuels nœuds statiques | + | |
- | * le démon **udevd** collecte des données appelées **uevents** du noyau et cherche une règle correspondante dans le répertoire **/ | + | |
- | * 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 **/ | + | |
- | * 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'// | + | |
- | + | ||
- | Le fichier de configuration principal d'Udev est **/ | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | # see udev.conf(5) for details | + | |
- | # | + | |
- | # udevd is also started in the initrd. | + | |
- | # also want to rebuild the initrd, so that it will include the modified configuration. | + | |
- | + | ||
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | </ | + | |
- | + | ||
- | Les fichiers de règles se trouvent dans **/ | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | 39-usbmuxd.rules | + | |
- | 40-usb_modeswitch.rules | + | |
- | 50-firmware.rules | + | |
- | 50-udev-default.rules | + | |
- | 55-dm.rules | + | |
- | 56-lvm.rules | + | |
- | 60-autosuspend.rules | + | |
- | 60-block.rules | + | |
- | 60-cdrom_id.rules | + | |
- | 60-drm.rules | + | |
- | 60-evdev.rules | + | |
- | 60-fido-id.rules | + | |
- | 60-input-id.rules | + | |
- | 60-libgphoto2-6.rules | + | |
- | 60-libopenni2-0.rules | + | |
- | 60-libsane1.rules | + | |
- | 60-persistent-alsa.rules | + | |
- | 60-persistent-input.rules | + | |
- | 60-persistent-storage-dm.rules | + | |
- | 60-persistent-storage.rules | + | |
- | 60-persistent-storage-tape.rules | + | |
- | 60-persistent-v4l.rules | + | |
- | 60-qemu-guest-agent.rules | + | |
- | 60-sensor.rules | + | |
- | 60-serial.rules | + | |
- | 64-btrfs-dm.rules | + | |
- | 64-btrfs.rules | + | |
- | 64-xorg-xkb.rules | + | |
- | 65-libwacom.rules | + | |
- | 69-cd-sensors.rules | + | |
- | 69-lvm-metad.rules | + | |
- | 69-wacom.rules | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round important > | + | |
- | **Important** : Il vous est possible d' | + | |
- | </ | + | |
- | + | ||
- | Comme indique le nom de chaque fichier, le contenu est composé de règles à l' | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | # do not edit this file, it will be overwritten on update | + | |
- | + | ||
- | # run a command on remove events | + | |
- | ACTION==" | + | |
- | ACTION==" | + | |
- | + | ||
- | SUBSYSTEM==" | + | |
- | + | ||
- | # select " | + | |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | + | ||
- | SUBSYSTEM==" | + | |
- | mported" | + | |
- | ENV{MODALIAS}!="", | + | |
- | LABEL=" | + | |
- | + | ||
- | ACTION!=" | + | |
- | + | ||
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | KERNEL==" | + | |
- | + | ||
- | SUBSYSTEM==" | + | |
- | + | ||
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | + | ||
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | + | ||
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | + | ||
- | # When using static_node= with non-default permissions, | + | |
- | # tmpfiles.d/ | + | |
- | + | ||
- | SUBSYSTEM==" | + | |
- | OPTIONS+=" | + | |
- | + | ||
- | SUBSYSTEM==" | + | |
- | --More-- | + | |
- | [q] | + | |
- | </ | + | |
- | + | ||
- | Chaque règle prend la forme suivante : | + | |
- | + | ||
- | KEY, [KEY, ...] NAME [, SYMLINK] | + | |
- | + | ||
- | Chaque KEY est un champ au format **type=valeur** qui doit correspondre à un périphérique unique. La valeur de type peut prendre plusieurs formes : | + | |
- | + | ||
- | ^ Type ^ Description ^ Exemples ^ | + | |
- | | BUS | Type de bus | usb, scsi, ide | | + | |
- | | KERNEL | Le nom par défault du périphérique donné par le noyau | hda, ttyUSB0, lp0 | | + | |
- | | SUBSYSTEM | Le nom noyau du sous-système, généralement identique à la valeur du BUS | usb, scsi | | + | |
- | | DRIVER | Le nom du pilote qui contrôle le périphérique | usb-storage | | + | |
- | | ID | Le numéro du périphérique sur son bus | PCI bus id, USB id | | + | |
- | | PLACE | Ne concerne que les périphériques USB et donne la position topologique du périphérique sur son bus | S/O | | + | |
- | | SYSFS{filename} | Le nom du fichier dans /sys pour le périphérique. Ce fichier contient le fabricant, le label, le numéro de série et UUID du périphérique. La vérification de jusqu' | + | |
- | | PROGRAM | Ceci permet à Udev d' | + | |
- | | 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' | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | P: / | + | |
- | N: sdc | + | |
- | L: 0 | + | |
- | S: disk/ | + | |
- | S: disk/ | + | |
- | E: DEVPATH=/ | + | |
- | E: DEVNAME=/ | + | |
- | E: DEVTYPE=disk | + | |
- | E: MAJOR=8 | + | |
- | E: MINOR=32 | + | |
- | E: SUBSYSTEM=block | + | |
- | E: USEC_INITIALIZED=1712598 | + | |
- | E: ID_SCSI=1 | + | |
- | E: ID_VENDOR=QEMU | + | |
- | E: ID_VENDOR_ENC=QEMU\x20\x20\x20\x20 | + | |
- | E: ID_MODEL=QEMU_HARDDISK | + | |
- | E: ID_MODEL_ENC=QEMU\x20HARDDISK\x20\x20\x20 | + | |
- | E: ID_REVISION=2.5+ | + | |
- | E: ID_TYPE=disk | + | |
- | E: ID_SERIAL=0QEMU_QEMU_HARDDISK_drive-scsi1 | + | |
- | E: ID_SERIAL_SHORT=drive-scsi1 | + | |
- | E: ID_BUS=scsi | + | |
- | E: ID_PATH=pci-0000: | + | |
- | E: ID_PATH_TAG=pci-0000_00_05_0-scsi-0_0_0_1 | + | |
- | E: ID_PART_TABLE_UUID=304308a3 | + | |
- | E: ID_PART_TABLE_TYPE=dos | + | |
- | E: DEVLINKS=/ | + | |
- | E: TAGS=: | + | |
- | E: CURRENT_TAGS=: | + | |
- | </ | + | |
- | + | ||
- | Les options de la commande udevadm sont : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | udevadm [--help] [--version] [--debug] COMMAND [COMMAND OPTIONS] | + | |
- | + | ||
- | Send control commands or test the device manager. | + | |
- | + | ||
- | Commands: | + | |
- | info Query sysfs or the udev database | + | |
- | trigger | + | |
- | settle | + | |
- | control | + | |
- | monitor | + | |
- | test Test an event run | + | |
- | test-builtin | + | |
- | + | ||
- | See the udevadm(8) man page for details. | + | |
- | + | ||
- | root@debian11: | + | |
- | udevadm info [OPTIONS] [DEVPATH|FILE] | + | |
- | + | ||
- | Query sysfs or the udev database. | + | |
- | + | ||
- | -h --help | + | |
- | -V --version | + | |
- | -q --query=TYPE | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | -p --path=SYSPATH | + | |
- | -n --name=NAME | + | |
- | -r --root | + | |
- | -a --attribute-walk | + | |
- | of parent devices | + | |
- | -d --device-id-of-file=FILE Print major:minor of device containing this file | + | |
- | -x --export | + | |
- | -P --export-prefix | + | |
- | -e --export-db | + | |
- | -c --cleanup-db | + | |
- | -w --wait-for-initialization[=SECONDS] | + | |
- | Wait for device to be initialized | + | |
- | </ | + | |
- | + | ||
- | =====Système de fichiers /sys===== | + | |
- | + | ||
- | Le système de fichiers virtuel **/sys** a été introduit avec le noyau Linux **2.6**. Son rôle est de décrire le matériel pour udev. | + | |
- | + | ||
- | Saisissez la commande suivante : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | total 0 | + | |
- | drwxr-xr-x | + | |
- | drwxr-xr-x | + | |
- | drwxr-xr-x | + | |
- | drwxr-xr-x | + | |
- | drwxr-xr-x | + | |
- | drwxr-xr-x | + | |
- | drwxr-xr-x | + | |
- | drwxr-xr-x | + | |
- | drwxr-xr-x | + | |
- | drwxr-xr-x 151 root root 0 Apr 30 16:21 module | + | |
- | drwxr-xr-x | + | |
- | </ | + | |
- | + | ||
- | Chaque répertoire contient des informations : | + | |
- | + | ||
- | * **block** | + | |
- | * contient des informations sur les périphériques bloc | + | |
- | * **bus** | + | |
- | * contient des informations sur les bus de données | + | |
- | * **class** | + | |
- | * contient des informations sur des classes de matériel | + | |
- | * **devices** | + | |
- | * contient des informations sur la position des périphériques sur les bus | + | |
- | * **firmware** | + | |
- | * contient, entre autre, des informations sur l' | + | |
- | * **module** | + | |
- | * contient des informations sur les modules du noyau | + | |
- | * **power** | + | |
- | * contient des informations sur la gestion de l' | + | |
- | * **fs** | + | |
- | * contient des informations sur les systèmes de fichiers | + | |
- | + | ||
- | Pour illustrer ceci, saisissez la commande suivante : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | 204800 | + | |
- | </ | + | |
- | + | ||
- | Ce chiffre correspond aux nombre de secteurs. | + | |
- | + | ||
- | =====Limitation des ressources===== | + | |
- | + | ||
- | ====LAB #4 - ulimit==== | + | |
- | + | ||
- | Les ressources disponibles aux utilisateurs peuvent être limitées par l' | + | |
- | + | ||
- | La commande **ulimit** gère deux types de limite, la limite //hard// en utilisant l' | + | |
- | + | ||
- | La limite //soft// est la limite imposée à l' | + | |
- | + | ||
- | L' | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | # / | + | |
- | # | + | |
- | #Each line describes a limit for a user in the form: | + | |
- | # | + | |
- | #< | + | |
- | # | + | |
- | #Where: | + | |
- | #< | + | |
- | # - 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 | + | |
- | # - NOTE: group and wildcard limits are not applied to root. | + | |
- | # To apply a limit to the root user, < | + | |
- | # the literal username root. | + | |
- | # | + | |
- | #< | + | |
- | # - " | + | |
- | # - " | + | |
- | # | + | |
- | #< | + | |
- | # - core - limits the core file size (KB) | + | |
- | # - data - max data size (KB) | + | |
- | # - fsize - maximum filesize (KB) | + | |
- | # - memlock - max locked-in-memory address space (KB) | + | |
- | # - nofile - max number of open file descriptors | + | |
- | # - rss - max resident set size (KB) | + | |
- | # - stack - max stack size (KB) | + | |
- | # - cpu - max CPU time (MIN) | + | |
- | # - nproc - max number of processes | + | |
- | # - as - address space limit (KB) | + | |
- | # - maxlogins - max number of logins for this user | + | |
- | # - maxsyslogins - max number of logins on the system | + | |
- | # - priority - the priority to run user process with | + | |
- | # - locks - max number of file locks the user can hold | + | |
- | # - sigpending - max number of pending signals | + | |
- | # - msgqueue - max memory used by POSIX message queues (bytes) | + | |
- | # - nice - max nice priority allowed to raise to values: [-20, 19] | + | |
- | # - rtprio - max realtime priority | + | |
- | # - chroot - change root to directory (Debian-specific) | + | |
- | # | + | |
- | #< | + | |
- | # | + | |
- | + | ||
- | #* soft core 0 | + | |
- | #root hard core 100000 | + | |
- | #* | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | #ftp | + | |
- | #ftp | + | |
- | # | + | |
- | + | ||
- | # End of file | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round important > | + | |
- | **Important** : La valeur de la limite peut être un **nombre** ou le mot **unlimited**. | + | |
- | </ | + | |
- | + | ||
- | Par exemple, si root inscrit les deux ligne suivantes dans le fichier / | + | |
- | + | ||
- | < | + | |
- | ... | + | |
- | trainee | + | |
- | trainee | + | |
- | ... | + | |
- | </ | + | |
- | + | ||
- | la limite | + | |
- | + | ||
- | < | + | |
- | $ ulimit -n 4096 | + | |
- | </ | + | |
- | + | ||
- | Pour consulter la liste des limites actuelles, il convient d' | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | real-time non-blocking time (microseconds, | + | |
- | core file size (blocks, -c) 0 | + | |
- | data seg size | + | |
- | scheduling priority | + | |
- | file size | + | |
- | pending signals | + | |
- | max locked memory | + | |
- | max memory size | + | |
- | open files (-n) 1024 | + | |
- | pipe size (512 bytes, -p) 8 | + | |
- | POSIX message queues | + | |
- | real-time priority | + | |
- | stack size (kbytes, -s) 8192 | + | |
- | cpu time | + | |
- | max user processes | + | |
- | virtual memory | + | |
- | file locks (-x) unlimited | + | |
- | </ | + | |
- | + | ||
- | Les options de **ulimit** sont : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | ulimit: ulimit [-SHabcdefiklmnpqrstuvxPT] [limit] | + | |
- | Modify shell resource limits. | + | |
- | + | ||
- | Provides control over the resources available to the shell and processes | + | |
- | it creates, on systems that allow such control. | + | |
- | + | ||
- | Options: | + | |
- | | + | |
- | -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' | + | |
- | -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 | + | |
- | -R the maximum time a real-time process can run before blocking | + | |
- | -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', | + | |
- | current soft limit, the current hard limit, and no limit, respectively. | + | |
- | Otherwise, the current value of the specified resource is printed. | + | |
- | 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. | + | |
- | </ | + | |
- | + | ||
- | ====LAB #5 - cgroups v1==== | + | |
- | + | ||
- | === 5.1 - Préparation=== | + | |
- | + | ||
- | Debian 11 utilise cgroups v2 par défault. Pour revenir à l' | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | root@debian11: | + | |
- | # If you change this file, run ' | + | |
- | # / | + | |
- | # For full documentation of the options in this file, see: | + | |
- | # info -f grub -n ' | + | |
- | + | ||
- | GRUB_DEFAULT=0 | + | |
- | GRUB_TIMEOUT=5 | + | |
- | GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` | + | |
- | GRUB_CMDLINE_LINUX_DEFAULT=" | + | |
- | GRUB_CMDLINE_LINUX="" | + | |
- | + | ||
- | # Uncomment to enable BadRAM filtering, modify to suit your needs | + | |
- | # This works with Linux (no patch required) and with any kernel that obtains | + | |
- | # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...) | + | |
- | # | + | |
- | + | ||
- | # Uncomment to disable graphical terminal (grub-pc only) | + | |
- | # | + | |
- | + | ||
- | # The resolution used on graphical terminal | + | |
- | # note that you can use only modes which your graphic card supports via VBE | + | |
- | # you can see them in real GRUB with the command `vbeinfo' | + | |
- | # | + | |
- | + | ||
- | # Uncomment if you don't want GRUB to pass " | + | |
- | # | + | |
- | + | ||
- | # Uncomment to disable generation of recovery mode menu entries | + | |
- | # | + | |
- | + | ||
- | # Uncomment to get a beep at grub start | + | |
- | # | + | |
- | + | ||
- | root@debian11: | + | |
- | Generating grub configuration file ... | + | |
- | Found background image: / | + | |
- | Found linux image: / | + | |
- | Found initrd image: / | + | |
- | done | + | |
- | </ | + | |
- | + | ||
- | Redémarrez ensuite votre VM : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | </ | + | |
- | + | ||
- | === 5.2 - Présentation=== | + | |
- | + | ||
- | Les **Groupes de Contrôles** (//Control Groups//) aussi appelés **CGroups**, | + | |
- | + | ||
- | Les groupes de contrôle sont organisés de manière hiérarchique, | + | |
- | + | ||
- | 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 Debian 11 sont : | + | |
- | + | ||
- | * **blkio** - utilisé pour établir des limites sur l' | + | |
- | * **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' | + | |
- | * **freezer** - utilisé pour suspendre ou pour réactiver les tâches dans un groupe de contrôle, | + | |
- | * **memory** - utilisé pour établir les limites d' | + | |
- | * **net_cls** - utilisé pour repèrer les paquets réseau avec un identifiant de classe (// | + | |
- | * **perf_event** | + | |
- | * **hugetlb** - utilisé pour limiter des ressources sur des pages de mémoire virtuelle de grande taille. | + | |
- | + | ||
- | Il est à noter que : | + | |
- | + | ||
- | * chaque processus du système appartient à un cgroup et seulement à un cgroup à la fois, | + | |
- | * tous les threads d'un processus appartiennent au même cgroup, | + | |
- | * à la création d'un processus, celui-ci est mis dans le même cgroup que son processus parent, | + | |
- | * un processus peut être migré d'un cgroup à un autre cgroup. Par contre, la migration d'un processus n'a pas d' | + | |
- | + | ||
- | Commencez par installer le paquet **cgroup-tools** : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | </ | + | |
- | + | ||
- | Pour visualiser les hiérarchies, | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | cpuset / | + | |
- | cpu,cpuacct / | + | |
- | blkio / | + | |
- | memory / | + | |
- | devices / | + | |
- | freezer / | + | |
- | net_cls, | + | |
- | perf_event / | + | |
- | hugetlb / | + | |
- | pids / | + | |
- | rdma / | + | |
- | </ | + | |
- | + | ||
- | Sous Debian 11, **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' | + | |
- | + | ||
- | En haut de l' | + | |
- | + | ||
- | * le **system.slice** - l' | + | |
- | * le **user.slice** - l' | + | |
- | * le **machine.slice** - l' | + | |
- | + | ||
- | En dessous des tranches peuvent se trouver : | + | |
- | + | ||
- | * des **scopes** - des processus crées par **fork**, | + | |
- | * des **services** - des processus créés par une **Unité**. | + | |
- | + | ||
- | Les slices peuvent être visualisés avec la commande suivante : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | UNIT | + | |
- | -.slice | + | |
- | system-getty.slice | + | |
- | system-lvm2\x2dpvscan.slice | + | |
- | system-modprobe.slice | + | |
- | system-systemd\x2dcryptsetup.slice loaded active active Cryptsetup Units Slice | + | |
- | system.slice | + | |
- | user-1000.slice | + | |
- | user.slice | + | |
- | + | ||
- | LOAD = Reflects whether the unit definition was properly loaded. | + | |
- | ACTIVE = The high-level unit activation state, i.e. generalization of SUB. | + | |
- | SUB = The low-level unit activation state, values depend on unit type. | + | |
- | 8 loaded units listed. Pass --all to see loaded but inactive units, too. | + | |
- | To show all installed unit files use ' | + | |
- | </ | + | |
- | + | ||
- | L' | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | Control group /: | + | |
- | -.slice | + | |
- | ├─user.slice | + | |
- | │ └─user-1000.slice | + | |
- | │ | + | |
- | │ │ ├─app.slice | + | |
- | │ │ │ ├─pulseaudio.service | + | |
- | │ │ │ │ └─974 / | + | |
- | │ │ │ ├─pipewire.service | + | |
- | │ │ │ │ ├─973 / | + | |
- | │ │ │ │ └─984 / | + | |
- | │ │ │ └─dbus.service | + | |
- | │ │ │ | + | |
- | │ │ └─init.scope | + | |
- | │ | + | |
- | │ | + | |
- | │ | + | |
- | │ │ ├─ 993 sshd: trainee [priv] | + | |
- | │ │ ├─ 999 sshd: trainee@pts/ | + | |
- | │ │ ├─1000 -bash | + | |
- | │ │ ├─1003 su - | + | |
- | │ │ ├─1004 -bash | + | |
- | │ │ ├─1010 systemd-cgls | + | |
- | │ │ └─1011 less | + | |
- | │ | + | |
- | │ | + | |
- | │ | + | |
- | │ | + | |
- | │ | + | |
- | ├─init.scope | + | |
- | │ └─1 / | + | |
- | └─system.slice | + | |
- | ├─apache2.service | + | |
- | │ ├─595 / | + | |
- | │ ├─597 / | + | |
- | │ └─598 / | + | |
- | ├─systemd-udevd.service | + | |
- | │ └─317 / | + | |
- | ├─cron.service | + | |
- | │ └─491 / | + | |
- | ├─polkit.service | + | |
- | │ └─495 / | + | |
- | ├─rtkit-daemon.service | + | |
- | │ └─979 / | + | |
- | ├─auditd.service | + | |
- | │ └─460 / | + | |
- | ├─wpa_supplicant.service | + | |
- | │ └─498 / | + | |
- | ├─ModemManager.service | + | |
- | │ └─515 / | + | |
- | ├─inetd.service | + | |
- | │ └─694 / | + | |
- | ├─systemd-journald.service | + | |
- | │ └─296 / | + | |
- | ├─mdmonitor.service | + | |
- | │ └─432 /sbin/mdadm --monitor --scan | + | |
- | ├─ssh.service | + | |
- | │ └─580 sshd: / | + | |
- | lines 1-58 | + | |
- | [q] | + | |
- | </ | + | |
- | + | ||
- | En utilisant Systemd, plusieurs ressources peuvent être limitées : | + | |
- | + | ||
- | * **CPUShares** - par défault 1024, | + | |
- | * **MemoryLimit** - limite exprimée en Mo ou en Go. Pas de valeur par défaut, | + | |
- | * **BlockIOWeight** - valeur entre 10 et 1000. Pas de valeur par défaut, | + | |
- | * **StartupCPUShares** - comme CPUShares mais uniquement appliqué pendant le démarrage, | + | |
- | * **StartupBlockIOWeight** - comme BlockIOWeight mais uniquement appliqué pendant le démarrage, | + | |
- | * **CPUQuota** - utilisé pour limiter le temps CPU, même quand le système ne fait rien. | + | |
- | + | ||
- | === 5.3 - Limitation de la Mémoire=== | + | |
- | + | ||
- | Commencez par créer le script **hello-world.sh** qui servira à générer un processus pour travailler avec les CGroups : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | root@debian11: | + | |
- | # | + | |
- | while [ 1 ]; do | + | |
- | echo "hello world" | + | |
- | sleep 360 | + | |
- | done | + | |
- | </ | + | |
- | + | ||
- | Rendez le script exécutable et testez-le : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | root@debian11: | + | |
- | hello world | + | |
- | ^C | + | |
- | </ | + | |
- | + | ||
- | Créez maintenant un CGroup dans le sous-système **memory** appelé **helloworld** : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | </ | + | |
- | + | ||
- | Par défaut, ce CGroup héritera de l' | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | root@debian11: | + | |
- | 39997440 | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round important > | + | |
- | **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 ). | + | |
- | </ | + | |
- | + | ||
- | Lancez maintenant le script **helloworld.sh** : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | [1] 1073 | + | |
- | root@debian11: | + | |
- | [Entrée] | + | |
- | + | ||
- | root@debian11: | + | |
- | root 1073 0.0 0.0 | + | |
- | root 1077 0.0 0.0 | + | |
- | </ | + | |
- | + | ||
- | Notez qu'il n'y a pas de limite de la mémoire, ce qui implique l' | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | CGROUP | + | |
- | 8: | + | |
- | </ | + | |
- | + | ||
- | Insérer le PID de notre script dans le CGroup **helloworld** : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | </ | + | |
- | + | ||
- | Notez maintenant l' | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | CGROUP | + | |
- | 8: | + | |
- | </ | + | |
- | + | ||
- | Constatez ensuite l' | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | 274432 | + | |
- | </ | + | |
- | + | ||
- | Tuez le script **hello-world.sh** : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | root@debian11: | + | |
- | root 1086 0.0 0.0 | + | |
- | [1]+ Terminated | + | |
- | </ | + | |
- | + | ||
- | Créez un second CGroup beaucoup plus restrictif : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | root@debian11: | + | |
- | root@debian11: | + | |
- | 4096 | + | |
- | </ | + | |
- | + | ||
- | Relancez le script **hello-world.sh** et insérez-le dans le nouveau CGroup : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | [1] 1089 | + | |
- | + | ||
- | root@debian11: | + | |
- | [Entrée] | + | |
- | + | ||
- | root@debian11: | + | |
- | </ | + | |
- | + | ||
- | Attendez la prochaine sortie de **hello world** sur le canal standard puis constatez que le script s' | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | root 1100 0.0 0.0 | + | |
- | [1]+ Killed | + | |
- | </ | + | |
- | + | ||
- | Notez la trace dans le fichier **/ | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | May 4 06:44:43 debian11 kernel: [ 994.012423] workingset_nodereclaim 0 | + | |
- | May 4 06:44:43 debian11 kernel: [ 994.012423] pgfault 0 | + | |
- | May 4 06:44:43 debian11 kernel: [ 994.012423] pgmajfault 0 | + | |
- | May 4 06:44:43 debian11 kernel: [ 994.012423] pgrefill 0 | + | |
- | May 4 06:44:43 debian11 kernel: [ 994.012423] pgscan 0 | + | |
- | May 4 06:44:43 debian11 kernel: [ 994.012423] pgsteal 0 | + | |
- | May 4 06:44:43 debian11 kernel: [ 994.012425] Tasks state (memory values in pages): | + | |
- | May 4 06:44:43 debian11 kernel: [ 994.012426] [ pid ] | + | |
- | May 4 06:44:43 debian11 kernel: [ 994.012428] [ | + | |
- | May 4 06:44:43 debian11 kernel: [ 994.012430] oom-kill: | + | |
- | </ | + | |
- | + | ||
- | ===5.4 - La Commande cgcreate=== | + | |
- | + | ||
- | Cette commande permet la création d'un CGroup : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | + | ||
- | root@debian11: | + | |
- | total 0 | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:47 cgroup.clone_children | + | |
- | --w--w--w- 1 root root 0 May 4 06:47 cgroup.event_control | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:47 cgroup.procs | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:47 memory.failcnt | + | |
- | --w------- 1 root root 0 May 4 06:47 memory.force_empty | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:47 memory.kmem.failcnt | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:47 memory.kmem.limit_in_bytes | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:47 memory.kmem.max_usage_in_bytes | + | |
- | -r--r--r-- 1 root root 0 May 4 06:47 memory.kmem.slabinfo | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:47 memory.kmem.tcp.failcnt | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:47 memory.kmem.tcp.limit_in_bytes | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:47 memory.kmem.tcp.max_usage_in_bytes | + | |
- | -r--r--r-- 1 root root 0 May 4 06:47 memory.kmem.tcp.usage_in_bytes | + | |
- | -r--r--r-- 1 root root 0 May 4 06:47 memory.kmem.usage_in_bytes | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:47 memory.limit_in_bytes | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:47 memory.max_usage_in_bytes | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:47 memory.memsw.failcnt | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:47 memory.memsw.limit_in_bytes | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:47 memory.memsw.max_usage_in_bytes | + | |
- | -r--r--r-- 1 root root 0 May 4 06:47 memory.memsw.usage_in_bytes | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:47 memory.move_charge_at_immigrate | + | |
- | -r--r--r-- 1 root root 0 May 4 06:47 memory.numa_stat | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:47 memory.oom_control | + | |
- | ---------- 1 root root 0 May 4 06:47 memory.pressure_level | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:47 memory.soft_limit_in_bytes | + | |
- | -r--r--r-- 1 root root 0 May 4 06:47 memory.stat | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:47 memory.swappiness | + | |
- | -r--r--r-- 1 root root 0 May 4 06:47 memory.usage_in_bytes | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:47 memory.use_hierarchy | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:47 notify_on_release | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:47 tasks | + | |
- | </ | + | |
- | + | ||
- | Il n' | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | </ | + | |
- | + | ||
- | ===5.5 - La Commande cgexec=== | + | |
- | + | ||
- | Cette commande permet d' | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | [1] 1106 | + | |
- | + | ||
- | root@debian11: | + | |
- | [Entrée] | + | |
- | + | ||
- | root@debian11: | + | |
- | 1106 | + | |
- | 1107 | + | |
- | root@debian11: | + | |
- | root 1106 0.0 0.0 | + | |
- | root 1107 0.0 0.0 | + | |
- | root 1108 0.0 0.0 0 0 ? I 06:49 0:00 [kworker/ | + | |
- | root 1113 0.0 0.0 | + | |
- | </ | + | |
- | + | ||
- | ===5.6 - La Commande cgdelete== | + | |
- | + | ||
- | Une fois le script terminé, cette commande permet de supprimer le cgroup : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | root@debian11: | + | |
- | root 1107 0.0 0.0 | + | |
- | root 1108 0.0 0.0 0 0 ? I 06:49 0:00 [kworker/ | + | |
- | root 1115 0.0 0.0 | + | |
- | [1]+ Terminated | + | |
- | + | ||
- | root@debian11: | + | |
- | + | ||
- | root@debian11: | + | |
- | ls: cannot access '/ | + | |
- | </ | + | |
- | + | ||
- | ==Le Fichier / | + | |
- | + | ||
- | Afin de les rendre persistants, | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | root@debian11: | + | |
- | group helloworld2 { | + | |
- | cpu { | + | |
- | cpu.shares = 100; | + | |
- | } | + | |
- | memory { | + | |
- | memory.limit_in_bytes = 40000; | + | |
- | } | + | |
- | } | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round important > | + | |
- | **Important** - Notez la création de **deux** limitations, | + | |
- | </ | + | |
- | + | ||
- | Créez donc les deux CGroups concernés : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | + | ||
- | root@debian11: | + | |
- | total 0 | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:53 cgroup.clone_children | + | |
- | --w--w--w- 1 root root 0 May 4 06:53 cgroup.event_control | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:53 cgroup.procs | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:53 memory.failcnt | + | |
- | --w------- 1 root root 0 May 4 06:53 memory.force_empty | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:53 memory.kmem.failcnt | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:53 memory.kmem.limit_in_bytes | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:53 memory.kmem.max_usage_in_bytes | + | |
- | -r--r--r-- 1 root root 0 May 4 06:53 memory.kmem.slabinfo | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:53 memory.kmem.tcp.failcnt | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:53 memory.kmem.tcp.limit_in_bytes | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:53 memory.kmem.tcp.max_usage_in_bytes | + | |
- | -r--r--r-- 1 root root 0 May 4 06:53 memory.kmem.tcp.usage_in_bytes | + | |
- | -r--r--r-- 1 root root 0 May 4 06:53 memory.kmem.usage_in_bytes | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:53 memory.limit_in_bytes | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:53 memory.max_usage_in_bytes | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:53 memory.memsw.failcnt | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:53 memory.memsw.limit_in_bytes | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:53 memory.memsw.max_usage_in_bytes | + | |
- | -r--r--r-- 1 root root 0 May 4 06:53 memory.memsw.usage_in_bytes | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:53 memory.move_charge_at_immigrate | + | |
- | -r--r--r-- 1 root root 0 May 4 06:53 memory.numa_stat | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:53 memory.oom_control | + | |
- | ---------- 1 root root 0 May 4 06:53 memory.pressure_level | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:53 memory.soft_limit_in_bytes | + | |
- | -r--r--r-- 1 root root 0 May 4 06:53 memory.stat | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:53 memory.swappiness | + | |
- | -r--r--r-- 1 root root 0 May 4 06:53 memory.usage_in_bytes | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:53 memory.use_hierarchy | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:53 notify_on_release | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:53 tasks | + | |
- | </ | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | + | ||
- | root@debian11: | + | |
- | total 0 | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:54 cgroup.clone_children | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:54 cgroup.procs | + | |
- | -r--r--r-- 1 root root 0 May 4 06:54 cpuacct.stat | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:54 cpuacct.usage | + | |
- | -r--r--r-- 1 root root 0 May 4 06:54 cpuacct.usage_all | + | |
- | -r--r--r-- 1 root root 0 May 4 06:54 cpuacct.usage_percpu | + | |
- | -r--r--r-- 1 root root 0 May 4 06:54 cpuacct.usage_percpu_sys | + | |
- | -r--r--r-- 1 root root 0 May 4 06:54 cpuacct.usage_percpu_user | + | |
- | -r--r--r-- 1 root root 0 May 4 06:54 cpuacct.usage_sys | + | |
- | -r--r--r-- 1 root root 0 May 4 06:54 cpuacct.usage_user | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:54 cpu.cfs_period_us | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:54 cpu.cfs_quota_us | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:54 cpu.shares | + | |
- | -r--r--r-- 1 root root 0 May 4 06:54 cpu.stat | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:54 notify_on_release | + | |
- | -rw-r--r-- 1 root root 0 May 4 06:54 tasks | + | |
- | </ | + | |
- | + | ||
- | ===5.7 - La Commande cgconfigparser=== | + | |
- | + | ||
- | Appliquez le contenu du fichier **/ | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | + | ||
- | root@debian11: | + | |
- | 36864 | + | |
- | + | ||
- | root@debian11: | + | |
- | 100 | + | |
- | </ | + | |
- | + | ||
- | ====LAB #6 - cgroups v2==== | + | |
- | + | ||
- | ===6.1 - Préparation=== | + | |
- | + | ||
- | Pour revenir à l' | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | root@debian11: | + | |
- | # If you change this file, run ' | + | |
- | # / | + | |
- | # For full documentation of the options in this file, see: | + | |
- | # info -f grub -n ' | + | |
- | + | ||
- | GRUB_DEFAULT=0 | + | |
- | GRUB_TIMEOUT=5 | + | |
- | GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` | + | |
- | GRUB_CMDLINE_LINUX_DEFAULT=" | + | |
- | GRUB_CMDLINE_LINUX="" | + | |
- | + | ||
- | # Uncomment to enable BadRAM filtering, modify to suit your needs | + | |
- | # This works with Linux (no patch required) and with any kernel that obtains | + | |
- | # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...) | + | |
- | # | + | |
- | + | ||
- | # Uncomment to disable graphical terminal (grub-pc only) | + | |
- | # | + | |
- | + | ||
- | # The resolution used on graphical terminal | + | |
- | # note that you can use only modes which your graphic card supports via VBE | + | |
- | # you can see them in real GRUB with the command `vbeinfo' | + | |
- | # | + | |
- | + | ||
- | # Uncomment if you don't want GRUB to pass " | + | |
- | # | + | |
- | + | ||
- | # Uncomment to disable generation of recovery mode menu entries | + | |
- | # | + | |
- | + | ||
- | # Uncomment to get a beep at grub start | + | |
- | # | + | |
- | + | ||
- | root@debian11: | + | |
- | Generating grub configuration file ... | + | |
- | Found background image: / | + | |
- | Found linux image: / | + | |
- | Found initrd image: / | + | |
- | done | + | |
- | </ | + | |
- | + | ||
- | Redémarrez ensuite votre VM : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | </ | + | |
- | + | ||
- | ===6.2 - Présentation=== | + | |
- | + | ||
- | A l' | + | |
- | + | ||
- | Pour vérifier l' | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | cgroup2 on / | + | |
- | </ | + | |
- | + | ||
- | et de consulter le contenu de ce point de montage : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | total 0 | + | |
- | -r--r--r-- | + | |
- | -rw-r--r-- | + | |
- | -rw-r--r-- | + | |
- | -rw-r--r-- | + | |
- | -r--r--r-- | + | |
- | -rw-r--r-- | + | |
- | -rw-r--r-- | + | |
- | -rw-r--r-- | + | |
- | -r--r--r-- | + | |
- | -r--r--r-- | + | |
- | -r--r--r-- | + | |
- | drwxr-xr-x | + | |
- | drwxr-xr-x | + | |
- | drwxr-xr-x | + | |
- | -rw-r--r-- | + | |
- | -rw-r--r-- | + | |
- | -rw-r--r-- | + | |
- | -r--r--r-- | + | |
- | -r--r--r-- | + | |
- | -rw-r--r-- | + | |
- | -r--r--r-- | + | |
- | drwxr-xr-x | + | |
- | drwxr-xr-x | + | |
- | drwxr-xr-x | + | |
- | drwxr-xr-x | + | |
- | drwxr-xr-x 23 root root 0 Jul 6 11:26 system.slice | + | |
- | drwxr-xr-x | + | |
- | </ | + | |
- | + | ||
- | Dans la version 2 de cgroup, certains noms ont changé par rapport à ceux utilisés dans la version 1 : | + | |
- | + | ||
- | ^ Version 1 ^ Version 2 ^ | + | |
- | | CPUShares | CPUWeight | | + | |
- | | StartupCPUShares | StartupCPUWeight | | + | |
- | | MemoryLimit | MemoryMax | | + | |
- | + | ||
- | Commencez par créer le cgroup enfant **pids** dans le cgroup racine : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | </ | + | |
- | + | ||
- | Placez le PID du terminal courant dans le fichier **cgroup.procs** du cgroup enfant : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | 1230 | + | |
- | root@debian11: | + | |
- | </ | + | |
- | + | ||
- | Contrôlez maintenant le contenu du fichier cgroup.procs ainsi que le nombre de PIDs dans le cgroup **pids** : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | 1230 | + | |
- | 1281 | + | |
- | + | ||
- | root@debian11: | + | |
- | 2 | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round important > | + | |
- | **Important** - Notez que le fichier cgroup.procs contient **deux** PIDs. Le premier est celui du Shell tandis que le deuxième est celui de la commande cat. | + | |
- | </ | + | |
- | + | ||
- | Injectez maintenant la valeur de **5** dans le fichier **pids.max** du cgroup ** pids** : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | </ | + | |
- | + | ||
- | Lancez la commande suivante pour créer 6 pids dans le cgroup : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | [1] 1290 | + | |
- | [2] 1291 | + | |
- | [3] 1292 | + | |
- | [4] 1293 | + | |
- | -bash: fork: retry: Resource temporarily unavailable | + | |
- | -bash: fork: retry: Resource temporarily unavailable | + | |
- | -bash: fork: retry: Resource temporarily unavailable | + | |
- | -bash: fork: retry: Resource temporarily unavailable | + | |
- | -bash: fork: Resource temporarily unavailable | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round important > | + | |
- | **Important** - Notez qu'à la tentantive de création du 6ème processus, une erreur est retournée. Le système tente ensuite 4 fois de plus puis renonce finalement avec le message d' | + | |
- | </ | + | |
- | + | ||
- | Dernièrement, | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | rmdir: failed to remove '/ | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round important > | + | |
- | **Important** - Notez qu'il n'est pas possible de supprimer un cgroup tant que celui-ci contient un processus. | + | |
- | </ | + | |
- | + | ||
- | Déplacez le processus du terminal courant dans le cgroup racine : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | </ | + | |
- | + | ||
- | Il est maintenant possible de supprimer le cgroup **pids** : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | root@debian11: | + | |
- | </ | + | |
- | + | ||
- | ===6.3 - Limitation de la CPU=== | + | |
- | + | ||
- | Créez un service appelé **foo** : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | root@debian11: | + | |
- | [Unit] | + | |
- | Description=The foo service that does nothing useful | + | |
- | After=remote-fs.target nss-lookup.target | + | |
- | + | ||
- | [Service] | + | |
- | ExecStart=/ | + | |
- | ExecStop=/ | + | |
- | + | ||
- | [Install] | + | |
- | WantedBy=multi-user.target | + | |
- | </ | + | |
- | + | ||
- | Démarrez et activez le service : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | root@debian11: | + | |
- | Created symlink / | + | |
- | root@debian11: | + | |
- | ● foo.service - The foo service that does nothing useful | + | |
- | | + | |
- | | + | |
- | Main PID: 997 (sha1sum) | + | |
- | Tasks: 1 (limit: 19155) | + | |
- | | + | |
- | CPU: 19.114s | + | |
- | | + | |
- | | + | |
- | + | ||
- | Jul 06 11:41:18 debian11 systemd[1]: Started The foo service that does nothing useful. | + | |
- | </ | + | |
- | + | ||
- | Utilisez ps pour voir le pourcentage du CPU utilisé par ce service : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | PID COMMAND | + | |
- | 997 sha1sum | + | |
- | </ | + | |
- | + | ||
- | Créez maintenant le service **bar** : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | root@debian11: | + | |
- | [Unit] | + | |
- | Description=The bar service that does nothing useful | + | |
- | After=remote-fs.target nss-lookup.target | + | |
- | + | ||
- | [Service] | + | |
- | ExecStart=/ | + | |
- | ExecStop=/ | + | |
- | + | ||
- | [Install] | + | |
- | WantedBy=multi-user.target | + | |
- | </ | + | |
- | + | ||
- | Démarrez et activez le service : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | + | ||
- | root@debian11: | + | |
- | + | ||
- | Created symlink / | + | |
- | + | ||
- | root@debian11: | + | |
- | ● bar.service - The bar service that does nothing useful | + | |
- | | + | |
- | | + | |
- | Main PID: 1020 (md5sum) | + | |
- | Tasks: 1 (limit: 19155) | + | |
- | | + | |
- | CPU: 15.079s | + | |
- | | + | |
- | | + | |
- | + | ||
- | Jul 06 11:45:24 debian11 systemd[1]: Started The bar service that does nothing useful. | + | |
- | </ | + | |
- | + | ||
- | Utilisez ps pour voir le pourcentage du CPU utilisé par ce service : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | PID COMMAND | + | |
- | 1020 md5sum | + | |
- | </ | + | |
- | + | ||
- | Utilisez la commande **ps** pour visualiser les deux processus : | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | PID COMMAND | + | |
- | 997 sha1sum | + | |
- | 1020 md5sum | + | |
- | </ | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | cpuset cpu io memory hugetlb pids rdma | + | |
- | </ | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | memory pids | + | |
- | + | ||
- | root@debian11: | + | |
- | + | ||
- | root@debian11: | + | |
- | + | ||
- | root@debian11: | + | |
- | cpuset cpu memory pids | + | |
- | </ | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | + | ||
- | root@debian11: | + | |
- | total 0 | + | |
- | -r--r--r-- 1 root root 0 Jul 6 12:18 cgroup.controllers | + | |
- | -r--r--r-- 1 root root 0 Jul 6 12:18 cgroup.events | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:18 cgroup.freeze | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:18 cgroup.max.depth | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:18 cgroup.max.descendants | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:18 cgroup.procs | + | |
- | -r--r--r-- 1 root root 0 Jul 6 12:18 cgroup.stat | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:18 cgroup.subtree_control | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:18 cgroup.threads | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:18 cgroup.type | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:18 cpu.max | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:18 cpu.pressure | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:18 cpuset.cpus | + | |
- | -r--r--r-- 1 root root 0 Jul 6 12:18 cpuset.cpus.effective | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:18 cpuset.cpus.partition | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:18 cpuset.mems | + | |
- | -r--r--r-- 1 root root 0 Jul 6 12:18 cpuset.mems.effective | + | |
- | -r--r--r-- 1 root root 0 Jul 6 12:18 cpu.stat | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:18 cpu.weight | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:18 cpu.weight.nice | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:18 io.pressure | + | |
- | -r--r--r-- 1 root root 0 Jul 6 12:18 memory.current | + | |
- | -r--r--r-- 1 root root 0 Jul 6 12:18 memory.events | + | |
- | -r--r--r-- 1 root root 0 Jul 6 12:18 memory.events.local | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:18 memory.high | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:18 memory.low | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:18 memory.max | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:18 memory.min | + | |
- | -r--r--r-- 1 root root 0 Jul 6 12:18 memory.numa_stat | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:18 memory.oom.group | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:18 memory.pressure | + | |
- | -r--r--r-- 1 root root 0 Jul 6 12:18 memory.stat | + | |
- | -r--r--r-- 1 root root 0 Jul 6 12:18 memory.swap.current | + | |
- | -r--r--r-- 1 root root 0 Jul 6 12:18 memory.swap.events | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:18 memory.swap.high | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:18 memory.swap.max | + | |
- | -r--r--r-- 1 root root 0 Jul 6 12:18 pids.current | + | |
- | -r--r--r-- 1 root root 0 Jul 6 12:18 pids.events | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:18 pids.max | + | |
- | </ | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | + | ||
- | root@debian11: | + | |
- | + | ||
- | root@debian11: | + | |
- | cpuset cpu memory pids | + | |
- | cpuset cpu | + | |
- | </ | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | root@debian11: | + | |
- | total 0 | + | |
- | -r--r--r-- 1 root root 0 Jul 6 12:20 cgroup.controllers | + | |
- | -r--r--r-- 1 root root 0 Jul 6 12:20 cgroup.events | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:20 cgroup.freeze | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:20 cgroup.max.depth | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:20 cgroup.max.descendants | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:20 cgroup.procs | + | |
- | -r--r--r-- 1 root root 0 Jul 6 12:20 cgroup.stat | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:20 cgroup.subtree_control | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:20 cgroup.threads | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:20 cgroup.type | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:20 cpu.max | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:20 cpu.pressure | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:20 cpuset.cpus | + | |
- | -r--r--r-- 1 root root 0 Jul 6 12:20 cpuset.cpus.effective | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:20 cpuset.cpus.partition | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:20 cpuset.mems | + | |
- | -r--r--r-- 1 root root 0 Jul 6 12:20 cpuset.mems.effective | + | |
- | -r--r--r-- 1 root root 0 Jul 6 12:20 cpu.stat | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:20 cpu.weight | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:20 cpu.weight.nice | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:20 io.pressure | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 12:20 memory.pressure | + | |
- | </ | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | + | ||
- | root@debian11: | + | |
- | 1 | + | |
- | </ | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | </ | + | |
- | + | ||
- | < | + | |
- | echo " | + | |
- | + | ||
- | echo " | + | |
- | </ | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | 0::/ | + | |
- | 0::/ | + | |
- | </ | + | |
- | + | ||
- | < | + | |
- | top - 12:36:33 up 1:37, 2 users, | + | |
- | Tasks: 154 total, | + | |
- | %Cpu(s): | + | |
- | MiB Mem : 16007.9 total, | + | |
- | MiB Swap: 975.0 total, | + | |
- | + | ||
- | PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND | + | |
- | 997 root 20 | + | |
- | 1020 root 20 | + | |
- | </ | + | |
- | + | ||
- | ===6.4 - La Commande systemctl set-property=== | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | total 0 | + | |
- | -r--r--r-- 1 root root 0 Jul 6 16:13 cgroup.controllers | + | |
- | -r--r--r-- 1 root root 0 Jul 6 10:58 cgroup.events | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 16:13 cgroup.freeze | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 16:13 cgroup.max.depth | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 16:13 cgroup.max.descendants | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 16:13 cgroup.procs | + | |
- | -r--r--r-- 1 root root 0 Jul 6 16:13 cgroup.stat | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 15:05 cgroup.subtree_control | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 16:13 cgroup.threads | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 16:13 cgroup.type | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 16:13 cpu.max | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 16:13 cpu.pressure | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 16:13 cpuset.cpus | + | |
- | -r--r--r-- 1 root root 0 Jul 6 16:13 cpuset.cpus.effective | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 16:13 cpuset.cpus.partition | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 16:13 cpuset.mems | + | |
- | -r--r--r-- 1 root root 0 Jul 6 16:13 cpuset.mems.effective | + | |
- | -r--r--r-- 1 root root 0 Jul 6 10:58 cpu.stat | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 16:13 cpu.weight | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 16:13 cpu.weight.nice | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 16:13 io.pressure | + | |
- | -r--r--r-- 1 root root 0 Jul 6 16:13 memory.current | + | |
- | -r--r--r-- 1 root root 0 Jul 6 16:13 memory.events | + | |
- | -r--r--r-- 1 root root 0 Jul 6 16:13 memory.events.local | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 10:58 memory.high | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 10:58 memory.low | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 10:58 memory.max | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 10:58 memory.min | + | |
- | -r--r--r-- 1 root root 0 Jul 6 16:13 memory.numa_stat | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 10:58 memory.oom.group | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 16:13 memory.pressure | + | |
- | -r--r--r-- 1 root root 0 Jul 6 16:13 memory.stat | + | |
- | -r--r--r-- 1 root root 0 Jul 6 16:13 memory.swap.current | + | |
- | -r--r--r-- 1 root root 0 Jul 6 16:13 memory.swap.events | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 16:13 memory.swap.high | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 10:58 memory.swap.max | + | |
- | -r--r--r-- 1 root root 0 Jul 6 16:13 pids.current | + | |
- | -r--r--r-- 1 root root 0 Jul 6 16:13 pids.events | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 10:58 pids.max | + | |
- | drwxr-xr-x 8 root root 0 Jul 6 15:22 user-1000.slice | + | |
- | drwxr-xr-x 5 root root 0 Jul 6 11:41 user-113.slice | + | |
- | </ | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | total 0 | + | |
- | -r--r--r-- 1 root root 0 Jul 6 16:14 cgroup.controllers | + | |
- | -r--r--r-- 1 root root 0 Jul 6 11:30 cgroup.events | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 16:14 cgroup.freeze | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 16:14 cgroup.max.depth | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 16:14 cgroup.max.descendants | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 16:14 cgroup.procs | + | |
- | -r--r--r-- 1 root root 0 Jul 6 16:14 cgroup.stat | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 15:05 cgroup.subtree_control | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 16:14 cgroup.threads | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 16:14 cgroup.type | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 16:14 cpu.pressure | + | |
- | -r--r--r-- 1 root root 0 Jul 6 11:30 cpu.stat | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 16:14 io.pressure | + | |
- | -r--r--r-- 1 root root 0 Jul 6 16:14 memory.current | + | |
- | -r--r--r-- 1 root root 0 Jul 6 16:14 memory.events | + | |
- | -r--r--r-- 1 root root 0 Jul 6 16:14 memory.events.local | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 11:30 memory.high | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 11:30 memory.low | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 11:30 memory.max | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 11:30 memory.min | + | |
- | -r--r--r-- 1 root root 0 Jul 6 16:14 memory.numa_stat | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 11:30 memory.oom.group | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 16:14 memory.pressure | + | |
- | -r--r--r-- 1 root root 0 Jul 6 16:14 memory.stat | + | |
- | -r--r--r-- 1 root root 0 Jul 6 16:14 memory.swap.current | + | |
- | -r--r--r-- 1 root root 0 Jul 6 16:14 memory.swap.events | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 16:14 memory.swap.high | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 11:30 memory.swap.max | + | |
- | -r--r--r-- 1 root root 0 Jul 6 16:14 pids.current | + | |
- | -r--r--r-- 1 root root 0 Jul 6 16:14 pids.events | + | |
- | -rw-r--r-- 1 root root 0 Jul 6 11:30 pids.max | + | |
- | drwxr-xr-x 2 root root 0 Jul 6 14:56 session-13.scope | + | |
- | drwxr-xr-x 2 root root 0 Jul 6 15:22 session-15.scope | + | |
- | drwxr-xr-x 2 root root 0 Jul 6 11:30 session-4.scope | + | |
- | drwxr-xr-x 2 root root 0 Jul 6 12:12 session-6.scope | + | |
- | drwxr-xr-x 4 trainee trainee 0 Jul 6 11:30 user@1000.service | + | |
- | drwxr-xr-x 2 root root 0 Jul 6 11:41 user-runtime-dir@1000.service | + | |
- | </ | + | |
- | + | ||
- | CPUQuota | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | root@debian11: | + | |
- | 40000 100000 | + | |
- | </ | + | |
- | + | ||
- | MemoryMax | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | root@debian11: | + | |
- | 1073741824 | + | |
- | </ | + | |
- | + | ||
- | MemoryHigh vs memoryMax | + | |
- | One such parameter is MemoryHigh, which is more of a soft limit. MemoryHigh would allow Pogo to exceed his memory allocation if it's unavoidable, | + | * **LDF513 - Gestion du Noyau et des Quotas** |
+ | * Rôle du noyau | ||
+ | * LAB #1 - Compilation et installation du noyau | ||
+ | * 1.1 - Déplacer /home | ||
+ | * 1.2 - Télécharger le Code Source du Noyau | ||
+ | * 1.3 - Configurer le Noyau | ||
+ | * 1.4 - Compiler le Noyau | ||
+ | * 1.5 - Installer le Nouveau Noyau | ||
+ | * 1.6 - Désinstaller un Noyau | ||
+ | * LAB #2 - Mise à Jour du Noyau avec le Gestionnaire des Paquets | ||
+ | * LAB #3 - Gestion des Quotas | ||
+ | * 3.1 - La Commande quotacheck | ||
+ | * 3.2 - La Commande edquota | ||
+ | * 3.3 - La Commande quotaon | ||
+ | * 3.4 - La Commande repquota | ||
+ | * 3.5 - La Commande quota | ||
+ | * 3.6 - La Commande warnquota | ||
- | IOReadBandwidthMax | + | * **LDF514 - Gestion du Système X et de l' |
+ | * X Window System | ||
+ | * Configuration | ||
+ | * Gestionnaire de Fenêtres | ||
+ | * Toolkits | ||
+ | * Freedesktop | ||
+ | * Display Manager | ||
+ | * XDM, GDM et KDM | ||
+ | * LightDM | ||
+ | * X.orgX11 | ||
+ | * Présentation | ||
+ | * Démarrage et Arrêt | ||
+ | * Utilisation | ||
+ | * Configuration | ||
+ | * La Section ServerFlags | ||
+ | * La Section ServerLayout | ||
+ | * La Section Files | ||
+ | * La Section Modules | ||
+ | * La Section InputDevice | ||
+ | * La Section Monitor | ||
+ | * La Section Device | ||
+ | * La Section Screen | ||
+ | * La Commande xwininfo | ||
+ | * La Commande xdpyinfo | ||
+ | * L' | ||
+ | * Le Clavier et la Souris | ||
+ | * Claviers Visuels | ||
+ | * L' | ||
+ | * Autres Technologies | ||
- | We'll now use the IOReadBandwidthMax parameter to limit the rate at which Pogo can transfer files, l | + | * **LDF515 - Gestion du Réseau** |
+ | * Présentation | ||
+ | * La Commande nmcli | ||
+ | * LAB #1 - Configuration du Réseau | ||
+ | * 1.1 - Connections et Profils | ||
+ | * 1.2 - Résolution des Noms | ||
+ | * 1.3 - Ajouter une Deuxième Adresse IP à un Profil | ||
+ | * 1.4 - La Commande hostname | ||
+ | * 1.5 - La Commande ip | ||
+ | * 1.6 - Activer/ | ||
+ | * 1.7 - Routage Statique | ||
+ | * La commande ip | ||
+ | * Activer/ | ||
+ | * LAB #2 - Diagnostique du Réseau | ||
+ | * 2.1 - ping | ||
+ | * 2.2 - netstat -i | ||
+ | * 2.3 - traceroute | ||
+ | * LAB #3 - Connexions à Distance | ||
+ | * 3.1 - Telnet | ||
+ | * 3.2 - wget | ||
+ | * 3.3 - ftp | ||
+ | * 3.4 - SSH | ||
+ | * Présentation | ||
+ | * SSH-1 | ||
+ | * SSH-2 | ||
+ | * Authentification par mot de passe | ||
+ | * Authentification par clef asymétrique | ||
+ | * Configuration du Serveur | ||
+ | * Configuration du Client | ||
+ | * Tunnels SSH | ||
+ | * 3.5 - SCP | ||
+ | * Présentation | ||
+ | * Utilisation | ||
+ | * 3.6 - Mise en Place des Clefs Asymétriques | ||
+ | * 3.7 - Services réseaux | ||
+ | * inetd | ||
+ | * TCP Wrapper | ||
+ | * LAB #4 - Le Parefeu Netfilter | ||
+ | * 4.1 - Présentation | ||
+ | * 4.2 - La Configuration de Netfilter par firewalld | ||
+ | * La Configuration de Base de firewalld | ||
+ | * La Commande firewall-cmd | ||
+ | * La Configuration Avancée de firewalld | ||
+ | * Le mode Panic de firewalld | ||
- | < | + | * **LDF516 |
- | root@debian11: | + | * Rappel du Programme de la Formation |
- | Filesystem | + | * Certification |
- | udev 7.8G | + | |
- | / | + | |
- | </ | + | |
- | < | + | =====Certification===== |
- | root@debian11: | + | |
- | 8:0 rbps=1000000 wbps=max riops=max wiops=max | + | |
- | </ | + | |
- | 8:0 est majeur mineur | + | Veuillez passer la Certification de la formation. Vérifiez ensuite que vous avez validé tous les modules |
----- | ----- | ||
- | Copyright © 2022 Hugh Norris. | + | Copyright © 2024 Hugh Norris. Document non-contractuel. Le programme peut être modifié sans préavis. |