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:l120 [2022/06/06 06:52] – admin | elearning:workbooks:debian:10:junior:l120 [2024/10/16 12:02] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
~~PDF: | ~~PDF: | ||
- | Version : **2022.01** | + | Version : **2024.02** |
Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
- | ======LDF514 | + | ======LDF511 |
=====Contenu du Module===== | =====Contenu du Module===== | ||
- | |||
- | * **LDF514 - Validation de la Formation** | ||
- | * Contenu du Module | ||
- | * Support de Cours | ||
- | * Rappel du Programme de la Formation | ||
- | * Validation Globale des Acquis | ||
- | * Évaluation de la Formation | ||
- | |||
- | =====Support de Cours===== | ||
- | |||
- | L' | ||
- | |||
- | L' | ||
- | |||
- | * de mesurer le niveau du stagiaire avant la formation et celui atteint en fin de formation grâce aux tests de validations des acquis, | ||
- | * de suivre du travail de chaque participant en termes de temps passé dans chaque module grâce à un reporting détaillé. | ||
- | |||
- | L' | ||
- | |||
- | * de télécharger des supports de cours et des LABS au format PDF le dernier jour de la formation, | ||
- | * de refaire les LABS en mode autonome en cas de missions décalées en relation avec le contenu de la formation initiale, | ||
- | * de rester en contact avec le formateur en cas de problèmes en production liés au contenu du cours, | ||
- | * de consulter les mises à jour du contenu des supports de cours pendant la période de l' | ||
- | * d' | ||
- | |||
- | =====Rappel du Programme de la Formation===== | ||
- | |||
- | * **LDF500 - Présentation de la Formation**. | ||
- | * Prérequis | ||
- | * Matériel | ||
- | * Logiciels | ||
- | * Internet | ||
- | * Programme de la Formation | ||
- | * Évaluation des Compétences | ||
- | * É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 367: | Ligne 16: | ||
* 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 402: | Ligne 59: | ||
* La Commande udevadm | * La Commande udevadm | ||
* Système de fichiers /sys | * Système de fichiers /sys | ||
- | * LAB #4 - Limiter | + | |
- | * 4.1 - ulimit | + | |
- | * 4.2 - Groupes | + | * LAB #5 - cgroups v2 |
- | * CGroups v1 | + | * 5.1 - Présentation |
- | * Préparation | + | * 5.2 - Limitation de la CPU |
- | * Présentation | + | * 5.3 - La Commande systemctl set-property |
- | * Limitation | + | |
- | * La Commande | + | =====Présentation des Fichiers Spéciaux===== |
- | * La Commande | + | |
- | * Le Fichier | + | Dans l' |
- | * La Commande | + | |
- | * CGroups | + | <WRAP center round important > |
+ | **Important** : Les périphériques qui nécessitent à ce que l' | ||
+ | </ | ||
+ | |||
+ | Consultez le contenu du répertoire /dev : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | total 0 | ||
+ | crw-r--r-- | ||
+ | drwxr-xr-x | ||
+ | drwxr-xr-x | ||
+ | crw-rw---- | ||
+ | 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 | ||
+ | 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, | ||
+ | ID 1d6b:0001 Linux Foundation 1.1 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 lsscsi==== | ||
+ | |||
+ | Cette commmande vous renseigne sur les périphériques SCSI et NVMe : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | |||
+ | root@debian11: | ||
+ | [1: | ||
+ | [2: | ||
+ | [2: | ||
+ | [2: | ||
+ | </ | ||
+ | |||
+ | ===Options de la commande=== | ||
+ | |||
+ | Les options de cette commande sont : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | Usage: lsscsi | ||
+ | [--help] [--hosts] [--kname] [--list] [--long] [--long-unit] | ||
+ | [--lunhex] [--no-nvme] [--pdt] [--protection] [--prot-mode] | ||
+ | [--scsi_id] [--size] [--sz-lbs] [--sysfsroot=PATH] [--transport] | ||
+ | [--unit] [--verbose] [--version] [--wwn] | ||
+ | where: | ||
+ | --brief|-b | ||
+ | --classic|-c | ||
+ | --controllers|-C | ||
+ | like SCSI hosts | ||
+ | --device|-d | ||
+ | --generic|-g | ||
+ | --help|-h | ||
+ | --hosts|-H | ||
+ | --kname|-k | ||
+ | --list|-L | ||
+ | attribute=value per line | ||
+ | --long|-l | ||
+ | --long-unit|-U | ||
+ | ' | ||
+ | --lunhex|-x | ||
+ | use twice to get full 16 digit hexadecimal LUN | ||
+ | --no-nvme|-N | ||
+ | --pdt|-D | ||
+ | --protection|-p | ||
+ | --protmode|-P | ||
+ | --scsi_id|-i | ||
+ | --size|-s | ||
+ | twice for power of two (e.g. 2.7 GiB), | ||
+ | thrice for number of blocks)) | ||
+ | --sysfsroot=PATH|-y PATH set sysfs mount point to PATH (def: /sys) | ||
+ | --sz-lbs|-S | ||
+ | adds comma followed by logical block size in bytes | ||
+ | --transport|-t | ||
+ | given, for initiator | ||
+ | --unit|-u | ||
+ | --verbose|-v | ||
+ | --version|-V | ||
+ | --wwn|-w | ||
+ | < | ||
+ | < | ||
+ | <' | ||
+ | |||
+ | List SCSI devices or hosts, followed by NVMe namespaces or controllers. | ||
+ | Many storage devices (e.g. SATA disks and USB attached storage) use SCSI | ||
+ | command sets and hence are also listed by this utility. Hyphenated long | ||
+ | options can also take underscore (and vice versa). | ||
+ | </ | ||
+ | |||
+ | ====1.5 - La Commande lscpu==== | ||
+ | |||
+ | Cett commande vous renseigne sur l' | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | Architecture: | ||
+ | CPU op-mode(s): | ||
+ | Byte Order: | ||
+ | Address sizes: | ||
+ | CPU(s): | ||
+ | On-line CPU(s) list: 0-7 | ||
+ | Thread(s) per core: 1 | ||
+ | Core(s) per socket: | ||
+ | Socket(s): | ||
+ | NUMA node(s): | ||
+ | Vendor ID: | ||
+ | CPU family: | ||
+ | Model: | ||
+ | Model name: Common KVM processor | ||
+ | Stepping: | ||
+ | CPU MHz: 3791.998 | ||
+ | BogoMIPS: | ||
+ | Hypervisor vendor: | ||
+ | Virtualization type: | ||
+ | L1d cache: | ||
+ | L1i cache: | ||
+ | L2 cache: | ||
+ | L3 cache: | ||
+ | NUMA node0 CPU(s): | ||
+ | Vulnerability Itlb multihit: | ||
+ | Vulnerability L1tf: Mitigation; PTE Inversion | ||
+ | Vulnerability Mds: | ||
+ | ; SMT Host state unknown | ||
+ | Vulnerability Meltdown: | ||
+ | Vulnerability Spec store bypass: Vulnerable | ||
+ | Vulnerability Spectre v1: Mitigation; usercopy/ | ||
+ | er sanitization | ||
+ | Vulnerability Spectre v2: Mitigation; Retpolines, STIBP disabled, RSB filling | ||
+ | Vulnerability Srbds: | ||
+ | Vulnerability Tsx async abort: | ||
+ | Flags: | ||
+ | mca cmov pat pse36 clflush mmx fxsr sse sse2 ht sysca | ||
+ | ll nx lm constant_tsc nopl xtopology cpuid tsc_known_ | ||
+ | freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault p | ||
+ | ti | ||
+ | root@debian11: | ||
+ | Architecture: | ||
+ | CPU op-mode(s): | ||
+ | Byte Order: | ||
+ | Address sizes: | ||
+ | CPU(s): | ||
+ | On-line CPU(s) list: 0-7 | ||
+ | Thread(s) per core: 1 | ||
+ | Core(s) per socket: | ||
+ | Socket(s): | ||
+ | NUMA node(s): | ||
+ | Vendor ID: | ||
+ | CPU family: | ||
+ | Model: | ||
+ | Model name: Common KVM processor | ||
+ | Stepping: | ||
+ | CPU MHz: | ||
+ | BogoMIPS: | ||
+ | Hypervisor vendor: | ||
+ | Virtualization type: | ||
+ | L1d cache: | ||
+ | L1i cache: | ||
+ | L2 cache: | ||
+ | L3 cache: | ||
+ | NUMA node0 CPU(s): | ||
+ | Vulnerability Itlb multihit: | ||
+ | Vulnerability L1tf: Mitigation; PTE Inversion | ||
+ | Vulnerability Mds: | ||
+ | Vulnerability Meltdown: | ||
+ | Vulnerability Spec store bypass: Vulnerable | ||
+ | Vulnerability Spectre v1: Mitigation; usercopy/ | ||
+ | Vulnerability Spectre v2: Mitigation; Retpolines, STIBP disabled, RSB filling | ||
+ | Vulnerability Srbds: | ||
+ | Vulnerability Tsx async abort: | ||
+ | Flags: | ||
+ | ic hypervisor lahf_lm cpuid_fault pti | ||
+ | </ | ||
+ | |||
+ | ===Options de la commande=== | ||
+ | |||
+ | Les options de cette commande sont : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | |||
+ | Usage: | ||
+ | lscpu [options] | ||
+ | |||
+ | Display information about the CPU architecture. | ||
+ | |||
+ | Options: | ||
+ | -a, --all print both online and offline CPUs (default for -e) | ||
+ | -b, --online | ||
+ | -B, --bytes | ||
+ | -C, --caches[=< | ||
+ | -c, --offline | ||
+ | -J, --json | ||
+ | -e, --extended[=< | ||
+ | -p, --parse[=< | ||
+ | -s, --sysroot < | ||
+ | -x, --hex print hexadecimal masks rather than lists of CPUs | ||
+ | -y, --physical | ||
+ | | ||
+ | |||
+ | -h, --help | ||
+ | -V, --version | ||
+ | |||
+ | Available output columns for -e or -p: | ||
+ | | ||
+ | CORE logical core number | ||
+ | SOCKET | ||
+ | NODE logical NUMA node number | ||
+ | BOOK logical book number | ||
+ | DRAWER | ||
+ | | ||
+ | POLARIZATION | ||
+ | | ||
+ | CONFIGURED | ||
+ | ONLINE | ||
+ | MAXMHZ | ||
+ | MINMHZ | ||
+ | |||
+ | Available output columns for -C: | ||
+ | ALL-SIZE | ||
+ | | ||
+ | NAME cache name | ||
+ | ONE-SIZE | ||
+ | TYPE cache type | ||
+ | WAYS ways of associativity | ||
+ | ALLOC-POLICY | ||
+ | WRITE-POLICY | ||
+ | PHY-LINE | ||
+ | SETS number of sets in the cache; set lines has the same cache index | ||
+ | | ||
+ | |||
+ | For more details see lscpu(1). | ||
+ | </ | ||
+ | |||
+ | ====1.6 - La Command lshw==== | ||
+ | |||
+ | Cette commande vous renseigne sur le matériel selon la **classe** de celui-ci. Commencez par visualiser les périphériques et leurs classes répectives : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | |||
+ | root@debian11: | ||
+ | Bus info Device | ||
+ | ==================================================== | ||
+ | system | ||
+ | bus Motherboard | ||
+ | memory | ||
+ | cpu@0 | ||
+ | cpu@1 | ||
+ | memory | ||
+ | memory | ||
+ | pci@0000: | ||
+ | pci@0000: | ||
+ | pci@0000: | ||
+ | scsi@1: | ||
+ | pci@0000: | ||
+ | usb@1 | ||
+ | usb@1: | ||
+ | pci@0000: | ||
+ | pci@0000: | ||
+ | pci@0000: | ||
+ | virtio@0 | ||
+ | pci@0000: | ||
+ | virtio@1 | ||
+ | scsi@2: | ||
+ | scsi@2: | ||
+ | scsi@2: | ||
+ | / | ||
+ | scsi@2: | ||
+ | scsi@2: | ||
+ | pci@0000: | ||
+ | virtio@2 | ||
+ | pci@0000: | ||
+ | pci@0000: | ||
+ | input PnP device PNP0303 | ||
+ | input PnP device PNP0f13 | ||
+ | storage | ||
+ | system | ||
+ | </ | ||
+ | |||
+ | Consultez maintenant le matériel de la classe | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | debian11 | ||
+ | description: | ||
+ | product: Standard PC (i440FX + PIIX, 1996) | ||
+ | vendor: QEMU | ||
+ | version: pc-i440fx-7.0 | ||
+ | width: 64 bits | ||
+ | capabilities: | ||
+ | configuration: | ||
+ | *-pnp00: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | Consultez maintenant le matériel des autres classes principales : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | *-firmware | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | date: 04/ | ||
+ | size: 96KiB | ||
+ | *-memory | ||
+ | | ||
+ | | ||
+ | size: 16GiB | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | vendor: QEMU | ||
+ | physical id: 0 | ||
+ | slot: DIMM 0 | ||
+ | size: 16GiB | ||
+ | |||
+ | root@debian11: | ||
+ | | ||
+ | | ||
+ | | ||
+ | bus info: pci@0000: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | root@debian11: | ||
+ | *-ide | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | bus info: pci@0000: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | *-scsi | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | bus info: pci@0000: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | *-pnp00: | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | root@debian11: | ||
+ | *-cdrom | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | bus info: scsi@1: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | *-disk:0 | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | bus info: scsi@2: | ||
+ | | ||
+ | | ||
+ | size: 32GiB (34GB) | ||
+ | | ||
+ | | ||
+ | *-disk:1 | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | bus info: scsi@2: | ||
+ | | ||
+ | | ||
+ | size: 64GiB (68GB) | ||
+ | | ||
+ | | ||
+ | *-disk:2 | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | bus info: scsi@2: | ||
+ | | ||
+ | | ||
+ | size: 4GiB (4294MB) | ||
+ | | ||
+ | | ||
+ | |||
+ | root@debian11: | ||
+ | *-volume: | ||
+ | | ||
+ | | ||
+ | | ||
+ | bus info: scsi@2: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | size: 31GiB | ||
+ | | ||
+ | | ||
+ | | ||
+ | *-volume: | ||
+ | | ||
+ | | ||
+ | bus info: scsi@2: | ||
+ | | ||
+ | size: 975MiB | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | physical id: 5 | ||
+ | logical name: /dev/sda5 | ||
+ | version: 1 | ||
+ | serial: 1f9439f5-4b19-49b1-b292-60c2c674cee9 | ||
+ | size: 975MiB | ||
+ | capacity: 975MiB | ||
+ | capabilities: | ||
+ | configuration: | ||
+ | |||
+ | root@debian11: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | bus info: pci@0000: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | description: | ||
+ | physical id: 0 | ||
+ | bus info: virtio@2 | ||
+ | logical name: ens18 | ||
+ | serial: 56: | ||
+ | capabilities: | ||
+ | configuration: | ||
+ | </ | ||
+ | |||
+ | ===Options | ||
+ | |||
+ | Les options de cette commande sont : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | Hardware Lister (lshw) - | ||
+ | usage: lshw [-format] [-options ...] | ||
+ | lshw -version | ||
+ | |||
+ | -version | ||
+ | |||
+ | format can be | ||
+ | -html | ||
+ | -xml output hardware tree as XML | ||
+ | -json | ||
+ | -short | ||
+ | -businfo | ||
+ | |||
+ | options can be | ||
+ | -class CLASS only show a certain class of hardware | ||
+ | -C CLASS same as ' | ||
+ | -c CLASS same as ' | ||
+ | -disable TEST | ||
+ | -enable TEST enable a test (like pci, isapnp, cpuid, etc. ) | ||
+ | -quiet | ||
+ | -sanitize | ||
+ | -numeric | ||
+ | -notime | ||
+ | </ | ||
+ | |||
+ | ====1.7 - 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 | ||
+ | </ | ||
+ | |||
+ | ====1.8 - La Commande | ||
+ | |||
+ | **smartctl** contrôle le système SMART (Self-Monitoring, | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | |||
+ | root@debian11: | ||
+ | smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.10.0-13-amd64] (local build) | ||
+ | Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org | ||
+ | |||
+ | === START OF ENABLE/ | ||
+ | unable to fetch IEC (SMART) mode page [unsupported field in scsi command] | ||
+ | Enable autosave (clear GLTSD bit) failed | ||
+ | |||
+ | root@debian11: | ||
+ | smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.10.0-13-amd64] (local build) | ||
+ | Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org | ||
+ | |||
+ | === START OF INFORMATION SECTION === | ||
+ | Vendor: | ||
+ | Product: | ||
+ | Revision: | ||
+ | Compliance: | ||
+ | User Capacity: | ||
+ | Logical block size: 512 bytes | ||
+ | LU is thin provisioned, | ||
+ | Device type: disk | ||
+ | Local Time is: Tue Nov 15 09:56:55 2022 CET | ||
+ | SMART support is: | ||
+ | |||
+ | === START OF READ SMART DATA SECTION === | ||
+ | Current Drive Temperature: | ||
+ | Drive Trip Temperature: | ||
+ | |||
+ | Error Counter logging not supported | ||
+ | |||
+ | Device does not support Self Test logging | ||
+ | </ | ||
+ | |||
+ | ===Options de la commande=== | ||
+ | |||
+ | Les options de cette commande sont : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | smartctl 7.2 2020-12-30 r5155 [x86_64-linux-5.10.0-13-amd64] (local build) | ||
+ | Copyright (C) 2002-20, Bruce Allen, Christian Franke, www.smartmontools.org | ||
+ | |||
+ | Usage: smartctl [options] device | ||
+ | |||
+ | ============================================ SHOW INFORMATION OPTIONS ===== | ||
+ | |||
+ | -h, --help, --usage | ||
+ | | ||
+ | |||
+ | -V, --version, --copyright, | ||
+ | Print license, copyright, and version information and exit | ||
+ | |||
+ | -i, --info | ||
+ | Show identity information for device | ||
+ | |||
+ | --identify[=[w][nvb]] | ||
+ | Show words and bits from IDENTIFY DEVICE data (ATA) | ||
+ | |||
+ | -g NAME, --get=NAME | ||
+ | Get device setting: all, aam, apm, dsn, lookahead, security, | ||
+ | wcache, rcache, wcreorder, wcache-sct | ||
+ | |||
+ | -a, --all | ||
+ | Show all SMART information for device | ||
+ | |||
+ | -x, --xall | ||
+ | Show all information for device | ||
+ | |||
+ | --scan | ||
+ | Scan for devices | ||
+ | |||
+ | --scan-open | ||
+ | Scan for devices and try to open each device | ||
+ | |||
+ | ================================== SMARTCTL RUN-TIME BEHAVIOR OPTIONS ===== | ||
+ | |||
+ | -j, --json[=cgiosuvy] | ||
+ | Print output in JSON or YAML format | ||
+ | |||
+ | -q TYPE, --quietmode=TYPE | ||
+ | Set smartctl quiet mode to one of: errorsonly, silent, noserial | ||
+ | |||
+ | -d TYPE, --device=TYPE | ||
+ | | ||
+ | ata, scsi[+TYPE], | ||
+ | |||
+ | -T TYPE, --tolerance=TYPE | ||
+ | | ||
+ | |||
+ | -b TYPE, --badsum=TYPE | ||
+ | Set action on bad checksum to one of: warn, exit, ignore | ||
+ | |||
+ | -r TYPE, --report=TYPE | ||
+ | | ||
+ | |||
+ | -n MODE[, | ||
+ | No check if: never, sleep, standby, idle (see man page) | ||
+ | |||
+ | ============================== DEVICE FEATURE ENABLE/ | ||
+ | |||
+ | -s VALUE, --smart=VALUE | ||
+ | Enable/ | ||
+ | |||
+ | -o VALUE, --offlineauto=VALUE | ||
+ | Enable/ | ||
+ | |||
+ | -S VALUE, --saveauto=VALUE | ||
+ | Enable/ | ||
+ | |||
+ | -s NAME[, | ||
+ | Enable/ | ||
+ | dsn, | ||
+ | standby, | ||
+ | wcreorder, | ||
+ | |||
+ | ======================================= READ AND DISPLAY DATA OPTIONS ===== | ||
+ | |||
+ | -H, --health | ||
+ | Show device SMART health status | ||
+ | |||
+ | -c, --capabilities | ||
+ | Show device SMART capabilities | ||
+ | |||
+ | -A, --attributes | ||
+ | Show device SMART vendor-specific Attributes and values | ||
+ | |||
+ | -f FORMAT, --format=FORMAT | ||
+ | Set output format for attributes: old, brief, hex[, | ||
+ | |||
+ | -l TYPE, --log=TYPE | ||
+ | Show device log. TYPE: error, selftest, selective, directory[, | ||
+ | xerror[, | ||
+ | sasphy[, | ||
+ | scttempint, | ||
+ | gplog, | ||
+ | |||
+ | -v N,OPTION , --vendorattribute=N, | ||
+ | Set display OPTION for vendor Attribute N (see man page) | ||
+ | |||
+ | -F TYPE, --firmwarebug=TYPE | ||
+ | Use firmware bug workaround: | ||
+ | none, nologdir, samsung, samsung2, samsung3, xerrorlba, swapid | ||
+ | |||
+ | -P TYPE, --presets=TYPE | ||
+ | Drive-specific presets: use, ignore, show, showall | ||
+ | |||
+ | -B [+]FILE, --drivedb=[+]FILE | ||
+ | Read and replace [add] drive database from FILE | ||
+ | [default is +/ | ||
+ | and then / | ||
+ | |||
+ | ============================================ DEVICE SELF-TEST OPTIONS ===== | ||
+ | |||
+ | -t TEST, --test=TEST | ||
+ | Run test. TEST: offline, short, long, conveyance, force, vendor,N, | ||
+ | select,M-N, pending,N, afterselect, | ||
+ | |||
+ | -C, --captive | ||
+ | Do test in captive mode (along with -t) | ||
+ | |||
+ | -X, --abort | ||
+ | Abort any non-captive test on device | ||
+ | |||
+ | =================================================== SMARTCTL EXAMPLES ===== | ||
+ | |||
+ | smartctl --all / | ||
+ | |||
+ | smartctl --smart=on --offlineauto=on --saveauto=on /dev/sda | ||
+ | (Enables SMART on first disk) | ||
+ | |||
+ | smartctl --test=long / | ||
+ | |||
+ | smartctl --attributes --log=selftest --quietmode=errorsonly /dev/sda | ||
+ | (Prints Self-Test & Attribute errors) | ||
+ | smartctl --all --device=3ware, | ||
+ | smartctl --all --device=3ware, | ||
+ | smartctl --all --device=3ware, | ||
+ | smartctl --all --device=3ware, | ||
+ | (Prints all SMART info for 3rd ATA disk on 3ware RAID controller) | ||
+ | smartctl --all --device=hpt, | ||
+ | (Prints all SMART info for the SATA disk attached to the 3rd PMPort | ||
+ | of the 1st channel on the 1st HighPoint RAID controller) | ||
+ | smartctl --all --device=areca, | ||
+ | (Prints all SMART info for 3rd ATA disk of the 1st enclosure | ||
+ | on Areca RAID controller) | ||
+ | </ | ||
+ | |||
+ | ====1.9 - Les Commandes accton et dump-acct==== | ||
+ | |||
+ | Cette commande permet d' | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | |||
+ | root@debian11: | ||
+ | Turning on process accounting, file set to the default '/ | ||
+ | </ | ||
+ | |||
+ | Par contre le fichier | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | m | ||
+ | p o | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | ... | ||
+ | Usc$mandb | ||
+ | o | ||
+ | o | ||
+ | o | ||
+ | Usc$mandb | ||
+ | o | ||
+ | o | ||
+ | o | ||
+ | Usc$mandb | ||
+ | |||
+ | o | ||
+ | o | ||
+ | Usc$mandb | ||
+ | o | ||
+ | | ||
+ | | ||
+ | dpkg Uscq$dpkg | ||
+ | </ | ||
+ | |||
+ | La commande **dump-acct** permet de voir son contenu mais pas de l' | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | accton | ||
+ | systemd-tty-ask |v3| | ||
+ | systemctl | ||
+ | acct.postinst | ||
+ | mandb | ||
+ | mandb | ||
+ | mandb | ||
+ | mandb | ||
+ | mandb | ||
+ | mandb | ||
+ | mandb | ||
+ | mandb | ||
+ | mandb | ||
+ | mandb | ||
+ | mandb | ||
+ | mandb | ||
+ | mandb | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | ===Options de la commande=== | ||
+ | |||
+ | Les options de cette commande sont : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | Usage: dump-acct [-hrR] [-n < | ||
+ | [--num < | ||
+ | [--format < | ||
+ | [--ahz < | ||
+ | |||
+ | The system' | ||
+ | </ | ||
+ | |||
+ | ====1.10 - La Commande | ||
+ | |||
+ | Cette commande vous renseigne sur l' | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | kworker/ | ||
+ | dump-acct | ||
+ | kworker/ | ||
+ | kworker/ | ||
+ | dump-acct | ||
+ | cat root | ||
+ | systemctl | ||
+ | less | ||
+ | systemctl | ||
+ | less | ||
+ | kworker/ | ||
+ | accton | ||
+ | accton | ||
+ | apt S | ||
+ | apt | ||
+ | sh | ||
+ | echo | ||
+ | gdbus S X root | ||
+ | test | ||
+ | test | ||
+ | dpkg | ||
+ | dpkg | ||
+ | dpkg | ||
+ | dpkg | ||
+ | sh | ||
+ | man-db.postinst | ||
+ | mandb S | ||
+ | mandb | ||
+ | mandb | ||
+ | mandb | ||
+ | mandb | ||
+ | mandb | ||
+ | ... | ||
+ | acct.postinst | ||
+ | systemctl | ||
+ | systemd-tty-ask | ||
+ | accton | ||
+ | |||
+ | root@debian11: | ||
+ | systemctl | ||
+ | systemctl | ||
+ | systemctl | ||
+ | </ | ||
+ | |||
+ | ===Options de la commande=== | ||
+ | |||
+ | Les options de cette commande sont : | ||
+ | |||
+ | < | ||
+ | systemctl | ||
+ | root@debian11: | ||
+ | Usage: lastcomm [-hpV] [-f file] [command] ... [user] ... [terminal] ... | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | The system' | ||
+ | </ | ||
+ | |||
+ | ====1.11 - La Commande sa==== | ||
+ | |||
+ | Cette commande vous renseigne sur les statistiques sur les processus lancés et leurs ressources systèmes: | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | root 0.00 cpu 576k mem 0 io accton | ||
+ | root 0.00 cpu 3278k mem 0 io systemd-tty-ask | ||
+ | root 0.00 cpu 2520k mem 0 io systemctl | ||
+ | root 0.00 cpu 605k mem 0 io acct.postinst | ||
+ | root 0.00 cpu 605k mem 0 io man-db.postinst | ||
+ | root 0.00 cpu 605k mem 0 io sh | ||
+ | root 0.01 cpu 3290k mem 0 io dpkg | ||
+ | root 0.00 cpu 2274k mem 0 io dpkg | ||
+ | root 0.00 cpu 2274k mem 0 io dpkg | ||
+ | root 0.00 cpu 2274k mem 0 io dpkg | ||
+ | root 0.00 cpu 1329k mem 0 io test | ||
+ | root 0.00 cpu 1329k mem 0 io test | ||
+ | root 0.00 cpu 39712k mem 0 io gdbus | ||
+ | root 0.00 cpu 1325k mem 0 io echo | ||
+ | root 0.00 cpu 605k mem 0 io sh | ||
+ | root 0.00 cpu 16036k mem 0 io apt * | ||
+ | root 0.46 cpu 5006k mem 0 io apt | ||
+ | root 0.00 cpu 0k mem 0 io accton | ||
+ | root 0.00 cpu 576k mem 0 io accton | ||
+ | root 0.00 cpu 0k mem 0 io kworker/ | ||
+ | root 0.00 cpu 1412k mem 0 io less | ||
+ | root 0.00 cpu 2520k mem 0 io systemctl | ||
+ | root 0.00 cpu 1412k mem 0 io less | ||
+ | root 0.00 cpu 2520k mem 0 io systemctl | ||
+ | root 0.00 cpu 1326k mem 0 io cat | ||
+ | root 0.00 cpu 907k mem 0 io dump-acct | ||
+ | root 0.00 cpu 0k mem 0 io kworker/ | ||
+ | root 0.06 cpu 0k mem 0 io kworker/ | ||
+ | root 0.00 cpu 1006k mem 0 io dump-acct | ||
+ | root 0.00 cpu 0k mem 0 io kworker/ | ||
+ | root 0.00 cpu 1028k mem 0 io lastcomm | ||
+ | root 0.00 cpu 1027k mem 0 io lastcomm | ||
+ | root 0.00 cpu 1027k mem 0 io lastcomm | ||
+ | root 0.00 cpu 908k mem 0 io lastcomm | ||
+ | root 0.00 cpu 0k mem 0 io kworker/ | ||
+ | </ | ||
+ | |||
+ | ===Options de la commande=== | ||
+ | |||
+ | Les options de cette commande sont : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | |||
+ | Usage: sa [ options ] [ file ] | ||
+ | |||
+ | options: [-abcdfiljkmnprstuDKP] [-v < | ||
+ | [--other-acct-file < | ||
+ | [--print-seconds] [--dont-read-summary-files] [--debug] | ||
+ | | ||
+ | | ||
+ | [--list-all-names] [--not-interactive] [--threshold < | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | The system' | ||
+ | |||
+ | raw process accounting data: / | ||
+ | summary by command name: / | ||
+ | summary by username: / | ||
+ | </ | ||
+ | |||
+ | ====1.12 - La Commande ac==== | ||
+ | |||
+ | Cette commande vous renseigne sur les statistiques des temps de connexion des utilisateurs : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | trainee | ||
+ | total 182.84 | ||
+ | |||
+ | root@debian11: | ||
+ | Apr 25 total | ||
+ | May 1 total 0.02 | ||
+ | Jun 18 total 0.09 | ||
+ | Jul 4 total | ||
+ | Jul 10 total 0.03 | ||
+ | Oct 9 total 4.94 | ||
+ | Oct 10 total | ||
+ | Oct 11 total | ||
+ | Oct 13 total | ||
+ | Nov 14 total 2.29 | ||
+ | Today | ||
+ | </ | ||
+ | |||
+ | ===Options de la commande=== | ||
+ | |||
+ | Les options de cette commande sont : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | |||
+ | Usage: ac [OPTION] ... | ||
+ | |||
+ | OPTIONS: | ||
+ | -d, --daily-totals | ||
+ | -p, --individual-totals | ||
+ | -f, --file < | ||
+ | --complain | ||
+ | --reboots | ||
+ | --supplants | ||
+ | --timewarps | ||
+ | --compatibility | ||
+ | -a, --all-days | ||
+ | --tw-leniency < | ||
+ | --tw-suspicious < | ||
+ | --print-year | ||
+ | --print-zeros | ||
+ | --debug | ||
+ | -V, --version | ||
+ | -h, --help | ||
+ | |||
+ | The system' | ||
+ | </ | ||
+ | |||
+ | =====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 de périphérique demande au processeur de fournir un service en utilisant un IRQ. Quand la demande est faite, le processeur interrompe ses activités et passe le contrôle au pilote identifié par l'IRQ. Techniquement l' | ||
+ | </ | ||
+ | |||
+ | ==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: | ||
+ | 0170-0177 : ata_piix | ||
+ | 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 de l' | ||
+ | |||
+ | < | ||
+ | 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 **%%DoS%%** utilisant la commande **ping**, saisissez la commande suivante : | ||
+ | |||
+ | # 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 **/etc/sysctl.conf** au démarrage de la machine. | ||
+ | |||
+ | 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 | ||
+ | --deprecated | ||
+ | -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 | ||
+ | |||
+ | 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 | ||
+ | </ | ||
+ | |||
+ | Dans le cas de cet exemple, nous pouvons constater que l’affichage montre : | ||
+ | |||
+ | | ||
+ | * 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 **load average** ou //charge moyenne// indiquent le nombre moyen de processus en cours de traitement ou en attente pour la période concernée. | ||
+ | |||
+ | 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' | ||
+ | |||
+ | * **%user** - Pourcentage de temps passé en mode utilisateur (exécutant des applications, | ||
+ | * **%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 | ||
+ | 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={ 0 | 1 | 2 } ] [ --human ] [ --pretty ] [ -o JSON ] | ||
+ | [ [ -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 d' | ||
+ | |||
+ | < | ||
+ | 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 **sar** (**S**ystem **A**ctivity **R**eporter) permet de surveiller toutes les ressources du système selon l' | ||
+ | |||
+ | ^ 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 : | ||
+ | |||
+ | * Au démarrage **tmpfs** est monté sur /dev, | ||
+ | * Udev copie les éventuels nœuds statiques de **/ | ||
+ | * 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, | ||
+ | | 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) | ||
+ | # | ||
+ | #< | ||
+ | # | ||
+ | |||
+ | #* | ||
+ | #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 du nombre de fichiers ouverts simultanément par trainee est de 1 024. Par contre, trainee a la possibilité d' | ||
+ | |||
+ | < | ||
+ | $ 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: | ||
+ | -S use the `soft' resource limit | ||
+ | -H use the `hard' resource limit | ||
+ | -a all current limits are reported | ||
+ | -b the socket buffer size | ||
+ | -c the maximum size of core files created | ||
+ | -d the maximum size of a process' | ||
+ | -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 | ||
+ | |||
+ | ===5.1 - 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 tentative 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: | ||
+ | </ | ||
+ | |||
+ | ===5.2 - Limitation de la CPU=== | ||
+ | |||
+ | Il existe deux façons de limiter les ressources de la CPU : | ||
+ | |||
+ | * **CPU bandwidth**, | ||
+ | * un système de limitation basé sur un pourcentage de CPU pour un ou plusieurs processus, | ||
+ | * **CPU weight**, | ||
+ | * un système de limitation basé sur la prioritisassion d'un ou de plusieurs processus par rapports aux autres processus. | ||
+ | |||
+ | Dans l' | ||
+ | |||
+ | Commencez par créer 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 la commande **ps** pour voir le pourcentage de la CPU utilisé par ce service : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | PID COMMAND | ||
+ | 997 sha1sum | ||
+ | </ | ||
+ | |||
+ | Créez maintenant un autre service dénommé **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 la commande **ps** pour voir le pourcentage de la CPU utilisé par ce service : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | PID COMMAND | ||
+ | 1020 md5sum | ||
+ | </ | ||
+ | |||
+ | Vérifiez maintenant la présence des contrôleurs **cpuset** et **cpu** dans l' | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | cpuset cpu io memory hugetlb pids rdma | ||
+ | </ | ||
+ | |||
+ | Activez maintenant les deux contrôleurs **cpuset** et **cpu** : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | memory pids | ||
+ | |||
+ | root@debian11: | ||
+ | |||
+ | root@debian11: | ||
+ | |||
+ | root@debian11: | ||
+ | cpuset cpu memory pids | ||
+ | </ | ||
+ | |||
+ | Créez le cgroup **enfant** appelé **FooBar** : | ||
+ | |||
+ | < | ||
+ | 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 | ||
+ | </ | ||
+ | |||
+ | Activez les contrôleurs **cpuset** et **cpu** pour le cgroup **FooBar** : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | |||
+ | root@debian11: | ||
+ | |||
+ | root@debian11: | ||
+ | cpuset cpu memory pids | ||
+ | cpuset cpu | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important > | ||
+ | **Important** - Notez qu'il n'est pas possible d' | ||
+ | </ | ||
+ | |||
+ | Créez maintenant le répertoire **/ | ||
+ | |||
+ | < | ||
+ | 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 | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important > | ||
+ | **Important** - Le répertoire **/ | ||
+ | </ | ||
+ | |||
+ | De façon à ce que les deux processus issus des services **foo** et **bar** se font concurrence sur la même CPU, injectez la valeur de **1** dans le fichier **/ | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | |||
+ | root@debian11: | ||
+ | 1 | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important > | ||
+ | **Important** - Notez que dans les faits, le contrôleur **cpu** n'est activé **que** dans le cas où le cgroup contient au moins 2 processus qui se font concurrence sur la même CPU. | ||
+ | </ | ||
+ | |||
+ | Mettez en place une limitation des ressources de la CPU avec la commande suivante : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important > | ||
+ | **Important** - Dans la commande ci-dessus, le premier nombre est un quota en microsecondes pendant lequel les processus dans le cgroup peuvent s' | ||
+ | </ | ||
+ | |||
+ | Ajoutez maintenant les processus des services **foo** et **bar** au cgroup **FooBar** : | ||
+ | |||
+ | < | ||
+ | echo " | ||
+ | |||
+ | echo " | ||
+ | </ | ||
+ | |||
+ | Vérifiez la prise en compte par le système de la commande précédente : | ||
+ | |||
+ | < | ||
+ | root@debian11: | ||
+ | 0::/ | ||
+ | 0::/ | ||
+ | </ | ||
+ | |||
+ | Dernièrement, | ||
+ | |||
+ | < | ||
+ | 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 | ||
+ | </ | ||
+ | |||
+ | ===5.3 - La Commande systemctl set-property=== | ||
+ | |||
+ | Comme déjà vu, systemd organise les processus dans des **slices**, par exemple les utilisateurs sont regroupés dans **/ | ||
+ | |||
+ | < | ||
+ | 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 | ||
+ | </ | ||
+ | |||
+ | et les processus d'un utilisateur spécifique dans un slice dénommé **user-UID.slice** : | ||
- | * **LDF512 | + | < |
- | | + | 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-- |
- | | + | -rw-r--r-- 1 root root 0 Jul 6 16:14 cgroup.max.depth |
- | | + | -rw-r--r-- |
- | | + | -rw-r--r-- |
- | | + | -r--r--r-- 1 root root 0 Jul 6 16:14 cgroup.stat |
- | | + | -rw-r--r-- |
- | * 3.1 - La Commande quotacheck | + | -rw-r--r-- 1 root root 0 Jul 6 16:14 cgroup.threads |
- | * 3.2 - La Commande edquota | + | -rw-r--r-- |
- | * 3.3 - La Commande quotaon | + | -rw-r--r-- 1 root root 0 Jul 6 16:14 cpu.pressure |
- | * 3.4 - La Commande repquota | + | -r--r--r-- |
- | * 3.5 - La Commande quota | + | -rw-r--r-- 1 root root 0 Jul 6 16:14 io.pressure |
- | * 3.6 - La Commande warnquota | + | -r--r--r-- |
+ | -r--r--r-- 1 root root 0 Jul 6 16:14 memory.events | ||
+ | -r--r--r-- | ||
+ | -rw-r--r-- 1 root root 0 Jul | ||
+ | -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-- | ||
+ | -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 | ||
+ | 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 | ||
+ | </ | ||
- | * **LDF513 - Gestion du Réseau** | + | De ce fait, il est possible d' |
- | * Présentation | + | |
- | * La Commande nmcli | + | |
- | * LAB #1 - Configuration du Réseau | + | |
- | * 1.1 - Connections et Profils | + | |
- | * 1.2 - Résolution | + | |
- | * 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 | + | |
- | * 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 | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | * **LDF514 - Validation de la Formation** | + | ==CPU== |
- | * Support de Cours | + | |
- | * Rappel du Programme de la Formation | + | |
- | * Validation Globale des Acquis | + | |
- | * Évaluation de la Formation | + | |
- | =====Validation des Acquis===== | + | < |
+ | root@debian11: | ||
+ | root@debian11: | ||
+ | 40000 100000 | ||
+ | </ | ||
- | Veuillez passer la Validation Globale des Acquis de la formation. Vérifiez ensuite que vous avez validé tous les modules du cours. | + | ==Mémoire== |
- | =====Évaluation de la Formation===== | + | < |
+ | root@debian11: | ||
+ | root@debian11: | ||
+ | 1073741824 | ||
+ | </ | ||
- | Afin de valider votre formation, veuillez compléter | + | <WRAP center round important > |
+ | **Important** - Notez que l' | ||
+ | </ | ||
----- | ----- | ||
- | Copyright © 2022 Hugh Norris. Document non-contractuel. Le programme peut être modifié sans préavis. | + | Copyright © 2024 Hugh Norris. |