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:centos:8:junior:l121 [2024/10/01 07:37] – created admin | elearning:workbooks:centos:8:junior:l121 [2024/10/01 08:01] (Version actuelle) – created admin | ||
---|---|---|---|
Ligne 5: | Ligne 5: | ||
Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
- | ======LCF601 - Gestion des Paramètres | + | ======LCF601 - Gestion des Disques, des Systèmes de Fichiers et du Swap====== |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# sed -i ' | + | |
- | [root@centos8 ~]# sed -i ' | + | |
- | </ | + | |
=====Contenu du Module===== | =====Contenu du Module===== | ||
- | * **LCF601 - Gestion des Paramètres | + | * **LCF601 - Gestion des Disques, des Systèmes de Fichiers |
* Contenu du Module | * Contenu du Module | ||
- | * Présentation des Fichiers Spéciaux | + | * Périphériques de stockage |
- | * LAB #1 - Découvrir le Matériel | + | * Partitions |
- | * 1.1 - La Commande lspci | + | * Partitionnement |
- | * 1.2 - La Commande lsusb | + | * LAB #1 - Partitionnement de votre Disque avec fdisk |
- | * 1.3 - La Commande lsblk | + | * LAB #2 - Modifier les Drapeaux des Partitions avec fdisk |
- | * 1.4 - La Commande lsscsi | + | * Logical Volume Manager (LVM) |
- | * 1.5 - La Commande lscpu | + | * LAB #3 - Volumes Logiques Linéaires |
- | * 1.6 - La Commande lshw | + | * Physical Volume (PV) |
- | * 1.7 - La Commande dmidecode | + | * Volume Group (VG) et Physical Extent (PE) |
- | * 1.8 - La Commande smartctl | + | * Logical Volumes (LV) |
- | * 1.9 - Les Commandes accton et dump-acct | + | * LAB #4 - Étendre un Volume Logique à Chaud |
- | * 1.10 - La Commande lastcomm | + | * LAB #5 - Snapshots |
- | * 1.11 - La Commande sa | + | * LAB #6 - Suppression des Volumes |
- | * 1.12 - La Commande ac | + | * LAB #7 - Volumes Logiques en Miroir |
- | * LAB #2 - La Commande sysctl | + | * LAB #8 - Modifier les Attributs LVM |
- | * 2.1 - Répertoire /proc | + | * LAB #9 - Volumes Logiques en Bandes |
- | * Fichiers | + | * LAB #10 - Gérer les Métadonnées |
- | * Processeur | + | * Systèmes de Fichiers Journalisés |
- | * Interruptions système | + | * Présentation |
- | * Canaux DMA | + | * Ext3 |
- | * Plages d' | + | * Gestion d' |
- | * Périphériques | + | * LAB #11 - Convertir un Système de Fichiers Ext3 en Ext2 |
- | * Modules | + | * LAB #12 - Convertir un Système de Fichiers Ext2 en Ext3 |
- | * Statistiques | + | * LAB #13 - Placer le Journal sur un autre Partition |
- | * Partitions | + | * LAB #14 - Modifier la Fréquence de Vérification du Système de Fichiers |
- | * Espaces | + | * Ext4 |
- | * Statistiques d' | + | * LAB #15 - Créer un Système de Fichiers Ext4 |
- | * Statistiques d' | + | * LAB #16 - Ajouter une Étiquette au Système de Fichiers Ext4 |
- | * Version du noyau | + | * LAB #17 - Convertir un Système de Fichiers Ext3 en Ext4 |
- | * Répertoires | + | * XFS |
- | * ide/scsi | + | * LAB #18 - Créer un Système |
- | * acpi | + | * LAB #19 - Ajouter une Étiquette au Système |
- | * bus | + | * Autres Systèmes |
- | * net | + | * ReiserFS |
- | * sys | + | * JFS |
- | * 2.2 - Utilisation | + | * Btrfs |
- | * LAB #3 - Interprétation des informations dans /proc | + | * Comparaison des Commandes par Système |
- | * 3.1 - free | + | * LAB #20 - Créer un Système de Fichiers ISO |
- | * 3.2 - uptime ou w | + | * La Commande mkisofs |
- | * 3.3 - iostat | + | * Systèmes de Fichiers Chiffrés |
- | * 3.4 - hdparm | + | * LAB #21 - Créer un Système de Fichiers Chiffré avec LUKS |
- | * 3.5 - vmstat | + | * Présentation |
- | * 3.6 - mpstat | + | * Mise en Place |
- | * 3.7 - sar | + | * Ajouter une deuxième Passphrase |
- | * Modules usb | + | * Supprimer une Passphrase |
- | * udev | + | * Raid Logiciel |
- | | + | * LAB #22 - Mise en Place du RAID 5 Logiciel |
- | * Système de fichiers /sys | + | * 22.1 - Préparer le disque |
- | | + | * 22.2 - Créer une Unité RAID |
- | * 4.1 - ulimit | + | * 22.3 - Remplacer une Unité Défaillante |
- | * 4.2 - Groupes de Contrôle | + | * Le Swap |
- | * La Limitation | + | * Taille du swap |
- | * La Commande | + | * Partitions |
- | * La Commande | + | * La Commande |
- | * Le Fichier | + | * La Commande |
- | * La Commande cgconfigparser | + | * LAB #23 - Créer un Fichier |
- | =====Présentation des Fichiers Spéciaux===== | + | =====Périphériques de stockage===== |
- | Dans l' | + | Les unités de stockage sous Linux sont référencées par un des fichiers se trouvant dans le répertoire |
+ | |||
+ | * hd[a-d] | ||
+ | * Les disques IDE et les lecteurs ATAPI | ||
+ | * sd[a-z] | ||
+ | * Les disques SCSI et SATA | ||
+ | * mmcblk[0-7] | ||
+ | * Les cartes SD/MMC | ||
+ | * scd[0-7] | ||
+ | * Les CDRoms SCSI | ||
+ | * xd[a-d] | ||
+ | * Les premiers disques sur IBM XT | ||
+ | * fd[0-7] | ||
+ | * Les lecteurs de disquettes | ||
+ | * st[0-7] | ||
+ | * Les lecteurs de bandes SCSI/ | ||
+ | * nst[0-7] | ||
+ | * Les lecteurs de bandes SCSI/SATA qui ne supportent **pas** le rembobinage | ||
+ | * ht[0-7] | ||
+ | * Les lecteurs de bandes PATA qui **supportent** le rembobinage | ||
+ | * nht[0-7] | ||
+ | * Les lecteurs de bandes PATA qui ne supportent **pas** le rembobinage | ||
+ | * rmt8, rmt16, tape-d, tape-reset | ||
+ | * Les lecteurs QIC-80 | ||
+ | * ram[0-15] | ||
+ | * Les disques virtuels. Ils sont supprimés | ||
+ | * Périphériques **loop** | ||
+ | * Il existe 16 unités loop qui sont utilisés pour accèder en mode bloc à un système de fichiers contenu dans un fichier, par exemple, une image **iso** | ||
+ | * md[x] | ||
+ | * Un volume **RAID** logiciel | ||
+ | * vg[x] | ||
+ | * Un groupe de volumes | ||
+ | * lv[x] | ||
+ | * Un volume logique | ||
+ | |||
+ | =====Partitions===== | ||
+ | |||
+ | Un PC comportent en règle générale 2 **contrôleurs** de disque, chacun capable de gérer 2 disques, un **maître** et un **esclave**. Les disques attachés à ces contrôleurs comportent des noms différents pour pouvoir | ||
+ | |||
+ | * Contrôleur 0 | ||
+ | * Maître | ||
+ | * **hda** - disque IDE | ||
+ | * **sda** - disque SATA ou SCSI | ||
+ | * Esclave | ||
+ | * **hdb** - disque IDE | ||
+ | * **sdb** - disque SATA ou SCSI | ||
+ | * Contrôleur 1 | ||
+ | * Maître | ||
+ | * **hdc** - disque IDE | ||
+ | * **sdc** - disque SATA ou SCSI | ||
+ | * Esclave | ||
+ | * **hdd** - disque IDE | ||
+ | * **sdd** - disque SATA ou SCSI | ||
+ | |||
+ | Un disque peut comporter trois types de partitions : | ||
+ | |||
+ | * **Partitions primaires**, | ||
+ | * Maximum de **4**. En effet, la Table des Partitions est grande de 64 octets. Il faut 16 octets pour codés une partition. | ||
+ | * **Partitions Etendues**, | ||
+ | * Généralement une seule partition étendue par disque. Elle contient des **Lecteurs Logiques** aussi appelés des partitions, | ||
+ | * **Lecteurs Logiqiques**. | ||
+ | |||
+ | Les 4 partitions primaires | ||
+ | |||
+ | * **hda1**, **hda2**, **hda3** et **hda4** pour le premier disque **IDE** sur le premier contrôleur de disque, | ||
+ | * **sda1**, **sda2**, **sda3** et **sda4** pour le premier disque **SCSI** ou **SATA** sur le premier contrôleur de disque. | ||
+ | |||
+ | {{free: | ||
+ | |||
+ | Une partition étendue prend la place d'une partition primaire et les lecteurs logiques qui s'y trouvent commencent à partir de **hda5** ou de **sda5**. | ||
+ | |||
+ | Pour clarifier ceci, considérons | ||
+ | |||
+ | Les lecteurs logiques commençant à **sda5**, nous obtenons la liste de partitions suivante : sda1, sda2, sda5, sda6, sda7. Notez que la sda3 ne peut pas être utilisée en tant que partition car elle est cachée par les lecteurs sda5, sda6 et sda7. | ||
+ | |||
+ | {{free: | ||
+ | |||
+ | Le nombre de partitions sur un disque est limité : | ||
+ | |||
+ | * **IDE**, | ||
+ | * Jusqu'à **63**, | ||
+ | * **SCSI**, | ||
+ | * Jusqu' | ||
+ | * **Disques utilisant l'API libata**, | ||
+ | * Jusqu' | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | **Important** : Les périphériques qui nécessitent à ce que l' | + | **Important** : Ces limites |
</ | </ | ||
- | Consultez le contenu du répertoire | + | =====Partitionnement===== |
+ | |||
+ | ====LAB #1 - Partitionnement de votre Disque sous RHEL/CentOS 8 avec fdisk==== | ||
+ | |||
+ | Pour procéder au partitionnement de votre disque ou de vos disques, RHEL/CentOS 8 possède l' | ||
+ | |||
+ | Lancez fdisk en fournissant en argument le fichier de référence de votre premier disque dur, par exemple | ||
< | < | ||
- | [root@centos8 ~]# ls -l /dev | more | + | [root@centos8 ~]# fdisk /dev/sdb |
- | total 0 | + | |
- | crw-r--r--. | + | Welcome to fdisk (util-linux 2.32.1). |
- | drwxr-xr-x. | + | Changes will remain in memory only, until you decide to write them. |
- | drwxr-xr-x. 2 root root 100 Jun 28 02:04 bsg | + | Be careful before using the write command. |
- | drwxr-xr-x. | + | |
- | lrwxrwxrwx. 1 root root 3 Jun 28 02:04 cdrom -> sr0 | + | Device does not contain a recognized partition table. |
- | drwxr-xr-x. 2 root root 2940 Jun 28 02:04 char | + | Created a new DOS disklabel with disk identifier 0xb0dacb39. |
- | drwxr-xr-x. | + | |
- | crw-------. | + | Command (m for help): |
- | lrwxrwxrwx. 1 root root 11 Jun 28 02:04 core -> /proc/kcore | + | |
- | drwxr-xr-x. 10 root root 200 Jun 28 02:04 cpu | + | |
- | crw-------. | + | |
- | drwxr-xr-x. 6 root root 120 Jun 28 02:04 disk | + | |
- | brw-rw----. | + | |
- | brw-rw----. 1 root disk 253, 1 Jun 28 02:04 dm-1 | + | |
- | drwxr-xr-x. | + | |
- | crw-rw----. | + | |
- | lrwxrwxrwx. | + | |
- | crw-rw-rw-. | + | |
- | crw-rw-rw-. | + | |
- | crw-------. | + | |
- | crw-------. | + | |
- | drwxr-xr-x. | + | |
- | crw-------. | + | |
- | lrwxrwxrwx. | + | |
- | drwxr-xr-x. | + | |
- | crw-r--r--. | + | |
- | lrwxrwxrwx. | + | |
- | crw-rw----. | + | |
- | crw-rw----. | + | |
- | crw-rw----. | + | |
- | crw-rw----. | + | |
- | crw-rw----. | + | |
- | drwxr-xr-x. | + | |
- | crw-------. | + | |
- | crw-r-----. | + | |
- | drwxrwxrwt. | + | |
- | drwxr-xr-x. | + | |
- | crw-rw-rw-. | + | |
- | --More-- | + | |
</ | </ | ||
- | On peut noter dans la sortie de la commande que certains fichiers sont de type **bloc** (**b**), tandis que d' | + | Tapez ensuite |
< | < | ||
- | ... | + | Command (m for help): m |
- | brw-rw----. | + | |
- | ... | + | |
- | crw-rw-rw-. | + | |
- | ... | + | |
- | </ | + | |
- | 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' | + | Help: |
- | Les deux informations clefs du fichier spécial sont situées à la place de la taille d'un fichier normal et se nomment le **majeur** et le **mineur** : | + | DOS (MBR) |
+ | | ||
+ | | ||
+ | | ||
- | | + | |
- | * le **mineur** identifie le périphérique ou une particularité du périphérique telle une partition | + | |
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
- | =====LAB #1 - Découvrir le Matériel===== | + | Misc |
+ | | ||
+ | | ||
+ | | ||
- | ====1.1 - La Commande lspci==== | + | Script |
+ | | ||
+ | | ||
- | Cette commande vous renseigne sur les adaptateurs reliés aux bus PCI, AGP et PCI express : | + | Save & Exit |
+ | | ||
+ | | ||
- | < | + | Create a new label |
- | [root@centos8 ~]# lspci | + | g |
- | 00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] | + | G |
- | 00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/ | + | o |
- | 00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/ | + | s |
- | 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: | + | Command |
- | 00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon | + | |
- | 00:07.0 SATA controller: Intel Corporation 82801IR/ | + | |
- | 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' | + | Pour créer une nouvelle partition, vous devez utiliser la commande **n**. |
+ | |||
+ | Créez donc les partitions suivantes sur votre disque : | ||
+ | |||
+ | ^ Partition ^ Type ^ Taille de la Partition ^ | ||
+ | | /dev/sdb1 | Primaire | 100 Mo | | ||
+ | | /dev/sdb2 | Primaire | 100 Mo | | ||
+ | | /dev/sdb3 | Primaire | 100 Mo | | ||
+ | | /dev/sdb4 | Extended | Du premier secteur disponible au dernier secteur du disque | | ||
+ | | /dev/sdb5 | Logique | 500 Mo | | ||
+ | | /dev/sdb6 | Logique | 200 Mo | | ||
+ | | /dev/sdb7 | Logique | 300 Mo | | ||
+ | | /dev/sda8 | Logique | 500 Mo | | ||
+ | | /dev/sdb9 | Logique | 400 Mo | | ||
+ | | /dev/sdb10 | Logique | 500 Mo | | ||
+ | | /dev/sdb11 | Logique | 500 Mo | | ||
+ | | /dev/sdb12 | Logique | 200 Mo | | ||
+ | |||
+ | Créez d'abord les partitions primaires | ||
< | < | ||
- | [root@centos8 ~]# lspci -v -s 00:03.0 | + | Command (m for help): n |
- | 00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon | + | Partition type |
- | | + | |
- | | + | e |
- | Flags: bus master, fast devsel, latency 0, IRQ 10 | + | Select (default p): |
- | I/O ports at e000 [size=64] | + | |
- | Memory at fe400000 | + | Using default response p. |
- | | + | Partition number (1-4, default 1): |
- | | + | First sector (2048-8388607, |
- | | + | Last sector, +sectors or +size{K, |
- | | + | |
- | | + | Created a new partition 1 of type ' |
- | | + | |
+ | Command (m for help): n | ||
+ | Partition type | ||
+ | | ||
+ | e | ||
+ | Select (default p): | ||
+ | |||
+ | Using default response p. | ||
+ | Partition number (2-4, default 2): | ||
+ | First sector (206848-8388607, default 206848): | ||
+ | Last sector, +sectors or +size{K, | ||
+ | |||
+ | Created a new partition 2 of type ' | ||
+ | |||
+ | Command (m for help): n | ||
+ | Partition type | ||
+ | | ||
+ | | ||
+ | Select (default p): | ||
+ | |||
+ | Using default response p. | ||
+ | Partition number (3,4, default 3): | ||
+ | First sector (411648-8388607, | ||
+ | Last sector, +sectors or +size{K, | ||
+ | |||
+ | Created a new partition 3 of type ' | ||
+ | |||
+ | Command (m for help): | ||
</ | </ | ||
- | ou : | + | Créez ensuite la partition étendue |
< | < | ||
- | [root@centos8 ~]# lspci -vv -s 00:03.0 | + | Command (m for help): n |
- | 00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon | + | Partition type |
- | | + | p |
- | Physical Slot: 3 | + | e |
- | Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx- | + | Select |
- | Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- | + | |
- | Latency: | + | |
- | | + | |
- | | + | |
- | Region 4: Memory at fe400000 | + | |
- | Capabilities: [84] Vendor Specific Information: | + | |
- | 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 | + | |
- | </ | + | |
- | ===Options de la commande=== | + | Selected partition 4 |
+ | First sector (616448-8388607, | ||
+ | Last sector, +sectors or +size{K, | ||
- | Les options de cette commande sont : | + | Created a new partition 4 of type ' |
+ | |||
+ | Command (m for help): | ||
+ | </ | ||
+ | |||
+ | Créez maintenant les autres partitions l'une après l' | ||
< | < | ||
- | [root@centos8 ~]# lspci --help | + | Command (m for help): n |
- | lspci: invalid option | + | All primary partitions are in use. |
- | Usage: lspci [< | + | Adding logical partition 5 |
+ | First sector (618496-8388607, default 618496): | ||
+ | Last sector, +sectors or +size{K, | ||
- | Basic display modes: | + | Created a new partition 5 of type ' |
- | -mm | + | |
- | -t Show bus tree | + | |
- | Display options: | + | Command |
- | -v Be verbose | + | All primary partitions are in use. |
- | -k Show kernel drivers handling each device | + | Adding logical partition 6 |
- | -x Show hex-dump of the standard part of the config space | + | First sector (1644544-8388607, default 1644544): |
- | -xxx Show hex-dump of the whole config space (dangerous; root only) | + | Last sector, +sectors or +size{K, |
- | -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 | + | Created a new partition 6 of type 'Linux' and of size 200 MiB. |
- | -n Show numeric ID's | + | |
- | -nn Show both textual | + | |
- | -q Query the PCI ID database for unknown ID's via DNS | + | |
- | -qq As above, but re-query locally cached entries | + | |
- | -Q Query the PCI ID database for all ID's via DNS | + | |
- | Selection of devices: | + | Command (m for help): n |
- | -s [[[[< | + | All primary partitions are in use. |
- | -d [< | + | Adding logical partition 7 |
+ | First sector (2056192-8388607, default 2056192): | ||
+ | Last sector, +sectors or +size{K, | ||
- | Other options: | + | Created a new partition 7 of type ' |
- | -i < | + | |
- | -p < | + | |
- | -M Enable `bus | + | |
- | </ | + | |
- | ====1.2 - La Commande lsusb==== | + | Command (m for help): n |
+ | All primary partitions are in use. | ||
+ | Adding logical partition 8 | ||
+ | First sector (2672640-8388607, default 2672640): | ||
+ | Last sector, +sectors or +size{K, | ||
- | Cette commande vous renseigne sur les adaptateurs reliés au bus usb : | + | Created a new partition 8 of type ' |
- | < | + | Command (m for help): n |
- | [root@centos8 ~]# lsusb | + | All primary partitions are in use. |
- | Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd | + | Adding logical partition 9 |
- | Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub | + | First sector (3698688-8388607, |
+ | Last sector, +sectors or +size{K, | ||
+ | |||
+ | Created a new partition 9 of type ' | ||
+ | |||
+ | | ||
+ | All primary partitions are in use. | ||
+ | Adding logical partition 10 | ||
+ | First sector (4519936-8388607, default 4519936): | ||
+ | Last sector, +sectors or +size{K, | ||
+ | |||
+ | Created a new partition 10 of type ' | ||
+ | |||
+ | Command (m for help): n | ||
+ | All primary partitions are in use. | ||
+ | Adding logical partition 11 | ||
+ | First sector (5545984-8388607, | ||
+ | Last sector, +sectors or +size{K, | ||
+ | |||
+ | Created a new partition 11 of type ' | ||
+ | |||
+ | Command (m for help): n | ||
+ | All primary partitions are in use. | ||
+ | Adding logical partition 12 | ||
+ | First sector (6572032-8388607, | ||
+ | Last sector, +sectors or +size{K, | ||
+ | |||
+ | Created a new partition 12 of type 'Linux' and of size 200 MiB. | ||
- | [root@centos8 ~]# lsusb -vt | + | Command (m for help): |
- | /: Bus 01.Port 1: Dev 1, Class=root_hub, | + | |
- | |__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, | + | |
</ | </ | ||
- | ===Options de la commande=== | + | Tapez ensuite |
- | Les options de cette commande | + | < |
+ | Command (m for help): p | ||
+ | Disk /dev/sdb: 4 GiB, 4294967296 bytes, 8388608 sectors | ||
+ | Units: sectors of 1 * 512 = 512 bytes | ||
+ | Sector size (logical/ | ||
+ | I/O size (minimum/ | ||
+ | Disklabel type: dos | ||
+ | Disk identifier: 0xb0dacb39 | ||
+ | |||
+ | Device | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | |||
+ | Command (m for help): | ||
+ | </ | ||
+ | |||
+ | Ecrivez la table des partitions sur disque et exécutez la commande | ||
< | < | ||
- | [root@centos8 ~]# lsusb --help | + | Command (m for help): w |
- | Usage: lsusb [options]... | + | The partition table has been altered. |
- | List USB devices | + | Calling ioctl() to re-read partition table. |
- | -v, --verbose | + | Syncing disks. |
- | | + | |
- | | + | [root@centos8 ~]# partprobe |
- | Show only devices with specified device and/or | + | [root@centos8 ~]# |
- | bus numbers (in decimal) | + | |
- | -d vendor:[product] | + | |
- | Show only devices with the specified vendor and | + | |
- | product ID numbers (in hexadecimal) | + | |
- | .LAB#1 | + | |
- | -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==== | + | Lancez fdisk puis tapez ensuite la lettre **p** puis < |
- | Cette commande vous rensigne sur les partitions des disques | + | < |
+ | [root@centos8 ~]# fdisk /dev/sdb | ||
+ | |||
+ | Welcome to fdisk (util-linux 2.32.1). | ||
+ | Changes will remain in memory only, until you decide to write them. | ||
+ | Be careful before using the write command. | ||
+ | |||
+ | |||
+ | Command (m for help): p | ||
+ | Disk /dev/sdb: 4 GiB, 4294967296 bytes, 8388608 sectors | ||
+ | Units: sectors of 1 * 512 = 512 bytes | ||
+ | Sector size (logical/ | ||
+ | I/O size (minimum/ | ||
+ | Disklabel type: dos | ||
+ | Disk identifier: 0xb0dacb39 | ||
+ | |||
+ | Device | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | |||
+ | Command (m for help): | ||
+ | </ | ||
+ | |||
+ | Pour supprimer une partition, utilisez la commande | ||
< | < | ||
- | [root@centos8 ~]# lsblk | + | Command (m for help): d |
- | NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT | + | Partition number (1-12, default 12): 12 |
- | sda 8:0 0 | + | |
- | ├─sda1 | + | Partition 12 has been deleted. |
- | └─sda2 | + | |
- | | + | Command (m for help): p |
- | | + | Disk /dev/sdb: 4 GiB, 4294967296 bytes, 8388608 sectors |
- | sdb | + | Units: sectors of 1 * 512 = 512 bytes |
- | sdc | + | Sector size (logical/physical): 512 bytes / 512 bytes |
- | └─sdc1 | + | I/O size (minimum/ |
- | sdd | + | Disklabel type: dos |
- | sr0 11:0 1 1024M 0 rom | + | Disk identifier: 0xb0dacb39 |
+ | |||
+ | Device | ||
+ | / | ||
+ | /dev/ | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | /dev/ | ||
+ | / | ||
+ | / | ||
- | [root@centos8 ~]# lsblk -l | + | Command (m for help): |
- | NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT | + | |
- | sda | + | |
- | sda1 8:1 0 1G 0 part /boot | + | |
- | sda2 8:2 0 | + | |
- | sdb | + | |
- | sdc | + | |
- | sdc1 8:33 | + | |
- | sdd | + | |
- | sr0 11:0 1 1024M 0 rom | + | |
- | cl_centos8-root 253:0 0 27.8G 0 lvm / | + | |
- | cl_centos8-swap 253:1 0 3.2G 0 lvm [SWAP] | + | |
</ | </ | ||
- | ===Options | + | A ce stade, la partition n'a **pas** été réellement supprimée. En effet, vous avez la possibilité de sortir |
- | Les options | + | Tapez donc q pour sortir |
< | < | ||
- | [root@centos8 ~]# lsblk --help | + | Command (m for help): q |
- | Usage: | + | [root@centos8 ~]# fdisk /dev/sdb |
- | | + | |
- | List information about block devices. | + | Welcome to fdisk (util-linux 2.32.1). |
+ | Changes will remain in memory only, until you decide to write them. | ||
+ | Be careful before using the write command. | ||
- | Options: | ||
- | -a, --all print all devices | ||
- | -b, --bytes | ||
- | -d, --nodeps | ||
- | -D, --discard | ||
- | -z, --zoned | ||
- | -e, --exclude < | ||
- | -f, --fs | ||
- | -i, --ascii | ||
- | -I, --include < | ||
- | -J, --json | ||
- | -l, --list | ||
- | -T, --tree | ||
- | -m, --perms | ||
- | -n, --noheadings | ||
- | -o, --output < | ||
- | -O, --output-all | ||
- | -p, --paths | ||
- | -P, --pairs | ||
- | -r, --raw use raw output format | ||
- | -s, --inverse | ||
- | -S, --scsi | ||
- | -t, --topology | ||
- | -x, --sort < | ||
- | -h, --help | + | Command (m for help): p |
- | -V, --version | + | Disk /dev/sdb: 4 GiB, 4294967296 bytes, 8388608 sectors |
+ | Units: sectors of 1 * 512 = 512 bytes | ||
+ | Sector size (logical/ | ||
+ | I/O size (minimum/ | ||
+ | Disklabel type: dos | ||
+ | Disk identifier: 0xb0dacb39 | ||
- | Available output columns: | + | Device |
- | NAME device name | + | / |
- | | + | / |
- | | + | / |
- | | + | / |
- | MOUNTPOINT | + | / |
- | | + | / |
- | | + | / |
- | PARTTYPE | + | /dev/sdb8 |
- | | + | /dev/ |
- | | + | / |
- | | + | / |
- | RA read-ahead of the device | + | / |
- | | + | |
- | RM removable device | + | |
- | | + | |
- | | + | |
- | SERIAL | + | |
- | | + | |
- | STATE state of the device | + | |
- | | + | |
- | GROUP group name | + | |
- | MODE device node permissions | + | |
- | ALIGNMENT | + | |
- | MIN-IO | + | |
- | OPT-IO | + | |
- | | + | |
- | LOG-SEC | + | |
- | ROTA rotational device | + | |
- | | + | |
- | | + | |
- | TYPE device type | + | |
- | DISC-ALN | + | |
- | | + | |
- | DISC-MAX | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | HCTL Host: | + | |
- | TRAN device transport type | + | |
- | SUBSYSTEMS | + | |
- | | + | |
- | | + | |
- | | + | |
- | For more details see lsblk(8). | + | Command |
</ | </ | ||
- | ====1.4 - La Commande lsscsi==== | + | ====LAB #2 - Modifier les Drapeaux des Partitions avec fdisk==== |
- | Cette commmande vous renseigne | + | Afin de mettre en place un RAID logiciel ou un volume logique, il est nécessaire de modifier les types de systèmes de fichiers |
- | < | + | Modifiez donc les nouvelles partitions à l'aide de la commande **t** de **fdisk** selon le tableau ci-dessous |
- | [root@centos8 ~]# lsscsi | + | |
- | [1: | + | |
- | [2: | + | |
- | [3: | + | |
- | [4: | + | |
- | [5:0:0:0] disk ATA QEMU HARDDISK | + | |
- | </ | + | |
- | ===Options | + | ^ Taille |
+ | | 500 Mo | RAID (fd) | | ||
+ | | 200 Mo | Linux LVM (8e) | | ||
+ | | 300 Mo | Linux LVM (8e) | | ||
+ | | 500 Mo | RAID (fd) | | ||
+ | | 400 Mo | Linux LVM (8e) | | ||
+ | | 500 Mo | RAID (fd) | | ||
+ | | 500 Mo | RAID (fd) | | ||
+ | | 200 Mo | Inchangé | | ||
- | Les options de cette commande sont : | + | Vous obtiendrez un résultat similaire à celui-ci |
< | < | ||
- | [root@centos8 ~]# man lsscsi | + | Command (m for help): t |
- | [root@centos8 ~]# lsscsi | + | Partition number (1-12, default 12): 5 |
- | Usage: lsscsi | + | Hex code (type L to list all codes): fd |
- | | + | |
- | | + | Changed type of partition ' |
- | | + | |
- | | + | Command (m for help): t |
- | where: | + | Partition number (1-12, default 12): 6 |
- | | + | Hex code (type L to list all codes): 8e |
- | | + | |
- | | + | Changed type of partition ' |
- | like SCSI hosts | + | |
- | --device|-d | + | Command (m for help): t |
- | --generic|-g | + | Partition number (1-12, default 12): 7 |
- | --help|-h this usage information | + | Hex code (type L to list all codes): 8e |
- | --hosts|-H | + | |
- | | + | Changed type of partition |
- | --list|-L | + | |
- | | + | Command (m for help): t |
- | | + | Partition number (1-12, default 12): 8 |
- | --long-unit|-U | + | Hex code (type L to list all codes): fd |
- | | + | |
- | | + | Changed type of partition ' |
- | use twice to get full 16 digit hexadecimal LUN | + | |
- | --no-nvme|-N | + | Command |
- | | + | Partition number |
- | | + | Hex code (type L to list all codes): 8e |
- | | + | |
- | | + | Changed type of partition |
- | | + | |
- | twice for power of two (e.g. 2.7 GiB), | + | Command |
- | thrice for number of blocks)) | + | Partition number |
- | | + | Hex code (type L to list all codes): fd |
- | | + | |
- | adds comma followed by logical block size in bytes | + | Changed type of partition |
- | --transport|-t | + | |
- | | + | Command (m for help): t |
- | | + | Partition number (1-12, default 12): 11 |
- | | + | Hex code (type L to list all codes): fd |
- | --version|-V | + | |
- | --wwn|-w | + | |
- | < | + | |
- | < | + | |
- | <' | + | |
- | List SCSI devices or hosts, followed by NVMe namespaces or controllers. | + | Changed type of partition ' |
- | 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 | + | A l'issu des modifications, |
- | Cett commande vous renseigne sur l' | + | < |
+ | Command (m for help): p | ||
+ | Disk /dev/sdb: 4 GiB, 4294967296 bytes, 8388608 sectors | ||
+ | Units: sectors of 1 * 512 = 512 bytes | ||
+ | Sector size (logical/ | ||
+ | I/O size (minimum/ | ||
+ | Disklabel type: dos | ||
+ | Disk identifier: 0xb0dacb39 | ||
+ | |||
+ | Device | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | |||
+ | Command (m for help): | ||
+ | </ | ||
+ | |||
+ | Pour écrire la nouvelle table des partitions sur disque, vous devez utilisez la commande **w** puis la commande **partprobe** | ||
< | < | ||
- | [root@centos8 ~]# lscpu | + | Command |
- | Architecture: | + | The partition table has been altered! |
- | CPU op-mode(s): | + | |
- | Byte Order: | + | Calling ioctl() to re-read partition table. |
- | CPU(s): | + | |
- | On-line CPU(s) list: 0-7 | + | WARNING: Re-reading the partition table failed with error 16: Device or resource busy. |
- | Thread(s) per core: 1 | + | The kernel still uses the old table. The new table will be used at |
- | Core(s) per socket: 4 | + | the next reboot or after you run partprobe(8) or kpartx(8) |
- | Socket(s): 2 | + | Syncing disks. |
- | NUMA node(s): | + | [root@centos8 ~]# partprobe |
- | Vendor ID: | + | |
- | BIOS Vendor ID: QEMU | + | |
- | CPU family: | + | |
- | Model: | + | |
- | Model name: Intel(R) Xeon(R) CPU E3-1270 v6 @ 3.80GHz | + | |
- | BIOS Model name: | + | |
- | Stepping: | + | |
- | CPU MHz: | + | |
- | BogoMIPS: | + | |
- | Virtualization: | + | |
- | Hypervisor vendor: | + | |
- | Virtualization type: full | + | |
- | L1d cache: | + | |
- | L1i cache: | + | |
- | L2 cache: | + | |
- | L3 cache: | + | |
- | NUMA node0 CPU(s): | + | |
- | Flags: | + | |
</ | </ | ||
- | ===Options de la commande=== | + | ====Options de la Commande fdisk==== |
Les options de cette commande sont : | Les options de cette commande sont : | ||
< | < | ||
- | [root@centos8 ~]# lscpu --help | + | [root@centos8 ~]# fdisk --help |
Usage: | Usage: | ||
- | lscpu [options] | + | fdisk [options] |
+ | fdisk [options] -l [< | ||
- | Display | + | Display |
Options: | Options: | ||
- | -a, --all print both online | + | -b, --sector-size < |
- | -b, --online | + | -B, --protect-boot |
- | -c, --offline | + | -c, --compatibility[=< |
- | -J, --json use JSON for default or extended format | + | -L, --color[=< |
- | -e, --extended[=<list>] print out an extended | + | |
- | -p, --parse[=<list>] print out a parsable format | + | -l, --list |
- | -s, --sysroot | + | -o, --output < |
- | -x, --hex print hexadecimal masks rather than lists of CPUs | + | -t, --type < |
- | -y, --physical | + | -u, --units[=<unit>] |
+ | -s, --getsz | ||
+ | | ||
+ | -w, --wipe <mode> wipe signatures (auto, always or never) | ||
+ | -W, --wipe-partitions | ||
+ | |||
+ | -C, --cylinders < | ||
+ | -H, --heads < | ||
+ | -S, --sectors < | ||
- | -h, --help | + | -h, --help |
- | -V, --version | + | -V, --version |
Available output columns: | Available output columns: | ||
- | | + | gpt: Device Start End Sectors Size Type Type-UUID Attrs Name UUID |
- | | + | dos: Device Start End Sectors Cylinders Size Type Id Attrs Boot End-C/H/S Start-C/H/S |
- | | + | bsd: Slice Start End Sectors Cylinders Size Type Bsize Cpg Fsize |
- | CLUSTER | + | sgi: Device Start End Sectors Cylinders Size Type Id Attrs |
- | | + | sun: Device Start End Sectors Cylinders Size Type Id Flags |
- | BOOK logical book number | + | |
- | DRAWER | + | |
- | | + | |
- | POLARIZATION | + | |
- | | + | |
- | CONFIGURED | + | |
- | ONLINE | + | |
- | MAXMHZ | + | |
- | MINMHZ | + | |
- | For more details see lscpu(1). | + | For more details see fdisk(8). |
</ | </ | ||
- | ====1.6 - La Command lshw==== | + | =====Logical Volume Manager (LVM)===== |
- | Cette commande vous renseigne sur le matériel selon la **classe** de celui-ci. Commencez par visualiser | + | ====LAB #3 - Volumes Logiques Linéaires==== |
+ | |||
+ | Afin de mettre en place le LVM, vous avez besoin du paquet | ||
+ | |||
+ | Nous allons travailler sous RHEL/CentOS 8 avec les partitions suivantes | ||
< | < | ||
- | [root@centos8 ~]# lshw -businfo | + | /dev/sdb6 |
- | Bus info Device | + | /dev/sdb7 |
- | ==================================================== | + | /dev/sdb9 |
- | system | + | |
- | bus Motherboard | + | |
- | memory | + | |
- | cpu@0 | + | |
- | cpu@1 | + | |
- | memory | + | |
- | memory | + | |
- | pci@0000: | + | |
- | pci@0000: | + | |
- | input PnP device PNP0303 | + | |
- | input PnP device PNP0f13 | + | |
- | storage | + | |
- | system | + | |
- | pci@0000: | + | |
- | scsi@1: | + | |
- | pci@0000: | + | |
- | usb@1 | + | |
- | usb@1: | + | |
- | pci@0000: | + | |
- | pci@0000: | + | |
- | pci@0000: | + | |
- | virtio@0 | + | |
- | pci@0000: | + | |
- | scsi@2: | + | |
- | scsi@2: | + | |
- | scsi@2: | + | |
- | scsi@3: | + | |
- | scsi@4: | + | |
- | scsi@4: | + | |
- | scsi@5: | + | |
- | pci@0000: | + | |
- | virtio@1 | + | |
- | pci@0000: | + | |
- | virtio@2 | + | |
- | pci@0000: | + | |
- | pci@0000: | + | |
- | input0 | + | |
- | input1 | + | |
- | input3 | + | |
- | input4 | + | |
- | input6 | + | |
</ | </ | ||
- | Consultez maintenant | + | Pour initialiser |
< | < | ||
- | [root@centos8 ~]# lshw -c system | + | [root@centos8 ~]# vgscan |
- | centos8.ittraining.loc | + | |
- | description: | + | |
- | product: Standard PC (i440FX + PIIX, 1996) | + | |
- | vendor: QEMU | + | |
- | version: pc-i440fx-7.0 | + | |
- | width: 64 bits | + | |
- | capabilities: | + | |
- | configuration: | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
</ | </ | ||
- | Consultez maintenant le matériel des autres classes principales | + | Les options de la commande **vgscan** sont : |
< | < | ||
- | [root@centos8 ~]# lshw -c memory | + | [root@centos8 ~]# vgscan |
- | *-firmware | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | date: 04/ | + | |
- | size: 96KiB | + | |
- | | + | |
- | | + | |
- | | + | |
- | size: 16GiB | + | |
- | | + | |
- | | + | |
- | | + | |
- | description: | + | |
- | vendor: QEMU | + | |
- | physical id: 0 | + | |
- | slot: DIMM 0 | + | |
- | [root@centos8 ~]# lshw -c video | + | vgscan |
- | *-display | + | [ --ignorelockingfailure ] |
- | description: | + | [ |
- | | + | [ |
- | | + | [ |
- | bus info: pci@0000: | + | [ COMMON_OPTIONS ] |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | resources: irq:0 memory: | + | |
+ | Common options for lvm: | ||
+ | [ -d|--debug ] | ||
+ | [ -h|--help ] | ||
+ | [ -q|--quiet ] | ||
+ | [ -v|--verbose ] | ||
+ | [ -y|--yes ] | ||
+ | [ -t|--test ] | ||
+ | [ --commandprofile String ] | ||
+ | [ --config String ] | ||
+ | [ --driverloaded y|n ] | ||
+ | [ --nolocking ] | ||
+ | [ --lockopt String ] | ||
+ | [ --longhelp ] | ||
+ | [ --profile String ] | ||
+ | [ --version ] | ||
- | [root@centos8 ~]# lshw -c storage | + | Common variables for lvm: |
- | *-pnp00:02 | + | |
- | product: PnP device PNP0700 | + | e.g. PV, VG, LV, Size, Number, String, Tag. |
- | physical id: 2 | + | |
- | | + | |
- | *-ide | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | bus info: pci@0000: | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | *-sata | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | bus info: pci@0000: | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
+ | PV | ||
+ | Physical Volume name, a device path under /dev. | ||
+ | For commands managing physical extents, a PV positional arg | ||
+ | generally accepts a suffix indicating a range (or multiple ranges) | ||
+ | of PEs. When the first PE is omitted, it defaults to the start of | ||
+ | the device, and when the last PE is omitted it defaults to the end. | ||
+ | PV[: | ||
+ | PV[: | ||
- | [root@centos8 ~]# lshw -c disk | + | LV |
- | | + | |
- | | + | arg generally includes the VG name and LV name, e.g. VG/LV. |
- | | + | LV followed by _< |
- | | + | |
- | | + | The _new suffix indicates that the LV name is new. |
- | bus info: scsi@1: | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | *-disk:0 | + | |
- | | + | |
- | | + | |
- | | + | |
- | bus info: scsi@2: | + | |
- | | + | |
- | | + | |
- | | + | |
- | size: 32GiB (34GB) | + | |
- | | + | |
- | | + | |
- | *-disk:1 | + | |
- | | + | |
- | | + | |
- | | + | |
- | bus info: scsi@3:0.0.0 | + | |
- | logical | + | |
- | | + | |
- | | + | |
- | size: 4GiB (4294MB) | + | |
- | | + | |
- | *-disk:2 | + | |
- | | + | |
- | | + | |
- | | + | |
- | bus info: scsi@4:0.0.0 | + | |
- | logical name: /dev/sdc | + | |
- | version: 2.5+ | + | |
- | | + | |
- | size: 64GiB (68GB) | + | |
- | | + | |
- | | + | |
- | *-disk:3 | + | |
- | | + | |
- | | + | |
- | | + | |
- | bus info: scsi@5:0.0.0 | + | |
- | logical | + | |
- | | + | |
- | | + | |
- | size: 32GiB (34GB) | + | |
- | | + | |
+ | Tag | ||
+ | Tag name. See lvm(8) for information about tag names and using | ||
+ | tags in place of a VG, LV or PV. | ||
- | [root@centos8 ~]# lshw -c volume | + | Select |
- | | + | |
- | description: | + | if the --select option is used. No arg appears in this position. |
- | | + | |
- | | + | |
- | bus info: scsi@2: | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | size: 1GiB | + | |
- | | + | |
- | | + | |
- | | + | |
- | *-volume: | + | |
- | | + | |
- | | + | |
- | bus info: scsi@2: | + | |
- | | + | |
- | | + | |
- | size: 30GiB | + | |
- | | + | |
- | | + | |
- | *-volume | + | |
- | | + | |
- | | + | |
- | | + | |
- | bus info: scsi@4: | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | size: 63GiB | + | |
- | | + | |
- | | + | |
- | | + | |
- | [root@centos8 ~]# lshw -c network | + | Size[UNIT] |
- | | + | Size is an input number that accepts an optional unit. |
- | description: | + | Input units are always treated as base two values, regardless of |
- | product: Virtio network device | + | |
- | | + | The default input unit is specified by letter, followed by |UNIT. |
- | | + | UNIT represents other possible input units: BbBsSkKmMgGtTpPeE. |
- | bus info: pci@0000: | + | (This should not be confused with the output control |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | description: | + | |
- | physical id: 0 | + | |
- | bus info: virtio@1 | + | |
- | logical name: ens18 | + | |
- | serial: 5e: | + | |
- | capabilities: | + | |
- | configuration: | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | physical id: 13 | + | |
- | bus info: pci@0000: | + | |
- | version: 00 | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | *-virtio2 | + | |
- | description: | + | |
- | physical id: 0 | + | |
- | bus info: virtio@2 | + | |
- | logical name: ens19 | + | |
- | serial: ea: | + | |
- | capabilities: | + | |
- | configuration: | + | |
</ | </ | ||
- | ===Options de la commande=== | + | ===Physical Volume (PV)=== |
- | Les options de cette commande | + | Pour créer le **PV** il convient d' |
< | < | ||
- | [root@centos8 ~]# lshw -h | + | [root@centos8 ~]# pvcreate /dev/sdb6 /dev/sdb7 /dev/sdb9 |
- | Hardware Lister (lshw) - B.02.19.2 | + | |
- | usage: lshw [-format] [-options ...] | + | Physical volume "/ |
- | lshw -version | + | |
+ | </ | ||
- | -version | + | Les options de la commande **pvcreate** sont : |
- | format can be | + | < |
- | -html | + | [root@centos8 ~]# pvcreate |
- | -xml output hardware tree as XML | + | |
- | -json | + | |
- | | + | |
- | -businfo | + | |
- | options can be | + | pvcreate PV ... |
- | -dump filename | + | [ -f|--force ] |
- | -class CLASS only show a certain class of hardware | + | [ -M|--metadatatype lvm2 ] |
- | -C CLASS same as '-class CLASS' | + | [ -u|--uuid String ] |
- | -c CLASS same as '-class CLASS' | + | [ -Z|--zero y|n ] |
- | -disable TEST | + | [ --dataalignment Size[k|UNIT] ] |
- | -enable TEST enable a test (like pci, isapnp, cpuid, etc. ) | + | [ |
- | -quiet don't display status | + | [ |
- | -sanitize | + | [ |
- | -numeric | + | [ |
- | -notime | + | [ --metadatasize Size[m|UNIT] ] |
- | </ | + | [ |
+ | [ | ||
+ | [ | ||
+ | [ --reportformat basic|json ] | ||
+ | [ --restorefile String ] | ||
+ | [ COMMON_OPTIONS ] | ||
- | ====1.7 | + | Common options for lvm: |
+ | [ -d|--debug ] | ||
+ | [ -h|--help ] | ||
+ | [ -q|--quiet ] | ||
+ | [ -v|--verbose ] | ||
+ | [ -y|--yes ] | ||
+ | [ -t|--test ] | ||
+ | [ --commandprofile String ] | ||
+ | [ --config String ] | ||
+ | [ --driverloaded y|n ] | ||
+ | [ --nolocking ] | ||
+ | [ --lockopt String ] | ||
+ | [ --longhelp ] | ||
+ | [ --profile String ] | ||
+ | [ --version ] | ||
- | La commande **dmidecode** lit la table **DMI** (//Desktop Management Interface// | + | Common variables for lvm: |
+ | Variables in option or position args are capitalized, | ||
+ | e.g. PV, VG, LV, Size, Number, String, Tag. | ||
- | * l' | + | PV |
- | * les extensions possibles. | + | Physical Volume name, a device path under /dev. |
+ | For commands managing physical extents, a PV positional arg | ||
+ | generally accepts a suffix indicating a range (or multiple ranges) | ||
+ | of PEs. When the first PE is omitted, it defaults to the start of | ||
+ | the device, and when the last PE is omitted it defaults to the end. | ||
+ | PV[: | ||
+ | | ||
- | < | + | LV |
- | [root@centos8 ~]# dmidecode | + | |
- | # dmidecode 3.2 | + | arg generally includes the VG name and LV name, e.g. VG/LV. |
- | Getting SMBIOS data from sysfs. | + | LV followed by _< |
- | SMBIOS 2.8 present. | + | required. (raid represents raid< |
- | 11 structures occupying 511 bytes. | + | The _new suffix indicates that the LV name is new. |
- | Table at 0x000F5870. | + | |
- | Handle 0x0000, DMI type 0, 24 bytes | + | Tag |
- | BIOS Information | + | |
- | | + | |
- | Version: rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org | + | |
- | | + | |
- | Address: 0xE8000 | + | |
- | Runtime Size: 96 kB | + | |
- | ROM Size: 64 kB | + | |
- | Characteristics: | + | |
- | BIOS characteristics not supported | + | |
- | Targeted content distribution is supported | + | |
- | BIOS Revision: 0.0 | + | |
- | Handle 0x0100, DMI type 1, 27 bytes | + | Select |
- | System Information | + | |
- | | + | |
- | | + | |
- | Version: pc-i440fx-5.2 | + | |
- | Serial Number: Not Specified | + | |
- | UUID: 95bd69e3-4a74-44a7-b58c-b74fbfb86df2 | + | |
- | Wake-up Type: Power Switch | + | |
- | SKU Number: Not Specified | + | |
- | Family: Not Specified | + | |
- | Handle 0x0300, DMI type 3, 22 bytes | + | Size[UNIT] |
- | Chassis Information | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | Boot-up 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 | + | Pour visualiser le PV il convient d' |
- | Processor Information | + | |
- | Socket Designation: CPU 0 | + | |
- | 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: 4 | + | |
- | Core Enabled: 4 | + | |
- | Thread Count: 1 | + | |
- | Characteristics: | + | |
- | Handle 0x0401, DMI type 4, 42 bytes | + | < |
- | Processor Information | + | [root@centos8 ~]# pvdisplay /dev/sdb6 /dev/sdb7 /dev/sdb9 |
- | | + | "/ |
- | Type: Central Processor | + | --- NEW Physical volume --- |
- | | + | PV Name / |
- | | + | VG Name |
- | ID: 61 0F 00 00 FF FB 8B 07 | + | PV Size 200.00 MiB |
- | | + | Allocatable |
- | | + | PE Size |
- | | + | Total PE 0 |
- | Max Speed: 2000 MHz | + | Free PE 0 |
- | | + | Allocated PE 0 |
- | | + | PV UUID |
- | | + | |
- | L1 Cache Handle: Not Provided | + | "/ |
- | L2 Cache Handle: Not Provided | + | --- NEW Physical volume --- |
- | L3 Cache Handle: Not Provided | + | PV Name / |
- | | + | VG Name |
- | Asset Tag: Not Specified | + | PV Size 300.00 MiB |
- | Part Number: Not Specified | + | |
- | Core Count: 4 | + | PE Size |
- | Core Enabled: 4 | + | Total PE 0 |
- | | + | Free PE 0 |
- | | + | |
+ | PV UUID | ||
+ | | ||
+ | "/ | ||
+ | --- NEW Physical volume --- | ||
+ | PV Name / | ||
+ | VG Name | ||
+ | PV Size | ||
+ | | ||
+ | PE Size | ||
+ | Total PE 0 | ||
+ | Free PE 0 | ||
+ | Allocated PE 0 | ||
+ | PV UUID | ||
+ | </ | ||
- | Handle 0x1000, DMI type 16, 23 bytes | + | Les options de la commande **pvdisplay** sont : |
- | 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 | + | [root@centos8 ~]# pvdisplay --longhelp |
- | 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 | + | pvdisplay |
- | Memory Array Mapped Address | + | [ -a|--all ] |
- | | + | [ -c|--colon ] |
- | | + | [ -C|--columns ] |
- | Range Size: 3 GB | + | [ -m|--maps ] |
- | | + | [ -o|--options String ] |
- | | + | [ -S|--select String ] |
+ | [ -s|--short ] | ||
+ | [ -O|--sort String ] | ||
+ | [ --aligned ] | ||
+ | [ --binary ] | ||
+ | [ --configreport log|vg|lv|pv|pvseg|seg ] | ||
+ | [ --foreign ] | ||
+ | [ --ignorelockingfailure ] | ||
+ | [ --logonly ] | ||
+ | [ --noheadings ] | ||
+ | [ --nosuffix ] | ||
+ | [ --readonly ] | ||
+ | [ --reportformat basic|json ] | ||
+ | [ --separator String ] | ||
+ | [ --shared ] | ||
+ | [ --unbuffered ] | ||
+ | [ --units r|R|h|H|b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | [ PV|Tag ... ] | ||
- | Handle 0x1301, DMI type 19, 31 bytes | + | Common options for lvm: |
- | Memory Array Mapped Address | + | [ -d|--debug ] |
- | | + | [ -h|--help ] |
- | | + | [ -q|--quiet ] |
- | Range Size: 1 GB | + | [ -v|--verbose ] |
- | | + | [ -y|--yes ] |
- | | + | [ -t|--test ] |
+ | [ --commandprofile String ] | ||
+ | [ --config String ] | ||
+ | [ --driverloaded y|n ] | ||
+ | [ --nolocking ] | ||
+ | [ --lockopt String ] | ||
+ | [ --longhelp ] | ||
+ | [ --profile String ] | ||
+ | [ --version ] | ||
- | Handle 0x2000, DMI type 32, 11 bytes | + | Common variables for lvm: |
- | System Boot Information | + | Variables in option or position args are capitalized, |
- | | + | |
- | Handle 0x7F00, DMI type 127, 4 bytes | + | PV |
- | End Of Table | + | Physical Volume name, a device path under /dev. |
+ | For commands managing physical extents, a PV positional arg | ||
+ | generally accepts a suffix indicating a range (or multiple ranges) | ||
+ | of PEs. When the first PE is omitted, it defaults to the start of | ||
+ | the device, and when the last PE is omitted it defaults to the end. | ||
+ | PV[: | ||
+ | PV[: | ||
+ | |||
+ | LV | ||
+ | Logical Volume name. See lvm(8) for valid names. An LV positional | ||
+ | arg generally includes the VG name and LV name, e.g. VG/LV. | ||
+ | LV followed by _<type> indicates that an LV of the given type is | ||
+ | required. (raid represents raid< | ||
+ | The _new suffix indicates that the LV name is new. | ||
+ | |||
+ | Tag | ||
+ | Tag name. See lvm(8) for information about tag names and using | ||
+ | tags in place of a VG, LV or PV. | ||
+ | |||
+ | Select | ||
+ | Select indicates that a required positional arg can be omitted | ||
+ | if the --select option is used. No arg appears in this position. | ||
+ | |||
+ | Size[UNIT] | ||
+ | Size is an input number that accepts an optional unit. | ||
+ | Input units are always treated as base two values, regardless of | ||
+ | capitalization, | ||
+ | The default input unit is specified by letter, followed by |UNIT. | ||
+ | UNIT represents other possible input units: BbBsSkKmMgGtTpPeE. | ||
+ | (This should not be confused with the output control --units, where | ||
+ | | ||
</ | </ | ||
- | ===Options de la commande=== | + | ===Volume Group (VG) et Physical Extent (PE)=== |
- | Les options de cette commande | + | Pour créer un Volume Group dénommé **vg0**, il convient d' |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | Usage: dmidecode [OPTIONS] | + | |
- | Options are: | + | |
- | -d, --dev-mem FILE Read memory from device FILE (default: | + | |
- | -h, --help | + | |
- | -q, --quiet | + | |
- | -s, --string KEYWORD | + | |
- | -t, --type TYPE Only display the entries of given type | + | |
- | -u, --dump | + | |
- | | + | |
- | | + | |
- | -V, --version | + | |
</ | </ | ||
- | ====1.8 - La Commande smartctl==== | + | Les options de la commande |
- | + | ||
- | **smartctl** contrôle le système SMART (Self-Monitoring, | + | |
< | < | ||
- | [root@centos8 ~]# smartctl | + | [root@centos8 ~]# vgcreate |
+ | vgcreate | ||
- | [root@centos8 ~]# smartctl | + | vgcreate VG_new PV ... |
- | smartctl 7.1 2020-04-05 r5049 [x86_64-linux-4.18.0-305.7.1.el8_4.x86_64] (local build) | + | [ -A|--autobackup y|n ] |
- | Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org | + | [ -c|--clustered y|n ] |
+ | [ -l|--maxlogicalvolumes Number ] | ||
+ | [ -p|--maxphysicalvolumes Number ] | ||
+ | [ -M|--metadatatype lvm2 ] | ||
+ | [ -s|--physicalextentsize Size[m|UNIT] ] | ||
+ | [ -f|--force ] | ||
+ | [ -Z|--zero y|n ] | ||
+ | [ --addtag Tag ] | ||
+ | [ --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit ] | ||
+ | [ --metadataprofile String ] | ||
+ | [ --labelsector Number ] | ||
+ | [ --metadatasize Size[m|UNIT] ] | ||
+ | [ --pvmetadatacopies 0|1|2 ] | ||
+ | [ | ||
+ | [ --reportformat basic|json ] | ||
+ | [ --dataalignment Size[k|UNIT] ] | ||
+ | [ --dataalignmentoffset Size[k|UNIT] ] | ||
+ | [ --shared ] | ||
+ | [ --systemid String ] | ||
+ | [ --locktype sanlock|dlm|none ] | ||
+ | [ COMMON_OPTIONS ] | ||
- | === START OF INFORMATION SECTION === | + | Common options for lvm: |
- | Device Model: QEMU HARDDISK | + | [ -d|--debug ] |
- | Serial Number: | + | [ -h|--help ] |
- | Firmware Version: 2.5+ | + | [ -q|--quiet |
- | User Capacity: | + | [ -v|--verbose ] |
- | Sector Size: 512 bytes logical/ | + | [ -y|--yes |
- | Device is: Not in smartctl database | + | [ -t|--test ] |
- | ATA Version is: | + | [ --commandprofile String ] |
- | Local Time is: Sun Nov 13 09:12:18 2022 CET | + | [ |
- | SMART support is: Available | + | [ --driverloaded y|n ] |
- | SMART support is: Enabled | + | [ --nolocking ] |
+ | [ --lockopt String ] | ||
+ | [ --longhelp ] | ||
+ | [ --profile String ] | ||
+ | [ --version ] | ||
- | === START OF READ SMART DATA SECTION === | + | Use --longhelp to show all options and advanced commands. |
- | SMART overall-health self-assessment test result: PASSED | + | </ |
- | General SMART Values: | + | Pour afficher les informations concernant **vg0**, il convient d' |
- | Offline data collection status: | + | |
- | was completed without error. | + | |
- | Auto Offline Data Collection: Disabled. | + | |
- | Self-test execution status: | + | |
- | without error or no self-test has ever | + | |
- | been run. | + | |
- | Total time to complete Offline | + | |
- | data collection: | + | |
- | Offline data collection | + | |
- | capabilities: | + | |
- | No Auto Offline data collection support. | + | |
- | Suspend Offline collection upon new | + | |
- | command. | + | |
- | Offline surface scan supported. | + | |
- | Self-test supported. | + | |
- | No Conveyance Self-test supported. | + | |
- | No Selective Self-test supported. | + | |
- | SMART capabilities: | + | |
- | power-saving mode. | + | |
- | Supports SMART auto save timer. | + | |
- | Error logging capability: | + | |
- | No General Purpose Logging support. | + | |
- | Short self-test routine | + | |
- | recommended polling time: ( 2) minutes. | + | |
- | Extended self-test routine | + | |
- | recommended polling time: ( 54) minutes. | + | |
- | SMART Attributes Data Structure revision number: 1 | + | < |
- | Vendor Specific SMART Attributes with Thresholds: | + | [root@centos8 ~]# vgdisplay vg0 |
- | ID# ATTRIBUTE_NAME | + | --- Volume group --- |
- | 1 Raw_Read_Error_Rate | + | VG Name vg0 |
- | 3 Spin_Up_Time | + | System |
- | | + | Format |
- | | + | |
- | | + | Metadata Sequence No 1 |
- | 12 Power_Cycle_Count | + | VG Access |
- | 190 Airflow_Temperature_Cel 0x0003 | + | VG Status |
+ | MAX LV | ||
+ | | ||
+ | Open LV 0 | ||
+ | Max PV 0 | ||
+ | Cur PV | ||
+ | Act PV 3 | ||
+ | | ||
+ | | ||
+ | Total PE 110 | ||
+ | Alloc PE / Size 0 / 0 | ||
+ | | ||
+ | | ||
+ | </code> | ||
- | SMART Error Log Version: 1 | + | Les options de la commande **vgdisplay** sont : |
- | No Errors Logged | + | |
- | SMART Self-test log structure revision number 1 | + | < |
- | No self-tests have been logged. | + | [root@centos8 ~]# vgdisplay |
+ | vgdisplay - Display volume group information | ||
- | Selective Self-tests/ | + | vgdisplay |
+ | [ -A|--activevolumegroups ] | ||
+ | [ -c|--colon ] | ||
+ | [ -C|--columns ] | ||
+ | [ -o|--options String ] | ||
+ | [ -S|--select String ] | ||
+ | [ -s|--short ] | ||
+ | [ -O|--sort String ] | ||
+ | [ --aligned ] | ||
+ | [ --binary ] | ||
+ | [ --configreport log|vg|lv|pv|pvseg|seg ] | ||
+ | [ --foreign ] | ||
+ | [ --ignorelockingfailure ] | ||
+ | [ --logonly ] | ||
+ | [ --noheadings ] | ||
+ | [ --nosuffix ] | ||
+ | [ --readonly ] | ||
+ | [ --reportformat basic|json ] | ||
+ | [ --shared ] | ||
+ | [ --separator String ] | ||
+ | [ --unbuffered ] | ||
+ | [ --units r|R|h|H|b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | [ VG|Tag ... ] | ||
+ | |||
+ | Common options for lvm: | ||
+ | [ -d|--debug ] | ||
+ | [ -h|--help ] | ||
+ | [ -q|--quiet ] | ||
+ | [ -v|--verbose ] | ||
+ | [ -y|--yes ] | ||
+ | [ -t|--test ] | ||
+ | [ --commandprofile String ] | ||
+ | [ --config String ] | ||
+ | [ --driverloaded y|n ] | ||
+ | [ --nolocking ] | ||
+ | [ --lockopt String ] | ||
+ | [ --longhelp ] | ||
+ | [ --profile String ] | ||
+ | [ --version ] | ||
+ | |||
+ | Use --longhelp to show all options and advanced commands. | ||
</ | </ | ||
- | ===Options de la commande=== | + | ===Logical Volumes (LV)=== |
- | Les options de cette commande | + | Pour créer un **Logical Volume** dénommé **lv0** dans le **Volume Group** **vg0**, il convient d' |
< | < | ||
- | [root@centos8 ~]# smartctl | + | [root@centos8 ~]# lvcreate |
- | smartctl 7.1 2020-04-05 r5049 [x86_64-linux-4.18.0-305.7.1.el8_4.x86_64] (local build) | + | |
- | Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org | + | Logical volume " |
+ | </ | ||
- | Usage: smartctl [options] device | + | <WRAP center round important 60%> |
+ | **Important** -Notez que la taille du LV est un multiple du PE. | ||
+ | </ | ||
- | ============================================ SHOW INFORMATION OPTIONS ===== | + | Les options de la commande **lvcreate** sont : |
- | -h, --help, --usage | + | < |
- | | + | [root@centos8 ~]# lvcreate |
+ | lvcreate | ||
- | -V, --version, | + | |
- | Print license, copyright, and version information and exit | + | lvcreate |
+ | [ -l|--extents Number[PERCENT] ] | ||
+ | [ | ||
+ | [ COMMON_OPTIONS ] | ||
+ | [ PV ... ] | ||
- | -i, --info | + | |
- | Show identity information for device | + | lvcreate |
+ | [ -l|--extents Number[PERCENT] ] | ||
+ | [ -I|--stripesize Size[k|UNIT] ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | [ PV ... ] | ||
- | --identify[=[w][nvb]] | + | |
- | Show words and bits from IDENTIFY DEVICE data (ATA) | + | lvcreate -m|--mirrors Number -L|--size Size[m|UNIT] VG |
+ | [ -l|--extents Number[PERCENT] ] | ||
+ | [ -R|--regionsize Size[m|UNIT] ] | ||
+ | [ --mirrorlog core|disk ] | ||
+ | [ --minrecoveryrate Size[k|UNIT] ] | ||
+ | [ --maxrecoveryrate Size[k|UNIT] ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | [ PV ... ] | ||
- | | + | |
- | Get device setting: all, aam, apm, dsn, lookahead, security, | + | lvcreate |
- | | + | [ -l|--extents Number[PERCENT] ] |
+ | [ -m|--mirrors Number ] | ||
+ | [ -i|--stripes Number ] | ||
+ | [ -I|--stripesize Size[k|UNIT] ] | ||
+ | [ -R|--regionsize Size[m|UNIT] ] | ||
+ | [ --minrecoveryrate Size[k|UNIT] ] | ||
+ | [ --maxrecoveryrate Size[k|UNIT] ] | ||
+ | [ --raidintegrity y|n ] | ||
+ | [ --raidintegritymode String ] | ||
+ | [ --raidintegrityblocksize Number ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | [ PV ... ] | ||
- | | + | |
- | Show all SMART information for device | + | lvcreate |
+ | [ -l|--extents Number[PERCENT] ] | ||
+ | [ -I|--stripesize Size[k|UNIT] ] | ||
+ | [ -R|--regionsize Size[m|UNIT] ] | ||
+ | [ --minrecoveryrate Size[k|UNIT] ] | ||
+ | [ --maxrecoveryrate Size[k|UNIT] ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | [ PV ... ] | ||
- | -x, --xall | + | |
- | Show all information for device | + | lvcreate |
+ | [ -l|--extents Number[PERCENT] ] | ||
+ | [ -i|--stripes Number ] | ||
+ | [ -I|--stripesize Size[k|UNIT] ] | ||
+ | [ -c|--chunksize Size[k|UNIT] ] | ||
+ | [ --type snapshot ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | [ PV ... ] | ||
- | --scan | + | |
- | Scan for devices | + | lvcreate |
+ | [ -l|--extents Number[PERCENT] ] | ||
+ | [ -c|--chunksize Size[k|UNIT] ] | ||
+ | [ -i|--stripes Number ] | ||
+ | [ -I|--stripesize Size[k|UNIT] ] | ||
+ | [ --thinpool LV_new ] | ||
+ | [ --poolmetadatasize Size[m|UNIT] ] | ||
+ | [ --poolmetadataspare y|n ] | ||
+ | [ --discards passdown|nopassdown|ignore ] | ||
+ | [ --errorwhenfull y|n ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | [ PV ... ] | ||
- | --scan-open | + | |
- | Scan for devices and try to open each device | + | lvcreate |
+ | [ -l|--extents Number[PERCENT] ] | ||
+ | [ -H|--cache ] | ||
+ | [ -c|--chunksize Size[k|UNIT] ] | ||
+ | [ --poolmetadatasize Size[m|UNIT] ] | ||
+ | [ --poolmetadataspare y|n ] | ||
+ | [ --cachemode writethrough|writeback|passthrough ] | ||
+ | [ --cachepolicy String ] | ||
+ | [ --cachesettings String ] | ||
+ | [ --cachemetadataformat auto|1|2 ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | [ PV ... ] | ||
- | ================================== SMARTCTL RUN-TIME BEHAVIOR OPTIONS ===== | + | Create a thin LV in a thin pool (infers |
+ | lvcreate -V|--virtualsize Size[m|UNIT] --thinpool LV_thinpool VG | ||
+ | [ -T|--thin ] | ||
+ | [ --type thin ] | ||
+ | [ --discards passdown|nopassdown|ignore ] | ||
+ | [ --errorwhenfull y|n ] | ||
+ | [ COMMON_OPTIONS ] | ||
- | -j, --json[=[cgiosuv]] | + | |
- | Print output in JSON format | + | (infers |
+ | lvcreate | ||
+ | [ | ||
+ | [ | ||
+ | [ --errorwhenfull y|n ] | ||
+ | [ COMMON_OPTIONS ] | ||
- | -q TYPE, --quietmode=TYPE | + | |
- | Set smartctl quiet mode to one of: errorsonly, silent, noserial | + | lvcreate |
+ | [ -T|--thin ] | ||
+ | [ -c|--chunksize Size[k|UNIT] ] | ||
+ | [ --poolmetadatasize Size[m|UNIT] ] | ||
+ | [ --poolmetadataspare y|n ] | ||
+ | [ --discards passdown|nopassdown|ignore ] | ||
+ | [ --errorwhenfull y|n ] | ||
+ | [ COMMON_OPTIONS ] | ||
- | -d TYPE, --device=TYPE | + | |
- | | + | lvcreate |
- | ata, scsi[+TYPE], nvme[,NSID], sat[,auto][,N][+TYPE], usbcypress[,X], usbjmicron[,p][,x][,N], usbprolific, | + | [ -l|--extents Number[PERCENT] ] |
+ | [ -V|--virtualsize Size[m|UNIT] ] | ||
+ | [ -i|--stripes Number | ||
+ | [ -I|--stripesize Size[k|UNIT] ] | ||
+ | [ | ||
+ | [ | ||
+ | [ | ||
+ | [ | ||
+ | [ COMMON_OPTIONS | ||
+ | [ PV ... ] | ||
- | -T TYPE, --tolerance=TYPE | + | |
- | Tolerance: normal, conservative, | + | where the new thin pool is named by the --thinpool arg. |
+ | lvcreate --type thin -V|--virtualsize Size[m|UNIT] -L|--size Size[m|UNIT] --thinpool LV_new | ||
+ | [ -l|--extents Number[PERCENT] ] | ||
+ | [ -T|--thin ] | ||
+ | [ -c|--chunksize Size[k|UNIT] ] | ||
+ | [ -i|--stripes Number ] | ||
+ | [ -I|--stripesize Size[k|UNIT] ] | ||
+ | [ --poolmetadatasize Size[m|UNIT] ] | ||
+ | [ --poolmetadataspare y|n ] | ||
+ | [ --discards passdown|nopassdown|ignore ] | ||
+ | [ --errorwhenfull y|n ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | [ PV ... ] | ||
- | | + | |
- | Set action on bad checksum to one of: warn, exit, ignore | + | which converts the new LV to type cache. |
+ | lvcreate | ||
+ | [ -l|--extents Number[PERCENT] ] | ||
+ | [ -H|--cache ] | ||
+ | [ -c|--chunksize Size[k|UNIT] ] | ||
+ | [ -i|--stripes Number ] | ||
+ | [ -I|--stripesize Size[k|UNIT] ] | ||
+ | [ --poolmetadatasize Size[m|UNIT] ] | ||
+ | [ --poolmetadataspare y|n ] | ||
+ | [ --cachemode writethrough|writeback|passthrough ] | ||
+ | [ --cachepolicy String ] | ||
+ | [ --cachesettings String ] | ||
+ | [ --cachemetadataformat auto|1|2 ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | [ PV ... ] | ||
- | | + | |
- | Report transactions (see man page) | + | which converts the new LV to type cache. |
+ | lvcreate | ||
+ | [ -l|--extents Number[PERCENT] ] | ||
+ | [ -c|--chunksize Size[k|UNIT] ] | ||
+ | [ -i|--stripes Number ] | ||
+ | [ -I|--stripesize Size[k|UNIT] ] | ||
+ | [ --cachemode writethrough|writeback|passthrough ] | ||
+ | [ --cachepolicy String ] | ||
+ | [ --cachesettings String ] | ||
+ | [ --cachemetadataformat auto|1|2 ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | [ PV ... ] | ||
- | -n MODE[,STATUS], --nocheck=MODE[,STATUS] (ATA) | + | |
- | No check if: never, sleep, standby, idle (see man page) | + | the specified cache device, which converts the |
+ | new LV to type cache. | ||
+ | lvcreate --type cache -L|--size Size[m|UNIT] --cachedevice PV VG | ||
+ | [ -l|--extents Number[PERCENT] | ||
+ | [ -c|--chunksize Size[k|UNIT] ] | ||
+ | [ -i|--stripes Number ] | ||
+ | [ -I|--stripesize Size[k|UNIT] ] | ||
+ | [ --cachemode writethrough|writeback|passthrough ] | ||
+ | [ --cachepolicy String ] | ||
+ | [ --cachesettings String ] | ||
+ | [ --cachemetadataformat auto|1|2 ] | ||
+ | [ --cachesize Size[m|UNIT] ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | [ PV ... ] | ||
- | ============================== DEVICE FEATURE ENABLE/ | + | Create a new LV, then attach the specified cachevol |
+ | which converts the new LV to type writecache. | ||
+ | lvcreate --type writecache -L|--size Size[m|UNIT] --cachevol LV VG | ||
+ | [ -l|--extents Number[PERCENT] ] | ||
+ | [ -i|--stripes Number ] | ||
+ | [ -I|--stripesize Size[k|UNIT] ] | ||
+ | [ --cachesettings String ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | [ PV ... ] | ||
- | | + | |
- | | + | the specified cache device, which converts the |
+ | new LV to type writecache. | ||
+ | lvcreate | ||
+ | [ -l|--extents Number[PERCENT] ] | ||
+ | [ -i|--stripes Number ] | ||
+ | [ -I|--stripesize Size[k|UNIT] ] | ||
+ | [ --cachesize Size[m|UNIT] ] | ||
+ | [ --cachesettings String ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | [ PV ... ] | ||
- | -o VALUE, | + | |
- | | + | [ -a|--activate y|n|ay ] |
+ | [ -A|--autobackup y|n ] | ||
+ | [ -C|--contiguous y|n ] | ||
+ | [ -M|--persistent y|n ] | ||
+ | [ -j|--major Number ] | ||
+ | [ -k|--setactivationskip y|n ] | ||
+ | [ -K|--ignoreactivationskip ] | ||
+ | [ -n|--name String ] | ||
+ | [ -p|--permission rw|r ] | ||
+ | [ -r|--readahead auto|none|Number ] | ||
+ | [ -W|--wipesignatures y|n ] | ||
+ | [ -Z|--zero y|n ] | ||
+ | [ --addtag Tag ] | ||
+ | [ --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit ] | ||
+ | [ --ignoremonitoring ] | ||
+ | [ --metadataprofile String ] | ||
+ | [ --minor Number ] | ||
+ | [ --monitor y|n ] | ||
+ | [ --nosync ] | ||
+ | [ --noudevsync ] | ||
+ | [ --reportformat basic|json ] | ||
- | -S VALUE, | + | |
- | | + | [ -d|--debug ] |
+ | [ -h|--help ] | ||
+ | [ -q|--quiet ] | ||
+ | [ -v|--verbose ] | ||
+ | [ -y|--yes ] | ||
+ | [ -t|--test ] | ||
+ | [ --commandprofile String ] | ||
+ | [ --config String ] | ||
+ | [ --driverloaded y|n ] | ||
+ | [ --nolocking ] | ||
+ | [ --lockopt String ] | ||
+ | [ --longhelp ] | ||
+ | [ --profile String ] | ||
+ | [ --version ] | ||
- | -s NAME[, | + | |
- | | + | </code> |
- | dsn, | + | |
- | standby, | + | |
- | wcreorder, | + | |
- | ======================================= READ AND DISPLAY DATA OPTIONS ===== | + | Créez maintenant un répertoire dans /mnt pour monter lv0 : |
- | -H, --health | + | < |
- | Show device SMART health status | + | [root@centos8 ~]# mkdir /mnt/lvm |
+ | </ | ||
- | -c, --capabilities | + | Créez un système de fichiers en **ext3** sur / |
- | Show device SMART capabilities | + | |
- | | + | < |
- | Show device SMART vendor-specific Attributes | + | [root@centos8 ~]# mke2fs |
+ | mke2fs 1.45.6 (20-Mar-2020) | ||
+ | Creating filesystem with 360448 1k blocks | ||
+ | Filesystem UUID: 87b6d526-d379-4e0c-8984-94811f1cee33 | ||
+ | Superblock backups stored on blocks: | ||
+ | 8193, 24577, 40961, 57345, 73729, 204801, 221185 | ||
- | -f FORMAT, --format=FORMAT | + | Allocating group tables: done |
- | Set output format for attributes: old, brief, hex[, | + | Writing inode tables: done |
+ | Creating journal | ||
+ | Writing superblocks and filesystem accounting information: done | ||
+ | </ | ||
- | -l TYPE, --log=TYPE | + | Montez votre lv0 : |
- | 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) | + | [root@centos8 ~]# mount -t ext3 / |
+ | </ | ||
- | -F TYPE, --firmwarebug=TYPE | + | Vous allez maintenant copier le contenu de votre répertoire /home vers /mnt/lvm. |
- | Use firmware bug workaround: | + | |
- | none, nologdir, samsung, samsung2, samsung3, xerrorlba, swapid | + | |
- | -P TYPE, --presets=TYPE | + | Saisissez donc la commande pour copier le contenu de /home : |
- | Drive-specific presets: use, ignore, show, showall | + | |
- | -B [+]FILE, --drivedb=[+]FILE | + | < |
- | Read and replace [add] drive database from FILE | + | [root@centos8 ~]# cp -a /home /mnt/lvm |
- | [default is +/etc/smartmontools/smart_drivedb.h | + | </code> |
- | and then | + | |
- | ============================================ DEVICE SELF-TEST OPTIONS ===== | + | Constatez ensuite le contenu de /mnt/lvm : |
- | | + | < |
- | Run test. TEST: offline, short, long, conveyance, force, vendor,N, | + | [root@centos8 ~]# ls -l /mnt/lvm |
- | | + | total 14 |
+ | drwxr-xr-x. 5 root root 1024 Apr 20 14:35 home | ||
+ | drwx------. 2 root root 12288 May 26 17:00 lost+found | ||
+ | </ | ||
- | -C, --captive | + | Une particularité du volume logique est la capacité de d' |
- | Do test in captive mode (along with -t) | + | |
- | -X, --abort | + | < |
- | Abort any non-captive test on device | + | [root@centos8 ~]# df -h /mnt/lvm |
+ | Filesystem | ||
+ | / | ||
+ | </ | ||
- | =================================================== SMARTCTL EXAMPLES ===== | + | Dans la cas de notre exemple, la taille est de **333 Mo** avec **17 Mo** occupé. |
- | smartctl | + | ====LAB #4 - Etendre un Volume Logique à Chaud==== |
- | smartctl --smart=on --offlineauto=on --saveauto=on /dev/sda | + | Pour agrandir un volume logique, le paquet **lvm2** contient les commandes **lvextend** et **resize2fs** : |
- | (Enables SMART on first disk) | + | |
- | smartctl --test=long / | + | < |
- | + | [root@centos8 ~]# lvextend | |
- | smartctl --attributes --log=selftest --quietmode=errorsonly | + | |
- | (Prints Self-Test & Attribute errors) | + | |
- | smartctl --all --device=3ware, | + | |
- | | + | |
- | | + | |
- | smartctl --all --device=3ware, | + | |
- | | + | |
- | smartctl --all --device=hpt, | + | |
- | | + | |
- | of the 1st channel on the 1st HighPoint RAID controller) | + | |
- | | + | |
- | (Prints all SMART info for 3rd ATA disk of the 1st enclosure | + | |
- | on Areca RAID controller) | + | |
</ | </ | ||
- | ====1.9 - Les Commandes accton et dump-acct==== | + | <WRAP center round important 60%> |
+ | **Important** - Notez que l' | ||
+ | </ | ||
- | Cette commande permet d' | + | Les options de la commande **lvextend** sont : |
< | < | ||
- | [root@centos8 ~]# accton on | + | [root@centos8 ~]# lvextend |
- | Turning on process accounting, file set to the default '/ | + | |
- | [root@centos8 ~]# systemctl status psacct | + | |
- | ● psacct.service | + | |
- | Loaded: loaded (/ | + | |
- | | + | |
- | ...skipping... | + | |
- | ● psacct.service | + | |
- | | + | |
- | | + | |
- | [root@centos8 ~]# systemctl enable psacct | + | Extend an LV by a specified size. |
- | Created symlink / | + | lvextend -L|--size |
+ | [ -l|--extents [+]Number[PERCENT] ] | ||
+ | [ -r|--resizefs ] | ||
+ | [ -i|--stripes Number ] | ||
+ | [ -I|--stripesize Size[k|UNIT] ] | ||
+ | [ --poolmetadatasize [+]Size[m|UNIT] ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | [ PV ... ] | ||
- | [root@centos8 ~]# systemctl start psacct | + | Extend an LV by specified PV extents. |
+ | lvextend LV PV ... | ||
+ | [ -r|--resizefs ] | ||
+ | [ -i|--stripes Number ] | ||
+ | [ -I|--stripesize Size[k|UNIT] ] | ||
+ | [ COMMON_OPTIONS | ||
- | [root@centos8 ~]# systemctl status psacct | + | Extend a pool metadata SubLV by a specified size. |
- | ● psacct.service | + | lvextend --poolmetadatasize [+]Size[m|UNIT] LV_thinpool |
- | | + | [ -i|--stripes Number ] |
- | | + | [ -I|--stripesize Size[k|UNIT] ] |
- | | + | [ COMMON_OPTIONS ] |
- | Process: 39763 ExecStartPre=/ | + | [ PV ... ] |
- | Main PID: 39765 (code=exited, | + | |
- | Nov 13 09:35:16 centos8.ittraining.loc systemd[1]: Starting Kernel process accounting> | + | Extend an LV according to a predefined policy. |
- | Nov 13 09:35:16 centos8.ittraining.loc accton[39765]: Turning on process accounting, > | + | lvextend --usepolicies LV_snapshot_thinpool |
- | Nov 13 09:35:16 centos8.ittraining.loc systemd[1]: Started Kernel process accounting. | + | [ -r|--resizefs |
- | </ | + | [ COMMON_OPTIONS |
+ | [ PV ... ] | ||
- | Par contre le fichier **/ | + | Common options for command: |
+ | [ -A|--autobackup y|n ] | ||
+ | [ -f|--force ] | ||
+ | [ -m|--mirrors Number ] | ||
+ | [ -n|--nofsck ] | ||
+ | [ --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit ] | ||
+ | [ --nosync ] | ||
+ | [ --noudevsync ] | ||
+ | [ --reportformat basic|json ] | ||
+ | [ --type linear|striped|snapshot|mirror|raid|thin|cache|vdo|thin-pool|cache-pool|vdo-pool ] | ||
- | < | + | Common options for lvm: |
- | [root@centos8 ~]# cat / | + | [ -d|--debug ] |
- | #pcKaccton pcEusleep%$pcu, | + | [ -h|--help ] |
+ | [ -q|--quiet ] | ||
+ | [ -v|--verbose ] | ||
+ | [ -y|--yes ] | ||
+ | [ -t|--test ] | ||
+ | [ | ||
+ | [ | ||
+ | [ | ||
+ | [ | ||
+ | [ | ||
+ | [ | ||
+ | [ | ||
+ | [ | ||
+ | |||
+ | Use --longhelp to show all options and advanced commands. | ||
</ | </ | ||
- | La commande **dump-acct** permet de voir son contenu mais pas de l'exploiter | + | Le volume ayant été agrandi, il est necessaire maintenant d'agrandir le filesystem qui s'y trouve |
< | < | ||
- | [root@centos8 ~]# dump-acct | + | [root@centos8 ~]# resize2fs |
- | accton | + | resize2fs |
- | sleep | + | Filesystem at /dev/vg0/lv0 is mounted on /mnt/lvm; on-line resizing required |
- | awk | + | old_desc_blocks = 2, new_desc_blocks = 2 |
- | ksmtuned | + | The filesystem on / |
- | pgrep | + | |
- | ksmtuned | + | |
- | ksmtuned | + | |
- | awk | + | |
- | ksmtuned | + | |
- | less |v3| | + | |
- | systemctl | + | |
- | sleep | + | |
- | awk | + | |
- | ksmtuned | + | |
- | pgrep | + | |
- | ksmtuned | + | |
- | ksmtuned | + | |
- | awk | + | |
- | ksmtuned | + | |
- | rpc-pipefs-gene |v3| | + | |
- | nfs-server-gene |v3| | + | |
- | systemd-cryptse |v3| | + | |
- | systemd-system- |v3| | + | |
- | systemd-hiberna |v3| | + | |
- | ... | + | |
</ | </ | ||
- | ===Options de la commande=== | + | Constatez maintenant |
- | + | ||
- | Les options | + | |
< | < | ||
- | [root@centos8 ~]# dump-acct --help | + | [root@centos8 ~]# df -h /mnt/lvm |
- | Usage: dump-acct [-hrR] [-n < | + | Filesystem |
- | [--num < | + | / |
- | [--format < | + | |
- | [--ahz < | + | |
- | + | ||
- | The system' | + | |
</ | </ | ||
- | ====1.10 - La Commande lastcomm==== | + | Vous noterez que la taille a augmentée mais que les données sont toujours présentes. |
- | Cette commande vous renseigne sur l' | + | ====LAB #5 - Snapshots==== |
- | < | + | Un snapshot est un instantané d'un système de fichiers. Dans cet exemple, vous allez créer un snapshot de votre lv0 : |
- | [root@centos8 ~]# lastcomm | + | |
- | bash F root | + | |
- | gdbus X root | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | kworker/ | + | |
- | ksmtuned | + | |
- | ksmtuned | + | |
- | pgrep root | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | sleep root | + | |
- | kworker/ | + | |
- | kworker/ | + | |
- | kworker/ | + | |
- | dump-acct | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | ksmtuned | + | |
- | ksmtuned | + | |
- | pgrep root | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | sleep root | + | |
- | dump-acct | + | |
- | man root | + | |
- | less | + | |
- | kworker/ | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | ksmtuned | + | |
- | ksmtuned | + | |
- | pgrep root | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | sleep root | + | |
- | man | + | |
- | nroff root | + | |
- | groff root | + | |
- | grotty | + | |
- | troff root | + | |
- | nroff | + | |
- | locale | + | |
- | tbl root | + | |
- | preconv | + | |
- | man | + | |
- | man | + | |
- | man | + | |
- | man | + | |
- | man | + | |
- | man | + | |
- | man | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | ksmtuned | + | |
- | ksmtuned | + | |
- | pgrep root | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | sleep root | + | |
- | dump-acct | + | |
- | kworker/ | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | ksmtuned | + | |
- | ksmtuned | + | |
- | pgrep root | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | sleep root | + | |
- | cat root | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | ksmtuned | + | |
- | ksmtuned | + | |
- | pgrep root | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | sleep root | + | |
- | kworker/ | + | |
- | systemctl | + | |
- | less | + | |
- | systemd-cgroups | + | |
- | systemd-cgroups | + | |
- | systemctl | + | |
- | systemd-tty-ask | + | |
- | accton | + | |
- | accton | + | |
- | accton-create | + | |
- | systemctl | + | |
- | (sd-executor) | + | |
- | systemd-gpt-aut | + | |
- | systemd-getty-g | + | |
- | systemd-veritys | + | |
- | systemd-sysv-ge | + | |
- | systemd-debug-g | + | |
- | selinux-autorel | + | |
- | grep | + | |
- | ostree-system-g | + | |
- | systemd-rc-loca | + | |
- | anaconda-genera | + | |
- | lvm2-activation | + | |
- | kdump-dep-gener | + | |
- | selinuxenabled | + | |
- | lvmconfig | + | |
- | grep | + | |
- | readlink | + | |
- | systemd-fstab-g | + | |
- | systemd-hiberna | + | |
- | systemd-system- | + | |
- | systemd-cryptse | + | |
- | nfs-server-gene | + | |
- | rpc-pipefs-gene | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | ksmtuned | + | |
- | ksmtuned | + | |
- | pgrep root | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | sleep root | + | |
- | systemctl | + | |
- | less | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | ksmtuned | + | |
- | ksmtuned | + | |
- | pgrep root | + | |
- | ksmtuned | + | |
- | awk root | + | |
- | sleep root | + | |
- | accton | + | |
- | [root@centos8 ~]# lastcomm grep | + | Avant de commencer, créez un fichier de 10Mo dans le volume : |
- | grep | + | |
- | grep | + | < |
- | grep | + | [root@centos8 ~]# dd if=/dev/zero of=/ |
- | grep | + | 10+0 records in |
+ | 10+0 records out | ||
+ | 10485760 bytes (10 MB, 10 MiB) copied, | ||
</ | </ | ||
- | ===Options de la commande=== | + | Créez maintenant un snapshot |
- | + | ||
- | Les options de cette commande sont : | + | |
< | < | ||
- | [root@centos8 ~]# lastcomm | + | [root@centos8 ~]# lvcreate |
- | Usage: lastcomm [-hpV] [-f file] [command] ... [user] ... [terminal] ... | + | Rounding up size to full physical extent 24.00 MiB |
- | | + | Logical volume " |
- | | + | |
- | | + | |
- | + | ||
- | The system' | + | |
</ | </ | ||
- | ====1.11 - La Commande sa==== | + | Pour avoir une confirmation de la création du snapshot, utilisez la commande |
- | + | ||
- | Cette commande | + | |
< | < | ||
- | [root@centos8 ~]# sa -u | egrep " | + | [root@centos8 ~]# lvs |
- | root | + | |
- | root | + | root cl_centos8 |
- | root 0.00 cpu | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 11276k mem 0 io pgrep | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6528k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6344k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 2426k mem 0 io less | + | |
- | root 0.00 cpu 23376k mem 0 io systemctl | + | |
- | root 0.00 cpu 1827k mem 0 io sleep | + | |
- | root 0.00 cpu 6378k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 11276k mem 0 io pgrep | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6528k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6344k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 9688k mem 0 io rpc-pipefs-gene | + | |
- | root 0.00 cpu 9720k mem 0 io nfs-server-gene | + | |
- | root 0.00 cpu 22592k mem 0 io systemd-cryptse | + | |
- | root 0.00 cpu 22592k mem 0 io systemd-system- | + | |
- | root 0.00 cpu 22592k mem 0 io systemd-hiberna | + | |
- | root 0.00 cpu 22592k mem 0 io systemd-fstab-g | + | |
- | root 0.00 cpu 1098k mem 0 io readlink | + | |
- | root 0.00 cpu 2302k mem 0 io grep | + | |
- | root 0.00 cpu 16260k mem 0 io lvmconfig | + | |
- | root 0.00 cpu 3350k mem 0 io selinuxenabled | + | |
- | root 0.00 cpu | + | |
- | root 0.00 cpu 8406k mem 0 io lvm2-activation | + | |
- | root 0.00 cpu 5764k mem 0 io anaconda-genera | + | |
- | root 0.00 cpu 22592k mem 0 io systemd-rc-loca | + | |
- | root 0.01 cpu 38192k mem 0 io ostree-system-g | + | |
- | root 0.00 cpu 2302k mem 0 io grep | + | |
- | root 0.00 cpu 5764k mem 0 io selinux-autorel | + | |
- | root 0.00 cpu 22592k mem 0 io systemd-debug-g | + | |
- | root 0.00 cpu 22592k mem 0 io systemd-sysv-ge | + | |
- | root 0.00 cpu 22592k mem 0 io systemd-veritys | + | |
- | root 0.00 cpu 22592k mem 0 io systemd-getty-g | + | |
- | root 0.00 cpu 22592k mem 0 io systemd-gpt-aut | + | |
- | root 0.00 cpu 63728k mem 0 io (sd-executor) | + | |
- | root 0.00 cpu 23632k mem 0 io systemctl | + | |
- | root 0.00 cpu 6496k mem 0 io accton-create | + | |
- | root 0.00 cpu 0k mem 0 io accton | + | |
- | root 0.00 cpu 1090k mem 0 io accton | + | |
- | root 0.00 cpu 22592k mem 0 io systemd-tty-ask | + | |
- | root 0.00 cpu 23376k mem 0 io systemctl | + | |
- | root 0.00 cpu 22592k mem 0 io systemd-cgroups | + | |
- | root 0.00 cpu 22592k mem 0 io systemd-cgroups | + | |
- | root 0.00 cpu 2426k mem 0 io less | + | |
- | root 0.00 cpu 23376k mem 0 io systemctl | + | |
- | root 0.00 cpu 0k mem 0 io kworker/ | + | |
- | root 0.00 cpu 1827k mem 0 io sleep | + | |
- | root 0.00 cpu 6378k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 11276k mem 0 io pgrep | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6528k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6344k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 1828k mem 0 io cat | + | |
- | root 0.00 cpu 1827k mem 0 io sleep | + | |
- | root 0.00 cpu 6378k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 11276k mem 0 io pgrep | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6528k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6344k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 0k mem 0 io kworker/ | + | |
- | root 0.00 cpu 1994k mem 0 io dump-acct | + | |
- | root 0.00 cpu 1827k mem 0 io sleep | + | |
- | root 0.00 cpu 6378k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 11276k mem 0 io pgrep | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6528k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6344k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 4582k mem 0 io man * | + | |
- | root 0.00 cpu 4804k mem 0 io man * | + | |
- | root 0.00 cpu 4804k mem 0 io man * | + | |
- | root 0.00 cpu 4804k mem 0 io man * | + | |
- | root 0.00 cpu 4804k mem 0 io man * | + | |
- | root 0.00 cpu 4804k mem 0 io man * | + | |
- | root 0.00 cpu 4844k mem 0 io man * | + | |
- | root 0.00 cpu 4186k mem 0 io preconv | + | |
- | root 0.00 cpu 3476k mem 0 io tbl | + | |
- | root 0.00 cpu 1831k mem 0 io locale | + | |
- | root 0.00 cpu 3182k mem 0 io nroff * | + | |
- | root 0.00 cpu 4186k mem 0 io troff | + | |
- | root 0.00 cpu 3674k mem 0 io grotty | + | |
- | root 0.00 cpu 3496k mem 0 io groff | + | |
- | root 0.00 cpu 3182k mem 0 io nroff | + | |
- | root 0.00 cpu 4804k mem 0 io man * | + | |
- | root 0.00 cpu 1827k mem 0 io sleep | + | |
- | root 0.00 cpu 6378k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 11276k mem 0 io pgrep | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6528k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6344k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 0k mem 0 io kworker/ | + | |
- | root 0.00 cpu 2426k mem 0 io less | + | |
- | root 0.01 cpu 4770k mem 0 io man | + | |
- | root 0.00 cpu 1994k mem 0 io dump-acct | + | |
- | root 0.00 cpu 1827k mem 0 io sleep | + | |
- | root 0.00 cpu 6378k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 11276k mem 0 io pgrep | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6528k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6344k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 2094k mem 0 io dump-acct | + | |
- | root 0.00 cpu 0k mem 0 io kworker/ | + | |
- | root 0.00 cpu 0k mem 0 io kworker/ | + | |
- | root 0.00 cpu 0k mem 0 io kworker/ | + | |
- | root 0.00 cpu 1827k mem 0 io sleep | + | |
- | root 0.00 cpu 6378k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 11276k mem 0 io pgrep | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6528k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 0k mem 0 io kworker/ | + | |
- | root 0.00 cpu 6344k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 93648k mem 0 io gdbus | + | |
- | root 0.00 cpu 6888k mem 0 io bash * | + | |
- | root 0.00 cpu 5410k mem 0 io lastcomm | + | |
- | root 0.00 cpu 1827k mem 0 io sleep | + | |
- | root 0.00 cpu 6378k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 11276k mem 0 io pgrep | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6528k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6344k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 4570k mem 0 io man * | + | |
- | root 0.00 cpu 4804k mem 0 io man * | + | |
- | root 0.00 cpu 4804k mem 0 io man * | + | |
- | root 0.00 cpu 4804k mem 0 io man * | + | |
- | root 0.00 cpu 4804k mem 0 io man * | + | |
- | root 0.00 cpu 4804k mem 0 io man * | + | |
- | root 0.00 cpu 4844k mem 0 io man * | + | |
- | root 0.00 cpu 4186k mem 0 io preconv | + | |
- | root 0.00 cpu 3476k mem 0 io tbl | + | |
- | root 0.00 cpu 1831k mem 0 io locale | + | |
- | root 0.00 cpu 3182k mem 0 io nroff * | + | |
- | root 0.00 cpu 4186k mem 0 io troff | + | |
- | root 0.00 cpu 3706k mem 0 io grotty | + | |
- | root 0.00 cpu 3496k mem 0 io groff | + | |
- | root 0.00 cpu 3182k mem 0 io nroff | + | |
- | root 0.00 cpu 4804k mem 0 io man * | + | |
- | root 0.00 cpu 1827k mem 0 io sleep | + | |
- | root 0.00 cpu 6378k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 11276k mem 0 io pgrep | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6528k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6344k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 2426k mem 0 io less | + | |
- | root 0.00 cpu 4770k mem 0 io man | + | |
- | root 0.00 cpu 4604k mem 0 io man * | + | |
- | root 0.00 cpu 4760k mem 0 io man * | + | |
- | root 0.00 cpu 4804k mem 0 io man * | + | |
- | root 0.00 cpu 4804k mem 0 io man * | + | |
- | root 0.00 cpu 4804k mem 0 io man * | + | |
- | root 0.00 cpu 4804k mem 0 io man * | + | |
- | root 0.00 cpu 4804k mem 0 io man * | + | |
- | root 0.00 cpu 4844k mem 0 io man * | + | |
- | root 0.00 cpu 4186k mem 0 io preconv | + | |
- | root 0.00 cpu 3476k mem 0 io tbl | + | |
- | root 0.00 cpu 1831k mem 0 io locale | + | |
- | root 0.00 cpu 3182k mem 0 io nroff * | + | |
- | root 0.00 cpu 4186k mem 0 io troff | + | |
- | root 0.00 cpu 3700k mem 0 io grotty | + | |
- | root 0.00 cpu 3496k mem 0 io groff | + | |
- | root 0.00 cpu 3182k mem 0 io nroff | + | |
- | root 0.00 cpu 4804k mem 0 io man * | + | |
- | root 0.00 cpu 1827k mem 0 io sleep | + | |
- | root 0.00 cpu 6378k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 11276k mem 0 io pgrep | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6528k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6344k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 1827k mem 0 io sleep | + | |
- | root 0.00 cpu 6378k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 11276k mem 0 io pgrep | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6528k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6344k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 0k mem 0 io kworker/ | + | |
- | root 0.00 cpu 2426k mem 0 io less | + | |
- | root 0.00 cpu 4770k mem 0 io man | + | |
- | root 0.00 cpu 5312k mem 0 io sa | + | |
- | root 0.00 cpu 3034k mem 0 io grep | + | |
- | root 0.00 cpu 5312k mem 0 io sa | + | |
- | root 0.00 cpu 1827k mem 0 io sleep | + | |
- | root 0.00 cpu 6378k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 11276k mem 0 io pgrep | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6528k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 6344k mem 0 io awk | + | |
- | root 0.00 cpu 6658k mem 0 io ksmtuned | + | |
- | root 0.00 cpu 0k mem 0 io kworker/ | + | |
</ | </ | ||
- | ===Options de la commande=== | + | <WRAP center round important 60%> |
+ | **Important** - Notez que le snapshot est créé dans le même VG que le LV d' | ||
+ | </ | ||
- | Les options de cette commande sont : | + | Les options de la commande |
< | < | ||
- | [root@centos8 ~]# sa --help | + | [root@centos8 ~]# lvs --help |
+ | lvs - Display information about logical volumes | ||
- | Usage: sa [ options ] [ file ] | + | lvs |
- | + | [ -H|--history | |
- | options: | + | [ -a|--all ] |
- | [--other-acct-file < | + | [ -o|--options String |
- | [--print-seconds] [--dont-read-summary-files] [--debug] | + | [ -S|--select String |
- | | + | [ -O|--sort String |
- | | + | [ --segments |
- | [--list-all-names] [--not-interactive] [--threshold <num>] | + | [ --aligned |
- | | + | [ --binary |
- | | + | [ --configreport log|vg|lv|pv|pvseg|seg |
- | | + | [ --foreign |
+ | [ --ignorelockingfailure | ||
+ | [ --logonly | ||
+ | [ --nameprefixes | ||
+ | [ --noheadings | ||
+ | [ --nosuffix | ||
+ | [ --readonly | ||
+ | [ --reportformat basic|json | ||
+ | [ --rows ] | ||
+ | [ --separator String | ||
+ | [ --shared | ||
+ | [ --unbuffered | ||
+ | [ --units r|R|h|H|b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E | ||
+ | [ --unquoted | ||
+ | [ COMMON_OPTIONS | ||
+ | [ VG|LV|Tag ... ] | ||
- | The system' | + | Common options for lvm: |
+ | [ -d|--debug ] | ||
+ | [ -h|--help ] | ||
+ | [ -q|--quiet ] | ||
+ | [ -v|--verbose ] | ||
+ | [ -y|--yes ] | ||
+ | [ -t|--test ] | ||
+ | [ --commandprofile String ] | ||
+ | [ --config String ] | ||
+ | [ --driverloaded y|n ] | ||
+ | [ --nolocking ] | ||
+ | [ --lockopt String ] | ||
+ | [ --longhelp ] | ||
+ | [ --profile String ] | ||
+ | [ --version ] | ||
- | | + | |
- | summary by command name: / | + | |
- | summary by username: / | + | |
</ | </ | ||
- | ====1.12 - La Commande ac==== | + | Créez maintenant un répertoire pour monter le snapshot |
- | + | ||
- | Cette commande vous renseigne sur les statistiques des temps de connexion des utilisateurs | + | |
< | < | ||
- | [root@centos8 ~]# ac -p | + | [root@centos8 ~]# mkdir / |
- | | + | </ |
- | total 247.51 | + | |
- | [root@centos8 ~]# ac -d | + | Montez le snapshot : |
- | Jun 16 total 6.41 | + | |
- | Jun 17 total | + | < |
- | Jul 19 total 6.94 | + | [root@centos8 ~]# mount / |
- | Jul 20 total | + | |
- | Sep 2 total 0.03 | + | |
- | Sep 3 total 0.01 | + | |
- | Sep 5 total | + | |
- | Oct 9 total 0.92 | + | |
- | Oct 11 total 4.17 | + | |
- | Oct 12 total 5.45 | + | |
- | Nov 7 total | + | |
- | Nov 8 total | + | |
- | Nov 9 total | + | |
- | Nov 10 total 8.48 | + | |
- | Nov 11 total 3.01 | + | |
- | Today | + | |
</ | </ | ||
- | ===Options de la commande=== | + | Comparez le volume d' |
- | Les options | + | < |
+ | [root@centos8 ~]# ls -l /mnt/lvm | ||
+ | total 10296 | ||
+ | -rw-r--r--. 1 root root 10485760 Jun 24 04:41 10M | ||
+ | drwxr-xr-x. 3 root root 1024 Jun 16 06:39 home | ||
+ | drwx------. 2 root root 12288 Jun 24 04:20 lost+found | ||
+ | [root@centos8 ~]# ls -l / | ||
+ | total 10296 | ||
+ | -rw-r--r--. 1 root root 10485760 Jun 24 04:41 10M | ||
+ | drwxr-xr-x. 3 root root 1024 Jun 16 06:39 home | ||
+ | drwx------. 2 root root 12288 Jun 24 04:20 lost+found | ||
+ | </ | ||
+ | |||
+ | Supprimez maintenant le fichier **10M** | ||
< | < | ||
- | [root@centos8 ~]# ac --help | + | [root@centos8 ~]# rm / |
+ | rm: remove regular file '/ | ||
+ | </ | ||
- | Usage: ac [OPTION] ... | + | Constatez le résultat de cette suppression |
- | OPTIONS: | + | <code> |
- | -d, --daily-totals | + | [root@centos8 ~]# df -Ph /mnt/lvm |
- | -p, --individual-totals | + | Filesystem |
- | -f, --file | + | / |
- | --complain | + | |
- | | + | |
- | --supplants | + | |
- | --timewarps | + | |
- | --compatibility | + | |
- | -a, --all-days | + | |
- | --tw-leniency < | + | |
- | --tw-suspicious < | + | |
- | --print-year | + | |
- | --print-zeros | + | |
- | --debug | + | |
- | -V, --version | + | |
- | -h, --help | + | |
- | The system' | + | [root@centos8 ~]# df -Ph /mnt/testsnap/ |
+ | Filesystem | ||
+ | / | ||
+ | |||
+ | [root@centos8 ~]# lvs | ||
+ | LV | ||
+ | root | ||
+ | swap | ||
+ | lv0 vg0 owi-aos--- 456.00m | ||
+ | testsnap vg0 swi-aos--- | ||
</ | </ | ||
- | =====LAB #2 - La commande sysctl===== | + | <WRAP center round todo 60%> |
+ | **A Faire** | ||
+ | </ | ||
- | ====2.1 - Répertoire /proc==== | + | ====LAB #6 - Suppression des Volumes==== |
- | Le répertoire /proc contient des fichiers et des répertoires virtuels. Le contenu de ces fichiers est créé dynamiquement lors de la consultation. Seul root peut consulter la totalité des informations dans le répertoire /proc. | + | La suppression d'un volume logique se fait grace à la commande **lvremove** : |
< | < | ||
- | [root@centos8 ~]# ls /proc | + | [root@centos8 ~]# umount / |
- | 1 16391 19 2212 2427 2622 431 | + | [root@centos8 ~]# lvremove / |
- | 10 | + | Do you really want to remove active logical volume vg0/ |
- | 1007 | + | |
- | 11 | + | [root@centos8 ~]# umount / |
- | 11805 16593 2 | + | [root@centos8 ~]# lvremove / |
- | 12 | + | Do you really want to remove active logical volume vg0/lv0? [y/n]: y |
- | 1219 | + | |
- | 1228 | + | |
- | 1232 | + | |
- | 1234 | + | |
- | 1235 | + | |
- | 1247 | + | |
- | 13 | + | |
- | 1307 | + | |
- | 1339 | + | |
- | 1356 | + | |
- | 14 | + | |
- | 1441 | + | |
- | 1443 | + | |
- | 1444 | + | |
- | 1446 | + | |
- | 14977 1828 | + | |
- | 15 | + | |
- | 15067 183 2167 2330 2571 422 | + | |
- | 1536 | + | |
- | 1553 | + | |
- | 15594 186 2187 2358 259 | + | |
- | 15735 187 2190 2373 2593 427 | + | |
- | 16 | + | |
- | 16165 1883 | + | |
- | 16167 1888 | + | |
</ | </ | ||
- | ===Fichiers=== | + | <WRAP center round important 60%> |
+ | **Important** - Notez que cette opération necéssite à ce que le volume logique soit démonté. | ||
+ | </ | ||
- | ==Processeur== | + | Les options de la commande **lvremove** sont : |
< | < | ||
- | [root@centos8 ~]# cat / | + | [root@centos8 ~]# lvremove --help |
- | processor | + | |
- | vendor_id | + | |
- | cpu family | + | |
- | model : 6 | + | |
- | model name : Common KVM processor | + | |
- | stepping | + | |
- | microcode | + | |
- | cpu MHz : 1999.987 | + | |
- | cache size : 16384 KB | + | |
- | physical id : 0 | + | |
- | siblings | + | |
- | core id : 0 | + | |
- | cpu cores : 4 | + | |
- | 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 | + | lvremove VG|LV|Tag|Select ... |
- | vendor_id | + | [ -A|--autobackup y|n ] |
- | cpu family | + | [ -f|--force ] |
- | model : 6 | + | [ -S|--select String ] |
- | model name : Common KVM processor | + | [ --nohistory ] |
- | stepping | + | [ --noudevsync ] |
- | microcode | + | [ --reportformat basic|json ] |
- | cpu MHz : 1999.987 | + | [ COMMON_OPTIONS ] |
- | cache size : 16384 KB | + | |
- | physical id : 0 | + | |
- | siblings | + | |
- | core id : 1 | + | |
- | cpu cores : 4 | + | |
- | 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 | + | [ -d|--debug ] |
- | cpu family | + | [ -h|--help ] |
- | model : 6 | + | [ -q|--quiet ] |
- | model name : Common | + | [ -v|--verbose ] |
- | stepping | + | [ -y|--yes ] |
- | microcode | + | [ -t|--test ] |
- | cpu MHz : 1999.987 | + | [ --commandprofile String ] |
- | cache size : 16384 KB | + | [ --config String ] |
- | physical id : 0 | + | [ --driverloaded y|n ] |
- | siblings | + | [ --nolocking ] |
- | core id : 2 | + | [ --lockopt String ] |
- | cpu cores : 4 | + | [ --longhelp ] |
- | apicid | + | [ --profile String ] |
- | initial apicid | + | [ --version ] |
- | fpu : | + | |
- | 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 : 1999.987 | + | |
- | cache size : 16384 KB | + | |
- | physical id : 0 | + | |
- | siblings | + | |
- | core id : 3 | + | |
- | cpu cores : 4 | + | |
- | 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 : 1999.987 | + | |
- | cache size : 16384 KB | + | |
- | physical id : 1 | + | |
- | siblings | + | |
- | core id : 0 | + | |
- | cpu cores : 4 | + | |
- | 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 : 1999.987 | + | |
- | cache size : 16384 KB | + | |
- | physical id : 1 | + | |
- | siblings | + | |
- | core id : 1 | + | |
- | cpu cores : 4 | + | |
- | 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 | + | |
- | power management: | + | |
- | processor | + | Le Volume Group peut aussi être supprimé |
- | vendor_id | + | |
- | cpu family | + | |
- | model : 6 | + | |
- | model name : Common KVM processor | + | |
- | stepping | + | |
- | microcode | + | |
- | cpu MHz : 1999.987 | + | |
- | cache size : 16384 KB | + | |
- | physical id : 1 | + | |
- | siblings | + | |
- | core id : 2 | + | |
- | cpu cores : 4 | + | |
- | 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 | + | [root@centos8 ~]# vgremove vg0 |
- | cpu family | + | |
- | model : 6 | + | |
- | model name : Common KVM processor | + | |
- | stepping | + | |
- | microcode | + | |
- | cpu MHz : 1999.987 | + | |
- | cache size : 16384 KB | + | |
- | physical id : 1 | + | |
- | siblings | + | |
- | core id : 3 | + | |
- | cpu cores : 4 | + | |
- | 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== | + | Les options de la commande **vgremove** sont : |
< | < | ||
- | [root@centos8 ~]# cat / | + | [root@centos8 ~]# vgremove |
- | | + | |
- | 0: 109 0 0 0 0 0 0 0 IO-APIC 2-edge timer | + | |
- | | + | |
- | 8: 0 0 0 0 0 1 0 0 | + | |
- | 9: 0 0 0 0 0 0 0 0 | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | NMI: 0 0 0 0 0 0 0 0 | + | |
- | LOC: | + | |
- | SPU: 0 0 0 0 0 0 0 0 | + | |
- | PMI: 0 0 0 0 0 0 0 0 | + | |
- | IWI: 0 0 0 0 2 0 0 0 IRQ work interrupts | + | |
- | RTR: 0 0 0 0 0 0 0 0 APIC ICR read retries | + | |
- | RES: | + | |
- | CAL: 11095 11007 10841 10343 14679 | + | |
- | TLB: | + | |
- | TRM: 0 0 0 0 0 0 0 0 | + | |
- | THR: 0 0 0 0 0 0 0 0 | + | |
- | DFR: 0 0 0 0 0 0 0 0 | + | |
- | MCE: 0 0 0 0 0 0 0 0 | + | |
- | MCP: 288 288 288 288 288 288 288 288 | + | |
- | HYP: 0 0 0 0 0 0 0 0 | + | |
- | HRE: 0 0 0 0 0 0 0 0 | + | |
- | HVS: 0 0 0 0 0 0 0 0 | + | |
- | ERR: 0 | + | |
- | MIS: 0 | + | |
- | PIN: 0 0 0 0 0 0 0 0 | + | |
- | NPI: 0 0 0 0 0 0 0 0 | + | |
- | PIW: 0 0 0 0 0 0 0 0 | + | |
- | </ | + | |
- | <WRAP center round important 60%> | + | vgremove VG|Tag|Select |
- | **Important** : Un pilote de périphérique demande au processeur de fournir un service en utilisant un 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' | + | [ -f|--force ] |
- | </WRAP> | + | [ -S|--select String ] |
+ | [ --noudevsync ] | ||
+ | [ --reportformat basic|json ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | |||
+ | Common options for lvm: | ||
+ | [ -d|--debug ] | ||
+ | [ -h|--help ] | ||
+ | [ -q|--quiet ] | ||
+ | [ -v|--verbose ] | ||
+ | [ -y|--yes ] | ||
+ | [ -t|--test ] | ||
+ | [ --commandprofile String ] | ||
+ | [ --config String ] | ||
+ | [ --driverloaded y|n ] | ||
+ | [ --nolocking ] | ||
+ | [ --lockopt String ] | ||
+ | [ --longhelp ] | ||
+ | [ --profile String ] | ||
+ | [ --version ] | ||
+ | |||
+ | Use --longhelp to show all options and advanced commands. | ||
+ | </code> | ||
- | ==Canaux DMA== | + | Ainsi que le volume physique : |
< | < | ||
- | [root@centos8 ~]# cat /proc/dma | + | [root@centos8 ~]# pvremove |
- | 4: cascade | + | |
+ | Labels on physical volume "/ | ||
+ | Labels on physical volume "/ | ||
</ | </ | ||
- | ==Plages d' | + | Les options de la commande **pvremove** sont : |
< | < | ||
- | root@centos8 ~]# cat / | + | [root@centos8 ~]# pvremove |
- | 0000-0cf7 : PCI Bus 0000:00 | + | |
- | 0000-001f : dma1 | + | |
- | | + | |
- | | + | [ -f|--force ] |
- | | + | [ |
- | 0060-0060 : keyboard | + | [ COMMON_OPTIONS ] |
- | | + | |
- | 0070-0077 : rtc0 | + | |
- | 0080-008f : dma page reg | + | [ -d|--debug ] |
- | 00a0-00a1 : pic2 | + | [ -h|--help ] |
- | 00c0-00df : dma2 | + | [ -q|--quiet ] |
- | 00f0-00ff : fpu | + | [ -v|--verbose ] |
- | 0170-0177 : 0000: | + | [ -y|--yes ] |
- | | + | [ -t|--test ] |
- | 01f0-01f7 : 0000: | + | [ --commandprofile String ] |
- | | + | [ --config String ] |
- | 0376-0376 : 0000: | + | [ |
- | | + | [ --nolocking ] |
- | 03c0-03df : vga+ | + | [ |
- | 03f6-03f6 : 0000: | + | [ |
- | | + | [ --profile String ] |
- | --More-- | + | [ |
+ | |||
+ | Use --longhelp to show all options and advanced commands. | ||
</ | </ | ||
- | <WRAP center round alert 60%> | + | ====LAB #7 - Volumes Logiques en Miroir==== |
- | **Important** | + | |
- | </ | + | |
- | ==Périphériques== | + | Re-créez maintenant votre Volume Group : |
< | < | ||
- | [root@centos8 ~]# cat /proc/devices | + | [root@centos8 ~]# pvcreate |
- | Character devices: | + | |
- | 1 mem | + | |
- | 4 /dev/vc/0 | + | |
- | 4 tty | + | |
- | 4 ttyS | + | |
- | 5 /dev/tty | + | |
- | | + | |
- | | + | |
- | | + | |
- | 10 misc | + | |
- | 13 input | + | |
- | 21 sg | + | |
- | 29 fb | + | |
- | 128 ptm | + | |
- | 136 pts | + | |
- | 162 raw | + | |
- | 180 usb | + | |
- | 188 ttyUSB | + | |
- | 189 usb_device | + | |
- | 202 cpu/msr | + | |
- | 203 cpu/cpuid | + | |
- | 226 drm | + | |
- | 244 aux | + | |
- | 245 hidraw | + | |
- | 246 usbmon | + | |
- | 247 bsg | + | |
- | 248 watchdog | + | |
- | 249 ptp | + | |
- | 250 pps | + | |
- | 251 rtc | + | |
- | 252 dax | + | |
- | 253 tpm | + | |
- | 254 gpiochip | + | |
- | Block devices: | + | [root@centos8 ~]# vgcreate -s 8M vg0 /dev/sdb6 /dev/sdb7 /dev/sdb9 |
- | | + | |
- | 9 md | + | |
- | 11 sr | + | |
- | 65 sd | + | |
- | 66 sd | + | |
- | 67 sd | + | |
- | 68 sd | + | |
- | 69 sd | + | |
- | 70 sd | + | |
- | 71 sd | + | |
- | 128 sd | + | |
- | 129 sd | + | |
- | 130 sd | + | |
- | 131 sd | + | |
- | 132 sd | + | |
- | 133 sd | + | |
- | 134 sd | + | |
- | 135 sd | + | |
- | 253 device-mapper | + | |
- | 254 mdp | + | |
- | 259 blkext | + | |
</ | </ | ||
- | ==Modules== | + | Créez maintenant un Logical Volume en miroir grâce à l' |
< | < | ||
- | [root@centos8 ~]# cat / | + | [root@centos8 ~]# lvcreate |
- | xt_CHECKSUM 16384 1 - Live 0xffffffffc09a8000 | + | |
- | ipt_MASQUERADE 16384 3 - Live 0xffffffffc09a3000 | + | |
- | xt_conntrack 16384 1 - Live 0xffffffffc099e000 | + | |
- | ipt_REJECT 16384 2 - Live 0xffffffffc0999000 | + | |
- | nft_compat 20480 16 - Live 0xffffffffc0993000 | + | |
- | nf_nat_tftp 16384 0 - Live 0xffffffffc098b000 | + | |
- | nft_objref 16384 1 - Live 0xffffffffc0986000 | + | |
- | nf_conntrack_tftp 16384 3 nf_nat_tftp, | + | |
- | nft_counter 16384 33 - Live 0xffffffffc097c000 | + | |
- | tun 53248 1 - Live 0xffffffffc096e000 | + | |
- | bridge 192512 0 - Live 0xffffffffc093e000 | + | |
- | stp 16384 1 bridge, Live 0xffffffffc0939000 | + | |
- | llc 16384 2 bridge,stp, Live 0xffffffffc0930000 | + | |
- | nft_fib_inet 16384 1 - Live 0xffffffffc08f5000 | + | |
- | nft_fib_ipv4 16384 1 nft_fib_inet, | + | |
- | nft_fib_ipv6 16384 1 nft_fib_inet, | + | |
- | nft_fib 16384 3 nft_fib_inet, | + | |
- | nft_reject_inet 16384 5 - Live 0xffffffffc08de000 | + | |
- | nf_reject_ipv4 16384 2 ipt_REJECT, | + | |
- | nf_reject_ipv6 16384 1 nft_reject_inet, | + | |
- | nft_reject 16384 1 nft_reject_inet, | + | |
- | --More-- | + | |
</ | </ | ||
- | ==Statistiques de l' | + | Constatez maintenant la présence du miroir : |
< | < | ||
- | [root@centos8 ~]# cat /proc/diskstats | + | [root@centos8 ~]# lvdisplay -m /dev/vg0/lv1 |
- | 8 0 sda 15481 112 1445637 154103 10272 2377 277530 890611 0 237219 1044714 0 0 0 0 | + | --- Logical volume --- |
- | 8 1 sda1 402 3 66754 13349 31 18 392 4632 0 2824 17981 0 0 0 0 | + | LV Path / |
- | 8 2 sda2 14915 109 1375516 140528 8450 2359 277138 869788 0 225416 1010316 0 0 0 0 | + | LV Name lv1 |
- | 8 16 sdb 230 0 5991 36 0 0 0 0 0 110 36 0 0 0 0 | + | VG Name vg0 |
- | | + | LV UUID lJQQWs-n05T-pxzi-Zq2R-UzRI-kYZf-hsNPYQ |
- | | + | LV Write Access |
- | 253 1 dm-1 104 0 4440 79 0 0 0 0 0 71 79 0 0 0 0 | + | LV Creation host, time centos8.ittraining.loc, |
+ | LV Status | ||
+ | # open 0 | ||
+ | | ||
+ | Current LE 13 | ||
+ | Mirrored volumes | ||
+ | | ||
+ | Allocation | ||
+ | Read ahead sectors | ||
+ | - currently set to | ||
+ | Block device | ||
+ | |||
+ | | ||
+ | Logical extents | ||
+ | Type raid1 | ||
+ | Monitoring monitored | ||
+ | Raid Data LV 0 | ||
+ | Logical volume lv1_rimage_0 | ||
+ | Logical extents 0 to 12 | ||
+ | Raid Data LV 1 | ||
+ | Logical volume lv1_rimage_1 | ||
+ | Logical extents 0 to 12 | ||
+ | Raid Metadata LV 0 lv1_rmeta_0 | ||
+ | Raid Metadata LV 1 lv1_rmeta_1 | ||
</ | </ | ||
- | ==Partitions== | + | Le miroir s' |
< | < | ||
- | [root@centos8 ~]# cat /proc/partitions | + | [root@centos8 ~]# pvdisplay -m /dev/sdb6 /dev/sdb7 /dev/sdb9 |
- | major minor # | + | |
- | + | PV Name / | |
- | | + | VG Name vg0 |
- | | + | PV Size |
- | | + | |
- | 8 | + | PE Size 8.00 MiB |
- | | + | Total PE 24 |
- | 253 | + | Free PE 10 |
- | 253 1 3358720 dm-1 | + | Allocated PE 14 |
+ | PV UUID | ||
+ | |||
+ | --- Physical Segments --- | ||
+ | Physical extent 0 to 0: | ||
+ | Logical volume / | ||
+ | Logical extents 0 to 0 | ||
+ | Physical extent | ||
+ | Logical volume / | ||
+ | Logical extents 0 to 12 | ||
+ | Physical extent 14 to 23: | ||
+ | FREE | ||
+ | |||
+ | --- Physical volume --- | ||
+ | PV Name / | ||
+ | VG Name vg0 | ||
+ | PV Size | ||
+ | Allocatable | ||
+ | PE Size 8.00 MiB | ||
+ | Total PE 37 | ||
+ | Free PE 23 | ||
+ | Allocated PE 14 | ||
+ | PV UUID | ||
+ | |||
+ | --- Physical Segments --- | ||
+ | Physical extent 0 to 0: | ||
+ | Logical volume / | ||
+ | Logical extents 0 to 0 | ||
+ | | ||
+ | Logical volume / | ||
+ | Logical extents 0 to 12 | ||
+ | Physical extent 14 to 36: | ||
+ | FREE | ||
+ | |||
+ | --- Physical volume --- | ||
+ | PV Name / | ||
+ | VG Name vg0 | ||
+ | PV Size | ||
+ | Allocatable | ||
+ | PE Size 8.00 MiB | ||
+ | Total PE 49 | ||
+ | Free PE 49 | ||
+ | Allocated PE | ||
+ | PV UUID | ||
+ | | ||
+ | | ||
+ | Physical extent | ||
+ | | ||
</ | </ | ||
- | ==Espaces | + | La suppression du miroir se fait en utilisant la commande **lvconvert** en indiquant quel volume physique doit être vidé de son contenu : |
< | < | ||
- | [root@centos8 ~]# cat /proc/swaps | + | [root@centos8 ~]# lvconvert -m 0 /dev/vg0/ |
- | Filename | + | Are you sure you want to convert raid1 LV vg0/lv1 to type linear losing all resilience? [y/n]: y |
- | /dev/dm-1 | + | Logical volume vg0/lv1 successfully converted. |
</ | </ | ||
- | ==Statistiques d' | + | De même, il est possible de créer un miroir pour un volume logique existant : |
< | < | ||
- | [root@centos8 ~]# cat /proc/loadavg | + | [root@centos8 ~]# lvconvert -m 1 /dev/vg0/lv1 |
- | 0.00 0.00 0.00 1/697 16936 | + | Are you sure you want to convert linear LV vg0/lv1 to raid1 with 2 images enhancing resilience? [y/n]: y |
+ | Logical volume vg0/lv1 successfully converted. | ||
</ | </ | ||
- | ==Statistiques d' | + | Supprimez |
< | < | ||
- | [root@centos8 ~]# cat /proc/meminfo | + | [root@centos8 ~]# lvconvert -m 0 /dev/vg0/lv1 /dev/sdb7 |
- | MemTotal: | + | Are you sure you want to convert raid1 LV vg0/lv1 to type linear losing all resilience? [y/n]: y |
- | 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== | + | Les options de la commande **lvconvert** sont : |
< | < | ||
- | [root@centos8 ~]# cat / | + | [root@centos8 ~]# lvconvert |
- | Linux version 4.18.0-305.3.1.el8.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 8.4.1 20200928 (Red Hat 8.4.1-1) (GCC)) #1 SMP Tue Jun 1 16:14:33 UTC 2021 | + | |
- | </ | + | |
- | ===Répertoires=== | + | Convert LV to linear. |
+ | lvconvert --type linear LV | ||
+ | [ COMMON_OPTIONS ] | ||
+ | [ PV ... ] | ||
- | ==ide/ | + | Convert LV to striped. |
+ | lvconvert --type striped LV | ||
+ | [ -I|--stripesize Size[k|UNIT] ] | ||
+ | [ -R|--regionsize Size[m|UNIT] ] | ||
+ | [ -i|--interval Number ] | ||
+ | [ --stripes Number ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | [ PV ... ] | ||
- | Ce répertoire contient des répertoires dans lesquels se trouvent des informations sur la capacité, le type et la géométrie des disques. | + | Convert LV to type mirror (also see type raid1), |
+ | lvconvert --type mirror LV | ||
+ | [ -m|--mirrors [+|-]Number ] | ||
+ | [ -I|--stripesize Size[k|UNIT] ] | ||
+ | [ -R|--regionsize Size[m|UNIT] ] | ||
+ | [ -i|--interval Number ] | ||
+ | [ --stripes Number ] | ||
+ | [ --mirrorlog core|disk ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | [ PV ... ] | ||
- | ==acpi== | + | Convert LV to raid or change raid layout |
+ | (a specific raid level must be used, e.g. raid1). | ||
+ | lvconvert --type raid LV | ||
+ | [ -m|--mirrors [+|-]Number ] | ||
+ | [ -I|--stripesize Size[k|UNIT] ] | ||
+ | [ -R|--regionsize Size[m|UNIT] ] | ||
+ | [ -i|--interval Number ] | ||
+ | [ --stripes Number ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | [ PV ... ] | ||
- | Ce répertoire contient des informations sur la gestion de l' | + | Convert LV to raid1 or mirror, or change number of mirror images. |
+ | lvconvert -m|--mirrors [+|-]Number LV | ||
+ | [ -R|--regionsize Size[m|UNIT] ] | ||
+ | [ -i|--interval Number ] | ||
+ | [ --mirrorlog core|disk ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | [ PV ... ] | ||
- | ==bus== | + | Convert raid LV to change number of stripe images. |
+ | lvconvert --stripes Number LV_raid | ||
+ | [ -i|--interval Number ] | ||
+ | [ -R|--regionsize Size[m|UNIT] ] | ||
+ | [ -I|--stripesize Size[k|UNIT] ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | [ PV ... ] | ||
- | Ce répertoire contient un sous-répertoire par bus. | + | Convert raid LV to change the stripe size. |
+ | lvconvert -I|--stripesize Size[k|UNIT] LV_raid | ||
+ | [ -i|--interval Number ] | ||
+ | [ -R|--regionsize Size[m|UNIT] ] | ||
+ | [ COMMON_OPTIONS ] | ||
- | ==net== | + | Split images from a raid1 or mirror LV and use them to create a new LV. |
+ | lvconvert --splitmirrors Number -n|--name LV_new LV_cache_mirror_raid1 | ||
+ | [ COMMON_OPTIONS ] | ||
+ | [ PV ... ] | ||
- | Ce répertoire contient des informations sur le réseau. | + | Split images from a raid1 LV and track changes to origin for later merge. |
+ | lvconvert --splitmirrors Number --trackchanges LV_cache_raid1 | ||
+ | [ COMMON_OPTIONS ] | ||
+ | [ PV ... ] | ||
- | ==sys== | + | Merge LV images that were split from a raid1 LV. |
+ | lvconvert --mergemirrors VG|LV_linear_raid|Tag ... | ||
+ | [ COMMON_OPTIONS ] | ||
- | Ce répertoire contient des paramètres du 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 : | + | Convert LV to a thin LV, using the original LV as an external origin. |
+ | lvconvert --type thin --thinpool LV LV_linear_striped_thin_cache_raid | ||
+ | [ -T|--thin ] | ||
+ | [ -r|--readahead auto|none|Number ] | ||
+ | [ -c|--chunksize Size[k|UNIT] ] | ||
+ | [ -Z|--zero y|n ] | ||
+ | [ --originname LV_new ] | ||
+ | [ --poolmetadata LV ] | ||
+ | [ --poolmetadatasize Size[m|UNIT] ] | ||
+ | [ --poolmetadataspare y|n ] | ||
+ | [ --metadataprofile String ] | ||
+ | [ COMMON_OPTIONS ] | ||
- | | + | |
+ | lvconvert --type cache --cachepool LV LV_linear_striped_thinpool_vdo_vdopool_vdopooldata_raid | ||
+ | [ -H|--cache ] | ||
+ | [ -Z|--zero y|n ] | ||
+ | [ -r|--readahead auto|none|Number ] | ||
+ | [ -c|--chunksize Size[k|UNIT] ] | ||
+ | [ --cachemetadataformat auto|1|2 ] | ||
+ | [ --cachemode writethrough|writeback|passthrough ] | ||
+ | [ --cachepolicy String ] | ||
+ | [ --cachesettings String ] | ||
+ | [ --poolmetadata LV ] | ||
+ | [ --poolmetadatasize Size[m|UNIT] ] | ||
+ | [ --poolmetadataspare y|n ] | ||
+ | [ --metadataprofile String ] | ||
+ | [ COMMON_OPTIONS | ||
- | Cette commande | + | Attach |
+ | lvconvert --type writecache --cachevol LV LV_linear_striped_raid | ||
+ | [ --cachesettings String ] | ||
+ | [ COMMON_OPTIONS ] | ||
- | ====2.2 - Utilisation de la Commande sysctl==== | + | Attach a cache to an LV, converts the LV to type cache. |
+ | lvconvert --type cache --cachevol LV LV_linear_striped_thinpool_raid | ||
+ | [ -H|--cache ] | ||
+ | [ -Z|--zero y|n ] | ||
+ | [ -c|--chunksize Size[k|UNIT] ] | ||
+ | [ --cachemetadataformat auto|1|2 ] | ||
+ | [ --cachemode writethrough|writeback|passthrough ] | ||
+ | [ --cachepolicy String ] | ||
+ | [ --cachesettings String ] | ||
+ | [ --poolmetadatasize Size[m|UNIT] ] | ||
+ | [ COMMON_OPTIONS ] | ||
- | Les fichiers dans le répertoire **/ | + | Add a writecache to an LV, using a specified cache device. |
+ | lvconvert --type writecache --cachedevice PV LV_linear_striped_raid | ||
+ | [ --cachesize Size[m|UNIT] ] | ||
+ | [ --cachesettings String ] | ||
+ | [ COMMON_OPTIONS ] | ||
- | La commande **sysctl** applique les règles consignés dans le fichier **/ | + | Add a cache to an LV, using a specified cache device. |
+ | lvconvert --type cache --cachedevice PV LV_linear_striped_thinpool_raid | ||
+ | [ --cachesize Size[m|UNIT] ] | ||
+ | [ --cachesettings String ] | ||
+ | [ COMMON_OPTIONS ] | ||
- | Saisissez la commande : | + | Convert LV to type thin-pool. |
+ | lvconvert --type thin-pool LV_linear_striped_cache_raid | ||
+ | [ -I|--stripesize Size[k|UNIT] ] | ||
+ | [ -r|--readahead auto|none|Number ] | ||
+ | [ -c|--chunksize Size[k|UNIT] ] | ||
+ | [ -Z|--zero y|n ] | ||
+ | [ --stripes Number ] | ||
+ | [ --discards passdown|nopassdown|ignore ] | ||
+ | [ --poolmetadata LV ] | ||
+ | [ --poolmetadatasize Size[m|UNIT] ] | ||
+ | [ --poolmetadataspare y|n ] | ||
+ | [ --metadataprofile String ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | [ PV ... ] | ||
- | < | + | Convert LV to type cache-pool. |
- | [root@centos8 ~]# cat / | + | lvconvert --type cache-pool LV_linear_striped_raid |
- | # sysctl settings are defined through files in | + | [ -Z|--zero y|n ] |
- | # / | + | [ -r|--readahead auto|none|Number ] |
- | # | + | [ -c|--chunksize Size[k|UNIT] ] |
- | # Vendors settings live in / | + | [ --cachemetadataformat auto|1|2 ] |
- | # To override a whole file, create a new file with the same in | + | [ --cachemode writethrough|writeback|passthrough ] |
- | # / | + | [ --cachepolicy String ] |
- | # only specific settings, add a file with a lexically later | + | [ --cachesettings String ] |
- | # name in / | + | [ --poolmetadata LV ] |
- | # | + | [ --poolmetadatasize Size[m|UNIT] ] |
- | # For more information, | + | [ --poolmetadataspare y|n ] |
+ | [ --metadataprofile String ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | [ PV ... ] | ||
- | [root@centos8 ~]# ls -l /etc/sysctl.d/ | + | Convert LV to type vdopool. |
- | total 0 | + | |
- | lrwxrwxrwx. 1 root root 14 Mar 16 15:42 99-sysctl.conf -> ../ | + | [ -n|--name LV_new ] |
- | [root@centos8 ~]# ls -l / | + | [ -V|--virtualsize Size[m|UNIT] ] |
- | total 24 | + | [ |
- | -rw-r--r--. 1 root root 1810 Dec 22 2020 10-default-yama-scope.conf | + | [ |
- | -rw-r--r--. 1 root root 524 Mar 16 15:42 50-coredump.conf | + | [ COMMON_OPTIONS ] |
- | -rw-r--r--. 1 root root 1270 Mar 16 15:42 50-default.conf | + | |
- | -rw-r--r--. 1 root root 246 Jun 15 2020 50-libkcapi-optmem_max.conf | + | |
- | -rw-r--r--. 1 root root 636 Mar 16 15:42 50-pid-max.conf | + | |
- | -rw-r--r--. 1 root root 499 Nov 26 2019 60-libvirtd.conf | + | |
- | [root@centos8 ~]# cat / | + | Detach a cache from an LV. |
- | # This file is part of systemd. | + | |
- | # | + | [ COMMON_OPTIONS ] |
- | # systemd is free software; you can redistribute it and/or modify it | + | |
- | # under the terms of the GNU Lesser General Public License as published by | + | |
- | # the Free Software Foundation; either version 2.1 of the License, or | + | |
- | # (at your option) any later version. | + | |
- | # See sysctl.d(5) and core(5) for documentation. | + | Merge thin LV into its origin LV. |
+ | lvconvert --mergethin LV_thin | ||
+ | [ COMMON_OPTIONS ] | ||
- | # To override settings in this file, create a local file in /etc | + | Merge COW snapshot LV into its origin. |
- | # (e.g. /etc/sysctl.d/90-override.conf), | + | |
- | # there. | + | [ -i|--interval Number ] |
+ | [ COMMON_OPTIONS ] | ||
- | # System Request functionality of the kernel | + | Combine a former COW snapshot |
- | # | + | |
- | # Use kernel.sysrq = 1 to allow all keys. | + | |
- | # See https:// | + | [ -s|--snapshot ] |
- | # of values and keys. | + | [ -c|--chunksize Size[k|UNIT] ] |
- | kernel.sysrq = 16 | + | [ -Z|--zero y|n ] |
+ | [ COMMON_OPTIONS ] | ||
- | # Append the PID to the core filename | + | Replace failed PVs in a raid or mirror LV. |
- | kernel.core_uses_pid = 1 | + | |
+ | Repair a cache pool. | ||
+ | lvconvert --repair LV_thinpool_cache_cachepool_mirror_raid | ||
+ | [ -i|--interval Number ] | ||
+ | [ --usepolicies ] | ||
+ | [ --poolmetadataspare y|n ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | [ PV ... ] | ||
- | # https:// | + | Replace specific PV(s) in a raid LV with another PV. |
- | kernel.kptr_restrict = 1 | + | lvconvert --replace PV LV_raid |
+ | [ COMMON_OPTIONS ] | ||
+ | [ PV ... ] | ||
- | # Source route verification | + | Poll LV to continue conversion. |
- | net.ipv4.conf.all.rp_filter = 1 | + | |
+ | [ COMMON_OPTIONS ] | ||
- | # Do not accept source routing | + | Add or remove data integrity checksums to raid images. |
- | net.ipv4.conf.all.accept_source_route = 0 | + | lvconvert --raidintegrity y|n LV_raid |
+ | [ --raidintegritymode String ] | ||
+ | [ --raidintegrityblocksize Number ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | [ PV ... ] | ||
- | # Promote secondary addresses when the primary address is removed | + | Common options for command: |
- | net.ipv4.conf.all.promote_secondaries = 1 | + | [ -b|--background ] |
+ | [ -f|--force ] | ||
+ | [ --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit ] | ||
+ | [ --noudevsync ] | ||
- | # Fair Queue CoDel packet scheduler to fight bufferbloat | + | Common options for lvm: |
- | net.core.default_qdisc = fq_codel | + | [ -d|--debug ] |
+ | [ -h|--help ] | ||
+ | [ -q|--quiet ] | ||
+ | [ -v|--verbose ] | ||
+ | [ -y|--yes ] | ||
+ | [ -t|--test ] | ||
+ | [ --commandprofile String ] | ||
+ | [ --config String ] | ||
+ | [ --driverloaded y|n ] | ||
+ | [ --nolocking ] | ||
+ | [ --lockopt String ] | ||
+ | [ --longhelp ] | ||
+ | [ --profile String ] | ||
+ | [ --version ] | ||
- | # Enable hard and soft link protection | + | Use --longhelp to show all options |
- | fs.protected_hardlinks = 1 | + | |
- | fs.protected_symlinks = 1 | + | |
</ | </ | ||
- | Les options | + | ====LAB #8 - Modifier les Attributs LVM==== |
+ | |||
+ | En cas de présence d'un miroir, | ||
< | < | ||
- | [root@centos8 ~]# sysctl | + | [root@centos8 ~]# lvs |
+ | LV | ||
+ | root cl_centos8 | ||
+ | swap cl_centos8 -wi-ao---- | ||
+ | lv1 vg0 -wi-a----- 104.00m | ||
+ | </ | ||
- | Usage: | + | <WRAP center round important 60%> |
- | sysctl | + | Consultez **[[http://www.unixarena.com/ |
+ | </ | ||
- | Options: | + | La commande equivalente pour les Volume Groups est **vgs** |
- | -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 | + | [root@centos8 ~]# vgs |
- | + | VG #PV #LV #SN Attr | |
- | For more details see sysctl(8). | + | cl_centos8 |
+ | | ||
</ | </ | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | **Important** : Consultez | + | Consultez **[[http:// |
</ | </ | ||
- | =====LAB#3 - Interprétation des informations dans /proc===== | + | La commande equivalente pour les Physical Volumes est **pvs** : |
- | Les informations brutes stockées dans /proc peuvent être interprétées grâce à l' | + | < |
+ | [root@centos8 ~]# pvs | ||
+ | PV | ||
+ | | ||
+ | | ||
+ | | ||
+ | / | ||
+ | </ | ||
- | * free, | + | <WRAP center round important 60%> |
- | * uptime et w, | + | Consultez |
- | | + | </ |
- | | + | |
- | | + | |
- | * mpstat, | + | |
- | * sar. | + | |
- | ====3.1 - La Commande free==== | + | Les commandes **lvchange**, |
- | La commande | + | Par exemple, pour rendre inutilisable un Logical Volume, il convient d' |
< | < | ||
- | [root@centos8 ~]# free -m | + | [root@centos8 ~]# lvchange |
- | total used free shared | + | |
- | Mem: | + | |
- | Swap: 3279 | + | |
</ | </ | ||
- | Dans le cas de cet exemple, nous pouvons constater que l’affichage montre | + | Pour faire l' |
- | * 3735 Mo de mémoire physique totale, | + | < |
- | * 1135 Mo de mémoire physique utilisée et 1818 Mo de mémoire physique libre, | + | [root@centos8 ~]# lvchange -a y / |
- | * 3279 Mo de mémoire swap totale et 0 Mo de swap utilisé | + | </ |
- | Les options de cette commande sont : | + | Les options de la commande |
< | < | ||
- | [root@centos8 ~]# free --help | + | [root@centos8 ~]# lvchange |
+ | lvchange - Change the attributes of logical volume(s) | ||
- | Usage: | + | Change a general LV attribute. |
- | free [options] | + | For options listed in parentheses, |
+ | required, after which the others are optional. | ||
+ | lvchange | ||
+ | ( -C|--contiguous y|n, | ||
+ | -p|--permission rw|r, | ||
+ | -r|--readahead auto|none|Number, | ||
+ | -k|--setactivationskip y|n, | ||
+ | -Z|--zero y|n, | ||
+ | -M|--persistent n, | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | VG|LV|Tag|Select ... | ||
+ | [ -a|--activate y|n|ay ] | ||
+ | [ --poll y|n ] | ||
+ | [ --monitor y|n ] | ||
+ | [ COMMON_OPTIONS | ||
- | Options: | + | Resyncronize a mirror or raid LV. |
- | -b, --bytes | + | Use to reset ' |
- | | + | |
- | | + | [ -a|--activate y|n|ay ] |
- | | + | [ COMMON_OPTIONS ] |
- | | + | |
- | | + | |
- | -k, --kibi | + | |
- | -m, --mebi | + | |
- | -g, --gibi | + | |
- | | + | |
- | | + | |
- | -h, --human | + | |
- | | + | |
- | -l, --lohi show detailed low and high memory statistics | + | |
- | -t, --total show total for RAM + swap | + | |
- | -s N, --seconds N | + | |
- | -c N, --count N | + | |
- | -w, --wide | + | |
- | --help | + | Resynchronize or check a raid LV. |
- | -V, --version | + | lvchange |
+ | [ COMMON_OPTIONS ] | ||
- | For more details see free(1). | + | Reconstruct data on specific PVs of a raid LV. |
+ | lvchange --rebuild PV VG|LV_raid|Tag|Select ... | ||
+ | [ COMMON_OPTIONS ] | ||
+ | |||
+ | Activate or deactivate an LV. | ||
+ | lvchange -a|--activate y|n|ay VG|LV|Tag|Select ... | ||
+ | [ -P|--partial ] | ||
+ | [ -K|--ignoreactivationskip ] | ||
+ | [ --activationmode partial|degraded|complete ] | ||
+ | [ --poll y|n ] | ||
+ | [ --monitor y|n ] | ||
+ | [ --ignorelockingfailure ] | ||
+ | [ --sysinit ] | ||
+ | [ --readonly ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | |||
+ | Reactivate an LV using the latest metadata. | ||
+ | lvchange --refresh VG|LV|Tag|Select ... | ||
+ | [ -P|--partial ] | ||
+ | [ --activationmode partial|degraded|complete ] | ||
+ | [ --poll y|n ] | ||
+ | [ --monitor y|n ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | |||
+ | Start or stop monitoring an LV from dmeventd. | ||
+ | lvchange --monitor y|n VG|LV|Tag|Select ... | ||
+ | [ COMMON_OPTIONS ] | ||
+ | |||
+ | Start or stop processing an LV conversion. | ||
+ | lvchange --poll y|n VG|LV|Tag|Select ... | ||
+ | [ --monitor y|n ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | |||
+ | Make the minor device number persistent for an LV. | ||
+ | lvchange -M|--persistent y --minor Number LV | ||
+ | [ -j|--major Number ] | ||
+ | [ -a|--activate y|n|ay ] | ||
+ | [ --poll y|n ] | ||
+ | [ --monitor y|n ] | ||
+ | [ COMMON_OPTIONS ] | ||
+ | |||
+ | Common options for command: | ||
+ | [ -A|--autobackup y|n ] | ||
+ | [ -f|--force ] | ||
+ | [ -S|--select String ] | ||
+ | [ --ignoremonitoring ] | ||
+ | [ --noudevsync ] | ||
+ | [ --reportformat basic|json ] | ||
+ | |||
+ | Common options for lvm: | ||
+ | [ -d|--debug ] | ||
+ | [ -h|--help ] | ||
+ | [ -q|--quiet ] | ||
+ | [ -v|--verbose ] | ||
+ | [ -y|--yes ] | ||
+ | [ -t|--test ] | ||
+ | [ --commandprofile String ] | ||
+ | [ --config String ] | ||
+ | [ --driverloaded y|n ] | ||
+ | [ --nolocking ] | ||
+ | [ --lockopt String ] | ||
+ | [ --longhelp ] | ||
+ | [ --profile String ] | ||
+ | [ --version ] | ||
+ | |||
+ | Use --longhelp to show all options and advanced commands. | ||
</ | </ | ||
- | ====3.2 - Les Commandes uptime et w==== | + | ====LAB #9 - Volumes Logiques en Bandes==== |
+ | |||
+ | Un volume logique en bandes est créé pour augmenter, comme dans le cas du RAID, les performances des entrées et sorties. Pour créer ce volume, la commande **lvcreate** prend deux option supplémentaires : | ||
+ | |||
+ | * **-i** - indique le nombre de volumes de bandes, | ||
+ | * **-I** - indique la taille en Ko de chaque bande. | ||
- | Chacune des ces commandes indique | + | Saisissez donc la commande suivante |
< | < | ||
- | [root@centos8 ~]# uptime | + | [root@centos8 ~]# lvcreate -i2 -I64 -n lv2 -L 100M vg0 /dev/sdb7 /dev/sdb9 |
- | 04: | + | |
- | + | | |
- | [root@centos8 ~]# w | + | |
- | | + | |
- | 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. | + | Constatez la présence de vos bandes sur /dev/sda7 et sur /dev/sda9 : |
- | Par exemple si les valeurs sur un système muni d'un seul processeur étaient **3, | + | < |
+ | [root@centos8 ~]# lvdisplay -m / | ||
+ | --- Logical volume --- | ||
+ | LV Path / | ||
+ | LV Name lv2 | ||
+ | VG Name vg0 | ||
+ | LV UUID MmXbPt-ZF8u-rnIv-3YU9-m64J-RCz2-6NzAuG | ||
+ | LV Write Access | ||
+ | LV Creation host, time centos8.ittraining.loc, | ||
+ | LV Status | ||
+ | # open 0 | ||
+ | LV Size 112.00 MiB | ||
+ | Current LE 14 | ||
+ | Segments | ||
+ | Allocation | ||
+ | Read ahead sectors | ||
+ | - currently set to | ||
+ | Block device | ||
+ | |||
+ | --- Segments --- | ||
+ | Logical extents 0 to 13: | ||
+ | Type striped | ||
+ | Stripes 2 | ||
+ | Stripe size 64.00 KiB | ||
+ | Stripe 0: | ||
+ | Physical volume / | ||
+ | Physical extents 0 to 6 | ||
+ | Stripe 1: | ||
+ | Physical volume / | ||
+ | Physical extents 0 to 6 | ||
- | * 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 : | + | Utilisez maintenant la commande **lvs** pour visualiser les volumes physiques utilisés par le volume logique |
< | < | ||
- | [root@centos8 ~]# uptime | + | [root@centos8 ~]# lvs -o +devices |
+ | LV | ||
+ | root cl_centos8 | ||
+ | swap cl_centos8 -wi-ao---- | ||
+ | lv1 vg0 -wi-a----- 104.00m | ||
+ | lv2 vg0 -wi-a----- 112.00m | ||
+ | </ | ||
- | Usage: | + | ====LAB #10 - Gérer les Métadonnées==== |
- | | + | |
- | Options: | + | Les métadonnées pour chaque Volume Group sont stockés dans un fichier texte au nom du Volume Group dans le répertoire **/ |
- | -p, --pretty | + | |
- | -h, --help | + | |
- | -s, --since | + | |
- | -V, --version | + | |
- | For more details see uptime(1). | + | < |
+ | [root@centos8 ~]# cat / | ||
+ | # Generated by LVM2 version 2.03.09(2)-RHEL8 (2020-05-28): | ||
- | [root@centos8 ~]# w --help | + | contents = "Text Format Volume Group" |
+ | version = 1 | ||
- | Usage: | + | description = " |
- | w [options] | + | |
- | Options: | + | creation_host = " |
- | -h, --no-header | + | creation_time = 1622634458 # |
- | -u, --no-current | + | |
- | -s, --short | + | |
- | -f, --from | + | |
- | -o, --old-style | + | |
- | -i, --ip-addr | + | |
- | --help | + | vg0 { |
- | -V, --version | + | id = " |
+ | seqno = 11 | ||
+ | format = " | ||
+ | status = [" | ||
+ | flags = [] | ||
+ | extent_size = 16384 # 8 Megabytes | ||
+ | max_lv = 0 | ||
+ | max_pv = 0 | ||
+ | metadata_copies = 0 | ||
- | For more details see w(1). | + | physical_volumes { |
- | </ | + | |
- | ====3.3 | + | pv0 { |
+ | id = " | ||
+ | device | ||
- | La commande **iostat** affiche des statistiques sur l' | + | status = [" |
+ | flags = [] | ||
+ | dev_size = 409600 # 200 Megabytes | ||
+ | pe_start = 2048 | ||
+ | pe_count = 24 # 192 Megabytes | ||
+ | } | ||
- | < | + | pv1 { |
- | [root@centos8 ~]# iostat | + | id = " |
- | bash: iostat: command not found... | + | device = "/dev/ |
- | Install package ' | + | |
+ | status = [" | ||
+ | flags = [] | ||
+ | dev_size = 614400 # 300 Megabytes | ||
+ | pe_start = 2048 | ||
+ | pe_count = 37 # 296 Megabytes | ||
+ | } | ||
- | * Waiting in queue... | + | pv2 { |
- | The following packages have to be installed: | + | id = " |
- | | + | device = "/dev/sdb9" |
- | | + | |
- | Proceed with changes? [N/y] y | + | |
+ | status = [" | ||
+ | flags = [] | ||
+ | dev_size = 819200 # 400 Megabytes | ||
+ | pe_start = 2048 | ||
+ | pe_count = 49 # 392 Megabytes | ||
+ | } | ||
+ | } | ||
- | * Waiting in queue... | + | logical_volumes { |
- | * Waiting for authentication... | + | |
- | * Waiting in queue... | + | |
- | * Downloading packages... | + | |
- | * Requesting data... | + | |
- | * Testing changes... | + | |
- | * Installing packages... | + | |
- | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) | + | |
- | avg-cpu: | + | lv1 { |
- | 0.03 0.00 0.03 0.01 0.00 99.93 | + | id = " |
+ | status = [" | ||
+ | flags = [] | ||
+ | creation_time = 1622633848 # | ||
+ | creation_host = " | ||
+ | segment_count = 1 | ||
- | Device | + | segment1 { |
- | sda 0.28 | + | start_extent = 0 |
- | sdb | + | extent_count = 13 # 104 Megabytes |
- | scd0 0.00 | + | |
- | dm-0 0.26 | + | |
- | dm-1 0.00 | + | |
- | </ | + | |
- | Au-dessous de la première ligne indiquant la version du noyau du système et son nom d' | + | type = " |
+ | stripe_count = 1 # linear | ||
- | * **%user** - Pourcentage de temps passé en mode utilisateur (exécutant des applications, etc.) | + | stripes = [ |
- | * **%nice** - Pourcentage de temps passé en mode utilisateur (pour les processus qui ont modifié leur priorité de programmation à l'aide de la commande nice) | + | " |
- | * **%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. | + | lv2 { |
+ | id = " | ||
+ | status = [" | ||
+ | flags = [] | ||
+ | creation_time = 1622634458 # | ||
+ | creation_host = " | ||
+ | segment_count = 1 | ||
- | Au-dessous du rapport d' | + | segment1 { |
+ | start_extent = 0 | ||
+ | extent_count = 14 # 112 Megabytes | ||
- | * La spécification du périphérique. | + | type = " |
- | * Le nombre de transferts (ou opérations d'E/S) par seconde. | + | stripe_count = 2 |
- | * Le nombre de blocs de KB lus par seconde. | + | stripe_size = 128 # 64 Kilobytes |
- | * Le nombre de blocs de KB écrits par seconde. | + | |
- | * Le nombre total de KB lus. | + | |
- | * Le nombre total de KB écrits. | + | |
- | + | ||
- | Dernièrement, | + | |
- | < | + | stripes = [ |
- | [root@centos8 ~]# iostat -d -x | + | " |
- | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) | + | " |
+ | ] | ||
+ | } | ||
+ | } | ||
+ | } | ||
- | Device | + | } |
- | sda 0.20 0.16 | + | |
- | sdb 0.00 0.00 0.02 0.00 | + | |
- | scd0 | + | |
- | dm-0 | + | |
- | dm-1 | + | |
</ | </ | ||
- | Les options | + | Des archives sont créées lors de chaque modification d'un groupe |
< | < | ||
- | [root@centos8 ~]# iostat --help | + | [root@centos8 ~]# ls / |
- | Usage: iostat [ options ] [ < | + | vg0_00000-427117660.vg |
- | Options are: | + | vg0_00001-1993147316.vg vg0_00003-1757437978.vg vg0_00005-116946854.vg vg0_00007-1006758937.vg |
- | [ -c ] [ -d ] [ -h ] [ -k | -m ] [ -N ] [ -s ] [ -t ] [ -V ] [ -x ] [ -y ] [ -z ] | + | |
- | [ -j { ID | LABEL | PATH | UUID | ... } ] [ --human ] [ -o JSON ] | + | |
- | [ [ -H ] -g < | + | |
- | [ < | + | |
</ | </ | ||
- | ====3.4 - La Commande hdparm==== | + | La commande **vgcfgbackup** est utilisée pour sauvegarder les métadonnées manuellement dans le fichier **/ |
- | Pour surveiller la vitesse des entrées et des sorties du disque, vous pouvez utiliser la commande **hdparm** : | + | La commande **vgcfgrestore** permet de restaurer une sauvegarde. Sans l' |
< | < | ||
- | [root@centos8 ~]# hdparm -t /dev/sda | + | [root@centos8 ~]# vgcfgbackup vg0 |
- | + | | |
- | /dev/sda: | + | |
- | | + | |
</ | </ | ||
- | ====3.5 - La Commande vmstat==== | + | Il est aussi possible de modifier l' |
- | + | ||
- | La commande | + | |
< | < | ||
- | [root@centos8 ~]# vmstat 1 10 | + | [root@centos8 ~]# vgcfgbackup |
- | procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----- | + | |
- | r b | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
</ | </ | ||
- | La première ligne subdivise le champ en six catégories à savoir : processus, mémoire, swap, E/S, système et CPU sur lesquelles elle donne des statistiques. La seconde ligne identifie de manière encore plus détaillée chacun des champs, permettant ainsi de parcourir simplement et rapidement l'ensemble des données lors de la recherche de statistiques spécifiques. | + | Par contre, toute sauvegarde |
- | Les champs relatifs aux processus sont les suivants | + | < |
+ | [root@centos8 ~]# vgcfgrestore --list vg0 | ||
+ | |||
+ | File: / | ||
+ | VG name: vg0 | ||
+ | Description: | ||
+ | Backup Time: Wed May 26 10:43:14 2021 | ||
- | | + | |
- | | + | File: |
+ | VG name: vg0 | ||
+ | Description: | ||
+ | | ||
- | Les champs relatifs à la mémoire sont les suivants | + | |
+ | File: / | ||
+ | VG name: vg0 | ||
+ | Description: | ||
+ | Backup Time: Wed May 26 22:12:15 2021 | ||
- | * swpd — La quantité de mémoire virtuelle utilisée | + | |
- | | + | |
- | | + | |
- | * cache — La quantité de mémoire utilisée comme cache de pages | + | |
+ | Backup Time: Wed May 26 22:19:25 2021 | ||
- | Les champs relatifs au swap sont les suivants | + | |
+ | File: / | ||
+ | VG name: vg0 | ||
+ | Description: | ||
+ | Backup Time: Wed May 26 22:38:37 2021 | ||
- | * si — La quantité de mémoire chargée depuis le disque | + | |
- | * so — La quantité de mémoire déchargée sur le disque | + | |
+ | VG name: vg0 | ||
+ | Description: | ||
+ | Backup Time: Wed May 26 22:42:18 2021 | ||
- | Les champs relatifs aux Entrées/Sorties (E/S) sont les suivants | + | |
+ | File: /etc/lvm/ | ||
+ | VG name: vg0 | ||
+ | Description: | ||
+ | Backup Time: Wed May 26 22:43:49 2021 | ||
- | * bi — Blocs envoyés vers un périphérique blocs | + | |
- | * bo— Blocs reçus d'un périphérique blocs | + | |
+ | VG name: vg0 | ||
+ | Description: | ||
+ | Backup Time: Wed Jun 2 07:37:07 2021 | ||
- | Les champs relatifs au système sont les suivants | + | |
+ | File: / | ||
+ | VG name: vg0 | ||
+ | Description: | ||
+ | Backup Time: Wed Jun 2 07:37:28 2021 | ||
- | | + | |
- | | + | File: |
+ | VG name: vg0 | ||
+ | Description: | ||
+ | | ||
- | Les champs relatifs au CPU sont les suivants | + | |
+ | File: / | ||
+ | VG name: vg0 | ||
+ | Description: | ||
+ | Backup Time: Wed Jun 2 07:41:53 2021 | ||
- | * us — Le pourcentage de temps pendant lequel le CPU exécute un code de niveau utilisateur | + | |
- | | + | |
- | | + | |
- | * wa — Attente d'E/S | + | |
+ | Backup Time: Wed Jun 2 07:42:23 2021 | ||
- | Les options de cette commande sont : | + | |
+ | File: / | ||
+ | VG name: vg0 | ||
+ | Description: | ||
+ | Backup Time: Wed Jun 2 07:47:38 2021 | ||
- | < | + | |
- | [root@centos8 ~]# vmstat --help | + | File: |
+ | VG name: vg0 | ||
+ | Description: | ||
+ | Backup Time: Wed Jun 2 07:50:57 2021 | ||
+ | </code> | ||
- | Usage: | + | =====Systèmes de Fichiers Journalisés===== |
- | | + | |
- | Options: | + | ====Présentation==== |
- | -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 | + | Un journal est la partie d'un système de fichiers journalisé qui trace les opérations d' |
- | -V, --version | + | |
- | For more details see vmstat(8). | + | L' |
- | </ | + | |
- | <WRAP center round important | + | Sans un tel fichier journal, un outil de récupération de données après un arrêt brutal doit parcourir l' |
- | **Important** : Par défaut la commande vmstat affiche des informations depuis le démarrage du système. | + | |
+ | Linux peut utiliser un des systèmes de fichiers journalisés suivants : | ||
+ | |||
+ | ^ Système de fichier ^ Taille maximum - fichier ^ Taille maximum - système de fichier ^ | ||
+ | | **[[http:// | ||
+ | | **[[http:// | ||
+ | | **[[http:// | ||
+ | | **[[http:// | ||
+ | | **[[http:// | ||
+ | | **[[https:// | ||
+ | |||
+ | <WRAP center round todo 60%> | ||
+ | **A faire** : Pour comparer ces six systèmes de fichier, veuillez consulter **[[http:// | ||
</ | </ | ||
- | ====3.6 - La Commande mpstat==== | + | ====Ext3==== |
- | La commande | + | Ext3 est une évolution de Ext2 et a pour principale différence d' |
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | Pour plus d' | ||
+ | |||
+ | ===Gestion d' | ||
+ | |||
+ | Notez maintenant | ||
< | < | ||
- | [root@centos8 ~]# mpstat | + | [root@centos8 ~]# fdisk -l |
- | Linux 4.18.0-305.3.1.el8.x86_64 | + | Disk / |
+ | Units: sectors of 1 * 512 = 512 bytes | ||
+ | Sector size (logical/ | ||
+ | I/O size (minimum/ | ||
+ | Disklabel type: dos | ||
+ | Disk identifier: 0xb0dacb39 | ||
- | 04: | + | Device |
- | 04:53:22 | + | / |
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | |||
+ | |||
+ | Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors | ||
+ | Units: sectors of 1 * 512 = 512 bytes | ||
+ | Sector size (logical/ | ||
+ | I/O size (minimum/ | ||
+ | Disklabel type: dos | ||
+ | Disk identifier: 0x70b17285 | ||
+ | |||
+ | Device | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | Disk / | ||
+ | Units: sectors of 1 * 512 = 512 bytes | ||
+ | Sector size (logical/ | ||
+ | I/O size (minimum/ | ||
+ | |||
+ | |||
+ | Disk / | ||
+ | Units: sectors of 1 * 512 = 512 bytes | ||
+ | Sector size (logical/ | ||
+ | I/O size (minimum/ | ||
</ | </ | ||
- | Dans le cas où vous avez plusieurs processeurs ou coeurs, vous pouvez visualiser ces mêmes informations par unité de traitement | + | Créez un filesystem Ext3 sur /dev/sdb12 en utilisant la commande **mke2fs -j** : |
< | < | ||
- | [root@centos8 ~]# mpstat | + | [root@centos8 ~]# mke2fs |
- | Linux 4.18.0-305.3.1.el8.x86_64 | + | mke2fs |
+ | Creating filesystem with 204800 1k blocks and 51200 inodes | ||
+ | Filesystem UUID: a2515f45-a32a-4e87-b7e6-170448f3f803 | ||
+ | Superblock backups stored on blocks: | ||
+ | 8193, 24577, 40961, 57345, 73729 | ||
- | 04:54:28 | + | Allocating group tables: done |
- | 04:54:28 | + | Writing inode tables: done |
- | 04:54:28 | + | Creating journal (4096 blocks): done |
- | 04: | + | Writing superblocks and filesystem accounting information: done |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04:54:28 | + | |
</ | </ | ||
- | Pour afficher 5 jeux de statistiques à des intervales de 2 secondes pour tous les unités de traitement, il convient d' | + | Les options |
< | < | ||
- | [root@centos8 ~]# mpstat | + | [root@centos8 ~]# mke2fs |
- | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) 29/06/21 _x86_64_ | + | mke2fs: invalid option |
+ | Usage: mke2fs [-c|-l filename] [-b block-size] [-C cluster-size] | ||
+ | [-i bytes-per-inode] [-I inode-size] [-J journal-options] | ||
+ | [-G flex-group-size] [-N number-of-inodes] [-d root-directory] | ||
+ | [-m reserved-blocks-percentage] [-o creator-os] | ||
+ | [-g blocks-per-group] [-L volume-label] [-M last-mounted-directory] | ||
+ | [-O feature[,...]] [-r fs-revision] [-E extended-option[, | ||
+ | [-t fs-type] [-T usage-type ] [-U UUID] [-e errors_behavior][-z undo_file] | ||
+ | [-jnqvDFSV] device [blocks-count] | ||
+ | </code> | ||
- | 04: | + | <WRAP center round important 60%> |
- | 04:55:13 | + | **Important** |
- | 04: | + | </ |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | ===LAB #11 - Convertir un Système de Fichiers Ext3 en Ext2=== |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04:55:15 | + | Pour vérifier si un système de fichiers Ext2 est journalisé, |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04:55:17 | + | < |
- | 04:55:19 | + | [root@centos8 ~]# dumpe2fs -h / |
- | 04:55:19 | + | dumpe2fs 1.45.6 (20-Mar-2020) |
- | 04:55:19 1 | + | Filesystem volume name: < |
- | 04:55:19 | + | Last mounted on: <not available> |
- | 04:55:19 | + | Filesystem UUID: a2515f45-a32a-4e87-b7e6-170448f3f803 |
- | 04:55:19 | + | Filesystem magic number: |
- | 04:55:19 | + | Filesystem revision #: 1 (dynamic) |
- | 04:55:19 | + | Filesystem features: |
- | 04:55:19 | + | Filesystem flags: |
+ | Default mount options: | ||
+ | Filesystem state: clean | ||
+ | Errors behavior: | ||
+ | Filesystem OS type: Linux | ||
+ | Inode count: | ||
+ | Block count: | ||
+ | Reserved block count: | ||
+ | Free blocks: | ||
+ | Free inodes: | ||
+ | First block: | ||
+ | Block size: 1024 | ||
+ | Fragment size: 1024 | ||
+ | Reserved GDT blocks: 256 | ||
+ | Blocks per group: | ||
+ | Fragments per group: | ||
+ | Inodes per group: | ||
+ | Inode blocks per group: | ||
+ | Filesystem created: Wed Jun 2 07:55:24 2021 | ||
+ | Last mount time: n/a | ||
+ | Last write time: Wed Jun 2 07:55:24 2021 | ||
+ | Mount count: | ||
+ | Maximum mount count: | ||
+ | Last checked: | ||
+ | Check interval: | ||
+ | Reserved blocks uid: | ||
+ | Reserved blocks gid: | ||
+ | First inode: 11 | ||
+ | Inode size: 128 | ||
+ | Journal inode: | ||
+ | Default directory hash: | ||
+ | Directory Hash Seed: faee0b81-0538-4c06-8d86-468bc0c760ac | ||
+ | Journal backup: | ||
+ | Journal features: | ||
+ | Journal size: | ||
+ | Journal length: | ||
+ | Journal sequence: | ||
+ | Journal start: | ||
+ | </ | ||
- | 04: | + | <WRAP center round important 60%> |
- | 04:55:21 | + | **Important** |
- | 04: | + | </ |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | 04: | + | |
- | Average: CPU %usr | + | Les options de cette commande sont : |
- | Average: | + | |
- | Average: | + | < |
- | Average: | + | [root@centos8 ~]# dumpe2fs --help |
- | Average: 2 0.00 0.00 0.00 0.00 0.10 0.00 0.00 0.00 0.00 99.90 | + | dumpe2fs |
- | Average: 3 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 | + | dumpe2fs: invalid option -- ' |
- | Average: | + | Usage: dumpe2fs [-bfghimxV] [-o superblock=< |
- | Average: | + | |
- | Average: | + | |
- | Average: | + | |
</ | </ | ||
- | Les options | + | Pour supprimer le journal du système |
< | < | ||
- | [root@centos8 ~]# mpstat | + | [root@centos8 ~]# tune2fs |
- | Usage: mpstat [ options ] [ < | + | tune2fs 1.45.6 (20-Mar-2020) |
- | Options are: | + | |
- | [ -A ] [ -n ] [ -u ] [ -V ] [ -I { SUM | CPU | SCPU | ALL } ] | + | |
- | [ -N { < | + | |
</ | </ | ||
- | ====3.7 - La Commande sar==== | + | Les options de cette commande sont : |
- | La commande **sar** | + | < |
+ | [root@centos8 ~]# tune2fs --help | ||
+ | tune2fs 1.45.6 | ||
+ | tune2fs: invalid option -- '-' | ||
+ | Usage: tune2fs [-c max_mounts_count] [-e errors_behavior] [-f] [-g group] | ||
+ | [-i interval[d|m|w]] [-j] [-J journal_options] [-l] | ||
+ | [-m reserved_blocks_percent] [-o [^]mount_options[, | ||
+ | [-r reserved_blocks_count] [-u user] [-C mount_count] | ||
+ | [-L volume_label] [-M last_mounted_dir] | ||
+ | [-O [^]feature[, | ||
+ | [-E extended-option[,...]] [-T last_check_time] [-U UUID] | ||
+ | [-I new_inode_size] [-z undo_file] device | ||
+ | </ | ||
- | Sous RHEL/CentOS 8 la commande **/ | + | Constatez le résultat |
< | < | ||
- | [root@centos8 ~]# ls /usr/lib64/sa | + | [root@centos8 ~]# dumpe2fs -h /dev/sdb12 |
- | sa1 sa2 sadc | + | dumpe2fs 1.45.6 (20-Mar-2020) |
+ | Filesystem volume name: < | ||
+ | Last mounted on: <not available> | ||
+ | Filesystem UUID: a2515f45-a32a-4e87-b7e6-170448f3f803 | ||
+ | Filesystem magic number: | ||
+ | Filesystem revision #: 1 (dynamic) | ||
+ | Filesystem features: | ||
+ | Filesystem flags: | ||
+ | Default mount options: | ||
+ | Filesystem state: | ||
+ | Errors behavior: | ||
+ | Filesystem OS type: | ||
+ | Inode count: | ||
+ | Block count: | ||
+ | Reserved block count: | ||
+ | Free blocks: | ||
+ | Free inodes: | ||
+ | First block: | ||
+ | Block size: | ||
+ | Fragment size: 1024 | ||
+ | Reserved GDT blocks: | ||
+ | Blocks per group: | ||
+ | Fragments per group: | ||
+ | Inodes per group: | ||
+ | Inode blocks per group: | ||
+ | Filesystem created: | ||
+ | Last mount time: n/a | ||
+ | Last write time: Wed Jun 2 07:59:01 2021 | ||
+ | Mount count: | ||
+ | Maximum mount count: | ||
+ | Last checked: | ||
+ | Check interval: | ||
+ | Reserved blocks uid: 0 (user root) | ||
+ | Reserved blocks gid: 0 (group root) | ||
+ | First inode: | ||
+ | Inode size: | ||
+ | Default directory hash: | ||
+ | Directory Hash Seed: faee0b81-0538-4c06-8d86-468bc0c760ac | ||
+ | Journal backup: | ||
</ | </ | ||
- | Le script | + | <WRAP center round important 60%> |
+ | **Important** : Notez que le drapeau | ||
+ | </ | ||
- | ^ Option ^ Description ^ | + | Supprimez maintenant l'inode du journal : |
- | | -t | L'intervalle entre les collectes | | + | |
- | | -n | Nombre de collectes | | + | |
- | Le script **/usr/lib64/sa/sa2** exécute la commande **sar** et consigne les informations dans un fichier au format **/var/log/sa/sar<jj>** : | + | < |
+ | [root@centos8 ~]# fsck /dev/sdb12 | ||
+ | fsck from util-linux 2.32.1 | ||
+ | e2fsck 1.45.6 (20-Mar-2020) | ||
+ | /dev/sdb12: clean, 11/51200 files, 8013/204800 blocks | ||
+ | </code> | ||
+ | |||
+ | Créez maintenant un point de montage pour / | ||
< | < | ||
- | [root@centos8 ~]# ls /var/log/sa/ | + | [root@centos8 ~]# mkdir /mnt/sdb12 |
- | sa29 s | + | </code> |
+ | Essayez de monter /dev/sdb12 en tant que système de fichiers Ext3. Vous obtiendrez un résultat similaire à celui-ci : | ||
- | ar29 | + | < |
+ | [root@centos8 ~]# mount -t ext3 /dev/sdb12 / | ||
+ | mount: /mnt/sdb12: wrong fs type, bad option, bad superblock on /dev/sdb12, missing codepage or helper program, or other error. | ||
</ | </ | ||
- | Sous CentOS / RHEL 8, l'intervalle entre les collectes des informations est configuré par les **timers** de systemd au lieu des cron jobs : | + | <WRAP center round important 60%> |
+ | **Important** : Notez l'erreur due au mauvais système de fichiers qui suit l' | ||
+ | </ | ||
+ | |||
+ | Montez maintenant le système | ||
< | < | ||
- | [root@centos8 ~]# cat / | + | [root@centos8 ~]# mount -t ext2 /dev/sdb12 /mnt/sdb12 |
- | # /usr/lib/systemd/system/ | + | </code> |
- | # (C) 2014 Tomasz Torcz <tomek@pipebreaker.pl> | + | |
- | # | + | |
- | # sysstat-11.7.3 systemd unit file: | + | |
- | # Activates activity collector every 10 minutes | + | |
- | [Unit] | + | ===LAB #12 - Convertir un Système de Fichiers Ext2 en Ext3=== |
- | Description=Run system activity accounting tool every 10 minutes | + | |
- | [Timer] | + | Pour replacer le journal sur /dev/sdb12, il convient d' |
- | OnCalendar=*:00/10 | + | |
- | [Install] | + | < |
- | WantedBy=sysstat.service | + | [root@centos8 ~]# umount /mnt/sdb12 |
+ | |||
+ | [root@centos8 ~]# tune2fs -j / | ||
+ | tune2fs 1.45.6 (20-Mar-2020) | ||
+ | Creating journal inode: done | ||
</ | </ | ||
- | La valeur de **OnCalendar** indique | + | <WRAP center round important 60%> |
+ | **Important** : Notez que vous avez du démonter la partition avant d' | ||
+ | </ | ||
+ | |||
+ | ===LAB #13 - Placer le Journal sur un autre Partition=== | ||
+ | |||
+ | Le journal d'un système de fichiers peut être placé sur un autre périphérique bloc. | ||
- | Pour modifier l' | + | Créez |
< | < | ||
- | [root@centos8 ~]# systemctl edit sysstat-collect.timer | + | [root@centos8 ~]# mke2fs |
- | [root@centos8 ~]# cat /etc/systemd/ | + | mke2fs 1.45.6 (20-Mar-2020) |
- | [Unit] | + | Creating filesystem with 512000 1k blocks and 0 inodes |
- | Description=Run system activity accounting tool every 2 minutes | + | Filesystem UUID: 23327281-e88a-4da0-bafa-50ee10c52937 |
+ | Superblock backups stored on blocks: | ||
- | [Timer] | + | Zeroing journal device: |
- | OnCalendar= | + | |
- | OnCalendar=*:00/2 | + | |
- | AccuracySec=0 | + | |
</ | </ | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | **Important** : Notez la ligne **OnCalendar=** qui est necessaire afin de surcharger la valeur par défaut. | + | **Important** : Notez l' |
</ | </ | ||
- | Vérifiez ensuite la prise en compte | + | Créez maintenant un système |
< | < | ||
- | [root@centos8 ~]# systemctl status sysstat-collect.timer | + | [root@centos8 ~]# mke2fs |
- | ● sysstat-collect.timer - Run system activity accounting tool every 2 minutes | + | mke2fs 1.45.6 (20-Mar-2020) |
- | | + | Using journal device' |
- | | + | /dev/sdb12 contains a ext3 file system |
- | └─override.conf | + | last mounted on Wed Jun 2 08:03:11 2021 |
- | Active: active | + | Proceed anyway? |
- | | + | Creating filesystem with 204800 1k blocks and 51200 inodes |
+ | Filesystem UUID: 0e783411-6407-4cba-8db5-0e2729000c9e | ||
+ | Superblock backups stored on blocks: | ||
+ | 8193, 24577, 40961, 57345, 73729 | ||
- | Jun 29 06:16:04 centos8.ittraining.loc systemd[1]: Started Run system activity | + | Allocating group tables: done |
+ | Writing inode tables: done | ||
+ | Adding journal to device /dev/sdb11: done | ||
+ | Writing superblocks and filesystem | ||
</ | </ | ||
+ | |||
+ | <WRAP center round important 60%> | ||
+ | **Important** : Notez que le journal a été placé sur /dev/sdb11 graĉe à l' | ||
+ | </ | ||
+ | |||
+ | ===LAB #14 - Modifier la Fréquence de Vérification du Système de Fichiers Ext3=== | ||
+ | |||
+ | Pour modifier la fréquence de vérification du système de fichiers sur /dev/sdb12, il convient d' | ||
< | < | ||
- | [root@centos8 ~]# journalctl | + | [root@centos8 ~]# tune2fs |
- | -- Logs begin at Mon 2021-06-28 02:04:10 EDT, end at Tue 2021-06-29 09:18:00 EDT. -- | + | tune2fs |
- | Jun 29 06:20:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. | + | Setting interval between checks to 8640000 seconds |
- | Jun 29 06:26:29 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | Jun 29 06:30:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | Jun 29 06:40:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | Jun 29 06:50:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | Jun 29 07:00:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | Jun 29 07:10:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | Jun 29 07:20:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | Jun 29 07:30:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | Jun 29 07:40:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | Jun 29 07:50:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | Jun 29 07:53:56 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | Jun 29 07:54:00 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | Jun 29 07:56:00 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | Jun 29 07:58:00 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | Jun 29 08:00:00 centos8.ittraining.loc systemd[1]: sysstat-collect.service: | + | |
- | ... | + | |
</ | </ | ||
- | Saisissez la commande suivante | + | Dernièrement, |
< | < | ||
- | [root@centos8 ~]# sar | + | [root@centos8 ~]# dumpe2fs /dev/sdb12 | grep UUID |
- | Linux 4.18.0-305.3.1.el8.x86_64 | + | dumpe2fs |
+ | Filesystem UUID: 0e783411-6407-4cba-8db5-0e2729000c9e | ||
+ | Journal UUID: | ||
+ | </code> | ||
- | 06: | + | ====Ext4==== |
- | 06: | + | Le système de fichiers **Ext4** a été introduit dans le noyau **2.6.19** en mode expérimental et est devenu stable dans le noyau **2.6.28**. |
- | 06: | + | |
- | 06: | + | |
- | 06: | + | |
- | 06: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | Average: | + | |
- | 07: | + | Ext4 n'est pas une évolution de Ext3. Cependant il a une compatibilité ascendante avec Ext3. |
- | 07:56:00 CPU | + | Les fonctionnalités majeures d'Ext4 sont : |
- | 07: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 08: | + | |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | * l' |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | Average: | + | |
- | </ | + | |
- | ===Statistiques d'Utilisation du CPU=== | + | L'option **extents** est activée par défaut depuis le noyau **2.6.23**. |
- | Visualisez maintenant les statistiques d' | + | La compatibilité ascendante avec ext3 comprend |
- | < | + | * la possibilité de monter une partition Ext3 en tant que partition Ext4, |
- | [root@centos8 ~]# sar -u 5 3 | + | * la possibilité de monter une partition Ext4 en tant que partition Ext3 mais **uniquement** dans le cas où la partition Ext4 n'ait jamais utilisé l' |
- | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) 29/ | + | |
- | 09: | + | Pour plus d' |
- | 09:22:57 all 0.03 0.00 0.03 0.00 0.00 | + | |
- | 09: | + | |
- | 09: | + | |
- | Average: | + | |
- | </ | + | |
- | D' | + | ===LAB #15 - Créer un Système |
+ | |||
+ | Créez un système de fichiers Ext4 sur **/dev/sdb11** : | ||
< | < | ||
- | [root@centos8 ~]# sar -u ALL 5 3 | + | [root@centos8 ~]# mkfs.ext4 / |
- | Linux 4.18.0-305.3.1.el8.x86_64 | + | mke2fs |
+ | /dev/sdb11 contains a jbd file system | ||
+ | Proceed anyway? | ||
+ | Creating filesystem with 512000 1k blocks and 128016 inodes | ||
+ | Filesystem UUID: 72a6ad08-7023-4561-adcb-d434e00afed1 | ||
+ | Superblock backups stored on blocks: | ||
+ | 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409 | ||
- | 01:49:14 CPU %usr | + | Allocating group tables: done |
- | 01:49:19 all 0.03 0.00 0.00 0.00 0.00 0.03 0.00 0.00 0.00 99.95 | + | Writing inode tables: done |
- | 01: | + | Creating journal (8192 blocks): done |
- | 01:49:29 all 0.00 0.00 0.00 0.25 0.00 0.10 0.05 0.00 0.00 99.60 | + | Writing superblocks and filesystem accounting information: done |
- | Average: | + | |
</ | </ | ||
- | Pour consulter les statistiques d'un coeur spécifique, | + | Les options de cette commande sont : |
< | < | ||
- | [root@centos8 ~]# sar -u -P 1 5 3 | + | [root@centos8 ~]# mkfs.ext4 |
- | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) 29/06/21 _x86_64_ | + | mkfs.ext4: invalid option -- ' |
+ | Usage: mkfs.ext4 [-c|-l filename] [-b block-size] [-C cluster-size] | ||
+ | [-i bytes-per-inode] [-I inode-size] [-J journal-options] | ||
+ | [-G flex-group-size] [-N number-of-inodes] [-d root-directory] | ||
+ | [-m reserved-blocks-percentage] [-o creator-os] | ||
+ | [-g blocks-per-group] [-L volume-label] [-M last-mounted-directory] | ||
+ | [-O feature[,...]] [-r fs-revision] [-E extended-option[, | ||
+ | [-t fs-type] [-T usage-type ] [-U UUID] [-e errors_behavior][-z undo_file] | ||
+ | [-jnqvDFSV] device [blocks-count] | ||
+ | </code> | ||
- | 01:51:52 CPU | + | Consultez maintenant les caractéristiques du système de fichier |
- | 01: | + | |
- | 01: | + | |
- | 01: | + | |
- | Average: | + | |
- | [root@centos8 ~]# sar -u -P 5 5 3 | + | |
- | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) | + | |
- | 01:52:16 CPU | + | < |
- | 01:52:21 5 0.00 0.00 0.00 0.00 0.00 100.00 | + | [root@centos8 ~]# dumpe2fs /dev/sdb11 | more |
- | 01:52:26 5 0.00 0.00 0.00 0.00 0.00 100.00 | + | dumpe2fs 1.45.6 (20-Mar-2020) |
- | 01:52:31 5 0.00 0.00 0.00 0.00 0.00 100.00 | + | Filesystem volume name: < |
- | Average: | + | Last mounted on: < |
+ | Filesystem UUID: | ||
+ | Filesystem magic number: | ||
+ | Filesystem revision #: 1 (dynamic) | ||
+ | Filesystem features: | ||
+ | xtent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize meta | ||
+ | data_csum | ||
+ | Filesystem flags: | ||
+ | Default mount options: | ||
+ | Filesystem state: clean | ||
+ | Errors behavior: | ||
+ | Filesystem OS type: Linux | ||
+ | Inode count: | ||
+ | Block count: | ||
+ | Reserved block count: | ||
+ | Free blocks: | ||
+ | Free inodes: | ||
+ | First block: | ||
+ | Block size: | ||
+ | Fragment size: 1024 | ||
+ | Group descriptor size: | ||
+ | Reserved GDT blocks: | ||
+ | --More-- | ||
</ | </ | ||
- | ===Statistiques d' | + | ===LAB #16 - Ajouter une Etiquette au Système |
- | Utilisez | + | Utilisez |
< | < | ||
- | [root@centos8 ~]# sar -r 5 3 | + | [root@centos8 ~]# e2label /dev/sdb11 my_ext4 |
- | Linux 4.18.0-305.3.1.el8.x86_64 | + | [root@centos8 ~]# dumpe2fs /dev/sdb11 | more |
- | + | dumpe2fs | |
- | 07:33:32 kbmemfree | + | Filesystem volume name: |
- | 07:33:37 1647240 | + | Last mounted on: < |
- | 07:33:42 1647232 | + | Filesystem UUID: 72a6ad08-7023-4561-adcb-d434e00afed1 |
- | 07:33:47 1647232 | + | Filesystem magic number: |
- | Average: | + | Filesystem revision #: 1 (dynamic) |
+ | Filesystem features: | ||
+ | xtent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize meta | ||
+ | data_csum | ||
+ | Filesystem flags: | ||
+ | Default mount options: | ||
+ | Filesystem state: | ||
+ | Errors behavior: | ||
+ | Filesystem OS type: | ||
+ | Inode count: | ||
+ | Block count: | ||
+ | Reserved block count: 25600 | ||
+ | Free blocks: | ||
+ | Free inodes: | ||
+ | First block: | ||
+ | Block size: | ||
+ | Fragment size: 1024 | ||
+ | Group descriptor size: | ||
+ | Reserved GDT blocks: | ||
+ | --More-- | ||
</ | </ | ||
- | Utilisez | + | <WRAP center round important 60%> |
+ | **Important** - Notez que l'étiquette doit être de 16 caractères maximum. | ||
+ | </ | ||
+ | |||
+ | Créez un point de montage dans **/mnt** et essayez de monter **/ | ||
< | < | ||
- | [root@centos8 ~]# sar -S 5 3 | + | [root@centos8 ~]# mkdir /mnt/sdb11 |
- | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) | + | |
- | 07: | + | [root@centos8 ~]# mount -t ext3 /dev/sdb11 /mnt/sdb11 |
- | 07:32:03 3358716 | + | mount: /mnt/sdb11: wrong fs type, bad option, bad superblock on /dev/sdb11, missing codepage or helper program, or other error.. |
- | 07: | + | |
- | 07: | + | |
- | Average: | + | |
</ | </ | ||
- | ===Statistiques des E/S=== | + | <WRAP center round important 60%> |
+ | **Important** - Notez l' | ||
+ | </WRAP> | ||
- | Utilisez l' | + | Montez de nouveau la partition |
< | < | ||
- | [root@centos8 ~]# sar -b 5 3 | + | [root@centos8 ~]# mount /dev/sdb11 /mnt/sdb11 |
- | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) | + | |
- | 09: | + | [root@centos8 ~]# mount | grep sdb11 |
- | 09: | + | /dev/sdb11 on /mnt/sdb11 type ext4 (rw, |
- | 09: | + | |
- | 09: | + | |
- | Average: | + | |
</ | </ | ||
- | ===Statistiques des E/S par Disque=== | + | <WRAP center round important 60%> |
+ | **Important** - Constatez que la partition a été monté en tant qu' | ||
+ | </WRAP> | ||
- | Utilisez l' | + | ===LAB #17 - Convertir un Système de Fichiers Ext3 en Ext4=== |
+ | |||
+ | Créez un système de fichiers ext3 sur /dev/ | ||
< | < | ||
- | [root@centos8 ~]# sar -d 5 3 | + | [root@centos8 ~]# mkfs.ext3 / |
- | Linux 4.18.0-305.3.1.el8.x86_64 | + | mke2fs |
+ | /dev/sdb12 contains a ext3 file system | ||
+ | created on Wed Jun 2 08:10:40 2021 | ||
+ | Proceed anyway? | ||
+ | Creating filesystem with 204800 1k blocks and 51200 inodes | ||
+ | Filesystem UUID: b73322d4-f2e4-43bc-96ae-422d4584f3de | ||
+ | Superblock backups stored on blocks: | ||
+ | 8193, 24577, 40961, 57345, 73729 | ||
- | 09:25:45 DEV | + | Allocating group tables: done |
- | 09:25:50 | + | Writing inode tables: done |
- | 09:25:50 dev8-16 | + | Creating journal (4096 blocks): done |
- | 09:25:50 dev11-0 | + | Writing superblocks and filesystem accounting information: done |
- | 09: | + | </ |
- | 09: | + | |
- | 09: | + | Montez maintenant **/dev/sdb12** sur / |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | 09:25:55 | + | |
- | 09: | + | < |
- | 09: | + | [root@centos8 ~]# mount /dev/sdb12 /mnt/sdb12 |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | 09: | + | |
- | Average: | + | [root@centos8 ~]# ls -l /mnt/sdb12 |
- | Average: | + | total 12 |
- | Average: | + | drwx------. |
- | Average: | + | |
- | Average: | + | |
- | Average: dev253-1 | + | |
</ | </ | ||
- | La colonne | + | Créez le fichier |
< | < | ||
- | [root@centos8 ~]# sar -p -d 5 3 | + | [root@centos8 ~]# touch /mnt/ |
- | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) | + | </code> |
- | 07: | + | Injectez la chaine **check file** dans le fichier |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07:48:37 cl_centos8-swap | + | |
- | 07: | + | < |
- | 07: | + | [root@centos8 ~]# echo "check file" > /mnt/sdb12/ |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | [root@centos8 ~]# umount |
- | 07: | + | </ |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | 07: | + | |
- | Average: | + | Exécutez e2fsck sur /dev/sda12 : |
- | Average: | + | |
- | Average: | + | < |
- | Average: | + | [root@centos8 ~]# e2fsck / |
- | Average: | + | e2fsck 1.45.6 (20-Mar-2020) |
- | Average: | + | /dev/sdb12: clean, 12/51200 files, 12128/ |
</ | </ | ||
- | Les options de la commande sar sont : | + | Convertissez /dev/sdb12 en Ext4 : |
< | < | ||
- | [root@centos8 ~]# sar --help | + | [root@centos8 ~]# tune2fs |
- | Usage: sar [ options ] [ < | + | tune2fs 1.45.6 (20-Mar-2020) |
- | 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 { < | + | |
- | | + | |
- | Keywords are: | + | |
- | DEV | + | |
- | EDEV Network interfaces | + | |
- | 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 | + | |
- | | + | |
- | -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===== | + | Optimisez le système de fichiers : |
- | L'**USB** (//Universal Serial Bus//) est un bus de données qui peut offrir des taux de transfert jusqu' | + | < |
+ | [root@centos8 ~]# e2fsck -fDC0 / | ||
+ | e2fsck 1.45.6 (20-Mar-2020) | ||
+ | Pass 1: Checking inodes, blocks, and sizes | ||
+ | Pass 2: Checking directory structure | ||
+ | Pass 3: Checking directory connectivity | ||
+ | Pass 3A: Optimizing directories | ||
+ | Pass 4: Checking reference counts | ||
+ | Pass 5: Checking group summary information | ||
+ | |||
+ | / | ||
+ | /dev/sdb12: 12/51200 files (0.0% non-contiguous), | ||
+ | </ | ||
- | ^ Version USB ^ Module ^ Nom Complet ^ | + | Essayez de monter |
- | | 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é | + | < |
+ | [root@centos8 ~]# mount -t ext3 /dev/sdb12 / | ||
+ | mount: /mnt/sdb12: wrong fs type, bad option, bad superblock on /dev/sdb12, missing codepage or helper program, or other error. | ||
+ | </ | ||
- | ^ Module ^ Type de Périphérique ^ | + | Montez |
- | | **usb_storage** | + | |
- | | **usbhid** | + | |
- | | **snd-usb-audio** | + | |
- | | **usbvidéo** | + | |
- | | **irda-usb** | + | |
- | | | + | |
- | Les modules peuvent être chargés par un des moyens suivants : | + | < |
+ | [root@centos8 ~]# mount /dev/sdb12 /mnt/sdb12 | ||
- | * INITrd, | + | [root@centos8 ~]# ls -l /mnt/sdb12 |
- | * Le processus init (systemd), | + | total 14 |
- | | + | -rw-r--r--. 1 root root 11 Jun 2 08:45 check_file |
- | | + | drwx------. 2 root root 12288 Jun 2 08:42 lost+found |
- | * manuellement. | + | |
- | =====udev===== | + | [root@centos8 ~]# cat / |
+ | check file | ||
+ | </ | ||
- | Depuis le noyau Linux 2.6 Linux est capable de détecter des périphériques branchés à chaud. Cette technologie s'appelle le **// | + | Dernièrement, |
- | * Udev, | + | < |
- | * HAL, | + | [root@centos8 ~]# dumpe2fs /dev/sdb11 | grep UUID |
- | * Dbus. | + | dumpe2fs 1.45.6 (20-Mar-2020) |
+ | Filesystem UUID: 72a6ad08-7023-4561-adcb-d434e00afed1 | ||
- | Les rôles de chaque composant sont les suivants | + | [root@centos8 ~]# dumpe2fs /dev/sdb12 | grep UUID |
+ | dumpe2fs 1.45.6 (20-Mar-2020) | ||
+ | Filesystem UUID: | ||
+ | </ | ||
- | * Udev se charge de créer et supprimer d'une manière dynamique les nœuds dans le répertoire **/dev**, | + | ====XFS==== |
- | * HAL obtient des informations à partir d'Udev et créé un fichier au format XML représentant le périphérique branché. Il informe ensuite Nautilus en utilisant le Dbus, | + | |
- | * Dbus joue le rôle d'un bus système qui est utilisé pour la communication inter-processus. | + | |
- | Lors de démarrage | + | XFS est un système |
- | | + | <WRAP center round important 60%> |
- | * Udev copie les éventuels nœuds statiques | + | **Important** : Le système |
- | * 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'// | + | Pour plus d'informations concernant XFS, consultez |
- | Le fichier | + | ===LAB #18 - Créer un Système |
- | < | + | Démontez **/dev/sdb12** : |
- | [root@centos8 ~]# cat /etc/udev/ | + | |
- | # 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. | + | |
- | #udev_log=" | + | < |
+ | [root@centos8 ~]# umount /dev/sdb12 | ||
</ | </ | ||
- | Les fichiers | + | Créez un système de fichiers |
< | < | ||
- | [root@centos8 ~]# ls /lib/udev/rules.d/ | + | [root@centos8 ~]# mkfs.xfs -f /dev/sdb12 |
- | 01-md-raid-creating.rules | + | meta-data=/dev/sdb12 |
- | 10-dm.rules | + | = |
- | 11-dm-lvm.rules | + | = |
- | 11-dm-mpath.rules | + | = |
- | 11-dm-parts.rules | + | data |
- | 13-dm-disk.rules | + | = |
- | 39-usbmuxd.rules | + | naming |
- | 40-elevator.rules | + | log =internal log |
- | 40-libgphoto2.rules | + | = |
- | 40-redhat.rules | + | realtime =none |
- | 40-usb-blacklist.rules | + | |
- | 40-usb_modeswitch.rules | + | |
- | 50-udev-default.rules | + | |
- | 60-alias-kmsg.rules | + | |
- | 60-block.rules | + | |
- | 60-cdrom_id.rules | + | |
- | 60-drm.rules | + | |
- | 60-evdev.rules | + | |
- | 60-fido-id.rules | + | |
- | 60-input-id.rules | + | |
- | 60-libfprint-2-autosuspend.rules | + | |
- | 60-net.rules | + | |
- | 60-persistent-alsa.rules | + | |
- | 60-persistent-input.rules | + | |
- | 60-persistent-storage.rules | + | |
- | 60-persistent-storage-tape.rules | + | |
- | 60-persistent-v4l.rules | + | |
- | 60-raw.rules | + | |
- | 60-rdma-ndd.rules | + | |
- | 60-rdma-persistent-naming.rules | + | |
- | 60-sensor.rules | + | |
- | 60-serial.rules | + | |
- | 60-tpm-udev.rules | + | |
- | 61-gdm.rules | + | |
- | 61-gnome-bluetooth-rfkill.rules | + | |
- | 61-gnome-settings-daemon-rfkill.rules | + | |
- | 61-scsi-sg3_id.rules | + | |
- | 62-multipath.rules | + | |
- | 63-fc-wwpn-id.rules | + | |
- | 63-md-raid-arrays.rules | + | |
- | 63-scsi-sg3_symlink.rules | + | |
- | 64-btrfs.rules | + | |
- | 64-md-raid-assembly.rules | + | |
- | 65-libwacom.rules | + | |
- | 65-md-incremental.rules | + | |
- | 65-sane-backends.rules | + | |
- | 66-kpartx.rules | + | |
- | 68-del-part-nodes.rules | + | |
- | 69-btattach-bcm.rules | + | |
- | 69-cd-sensors.rules | + | |
- | 69-dm-lvm-metad.rules | + | |
- | 69-libmtp.rules | + | |
- | 69-md-clustered-confirm-device.rules | + | |
- | 70-hypervfcopy.rules | + | |
- | 70-hypervkvp.rules | + | |
- | 70-hypervvss.rules | + | |
- | 70-joystick.rules | + | |
- | 70-mouse.rules | + | |
- | 70-nvmf-autoconnect.rules | + | |
- | 70-power-switch.rules | + | |
- | 70-printers.rules | + | |
- | 70-spice-vdagentd.rules | + | |
- | 70-touchpad.rules | + | |
</ | </ | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | **Important** | + | **Important** |
</ | </ | ||
- | Comme indique le nom de chaque fichier, le contenu est composé de règles à l' | + | Les options |
< | < | ||
- | [root@centos8 ~]# cat /lib/udev/rules.d/50-udev-default.rules | + | [root@centos8 ~]# mkfs.xfs --help |
- | # do not edit this file, it will be overwritten on update | + | mkfs.xfs: invalid option -- ' |
+ | unknown option -- | ||
+ | Usage: mkfs.xfs | ||
+ | /* blocksize */ [-b size=num] | ||
+ | /* metadata */ [-m crc=0|1, | ||
+ | /* data subvol */ [-d agcount=n, | ||
+ | (sunit=value, | ||
+ | sectsize=num | ||
+ | /* force overwrite */ [-f] | ||
+ | /* inode size */ [-i log=n|perblock=n|size=num, | ||
+ | projid32bit=0|1, | ||
+ | /* no discard */ [-K] | ||
+ | /* log subvol */ [-l agnum=n, | ||
+ | sunit=value|su=num, | ||
+ | /* label */ [-L label (maximum 12 characters)] | ||
+ | /* naming */ [-n size=num, | ||
+ | /* no-op info only */ [-N] | ||
+ | /* prototype | ||
+ | /* quiet */ [-q] | ||
+ | /* realtime subvol */ [-r extsize=num,size=num, | ||
+ | /* sectorsize */ [-s size=num] | ||
+ | /* version */ [-V] | ||
+ | devicename | ||
+ | < | ||
+ | <num> is xxx (bytes), xxxs (sectors), xxxb (fs blocks), xxxk (xxx KiB), | ||
+ | xxxm (xxx MiB), xxxg (xxx GiB), xxxt (xxx TiB) or xxxp (xxx PiB). | ||
+ | < | ||
+ | </ | ||
- | # run a command on remove events | + | Consultez maintenant les caractéristiques du système de fichier : |
- | ACTION==" | + | |
- | ACTION==" | + | |
- | SUBSYSTEM==" | + | < |
+ | [root@centos8 ~]# xfs_info / | ||
+ | meta-data=/ | ||
+ | = sectsz=512 | ||
+ | = crc=1 finobt=1, sparse=1, rmapbt=0 | ||
+ | | ||
+ | data | ||
+ | | ||
+ | naming | ||
+ | log =internal log | ||
+ | | ||
+ | realtime =none | ||
+ | </code> | ||
- | # select " | + | Les options de cette commande sont : |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | < |
- | ENV{MODALIAS}!="", | + | [root@centos8 ~]# xfs_info |
+ | / | ||
+ | Usage: xfs_info [-V] [-t mtab] [mountpoint|device|file] | ||
+ | </ | ||
- | ACTION!=" | + | ===LAB #19 - Ajouter une Etiquette au Système de Fichiers XFS=== |
- | SUBSYSTEM==" | + | Utilisez la commande |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | KERNEL==" | + | |
- | SUBSYSTEM==" | + | < |
+ | [root@centos8 ~]# xfs_admin -L my_xfs / | ||
+ | xfs_admin: /dev/sdb12 contains a mounted filesystem | ||
- | SUBSYSTEM==" | + | fatal error -- couldn' |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | [root@centos8 ~]# umount /dev/sdb12 |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | |
- | SUBSYSTEM==" | + | [root@centos8 ~]# xfs_admin -L my_xfs /dev/sdb12 |
- | SUBSYSTEM==" | + | writing all SBs |
- | + | new label = "my_xfs" | |
- | SUBSYSTEM=="sound", GROUP=" | + | |
- | OPTIONS+=" | + | |
- | --More-- | + | |
</ | </ | ||
- | Chaque règle prend la forme suivante : | + | <WRAP center round important 60%> |
+ | **Important** - Notez que la partition XFS doit être démonté pour pouvoir utiliser la commande **xfs_admin**. | ||
+ | </ | ||
- | KEY, [KEY, ...] NAME [, SYMLINK] | + | Pour voir l'étiquette, utilisez |
- | + | ||
- | 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'information sur un périphérique il convient d' | + | |
< | < | ||
- | [root@centos8 ~]# udevadm info --query=all -n /dev/sda | + | [root@centos8 ~]# xfs_admin |
- | P: / | + | label = " |
- | N: sda | + | |
- | S: disk/ | + | |
- | S: disk/ | + | |
- | S: disk/ | + | |
- | S: disk/ | + | |
- | S: disk/ | + | |
- | E: DEVLINKS=/ | + | |
- | E: DEVNAME=/ | + | |
- | E: DEVPATH=/ | + | |
- | E: DEVTYPE=disk | + | |
- | E: ID_ATA=1 | + | |
- | E: ID_ATA_FEATURE_SET_SMART=1 | + | |
- | E: ID_ATA_FEATURE_SET_SMART_ENABLED=1 | + | |
- | E: ID_ATA_SATA=1 | + | |
- | E: ID_ATA_WRITE_CACHE=1 | + | |
- | E: ID_ATA_WRITE_CACHE_ENABLED=1 | + | |
- | E: ID_BUS=ata | + | |
- | E: ID_MODEL=QEMU_HARDDISK | + | |
- | E: ID_MODEL_ENC=QEMU\x20HARDDISK\x20\x20\x20 | + | |
- | E: ID_PART_TABLE_TYPE=dos | + | |
- | E: ID_PART_TABLE_UUID=b39ec5c8 | + | |
- | E: ID_PATH=pci-0000: | + | |
- | E: ID_PATH_TAG=pci-0000_00_07_0-ata-1 | + | |
- | E: ID_REVISION=2.5+ | + | |
- | E: ID_SCSI=1 | + | |
- | E: ID_SCSI_INQUIRY=1 | + | |
- | E: ID_SERIAL=QEMU_HARDDISK_QM00005 | + | |
- | E: ID_SERIAL_SHORT=QM00005 | + | |
- | E: ID_TYPE=disk | + | |
- | E: ID_VENDOR=ATA | + | |
- | E: ID_VENDOR_ENC=ATA\x20\x20\x20\x20\x20 | + | |
- | E: MAJOR=8 | + | |
- | E: MINOR=0 | + | |
- | E: SCSI_IDENT_LUN_ATA=QEMU_HARDDISK_QM00005 | + | |
- | E: SCSI_IDENT_LUN_T10=ATA_QEMU_HARDDISK_QM00005 | + | |
- | E: SCSI_IDENT_LUN_VENDOR=QM00005 | + | |
- | E: SCSI_IDENT_SERIAL=QM00005 | + | |
- | E: SCSI_MODEL=QEMU_HARDDISK | + | |
- | E: SCSI_MODEL_ENC=QEMU\x20HARDDISK\x20\x20\x20 | + | |
- | E: SCSI_REVISION=2.5+ | + | |
- | E: SCSI_TPGS=0 | + | |
- | E: SCSI_TYPE=disk | + | |
- | E: SCSI_VENDOR=ATA | + | |
- | E: SCSI_VENDOR_ENC=ATA\x20\x20\x20\x20\x20 | + | |
- | E: SUBSYSTEM=block | + | |
- | E: TAGS=: | + | |
- | E: USEC_INITIALIZED=8735808 | + | |
</ | </ | ||
- | ===Les options | + | <WRAP center round important 60%> |
+ | **Important** - Notez que l' | ||
+ | </ | ||
- | Les options de la commande | + | Les options de cette commande sont : |
< | < | ||
- | [root@centos8 ~]# udevadm | + | [root@centos8 ~]# xfs_admin |
- | udevadm [--help] [--version] [--debug] COMMAND | + | / |
- | + | Usage: xfs_admin | |
- | 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 | + | |
- | + | ||
- | [root@centos8 ~]# udevadm info --help | + | |
- | 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 | + | |
</ | </ | ||
- | =====Système de fichiers /sys===== | + | Dernièrement, |
- | + | ||
- | Le système de fichiers | + | |
- | + | ||
- | Saisissez la commande suivante | + | |
< | < | ||
- | [root@centos8 ~]# ls -l /sys | + | [root@centos8 ~]# xfs_admin |
- | total 0 | + | UUID = 15db1b62-0866-4aa4-9ac1-3ac325a4e20f |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. 14 root root 0 Jul 12 08:15 devices | + | |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. 153 root root 0 Jul 12 08:15 module | + | |
- | drwxr-xr-x. 2 root root 0 Jul 12 08:15 power | + | |
</ | </ | ||
- | Chaque répertoire contient des informations : | + | <WRAP center round important 60%> |
+ | **Important** - La commande **xfs_metadump** est utilisée pour sauvegarder les méta-données du système de fichiers, tandis que la commande **xfs_mdrestore** est utilisée pour restaurer les les méta-données du système de fichiers. | ||
+ | </ | ||
- | * **block** | + | =====Autres Systèmes |
- | * 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 : | + | <WRAP center round important 60%> |
+ | **Important** - Veuillez noter que le support des systèmes de fichiers **ReiserFS**, **JFS** et **Btrfs** est **absent** du noyau des distributions de Red Hat. | ||
+ | </ | ||
- | < | + | ====ReiserFS==== |
- | [root@centos8 ~]# cat / | + | |
- | 2097152 | + | |
- | </ | + | |
- | Ce chiffre correspond aux nombre de secteurs. | + | %%ReiserFS%% permet : |
- | =====LAB #4 - Limitation | + | * de meilleurs temps d' |
+ | * une plus grande efficacité pour ce qui concerne le stockage | ||
- | ====4.1 - ulimit==== | + | Pour plus d' |
- | Les ressources disponibles aux utilisateurs peuvent être limitées par l' | + | ====JFS==== |
- | La commande **ulimit** gère deux types de limite, la limite | + | JFS //Journaled File System// est un système de fichiers journalisé mis au point par IBM et disponible sous licence GPL. |
- | La limite //soft// est la limite imposée à l'utilisateur par défaut tandis que la limite | + | Pour plus d'informations concernant JFS, consultez **[[http://en.wikipedia.org/wiki/JFS_(file_system)|cette page]]**. |
- | L' | + | ====Btrfs==== |
- | < | + | **[[https://btrfs.wiki.kernel.org/|Btrfs]]**, (B-tree file system, prononcé ButterFS) est un système de fichiers expérimental basé sur la copie sur écriture sous licence GNU GPL, développé principalement par Oracle, Red Hat, Fujitsu, Intel, SUSE et STRATO AG, qui s' |
- | [root@centos8 ~]# cat /etc/security/limits.conf | + | |
- | # / | + | |
- | # | + | |
- | #This file sets the resource limits for the users logged in via PAM. | + | |
- | #It does not affect resource limits of the system services. | + | |
- | # | + | |
- | #Also note that configuration files in /etc/ | + | |
- | #which are read in alphabetical order, override the settings in this | + | |
- | #file in case the domain is the same or more specific. | + | |
- | #That means for example that setting a limit for wildcard domain here | + | |
- | #can be overriden with a wildcard setting in a config file in the | + | |
- | # | + | |
- | #with a user specific setting in the subdirectory. | + | |
- | # | + | |
- | #Each line describes a limit for a user in the form: | + | |
- | # | + | |
- | #< | + | |
- | # | + | |
- | #Where: | + | |
- | #< | + | |
- | # - a user name | + | |
- | # - a group name, with @group syntax | + | |
- | # - the wildcard | + | |
- | # - the wildcard %, can be also used with %group syntax, | + | |
- | # for maxlogin limit | + | |
- | # | + | |
- | #< | + | |
- | # - " | + | |
- | # - " | + | |
- | # | + | |
- | #< | + | |
- | # - 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 | + | |
- | # - 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 | + | |
- | # | + | |
- | #< | + | |
- | # | + | |
- | #* | + | A noter sont les points suivants : |
- | #* | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | #ftp | + | |
- | # | + | |
- | # End of file | + | * Btrfs utilise des extents, |
- | </ | + | * Btrfs stocke les données des très petits fichiers directement dans l' |
+ | * Btrfs gère une notion de « sous-volumes » permettant ainsi des snapshots, | ||
+ | * Btrfs possède ses techniques propres de protection des données, | ||
+ | * Btrfs permet de redimensionner à chaud la taille du système de fichiers, | ||
+ | * Btrfs gère le RAID 0 ainsi que le RAID 1 logiciel, | ||
+ | * Btrfs gère la comprssion du système de fichiers. | ||
- | <WRAP center round important 60%> | + | =====Comparaison des Commandes par Système |
- | **Important** : La valeur | + | |
- | </WRAP> | + | ^ Description ^ Ext3 ^ Ext4 ^ XFS ^ ReiserFS ^ JFS ^ Btrfs ^ |
+ | | Build a Linux filesystem | mkfs.ext3 (mke2fs -j) | mkfs.ext4 (mke4fs) | mkfs.xfs | mkfs.reiserfs (mkreiserfs) | mkfs.jfs (jfs_mkfs) | mkfs.btrfs | | ||
+ | | Check a Linux filesystem | e2fsck | e2fsck | xfs_check | ||
+ | | Adjust tunable filesystem parameters Linux filesystems | tune2fs | tune2fs | xfs_admin | reiserfstune | jfs_tune | btrfs-show-super, | ||
+ | | File system resizer | resize2fs | resize2fs | xfs_growfs | resize_reiserfs | S/O | btrfs filesystem resize | | ||
+ | | Dump filesystem information | dumpe2fs | dumpe2fs | xfs_info / xfs_metadump | debugreiserfs | jfs_tune | btrfstune | | ||
+ | | File system debugger | debugfs | debugfs | xfs_db | debugreiserfs | jfs_debugfs | btrfs-debug-tree | | ||
+ | | Change the label on a filesystem | e2label | e2label | xfs_admin | reiserfstune | jfs_tune | btrfs filesystem label | | ||
- | Par exemple, si root inscrit les deux ligne suivantes dans le fichier / | + | =====LAB #20 - Créer un Système de Fichiers ISO===== |
- | < | + | ====La Commande mkisofs==== |
- | ... | + | |
- | trainee | + | |
- | trainee | + | |
- | ... | + | |
- | </ | + | |
- | la limite du nombre | + | Pour créer un fichier ISO à partir d'une arborescence |
< | < | ||
- | $ ulimit | + | [root@centos8 ~]# cd /tmp |
+ | [root@centos8 tmp]# mkisofs | ||
+ | I: -input-charset not specified, using utf-8 (detected in locale settings) | ||
+ | Total translation table size: 1827 | ||
+ | Total rockridge attributes bytes: 1976 | ||
+ | Total directory bytes: 14336 | ||
+ | Path table size(bytes): | ||
+ | Max brk space used 1c000 | ||
+ | 186 extents written (0 MB) | ||
</ | </ | ||
- | Pour consulter la liste des limites actuelles, il convient d' | + | Le fichier ISO peut être monter en utilisant un périphérique de type **loop** : |
< | < | ||
- | [root@centos8 | + | [root@centos8 |
- | core file size (blocks, | + | mount: /mnt: WARNING: device write-protected, mounted read-only. |
- | data seg size | + | [root@centos8 tmp]# ls /mnt |
- | scheduling priority | + | systemd-private-192104a9224f499286f5adb5754e9e04-chronyd.service-FI2YXs |
- | file size | + | [root@centos8 tmp]# ls |
- | pending signals | + | systemd-private-192104a9224f499286f5adb5754e9e04-chronyd.service-FI2YXs |
- | max locked memory | + | |
- | max memory size | + | |
- | open files (-n) 1024 | + | |
- | pipe size (512 bytes, | + | |
- | POSIX message queues | + | |
- | real-time priority | + | |
- | stack size (kbytes, -s) 8192 | + | |
- | cpu time | + | |
- | max user processes | + | |
- | virtual memory | + | |
- | file locks (-x) unlimited | + | |
</ | </ | ||
- | ====Options de la commande==== | + | Démontez maintenant le fichier ISO : |
- | + | ||
- | Les options de **ulimit** sont : | + | |
< | < | ||
- | [root@centos8 | + | [root@centos8 |
- | ulimit: ulimit | + | [root@centos8 ~]# umount /tmp/tmp.iso |
- | Modify shell resource limits. | + | |
- | + | ||
- | Provides control over the resources available to the shell and processes | + | |
- | it creates, on systems that allow such control. | + | |
- | + | ||
- | Options: | + | |
- | -S use the `soft' resource limit | + | |
- | -H use the `hard' resource limit | + | |
- | -a all current limits are reported | + | |
- | -b the socket buffer size | + | |
- | -c the maximum size of core files created | + | |
- | -d the maximum size of a process' | + | |
- | -e the maximum scheduling priority (`nice' | + | |
- | -f the maximum size of files written by the shell and its children | + | |
- | -i the maximum number of pending signals | + | |
- | -k the maximum number of kqueues allocated for this process | + | |
- | -l the maximum size a process may lock into memory | + | |
- | -m the maximum resident set size | + | |
- | -n the maximum number of open file descriptors | + | |
- | -p the pipe buffer size | + | |
- | -q the maximum number of bytes in POSIX message queues | + | |
- | -r the maximum real-time scheduling priority | + | |
- | -s the maximum stack size | + | |
- | -t the maximum amount of cpu time in seconds | + | |
- | -u the maximum number of user processes | + | |
- | -v the size of virtual memory | + | |
- | -x the maximum number of file locks | + | |
- | -P the maximum number of pseudoterminals | + | |
- | -T the maximum number of threads | + | |
- | + | ||
- | Not all options are available on all platforms. | + | |
- | + | ||
- | If LIMIT is given, it is the new value of the specified resource; the | + | |
- | special LIMIT values `soft', | + | |
- | 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. | + | |
</ | </ | ||
- | ====4.2 - Groupes | + | ====Options |
- | Les **Groupes | + | Les options |
- | Les groupes de contrôle sont organisés de manière hiérarchique, | + | < |
+ | [root@centos8 ~]# mkisofs --help | ||
+ | Usage: genisoimage [options] file... | ||
+ | Options: | ||
+ | -nobak | ||
+ | -no-bak | ||
+ | -abstract FILE Set Abstract filename | ||
+ | -A ID, -appid ID Set Application ID | ||
+ | -biblio FILE Set Bibliographic filename | ||
+ | -cache-inodes | ||
+ | -no-cache-inodes | ||
+ | -check-oldnames | ||
+ | -check-session FILE Check all ISO9660 names from previous session | ||
+ | -copyright FILE Set Copyright filename | ||
+ | -debug | ||
+ | -b FILE, -eltorito-boot FILE | ||
+ | Set El Torito boot image name | ||
+ | -e FILE, -efi-boot FILE Set EFI boot image name | ||
+ | -eltorito-alt-boot | ||
+ | -B FILES, -sparc-boot FILES Set sparc boot image names | ||
+ | -sunx86-boot FILES Set sunx86 boot image names | ||
+ | -G FILE, -generic-boot FILE Set generic boot image name | ||
+ | -sparc-label label text Set sparc boot disk label | ||
+ | -sunx86-label label text Set sunx86 boot disk label | ||
+ | -c FILE, -eltorito-catalog FILE | ||
+ | Set El Torito boot catalog name | ||
+ | -C PARAMS, -cdrecord-params PARAMS | ||
+ | Magic paramters from cdrecord | ||
+ | -d, -omit-period | ||
+ | -dir-mode mode Make the mode of all directories this mode. | ||
+ | -D, -disable-deep-relocation | ||
+ | Disable deep directory relocation (violates ISO9660) | ||
+ | -file-mode mode Make the mode of all plain files this mode. | ||
+ | -f, -follow-links | ||
+ | -gid gid Make the group owner of all files this gid. | ||
+ | -graft-points | ||
+ | -root DIR Set root directory for all new files and directories | ||
+ | -old-root DIR Set root directory in previous session that is searched for files | ||
+ | -help Print option help | ||
+ | -hide GLOBFILE | ||
+ | -hide-list FILE File with list of ISO9660/RR files to hide | ||
+ | -hidden GLOBFILE | ||
+ | -hidden-list FILE File with list of ISO9660 files with hidden attribute | ||
+ | -hide-joliet GLOBFILE | ||
+ | -hide-joliet-list FILE File with list of Joliet files to hide | ||
+ | -hide-joliet-trans-tbl | ||
+ | -hide-rr-moved | ||
+ | -gui Switch behaviour for GUI | ||
+ | -i ADD_FILES | ||
+ | -input-charset CHARSET | ||
+ | -output-charset CHARSET | ||
+ | -iso-level LEVEL Set ISO9660 conformance level (1..3) or 4 for ISO9660 version 2 | ||
+ | -J, -joliet | ||
+ | -joliet-long | ||
+ | -jcharset CHARSET | ||
+ | -l, -full-iso9660-filenames Allow full 31 character filenames for ISO9660 names | ||
+ | -max-iso9660-filenames | ||
+ | -allow-limited-size | ||
+ | -allow-leading-dots | ||
+ | -ldots | ||
+ | -L, -allow-leading-dots | ||
+ | -log-file LOG_FILE | ||
+ | -m GLOBFILE, -exclude GLOBFILE | ||
+ | Exclude file name | ||
+ | -exclude-list FILE File with list of file names to exclude | ||
+ | -pad Pad output to a multiple of 32k (default) | ||
+ | -no-pad | ||
+ | -M FILE, -prev-session FILE Set path to previous session to merge | ||
+ | -dev SCSIdev | ||
+ | -N, -omit-version-number | ||
+ | -new-dir-mode mode Mode used when creating new directories. | ||
+ | -force-rr | ||
+ | -no-rr | ||
+ | -no-split-symlink-components | ||
+ | Inhibit splitting symlink components | ||
+ | -no-split-symlink-fields | ||
+ | -o FILE, -output FILE Set output file name | ||
+ | -path-list FILE File with list of pathnames to process | ||
+ | -p PREP, -preparer PREP Set Volume preparer | ||
+ | -print-size | ||
+ | -publisher PUB Set Volume publisher | ||
+ | -P PUB, -publisher PUB Set Volume publisher | ||
+ | -quiet | ||
+ | -r, -rational-rock | ||
+ | -R, -rock | ||
+ | -s TYPE, -sectype TYPE Set output sector type to e.g. data/ | ||
+ | -alpha-boot FILE Set alpha boot image name (relative to image root) | ||
+ | -hppa-cmdline CMDLINE | ||
+ | -hppa-kernel-32 FILE Set hppa 32-bit image name (relative to image root) | ||
+ | -hppa-kernel-64 FILE Set hppa 64-bit image name (relative to image root) | ||
+ | -hppa-bootloader FILE Set hppa boot loader file name (relative to image root) | ||
+ | -hppa-ramdisk FILE Set hppa ramdisk file name (relative to image root) | ||
+ | -mips-boot FILE Set mips boot image name (relative to image root) | ||
+ | -mipsel-boot FILE Set mipsel boot image name (relative to image root) | ||
+ | -jigdo-jigdo FILE | ||
+ | -jigdo-template FILE Produce a jigdo .template file as well as the .iso | ||
+ | -jigdo-min-file-size SIZE | ||
+ | -jigdo-force-md5 PATTERN | ||
+ | -jigdo-exclude PATTERN | ||
+ | -jigdo-map PATTERN1=PATTERN2 | ||
+ | Pattern(s) to map paths (e.g. Debian=/ | ||
+ | -md5-list FILE File containing MD5 sums of the files that should be checked | ||
+ | -jigdo-template-compress ALGORITHM | ||
+ | Choose to use gzip or bzip2 compression for template data; default is gzip | ||
+ | -checksum_algorithm_iso alg1, | ||
+ | Specify the checksum types desired for the output image | ||
+ | -checksum_algorithm_template alg1, | ||
+ | Specify the checksum types desired for the output jigdo template | ||
+ | -sort FILE Sort file content locations according to rules in FILE | ||
+ | -split-output | ||
+ | -stream-file-name FILE_NAME Set the stream file ISO9660 name (incl. version) | ||
+ | -stream-media-size # Set the size of your CD media in sectors | ||
+ | -sysid ID Set System ID | ||
+ | -T, -translation-table | ||
+ | -table-name TABLE_NAME | ||
+ | -ucs-level LEVEL Set Joliet UCS level (1..3) | ||
+ | -udf Generate UDF file system | ||
+ | -dvd-video | ||
+ | -uid uid Make the owner of all files this uid. | ||
+ | -U, -untranslated-filenames Allow Untranslated filenames (for HPUX & AIX - violates ISO9660). Forces -l, -d, -N, -allow-leading-dots, | ||
+ | -relaxed-filenames | ||
+ | -no-iso-translate | ||
+ | -allow-lowercase | ||
+ | -allow-multidot | ||
+ | -use-fileversion LEVEL Use file version # from filesystem | ||
+ | -v, -verbose | ||
+ | -version | ||
+ | -V ID, -volid ID Set Volume ID | ||
+ | -volset ID Set Volume set ID | ||
+ | -volset-size # Set Volume set size | ||
+ | -volset-seqno # Set Volume set sequence number | ||
+ | -x FILE, -old-exclude FILE Exclude file name(depreciated) | ||
+ | -hard-disk-boot | ||
+ | -no-emul-boot | ||
+ | -no-boot | ||
+ | -boot-load-seg # Set load segment for boot image | ||
+ | -boot-load-size # Set numbers of load sectors | ||
+ | -boot-info-table | ||
+ | -XA | ||
+ | -xa | ||
+ | -z, -transparent-compression | ||
+ | Enable transparent compression of files | ||
+ | -hfs-type TYPE Set HFS default TYPE | ||
+ | -hfs-creator CREATOR | ||
+ | -g, -apple | ||
+ | -h, -hfs Create ISO9660/HFS hybrid | ||
+ | -map MAPPING_FILE | ||
+ | -H MAPPING_FILE, | ||
+ | Map file extensions to HFS TYPE/ | ||
+ | -magic FILE Magic file for HFS TYPE/ | ||
+ | -probe | ||
+ | -mac-name | ||
+ | -no-mac-files | ||
+ | -boot-hfs-file FILE Set HFS boot image name | ||
+ | -part | ||
+ | -cluster-size SIZE Cluster size for PC Exchange Macintosh files | ||
+ | -auto FILE Set HFS AutoStart file name | ||
+ | -no-desktop | ||
+ | -hide-hfs GLOBFILE | ||
+ | -hide-hfs-list FILE List of HFS files to hide | ||
+ | -hfs-volid HFS_VOLID | ||
+ | -icon-position | ||
+ | -root-info FILE | ||
+ | -input-hfs-charset CHARSET | ||
+ | -output-hfs-charset CHARSET Output charset for HFS file name conversion | ||
+ | -hfs-unlock | ||
+ | -hfs-bless FOLDER_NAME | ||
+ | -hfs-parms PARAMETERS | ||
+ | -prep-boot FILE PReP boot image file -- up to 4 are allowed | ||
+ | -chrp-boot | ||
+ | --cap Look for AUFS CAP Macintosh files | ||
+ | --netatalk | ||
+ | --double | ||
+ | --ethershare | ||
+ | --exchange | ||
+ | --sgi Look for SGI Macintosh files | ||
+ | --macbin | ||
+ | --single | ||
+ | --ushare | ||
+ | --xinet | ||
+ | --dave | ||
+ | --sfm Look for SFM Macintosh files | ||
+ | --osx-double | ||
+ | --osx-hfs | ||
- | Ces hiérarchies multiples et séparés sont necéssaires parce que chaque hiérarchie est attaché à un ou plusieurs **sous-système(s)** aussi appelés des **Contrôleurs de Ressources** ou simplement des **Contrôleurs**. Les contrôleurs disponibles sous RHEl/CentOS 7 sont : | + | Report problems to debburn-devel@lists.alioth.debian.org. |
+ | </code> | ||
- | * **blkio** - utilisé pour établir des limites sur l' | + | =====Systèmes |
- | * **cpu** - utilisé pour fournir aux tâches des groupes | + | |
- | * **cpuacct** - utilisé pour produire des rapports automatiques sur les ressources CPU utilisées par les tâches dans un groupe de contrôle, | + | |
- | * **cpuset** - utilisé pour assigner des CPU individuels sur un système multicoeur et des noeuds de mémoire à des tâches dans un groupe de contrôle, | + | |
- | * **devices** - utilisé pour autoriser ou pour refuser l' | + | |
- | * **freezer** - utilisé pour suspendre ou pour réactiver les tâches dans un groupe de contrôle, | + | |
- | * **memory** - utilisé pour établir les limites d' | + | |
- | * **net_cls** - utilisé pour repèrer les paquets réseau avec un identifiant de classe (//classid//) afin de permettre au contrôleur de trafic Linux, **tc**, | + | |
- | * **perf_event** | + | |
- | * **hugetlb** - utilisé pour limiter des ressources sur des pages de mémoire virtuelle de grande taille. | + | |
- | Pour visualiser les hiérarchies, | + | ====LAB #21 - Créer un Système de Fichiers Chiffré avec LUKS sous RHEL/CentOS 8===== |
- | < | + | ===Présentation=== |
- | [root@centos8 ~]# lssubsys -am | + | |
- | bash: lssubsys: command not found... | + | |
- | Install package ' | + | |
+ | **LUKS** ( Linux Unified Key Setup ) permet de chiffrer l' | ||
- | * Waiting in queue... | + | ===Mise en Place=== |
- | The following packages have to be installed: | + | |
- | | + | |
- | | + | |
- | Proceed with changes? [N/y] y | + | |
+ | Remplissez la partition /dev/sdb12 avec des données aléatoires : | ||
- | * Waiting in queue... | + | < |
- | * Waiting for authentication... | + | [root@centos8 ~]# shred -v --iterations=1 |
- | * Waiting in queue... | + | shred: |
- | * Downloading packages... | + | |
- | * Requesting data... | + | |
- | * Testing changes... | + | |
- | * Installing packages... | + | |
- | cpuset | + | |
- | cpu, | + | |
- | blkio / | + | |
- | memory / | + | |
- | devices / | + | |
- | freezer / | + | |
- | net_cls, | + | |
- | perf_event / | + | |
- | hugetlb / | + | |
- | pids / | + | |
- | rdma / | + | |
</ | </ | ||
- | <code> | + | <WRAP center round important 60%> |
- | [root@centos8 ~]# lssubsys | + | **Important** : L' |
- | cpuset / | + | </WRAP> |
- | cpu,cpuacct / | + | |
- | blkio / | + | |
- | memory / | + | |
- | devices / | + | |
- | freezer / | + | |
- | net_cls, | + | |
- | perf_event / | + | |
- | hugetlb / | + | |
- | pids / | + | |
- | rdma / | + | |
- | </code> | + | |
- | Sous RHEL/CentOS 8, **Systemd** organise les processus dans chaque CGroup. Par exemple tous les processus démarrés par le serveur Apache se trouveront dans le même CGroup, y compris les scripts CGI. Ceci implique que la gestion des ressources en utilisant des hiérarchies est couplé | + | Initialisez |
- | En haut de l' | + | < |
+ | [root@centos8 ~]# cryptsetup | ||
- | * le **system.slice** - l' | + | WARNING! |
- | * le **user.slice** - l' | + | ======== |
- | * le **machine.slice** - l' | + | This will overwrite data on /dev/sdb12 irrevocably. |
- | En dessous des tranches peuvent se trouver | + | Are you sure? (Type ' |
+ | Enter passphrase for /dev/sdb12: fenestros123456789 | ||
+ | Verify passphrase: fenestros123456789 | ||
+ | Key slot 0 created. | ||
+ | Command successful. | ||
+ | </ | ||
- | * des **scopes** - des processus crées par **fork**, | + | <WRAP center round important 60%> |
- | * des **services** - des processus créés par une **Unité**. | + | **Important** : La passphrase ne sera pas en claire. Elle l'est ici pour vous montrer un mot de passe acceptable pour LUKS. |
+ | </ | ||
- | Les slices peuvent être visualisés avec la commande suivante | + | Ouvrez |
< | < | ||
- | [root@centos8 ~]# systemctl list-units --type=slice | + | [root@centos8 ~]# cryptsetup luksOpen /dev/sdb12 sdb12 |
- | UNIT LOAD | + | Enter passphrase for /dev/sdb12: fenestros123456789 |
- | -.slice | + | </ |
- | machine.slice | + | |
- | system-getty.slice | + | |
- | system-lvm2\x2dpvscan.slice | + | |
- | system-sshd\x2dkeygen.slice | + | |
- | system-systemd\x2dfsck.slice | + | |
- | system-systemd\x2dhibernate\x2dresume.slice loaded active active system-systemd\x2dhibernate\x2dresume.slice | + | |
- | system-user\x2druntime\x2ddir.slice | + | |
- | system-vncserver.slice | + | |
- | system.slice | + | |
- | user-1000.slice | + | |
- | user-42.slice | + | |
- | user.slice | + | |
- | LOAD = Reflects whether the unit definition was properly loaded. | + | Vérifiez que le système voit la partition : |
- | ACTIVE = The high-level unit activation state, i.e. generalization of SUB. | + | |
- | SUB = The low-level unit activation state, values depend on unit type. | + | |
- | 13 loaded units listed. Pass --all to see loaded but inactive units, too. | + | < |
- | To show all installed unit files use ' | + | [root@centos8 ~]# ls -l /dev/mapper | grep sdb12 |
+ | lrwxrwxrwx. 1 root root 7 Jun 2 10:03 sdb12 -> ../dm-2 | ||
</ | </ | ||
- | L' | + | Créez maintenant un système |
< | < | ||
- | [root@centos8 ~]# systemd-cgls | + | [root@centos8 ~]# mkfs.xfs /dev/mapper/sdb12 |
- | Control group /: | + | meta-data=/dev/mapper/sdb12 isize=512 |
- | -.slice | + | = |
- | ├─user.slice | + | |
- | │ ├─user-42.slice | + | |
- | │ │ ├─session-c1.scope | + | data = bsize=4096 |
- | │ │ │ ├─1317 gdm-session-worker [pam/gdm-launch-environment] | + | = |
- | │ │ │ ├─1459 | + | naming |
- | │ │ │ ├─1856 / | + | log |
- | │ │ │ ├─1882 / | + | = |
- | │ │ │ ├─2059 / | + | realtime |
- | │ │ │ ├─2132 ibus-daemon --xim --panel disable | + | |
- | │ │ │ ├─2135 / | + | |
- | │ │ │ ├─2138 / | + | |
- | │ │ │ ├─2251 / | + | |
- | │ │ │ ├─2261 / | + | |
- | │ │ │ ├─2268 / | + | |
- | │ │ │ ├─2271 / | + | |
- | │ │ │ ├─2272 / | + | |
- | │ │ │ ├─2273 / | + | |
- | │ │ │ ├─2274 / | + | |
- | │ │ │ ├─2275 / | + | |
- | │ │ │ ├─2280 / | + | |
- | │ │ │ ├─2281 / | + | |
- | │ │ │ ├─2283 / | + | |
- | │ │ │ ├─2284 / | + | |
- | │ │ │ ├─2285 / | + | |
- | │ │ │ ├─2290 / | + | |
- | │ │ │ ├─2321 / | + | |
- | │ │ │ ├─2328 / | + | |
- | │ │ │ ├─2333 / | + | |
- | │ │ │ └─2432 / | + | |
- | │ │ └─user@42.service | + | |
- | │ │ | + | |
- | │ │ │ └─2170 / | + | |
- | │ │ | + | |
- | │ │ │ └─1455 / | + | |
- | │ │ | + | |
- | │ │ │ ├─1357 / | + | |
- | │ │ │ └─1377 (sd-pam) | + | |
- | │ │ | + | |
- | │ │ │ ├─2090 / | + | |
- | │ │ │ ├─2095 / | + | |
- | │ │ │ └─2098 / | + | |
- | │ │ | + | |
- | │ │ | + | |
- | │ │ | + | |
- | │ └─user-1000.slice | + | |
- | │ | + | |
- | │ │ ├─gvfs-goa-volume-monitor.service | + | |
- | │ | + | |
- | │ | + | |
- | │ │ │ └─2191 / | + | |
- | │ │ ├─tracker-store.service | + | |
- | │ │ │ └─2653 / | + | |
- | │ │ ├─evolution-calendar-factory.service | + | |
- | │ │ │ ├─2605 / | + | |
- | │ │ │ └─2706 / | + | |
- | │ │ ├─pulseaudio.service | + | |
- | │ │ │ └─1456 / | + | |
- | │ | + | |
- | │ | + | |
- | │ │ │ └─1901 / | + | |
- | │ │ ├─evolution-source-registry.service | + | |
- | │ │ │ └─2206 / | + | |
- | │ │ ├─gvfs-udisks2-volume-monitor.service | + | |
- | │ │ │ └─2243 / | + | |
- | │ │ ├─init.scope | + | |
- | │ │ │ ├─1239 / | + | |
- | │ │ │ └─1318 (sd-pam) | + | |
- | │ │ ├─gvfs-gphoto2-volume-monitor.service | + | |
- | │ │ │ └─2269 / | + | |
- | │ │ ├─at-spi-dbus-bus.service | + | |
- | │ │ │ ├─1964 / | + | |
- | │ │ │ ├─1969 / | + | |
- | │ | + | |
- | │ │ ├─dbus.service | + | |
- | │ │ │ ├─1786 / | + | |
- | │ │ │ ├─2183 / | + | |
- | │ │ │ ├─2201 / | + | |
- | │ │ │ ├─2225 / | + | |
- | │ │ │ ├─2397 / | + | |
- | │ │ │ └─2721 / | + | |
- | │ │ ├─evolution-addressbook-factory.service | + | |
- | │ │ │ ├─2727 / | + | |
- | │ │ │ └─2771 / | + | |
- | │ │ ├─gvfs-mtp-volume-monitor.service | + | |
- | lines 44-86 | + | |
</ | </ | ||
- | En utilisant Systemd, plusieurs ressources peuvent être limitées | + | Montez la partition LUKS : |
- | * **CPUShares** - par défault 1024, | + | < |
- | * **MemoryLimit** - limite exprimée en Mo ou en Go. Pas de valeur par défaut, | + | [root@centos8 ~]# mount / |
- | * **BlockIOWeight** - valeur entre 10 et 1000. Pas de valeur par défaut, | + | </ |
- | * **StartupCPUShares** - comme CPUShares mais uniquement appliqué pendant le démarrage, | + | |
- | * **StartupBlockIOWeight** - comme BlockIOWeight mais uniquement appliqué pendant le démarrage, | + | |
- | * **CPUQuota** - utilisé pour limiter le temps CPU, même quand le système ne fait rien. | + | |
- | <WRAP center round important 60%> | + | Vérifiez la présence du montage |
- | **Important** | + | |
- | </ | + | |
- | ===Limitation de la Mémoire=== | + | < |
+ | [root@centos8 ~]# df -h | grep sdb12 | ||
+ | / | ||
+ | </ | ||
- | Commencez par créer | + | Editez |
< | < | ||
- | [root@centos8 ~]# vi hello-world.sh | + | [root@centos8 ~]# vi / |
- | [root@centos8 ~]# cat hello-world.sh | + | [root@centos8 ~]# cat / |
- | #!/bin/bash | + | sdb12 /dev/sdb12 none |
- | while [ 1 ]; do | + | |
- | echo "hello world" | + | |
- | sleep 360 | + | |
- | done | + | |
</ | </ | ||
- | Rendez le script exécutable et testez-le : | + | Modifiez |
< | < | ||
- | [root@centos8 ~]# chmod u+x hello-world.sh | + | [root@centos8 ~]# vi /etc/fstab |
- | [root@centos8 ~]# ./hello-world.sh | + | [root@centos8 ~]# cat / |
- | hello world | + | |
- | ^C | + | # |
+ | # / | ||
+ | # Created by anaconda on Fri May 8 07:35:23 2020 | ||
+ | # | ||
+ | # Accessible filesystems, | ||
+ | # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info. | ||
+ | # | ||
+ | # After editing this file, run ' | ||
+ | # units generated from this file. | ||
+ | # | ||
+ | UUID=4c0cc28c-0d59-45be-bd73-d292b80be33c / | ||
+ | UUID=2ae4c035-9244-458c-82c5-a49ae169cdb6 /boot | ||
+ | UUID=c8bb3f47-d67f-4b21-b781-766899dc83d4 swap swap defaults | ||
+ | / | ||
</ | </ | ||
- | Créez maintenant un CGroup dans le sous-système **memory** appelé **helloworld** | + | Restaurer les SC par défaut de SELinux |
< | < | ||
- | [root@centos8 ~]# mkdir /sys/fs/cgroup/memory/helloworld | + | [root@centos8 ~]# /sbin/restorecon -v -R /mnt/sdb12 |
+ | Relabeled | ||
</ | </ | ||
- | Par défaut, ce CGroup héritera de l' | + | Redémarrez votre machine virtuelle |
< | < | ||
- | [root@centos8 ~]# echo 40000000 > / | + | [root@centos8 ~]# shutdown -r now |
- | [root@centos8 ~]# cat / | + | |
- | 39997440 | + | |
</ | </ | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | **Important** | + | **Important** |
</ | </ | ||
- | Lancez maintenant le script | + | ===Ajouter une deuxième Passphrase=== |
+ | |||
+ | Pour ajouter une deuxième passphrase, utilisez la commande cryptsetup avec la sous-commande | ||
< | < | ||
- | [root@centos8 ~]# ./hello-world.sh & | + | [trainee@centos8 ~]$ su - |
- | [1] 35148 | + | Password: fenestros |
+ | [root@centos8 ~]# cryptsetup luksAddKey / | ||
+ | Enter any existing passphrase: fenestros123456789 | ||
+ | Enter new passphrase for key slot: redhat123456789 | ||
+ | Verify passphrase: redhat123456789 | ||
+ | </ | ||
- | [root@centos8 ~]# hello world | + | <WRAP center round important 60%> |
- | [Entrée] | + | **Important** : Les passphrases ne seront pas en claire. Elle le sont ici pour vous montrer des mots de passe acceptables pour LUKS. |
+ | </ | ||
- | [root@centos8 ~]# ps aux | grep hello-world | + | ===Supprimer une Passphrase=== |
- | root | + | |
- | root | + | |
- | </ | + | |
- | Notez qu'il n'y a pas de limite de la mémoire, ce qui implique l' | + | Pour supprimer une passphrase, utilisez la commande cryptsetup avec la sous-commande **luksRemoveKey** |
< | < | ||
- | [root@centos8 ~]# ps -ww -o cgroup 35148 | + | [root@centos8 ~]# cryptsetup luksRemoveKey |
- | CGROUP | + | Enter passphrase to be deleted: redhat123456789 |
- | 12:memory:/user.slice/user-1000.slice/ | + | |
</ | </ | ||
- | Insérer le PID de notre script dans le CGroup | + | Avant de poursuivre, éditez les fichiers |
< | < | ||
- | [root@centos8 ~]# echo 35148 > /sys/fs/cgroup/ | + | [root@centos8 ~]# vi /etc/fstab |
- | </code> | + | [root@centos8 ~]# cat /etc/fstab |
- | Notez maintenant l' | + | # |
+ | # / | ||
+ | # Created by anaconda on Fri May 8 07:35:23 2020 | ||
+ | # | ||
+ | # Accessible filesystems, | ||
+ | # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info. | ||
+ | # | ||
+ | # After editing this file, run ' | ||
+ | # units generated from this file. | ||
+ | # | ||
+ | UUID=4c0cc28c-0d59-45be-bd73-d292b80be33c / | ||
+ | UUID=2ae4c035-9244-458c-82c5-a49ae169cdb6 /boot | ||
+ | UUID=c8bb3f47-d67f-4b21-b781-766899dc83d4 swap swap defaults | ||
- | < | + | [root@centos8 ~]# vi /etc/crypttab |
- | [root@centos8 ~]# ps -ww -o cgroup 35148 | + | [root@centos8 ~]# cat /etc/crypttab |
- | CGROUP | + | [root@centos8 ~]# |
- | 12:memory:/helloworld, | + | |
</ | </ | ||
- | Constatez ensuite l' | + | =====Le Swap===== |
- | < | + | ====Taille du swap==== |
- | [root@centos8 ~]# cat / | + | |
- | 274432 | + | |
- | </ | + | |
- | Tuez le script **hello-world.sh** | + | Le tableau suivant résume la taille du swap recommandée en fonction de la mémoire de la machine |
- | < | + | ^ Mémoire ^ Taille du swap ^ |
- | [root@centos8 ~]# kill 35148 | + | | 4 Go ou moins | 2 Go | |
- | [root@centos8 ~]# ps aux | grep hello-world | + | | 4 Go à 16 Go | 4 Go | |
- | root | + | | 16 Go à 64 Go | 8 Go | |
- | [1]+ Terminated | + | | 64 Go à 256 Go | 16 Go | |
- | </ | + | |
- | Créez un second CGroup beaucoup plus restrictif | + | ====Partitions de swap==== |
+ | |||
+ | Une partition de swap peut être créée sur : | ||
+ | |||
+ | * une partition du disque dur | ||
+ | * un RAID logiciel | ||
+ | * un Volume Logique | ||
+ | |||
+ | ====La Commande swapon==== | ||
+ | |||
+ | Pour préparer un espace de swap, il convient d' | ||
< | < | ||
- | [root@centos8 ~]# mkdir / | + | [root@centos8 ~]# swapon -s |
- | [root@centos8 ~]# echo 6000 > / | + | Filename Type Size Used Priority |
- | [root@centos8 ~]# cat /sys/fs/ | + | /dev/dm-1 |
- | 4096 | + | |
</ | </ | ||
- | Relancez le script | + | <WRAP center round important 60%> |
+ | **Important** : Vous noterez que dans l' | ||
+ | </ | ||
+ | |||
+ | ===Options de la Commande=== | ||
+ | |||
+ | Les options de la commande swapon sont : | ||
< | < | ||
- | [root@centos8 ~]# ./hello-world.sh & | + | [root@centos8 ~]# swapon |
- | [1] 35389 | + | |
- | [root@centos8 ~]# hello world | + | Usage: |
- | [Entrée] | + | |
- | [root@centos8 ~]# echo 35389 > / | + | Enable devices and files for paging and swapping. |
- | </ | + | |
- | Attendez la prochaine sortie de **hello world** sur le canal standard puis constatez que le script | + | Options: |
+ | -a, --all enable all swaps from / | ||
+ | -d, --discard[=< | ||
+ | -e, --ifexists | ||
+ | -f, --fixpgsz | ||
+ | -o, --options < | ||
+ | -p, --priority < | ||
+ | -s, --summary | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | -v, --verbose | ||
- | <code> | + | -h, --help |
- | [root@centos8 ~]# hello world | + | -V, --version |
- | [Entrée] | + | |
- | [1]+ Killed | + | The <spec> parameter: |
+ | -L < | ||
+ | -U < | ||
+ | LABEL=< | ||
+ | | ||
+ | | ||
+ | | ||
+ | < | ||
+ | < | ||
+ | |||
+ | Available discard policy types (for --discard): | ||
+ | | ||
+ | | ||
+ | If no policy is selected, both discard types are enabled (default). | ||
+ | |||
+ | Available output columns: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | For more details see swapon(8). | ||
</ | </ | ||
- | ===La Commande cgcreate=== | + | <WRAP center round important 60%> |
+ | **Important** : L' | ||
+ | </ | ||
- | Cette commande permet | + | ====La Commande swapoff==== |
+ | |||
+ | Dans le cas de notre exemple, | ||
< | < | ||
- | [root@centos8 ~]# cgcreate | + | [root@centos8 ~]# swapoff /dev/dm-1 |
- | [root@centos8 ~]# ls -l / | + | [root@centos8 ~]# swapon |
- | total 0 | + | [root@centos8 ~]# |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 cgroup.clone_children | + | |
- | --w--w----. 1 root root 0 Jul 13 10:39 cgroup.event_control | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 cgroup.procs | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.failcnt | + | |
- | --w--w----. 1 root root 0 Jul 13 10:39 memory.force_empty | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.failcnt | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.limit_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.max_usage_in_bytes | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.kmem.slabinfo | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.tcp.failcnt | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.tcp.limit_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.tcp.max_usage_in_bytes | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.kmem.tcp.usage_in_bytes | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.kmem.usage_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.limit_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.max_usage_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.memsw.failcnt | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.memsw.limit_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.memsw.max_usage_in_bytes | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.memsw.usage_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.move_charge_at_immigrate | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.numa_stat | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.oom_control | + | |
- | ----------. 1 root root 0 Jul 13 10:39 memory.pressure_level | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.soft_limit_in_bytes | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.stat | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.swappiness | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.usage_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.use_hierarchy | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 notify_on_release | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:39 tasks | + | |
</ | </ | ||
- | Il n' | + | ===Options |
< | < | ||
- | [root@centos8 ~]# echo 40000000 > / | + | [root@centos8 ~]# swapoff --help |
- | </ | + | |
- | ==La Commande cgexec== | + | Usage: |
+ | | ||
- | Cette commande permet d' | + | Disable devices and files for paging and swapping. |
- | < | + | Options: |
- | [root@centos8 ~]# cgexec | + | -a, --all disable all swaps from /proc/swaps |
- | [1] 37670 | + | -v, --verbose |
- | [root@centos8 ~]# hello world | + | -h, --help |
- | [Entrée] | + | -V, --version |
- | [root@centos8 ~]# | + | The < |
+ | -L < | ||
+ | -U < | ||
+ | | ||
+ | | ||
+ | < | ||
+ | < | ||
+ | |||
+ | For more details see swapoff(8). | ||
</ | </ | ||
- | ==La Commande cgdelete== | + | ====LAB #22 - Créer un Fichier de Swap==== |
- | Une fois le script terminé, cette commande permet | + | Sous Linux, vous pouvez aussi bien utiliser un fichier |
- | < | + | La commande |
- | [root@centos8 ~]# ps aux | grep *.sh | + | |
- | root | + | |
- | root | + | |
- | [root@centos8 ~]# kill 37670 | + | * **count** |
+ | * le nombre | ||
+ | * **bs** | ||
+ | * la taille du bloc à copier | ||
- | root@centos8 ~]# ps aux | grep *.sh | + | Dans le cas du fichier swap il convient d' |
- | root | + | |
- | [1]+ Terminated | + | |
- | [root@centos8 ~]# cgdelete memory:helloworld2 | + | Pour créer votre fichier de swap de 268Mo, appelé **swap**, saisissez la commande suivante |
- | [root@centos8 ~]# ls -l /sys/fs/ | + | < |
- | ls: cannot access '/ | + | [root@centos8 ~]# dd if=/dev/zero of=/swap bs=1024k count=256 |
+ | 256+0 records in | ||
+ | 256+0 records out | ||
+ | 268435456 bytes (268 MB, 256 MiB) copied, 0.103048 s, 2.6 GB/s | ||
</ | </ | ||
- | ==Le Fichier / | + | Pour préparer le fichier en tant qu' |
- | Afin de les rendre persistants, il convient d' | + | < |
+ | [root@centos8 ~]# mkswap /swap | ||
+ | mkswap: /swap: insecure permissions 0644, 0600 suggested. | ||
+ | Setting up swapspace version 1, size = 256 MiB (268431360 bytes) | ||
+ | no label, UUID=ee6c9e3f-0712-47b1-8f97-17ba215959d7 | ||
+ | </ | ||
+ | |||
+ | Pour activer | ||
< | < | ||
- | [root@centos8 ~]# vi /etc/ | + | [root@centos8 ~]# swapon -p1 /swap |
- | [root@centos8 ~]# cat /etc/ | + | swapon: |
- | # | + | </code> |
- | # Copyright IBM Corporation. 2007 | + | |
- | # | + | Pour visualiser les éspaces swap, saisissez la commande suivante : |
- | # Authors: | + | |
- | # This program is free software; you can redistribute it and/or modify it | + | < |
- | # under the terms of version 2.1 of the GNU Lesser General Public License | + | [root@centos8 ~]# swapon -s |
- | # as published by the Free Software Foundation. | + | Filename Type Size Used Priority |
- | # | + | /swap file |
- | # This program is distributed in the hope that it would be useful, but | + | / |
- | # WITHOUT ANY WARRANTY; without even the implied warranty of | + | |
- | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | + | |
- | # | + | |
- | # | + | |
- | # By default, we expect systemd mounts everything on boot, | + | |
- | # so there is not much to do. | + | |
- | # See man cgconfig.conf for further details, how to create groups | + | |
- | # on system boot using this file. | + | |
- | group helloworld2 { | + | |
- | cpu { | + | |
- | cpu.shares = 100; | + | |
- | } | + | |
- | memory { | + | |
- | memory.limit_in_bytes = 40000; | + | |
- | } | + | |
- | } | + | |
</ | </ | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | **Important** | + | **Important** |
</ | </ | ||
- | Créez donc les deux CGroups concernés | + | <WRAP center round important 60%> |
+ | **Important** | ||
+ | </ | ||
- | < | + | Désactivez maintenant le fichier swap : |
- | [root@centos8 ~]# cgcreate -g memory:helloworld2 | + | |
- | [root@centos8 ~]# ls -l / | + | |
- | total 0 | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 cgroup.clone_children | + | |
- | --w--w----. 1 root root 0 Jul 13 10:46 cgroup.event_control | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 cgroup.procs | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.failcnt | + | |
- | --w--w----. 1 root root 0 Jul 13 10:46 memory.force_empty | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.failcnt | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.limit_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.max_usage_in_bytes | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.kmem.slabinfo | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.tcp.failcnt | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.tcp.limit_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.tcp.max_usage_in_bytes | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.kmem.tcp.usage_in_bytes | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.kmem.usage_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.limit_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.max_usage_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.memsw.failcnt | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.memsw.limit_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.memsw.max_usage_in_bytes | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.memsw.usage_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.move_charge_at_immigrate | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.numa_stat | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.oom_control | + | |
- | ----------. 1 root root 0 Jul 13 10:46 memory.pressure_level | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.soft_limit_in_bytes | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.stat | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.swappiness | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.usage_in_bytes | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.use_hierarchy | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 notify_on_release | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:46 tasks | + | |
- | </ | + | |
< | < | ||
- | [root@centos8 ~]# cgcreate -g cpu: | + | [root@centos8 ~]# swapoff /swap |
- | [root@centos8 ~]# ls -l /sys/fs/ | + | [root@centos8 ~]# swapon |
- | total 0 | + | Filename Type Size Used Priority |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cgroup.clone_children | + | /dev/dm-1 partition |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cgroup.procs | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.stat | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpuacct.usage | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_all | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_percpu | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_percpu_sys | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_percpu_user | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_sys | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_user | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.cfs_period_us | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.cfs_quota_us | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.rt_period_us | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.rt_runtime_us | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.shares | + | |
- | -r--r--r--. 1 root root 0 Jul 13 10:47 cpu.stat | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 notify_on_release | + | |
- | -rw-rw-r--. 1 root root 0 Jul 13 10:47 tasks | + | |
</ | </ | ||
- | ==La Commande cgconfigparser== | + | Supprimez maintenant |
- | + | ||
- | Appliquez | + | |
< | < | ||
- | [root@centos8 ~]# cgconfigparser -l /etc/ | + | [root@centos8 ~]# rm /swap |
- | [root@centos8 ~]# cat /sys/ | + | rm: remove regular file '/swap'? y |
- | 36864 | + | |
- | [root@centos8 ~]# cat / | + | |
- | 100 | + | |
</ | </ | ||
----- | ----- | ||
Copyright © 2024 Hugh Norris. | Copyright © 2024 Hugh Norris. |