Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
elearning:workbooks:centos:8:junior:l123 [2024/10/01 07:41] – created admin | elearning:workbooks:centos:8:junior:l123 [2024/10/01 08:05] (Version actuelle) – created admin | ||
---|---|---|---|
Ligne 5: | Ligne 5: | ||
Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
- | ======LCF603 - Gestion | + | ======LCF603 - Gestion |
=====Contenu du Module===== | =====Contenu du Module===== | ||
- | * **LCF603 - Gestion | + | * **LCF603 - Gestion |
* Contenu du Module | * Contenu du Module | ||
- | * Périphériques de stockage | + | * Présentation |
- | * Partitions | + | * BIOS, EFI et OpenFirmware |
- | * Partitionnement | + | * Systèmes à base du BIOS |
- | * LAB #1 - Partitionnement | + | * Charger de Démarrage |
- | * LAB #2 - Modifier les Drapeaux des Partitions avec fdisk | + | * Systèmes à base de l'EFI |
- | * Logical Volume Manager (LVM) | + | * Autres Systèmes |
- | * LAB #3 - Volumes Logiques Linéaires | + | * Gestionnaire d' |
- | * Physical Volume (PV) | + | * GRUB 2 |
- | * Volume Group (VG) et Physical Extent (PE) | + | * Le fichier / |
- | * Logical Volumes (LV) | + | * Le fichier / |
- | * LAB #4 - Étendre un Volume Logique à Chaud | + | * Les fichiers du répertoire /etc/grub.d |
- | * LAB #5 - Snapshots | + | * Configurer l' |
- | * LAB #6 - Suppression des Volumes | + | * Modifier la Configuration de GRUB 2 en Ligne de Commande |
- | * LAB #7 - Volumes Logiques en Miroir | + | * Chargeurs de Démarrages Alternatifs |
- | * LAB #8 - Modifier les Attributs LVM | + | * Systemd-boot |
- | * LAB #9 - Volumes Logiques en Bandes | + | * U-boot |
- | * LAB #10 - Gérer les Métadonnées | + | * Le Projet Syslinux |
- | * Systèmes de Fichiers Journalisés | + | * SYSLINUX |
- | * Présentation | + | * EXTLINUX |
- | * Ext3 | + | * ISOLINUX |
- | * Gestion d'Ext3 | + | * PXELINUX |
- | * LAB #11 - Convertir un Système de Fichiers Ext3 en Ext2 | + | * Isodhpfx |
- | * LAB #12 - Convertir un Système de Fichiers Ext2 en Ext3 | + | * Initramfs |
- | * LAB #13 - Placer | + | * Examiner l' |
- | * LAB #14 - Modifier la Fréquence | + | * Le script init |
- | * Ext4 | + | * Consulter |
- | * LAB #15 - Créer un Système de Fichiers Ext4 | + | * Processus |
- | * LAB #16 - Ajouter une Étiquette au Système de Fichiers Ext4 | + | * Processus Init |
- | * LAB #17 - Convertir un Système | + | * Systemd |
- | * XFS | + | * LAB #1 - La Commande systemctl |
- | * LAB #18 - Créer un Système | + | * LAB #2 - Fichiers |
- | * LAB #19 - Ajouter une Étiquette au Système de Fichiers | + | * 2.1 - Fichiers |
- | * Autres Systèmes | + | * 2.2 - Surchargement des Fichiers de Configuration par Défaut |
- | * ReiserFS | + | * LAB #3 - La Commande |
- | * JFS | + | * LAB #4 - Les Cibles Systemd |
- | * Btrfs | + | * 4.1 - Contrôler les dépendances d'une Cible |
- | | + | * 4.2 - La Cible par Défaut |
- | | + | * LAB #5 - Gestion des Services |
- | * La Commande | + | * 5.1 - Gestion des Instances Uniques |
- | * Systèmes de Fichiers Chiffrés | + | * 5.2 - Gestion d' |
- | * LAB #21 - Créer un Système de Fichiers Chiffré avec LUKS | + | * 5.3 - Interdire la Modification du Statut d'un Service |
- | * Présentation | + | * Arrêt Système |
- | * Mise en Place | + | * La Commande shutdown |
- | * Ajouter | + | * La Commande |
- | * Supprimer une Passphrase | + | * La Commande |
- | * Raid Logiciel | + | * La Commande poweroff |
- | * LAB #22 - Mise en Place du RAID 5 Logiciel | + | |
- | * 22.1 - Préparer le disque | + | |
- | * 22.2 - Créer une Unité RAID | + | |
- | * 22.3 - Remplacer une Unité Défaillante | + | |
- | * Le Swap | + | |
- | * Taille | + | |
- | * Partitions de swap | + | |
- | * La Commande | + | |
- | * La Commande | + | |
- | * LAB #23 - Créer un Fichier de Swap | + | |
- | =====Périphériques de stockage===== | + | =====Présentation===== |
- | Les unités | + | Le processus de démarrage |
- | * hd[a-d] | + | * Le **firmware** ou **micrologiciel** démarre en effectuant un test rapide du matériel, appelé un **Power-On Self Test** ou **POST**, puis recherche |
- | | + | * Le Charger |
- | | + | * Le noyau se charge |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | * ht[0-7] | + | |
- | * Les lecteurs de bandes PATA qui **supportent** le rembobinage | + | |
- | * nht[0-7] | + | |
- | * Les lecteurs de bandes PATA qui ne supportent **pas** le rembobinage | + | |
- | * rmt8, rmt16, tape-d, tape-reset | + | |
- | * Les lecteurs QIC-80 | + | |
- | * ram[0-15] | + | |
- | * Les disques virtuels. Ils sont supprimés à l' | + | |
- | * Périphériques **loop** | + | |
- | * Il existe 16 unités loop qui sont utilisés pour accèder | + | |
- | * md[x] | + | |
- | * Un volume **RAID** logiciel | + | |
- | * vg[x] | + | |
- | * Un groupe de volumes | + | |
- | * lv[x] | + | |
- | * Un volume logique | + | |
- | =====Partitions===== | + | <WRAP center round tip 60%> |
+ | **A retenir** : Il est possible de consulter le défilement des messages lors du démarrage en appuyant sur la touche < | ||
+ | </ | ||
- | Un PC comportent en règle générale 2 **contrôleurs** de disque, chacun capable de gérer 2 disques, | + | Cette description simpliste résume cependant |
- | * Contrôleur 0 | + | =====BIOS, EFI et OpenFirmware===== |
- | * 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 : | + | ====Systèmes à base du BIOS==== |
- | * **Partitions primaires**, | + | Au démarrage d'un système à base d'un processeur x86 ou x86-64, le premier programme exécuté a été traditionnellement le BIOS. Le BIOS a pour fonction |
- | * Maximum de **4**. En effet, la Table des Partitions est grande | + | |
- | * **Partitions Etendues**, | + | |
- | * Généralement une seule partition étendue par disque. Elle contient des **Lecteurs Logiques** aussi appelés des partitions, | + | |
- | * **Lecteurs Logiqiques**. | + | |
- | Les 4 partitions primaires sont numérotées | + | * Tester les composants et les circuits, |
+ | * Faire appel au BIOS de la carte graphique pour initialiser le système d' | ||
+ | * Détecter les périphériques de stockage, | ||
+ | * Lancer le **Charger de Démarrage** du système d' | ||
- | * **hda1**, **hda2**, **hda3** et **hda4** pour le premier disque **IDE** sur le premier contrôleur | + | ===Chargeur |
- | * **sda1**, **sda2**, **sda3** et **sda4** pour le premier disque **SCSI** ou **SATA** sur le premier contrôleur de disque. | + | |
- | {{free:disque.png|}} | + | La première partie du Chargeur de Démarrage est en règle générale placé dans le MBR du disque. |
- | Une partition étendue prend la place d' | + | * 446 octets pour le Charger de Démarrage, |
+ | * 64 octets pour la table de partitions, soit 16 octets par partition | ||
+ | | ||
- | Pour clarifier ceci, considérons un disque **SATA** contenant deux partitions primaires, une seule partition étendue et 3 lecteurs logiques. Dans ce cas, les deux premières partitions sont **sda1** et **sda2**, la partition étendue prend la place de la troisième partition primaire, la **sda3** et s'appelle ainsi tandis que la quatrième partition primaire est inexistante. | + | ====Systèmes à base de l'EFI==== |
- | 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 | + | Depuis 2011, le BIOS est en train d' |
- | {{free: | + | Sous EFI la première partie du gestionnaire de démarrage est un fichier ayant une extension .efi se trouvant dans un sous-répertoire au nom du système d' |
- | Le nombre | + | Pour que EFI fonctionne, le micrologiciel (**firmware**) d'EFI doit avoir connaissance |
- | * **IDE**, | + | <WRAP center round tip 60%> |
- | * Jusqu' | + | **A retenir** : Sous Linux c'est l' |
- | * **SCSI**, | + | </ |
- | * Jusqu'à **15**, | + | |
- | * **Disques utilisant | + | |
- | * Jusqu' | + | |
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | **Important** : Ces limites peuvent être dépassées en utilisant la gestion | + | **Important** : L'UEFI gère les **SSD** (//Solid State Drives//) qui utilisent le standard **NVMe** (// |
</ | </ | ||
- | =====Partitionnement===== | + | ====Autres Systèmes==== |
- | ====LAB #1 - Partitionnement de votre Disque sous RHEL/CentOS 8 avec fdisk==== | + | Les systèmes utilisant des processeurs autre qu'un x86 ou x86-64 utilisent un logiciel tel **[[http:// |
- | Pour procéder au partitionnement | + | =====Gestionnaires |
- | Lancez fdisk en fournissant en argument le fichier de référence de votre premier disque dur, par exemple : | + | ====GRUB 2==== |
- | < | + | GRUB 2 est une ré-écriture complète de GRUB Legacy. Il apporte des améliorations, |
- | [root@centos8 ~]# fdisk /dev/sdb | + | |
- | Welcome to fdisk (util-linux | + | Le lancement de GRUB 2 se fait en trois étapes : |
- | Changes will remain in memory only, until you decide to write them. | + | |
- | Be careful before using the write command. | + | |
- | Device does not contain a recognized partition | + | * Etape 1 : Le **boot.img**, |
- | Created a new DOS disklabel with disk identifier 0xb0dacb39. | + | * Etape 1.5 : Le **core.img**, |
+ | * Etape 2 : Contenu dans le répertoire **/ | ||
- | Command (m for help): | + | Dans le cas où le Charger de Démarrage **GRUB 2** n'est pas installé, il convient de saisir la commande suivante |
- | </ | + | |
- | Tapez ensuite la lettre **m** puis < | + | # grub2-install |
- | < | + | où **périphérique** est le nom du périphérique ou l' |
- | Command (m for help): m | + | |
- | Help: | + | **GRUB 2** lit ses entrées |
- | + | ||
- | DOS (MBR) | + | |
- | | + | |
- | | + | |
- | | + | |
- | + | ||
- | Generic | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | + | ||
- | Misc | + | |
- | | + | |
- | | + | |
- | | + | |
- | + | ||
- | Script | + | |
- | | + | |
- | | + | |
- | + | ||
- | Save & Exit | + | |
- | | + | |
- | | + | |
- | + | ||
- | Create a new label | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | + | ||
- | + | ||
- | Command (m for help): | + | |
- | </ | + | |
- | + | ||
- | Pour créer une nouvelle partition, vous devez utiliser la commande | + | |
- | + | ||
- | Créez donc les partitions suivantes sur votre disque : | + | |
- | + | ||
- | ^ Partition ^ Type ^ Taille | + | |
- | | /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 | + | |
- | | /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' | + | |
< | < | ||
- | Command (m for help): n | + | [root@centos8 ~]# cat / |
- | Partition type | + | # |
- | p | + | # DO NOT EDIT THIS FILE |
- | e | + | # |
- | Select (default | + | # It is automatically generated by grub2-mkconfig using templates |
+ | # from /etc/grub.d and settings from /etc/default/grub | ||
+ | # | ||
- | Using default response p. | + | ### BEGIN /etc/grub.d/00_header ### |
- | Partition number (1-4, default 1): | + | set pager=1 |
- | First sector (2048-8388607, | + | |
- | Last sector, +sectors or +size{K, | + | |
- | Created a new partition 1 of type ' | + | if [ -f ${config_directory}/ |
+ | load_env -f ${config_directory}/ | ||
+ | elif [ -s $prefix/ | ||
+ | load_env | ||
+ | fi | ||
+ | if [ " | ||
+ | set default=" | ||
+ | set next_entry= | ||
+ | | ||
+ | set boot_once=true | ||
+ | else | ||
+ | set default=" | ||
+ | fi | ||
- | Command (m for help): n | + | if [ x" |
- | Partition type | + | |
- | p | + | else |
- | e | + | |
- | Select (default p): | + | fi |
- | Using default response p. | + | export menuentry_id_option |
- | Partition number (2-4, default 2): | + | |
- | First sector (206848-8388607, | + | |
- | Last sector, +sectors or +size{K, | + | |
- | Created a new partition 2 of type ' | + | if [ " |
+ | set saved_entry=" | ||
+ | save_env saved_entry | ||
+ | set prev_saved_entry= | ||
+ | save_env prev_saved_entry | ||
+ | set boot_once=true | ||
+ | fi | ||
- | Command (m for help): n | + | function savedefault { |
- | Partition type | + | if [ -z " |
- | p | + | |
- | e | + | |
- | Select (default p): | + | fi |
+ | } | ||
- | Using default response p. | + | function load_video { |
- | Partition number (3,4, default 3): | + | if [ x$feature_all_video_module = xy ]; then |
- | First sector (411648-8388607, | + | |
- | Last sector, +sectors or +size{K, | + | else |
+ | insmod efi_gop | ||
+ | insmod efi_uga | ||
+ | insmod ieee1275_fb | ||
+ | insmod vbe | ||
+ | insmod vga | ||
+ | insmod video_bochs | ||
+ | insmod video_cirrus | ||
+ | fi | ||
+ | } | ||
- | Created a new partition 3 of type ' | + | terminal_output console |
+ | if [ x$feature_timeout_style = xy ] ; then | ||
+ | set timeout_style=menu | ||
+ | set timeout=5 | ||
+ | # Fallback normal timeout code in case the timeout_style feature is | ||
+ | # unavailable. | ||
+ | else | ||
+ | set timeout=5 | ||
+ | fi | ||
+ | ### END / | ||
- | Command (m for help): | + | ### BEGIN / |
- | </code> | + | set tuned_params="" |
+ | set tuned_initrd="" | ||
+ | ### END /etc/grub.d/00_tuned ### | ||
- | Créez ensuite la partition étendue : | + | ### BEGIN / |
+ | if [ " | ||
+ | set last_boot_ok=1 | ||
+ | else | ||
+ | set last_boot_ok=0 | ||
+ | fi | ||
- | < | + | # Reset boot_indeterminate after a successful boot |
- | Command (m for help): n | + | if [ " |
- | Partition type | + | set boot_indeterminate=0 |
- | | + | # Avoid boot_indeterminate causing the menu to be hidden more then once |
- | e | + | elif [ " |
- | Select (default e): e | + | set boot_indeterminate=2 |
+ | fi | ||
+ | set boot_success=0 | ||
+ | save_env boot_success boot_indeterminate | ||
- | Selected partition 4 | + | if [ x$feature_timeout_style = xy ] ; then |
- | First sector (616448-8388607, | + | if [ " |
- | Last sector, +sectors or +size{K,M,G,T,P} (616448-8388607, default 8388607): | + | unset menu_show_once |
+ | save_env menu_show_once | ||
+ | set timeout_style=menu | ||
+ | set timeout=60 | ||
+ | elif [ "${menu_auto_hide}" | ||
+ | set orig_timeout_style=${timeout_style} | ||
+ | set orig_timeout=${timeout} | ||
+ | if [ " | ||
+ | # timeout_style=menu + timeout=0 avoids the countdown code keypress check | ||
+ | set timeout_style=menu | ||
+ | set timeout=0 | ||
+ | else | ||
+ | set timeout_style=hidden | ||
+ | set timeout=1 | ||
+ | fi | ||
+ | fi | ||
+ | fi | ||
+ | ### END / | ||
- | Created a new partition 4 of type ' | + | ### BEGIN /etc/grub.d/01_users ### |
+ | if [ -f ${prefix}/ | ||
+ | source ${prefix}/ | ||
+ | if [ -n " | ||
+ | set superusers=" | ||
+ | export superusers | ||
+ | password_pbkdf2 root ${GRUB2_PASSWORD} | ||
+ | fi | ||
+ | fi | ||
+ | ### END / | ||
- | Command (m for help): | + | ### BEGIN / |
- | </ | + | insmod part_msdos |
+ | insmod ext2 | ||
+ | set root=' | ||
+ | if [ x$feature_platform_search_hint = xy ]; then | ||
+ | search --no-floppy --fs-uuid --set=root --hint-bios=hd0, | ||
+ | else | ||
+ | search --no-floppy --fs-uuid --set=root 2ae4c035-9244-458c-82c5-a49ae169cdb6 | ||
+ | fi | ||
+ | insmod part_msdos | ||
+ | insmod ext2 | ||
+ | set boot=' | ||
+ | if [ x$feature_platform_search_hint = xy ]; then | ||
+ | search --no-floppy --fs-uuid --set=boot --hint-bios=hd0, | ||
+ | else | ||
+ | search --no-floppy --fs-uuid --set=boot 2ae4c035-9244-458c-82c5-a49ae169cdb6 | ||
+ | fi | ||
- | Créez maintenant les autres partitions l'une après l' | + | # This section was generated by a script. Do not modify the generated file - all changes |
+ | # will be lost the next time file is regenerated. Instead edit the BootLoaderSpec files. | ||
+ | # | ||
+ | # The blscfg command parses the BootLoaderSpec files stored in / | ||
+ | # populates the boot menu. Please refer to the Boot Loader Specification documentation | ||
+ | # for the files format: https:// | ||
- | < | + | set default_kernelopts=" |
- | Command (m for help): n | + | |
- | All primary partitions are in use. | + | |
- | Adding logical partition 5 | + | |
- | First sector (618496-8388607, default 618496): | + | |
- | Last sector, +sectors or +size{K, | + | |
- | Created a new partition 5 of type ' | + | insmod blscfg |
+ | blscfg | ||
+ | ### END /etc/grub.d/10_linux ### | ||
- | Command (m for help): n | + | ### BEGIN / |
- | All primary partitions are in use. | + | ### END /etc/grub.d/ |
- | Adding logical partition 6 | + | |
- | First sector (1644544-8388607, | + | |
- | Last sector, +sectors or +size{K, | + | |
- | Created a new partition 6 of type ' | + | ### BEGIN /etc/grub.d/ |
+ | ### END / | ||
- | Command (m for help): n | + | ### BEGIN /etc/grub.d/30_os-prober ### |
- | All primary partitions are in use. | + | ### END / |
- | Adding logical partition 7 | + | |
- | First sector (2056192-8388607, default 2056192): | + | |
- | Last sector, +sectors or +size{K, | + | |
- | Created a new partition 7 of type ' | + | ### BEGIN /etc/grub.d/ |
+ | ### END / | ||
- | Command (m for help): n | + | ### BEGIN / |
- | All primary partitions are in use. | + | # This file provides an easy way to add custom menu entries. |
- | Adding logical partition 8 | + | # menu entries you want to add after this comment. |
- | First sector (2672640-8388607, | + | # the 'exec tail' line above. |
- | Last sector, +sectors or +size{K, | + | ### END / |
- | Created a new partition 8 of type ' | + | ### BEGIN /etc/grub.d/41_custom ### |
- | + | if [ -f ${config_directory}/custom.cfg ]; then | |
- | Command (m for help): n | + | |
- | All primary partitions are in use. | + | elif [ -z "${config_directory}" |
- | Adding logical partition 9 | + | |
- | First sector (3698688-8388607, default 3698688): | + | fi |
- | Last sector, +sectors or +size{K,M,G,T,P} (3698688-8388607, | + | ### END /etc/grub.d/41_custom ### |
- | + | ||
- | Created a new partition 9 of type ' | + | |
- | + | ||
- | | + | |
- | All primary partitions are in use. | + | |
- | Adding logical partition 10 | + | |
- | First sector (4519936-8388607, | + | |
- | Last sector, +sectors or +size{K,M,G,T,P} (4519936-8388607, | + | |
- | + | ||
- | 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, default 5545984): | + | |
- | Last sector, +sectors or +size{K,M,G,T,P} (5545984-8388607, default 8388607): +500M | + | |
- | + | ||
- | Created | + | |
- | + | ||
- | 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 ' | + | |
- | + | ||
- | Command (m for help): | + | |
</ | </ | ||
- | Tapez ensuite | + | Notez que ce fichier ne doit pas être modifié manuellement. En effet, il est généré par la commande |
- | < | + | * grub2-mkconfig -o /boot/grub2/ |
- | Command (m for help): p | + | * grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg |
- | Disk /dev/sdb: 4 GiB, 4294967296 bytes, 8388608 sectors | + | |
- | Units: sectors of 1 * 512 = 512 bytes | + | |
- | Sector size (logical/physical): 512 bytes / 512 bytes | + | |
- | I/O size (minimum/optimal): 512 bytes / 512 bytes | + | |
- | Disklabel type: dos | + | |
- | Disk identifier: 0xb0dacb39 | + | |
- | Device | + | Lors de l' |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | Command (m for help): | + | ===Le fichier |
- | </code> | + | |
- | + | ||
- | Ecrivez la table des partitions sur disque et exécutez la commande **partprobe** : | + | |
< | < | ||
- | Command (m for help): w | + | [root@centos8 ~]# cat / |
- | The partition table has been altered. | + | # this device map was generated by anaconda |
- | Calling ioctl() to re-read partition table. | + | (hd0) /dev/sda |
- | Syncing disks. | + | (hd1) /dev/sda |
- | + | ||
- | [root@centos8 ~]# partprobe | + | |
- | [root@centos8 ~]# | + | |
</ | </ | ||
- | Lancez fdisk puis tapez ensuite la lettre **p** puis < | + | ===Le fichier |
- | < | + | Ce fichier contient |
- | [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 | + | |
< | < | ||
- | Command (m for help): d | + | [root@centos8 ~]# cat /etc/default/grub |
- | Partition number (1-12, | + | GRUB_TIMEOUT=5 |
- | + | GRUB_DISTRIBUTOR=" | |
- | Partition 12 has been deleted. | + | GRUB_DEFAULT=saved |
- | + | GRUB_DISABLE_SUBMENU=true | |
- | Command | + | GRUB_TERMINAL_OUTPUT=" |
- | Disk /dev/sdb: 4 GiB, 4294967296 bytes, 8388608 sectors | + | GRUB_CMDLINE_LINUX=" |
- | Units: sectors of 1 * 512 = 512 bytes | + | GRUB_DISABLE_RECOVERY=" |
- | Sector size (logical/physical): 512 bytes / 512 bytes | + | GRUB_ENABLE_BLSCFG=true |
- | I/O size (minimum/ | + | |
- | Disklabel type: dos | + | |
- | Disk identifier: 0xb0dacb39 | + | |
- | + | ||
- | Device | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | + | ||
- | Command (m for help): | + | |
</ | </ | ||
- | A ce stade, la partition n' | + | <WRAP center round important 60%> |
+ | **Important** : Notez que toute modification | ||
+ | </ | ||
- | Tapez donc q pour sortir de fdisk puis relancez fdisk. Vous obtiendrez un résultat similaire à celui-ci | + | Dans ce fichier les directives sont : |
- | < | + | ^ Directive |
- | Command (m for help): q | + | | GRUB_TIMEOUT | Durée de l' |
+ | | GRUB_DISTRIBUTOR | Ligne de commande qui génère le texte de l' | ||
+ | | GRUB_DEFAULT | Entrée du menu sélectionner par défaut | | ||
+ | | GRUB_DISABLE_SUBMENU | Active ou désactive les sous-menus de GRUB2 | | ||
+ | | GRUB_TERMINAL_OUTPUT | Spécifie le terminal par défaut | | ||
+ | | GRUB_CMDLINE_LINUX | Paramètres passés au noyau peu importe le type de démarrage | | ||
+ | | GRUB_DISABLE_RECOVERY | Active ou désactive la génération des entrées en mode **recovery** | | ||
+ | | GRUB_BLSCFG | Active ou désactive l' | ||
- | [root@centos8 ~]# fdisk /dev/sdb | + | ===Les fichiers du répertoire |
- | Welcome to fdisk (util-linux 2.32.1). | + | Les fichiers |
- | 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): | + | |
- | </ | + | |
- | + | ||
- | ====LAB #2 - Modifier les Drapeaux des Partitions avec fdisk==== | + | |
- | + | ||
- | Afin de mettre en place un RAID logiciel ou un volume logique, il est nécessaire de modifier les types de systèmes de fichiers sur les partitions créées. | + | |
- | + | ||
- | Modifiez donc les nouvelles partitions à l'aide de la commande **t** de **fdisk** selon le tableau ci-dessous : | + | |
- | + | ||
- | ^ Taille de la Partition ^ Type de Système de Fichiers ^ | + | |
- | | 500 Mo | RAID (fd) | | + | |
- | | 200 Mo | Linux LVM (8e) | | + | |
- | | 300 Mo | Linux LVM (8e) | | + | |
- | | 500 Mo | RAID (fd) | | + | |
- | | 400 Mo | Linux LVM (8e) | | + | |
- | | 500 Mo | RAID (fd) | | + | |
- | | 500 Mo | RAID (fd) | | + | |
- | | 200 Mo | Inchangé | | + | |
- | + | ||
- | Vous obtiendrez un résultat similaire à celui-ci | + | |
< | < | ||
- | Command (m for help): t | + | [root@centos8 ~]# ls -l /etc/grub.d |
- | Partition number (1-12, default 12): 5 | + | total 92 |
- | Hex code (type L to list all codes): fd | + | -rwxr-xr-x. 1 root root 8958 Mar 2 15:51 00_header |
- | + | -rwxr-xr-x. | |
- | Changed type of partition ' | + | -rwxr-xr-x. 1 root root 232 Mar 2 15:51 01_users |
- | + | -rwxr-xr-x. 1 root root 832 Mar 2 15:51 08_fallback_counting | |
- | Command (m for help): t | + | -rwxr-xr-x. 1 root root 14088 Mar 2 15:51 10_linux |
- | Partition number (1-12, default 12): 6 | + | -rwxr-xr-x. 1 root root 830 Mar 2 15:51 10_reset_boot_success |
- | Hex code (type L to list all codes): 8e | + | -rwxr-xr-x. 1 root root 889 Mar 2 15:51 12_menu_auto_hide |
- | + | -rwxr-xr-x. 1 root root 11696 Mar 2 15:51 20_linux_xen | |
- | Changed type of partition ' | + | -rwxr-xr-x. 1 root root 2559 Mar 2 15:51 20_ppc_terminfo |
- | + | -rwxr-xr-x. 1 root root 10670 Mar 2 15:51 30_os-prober | |
- | Command (m for help): t | + | -rwxr-xr-x. 1 root root 1412 Mar 2 15:51 30_uefi-firmware |
- | Partition number (1-12, default 12): 7 | + | -rwxr-xr-x. 1 root root 214 Mar 2 15:51 40_custom |
- | Hex code (type L to list all codes): 8e | + | -rwxr-xr-x. 1 root root 216 Mar 2 15:51 41_custom |
- | + | -rw-r--r--. 1 root root 483 Mar 2 15:51 README | |
- | Changed type of partition ' | + | |
- | + | ||
- | Command (m for help): t | + | |
- | Partition number (1-12, default 12): 8 | + | |
- | Hex code (type L to list all codes): fd | + | |
- | + | ||
- | Changed type of partition ' | + | |
- | + | ||
- | Command (m for help): t | + | |
- | Partition number (1-12, default 12): 9 | + | |
- | Hex code (type L to list all codes): 8e | + | |
- | + | ||
- | Changed type of partition ' | + | |
- | + | ||
- | Command (m for help): t | + | |
- | Partition number (1-12, default 12): 10 | + | |
- | Hex code (type L to list all codes): fd | + | |
- | + | ||
- | Changed type of partition ' | + | |
- | + | ||
- | Command (m for help): t | + | |
- | Partition number (1-12, default 12): 11 | + | |
- | Hex code (type L to list all codes): fd | + | |
- | + | ||
- | Changed type of partition ' | + | |
</ | </ | ||
- | A l' | + | * **Le fichier / |
+ | * Le fichier **10_Linux** contient | ||
+ | * **Le fichier / | ||
+ | * Ce fichier recherche des éventuels systèmes d' | ||
+ | * **Les fichiers / | ||
+ | * Ces deux fichiers sont fournis en tant que modèles à personnaliser. | ||
- | < | + | ===Le Fichier |
- | Command (m for help): p | + | |
- | Disk /dev/sdb: 4 GiB, 4294967296 bytes, 8388608 sectors | + | |
- | Units: sectors of 1 * 512 = 512 bytes | + | |
- | Sector size (logical/physical): 512 bytes / 512 bytes | + | |
- | I/O size (minimum/ | + | |
- | Disklabel type: dos | + | |
- | Disk identifier: 0xb0dacb39 | + | |
- | Device | + | Le fichier **/boot/grub2/grubenv** contient l' |
- | /dev/sdb1 2048 206847 | + | |
- | /dev/ | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | + | ||
- | Command (m for help): | + | |
- | </ | + | |
- | + | ||
- | Pour écrire la nouvelle table des partitions sur disque, vous devez utilisez | + | |
< | < | ||
- | Command (m for help): w | + | [root@centos8 ~]# cat / |
- | The partition table has been altered! | + | # GRUB Environment Block |
- | + | saved_entry=de79af4f226d480fa7d3fec4cabbf97a-4.18.0-240.22.1.el8_3.x86_64 | |
- | Calling ioctl() to re-read partition table. | + | kernelopts=root=UUID=4c0cc28c-0d59-45be-bd73-d292b80be33c ro crashkernel=auto resume=UUID=c8bb3f47-d67f-4b21-b781-766899dc83d4 rhgb quiet |
- | + | boot_success=1 | |
- | WARNING: Re-reading the partition table failed with error 16: Device or resource busy. | + | boot_indeterminate=0 |
- | The kernel still uses the old table. The new table will be used at | + | ########################################################################################################################################## |
- | the next reboot or after you run partprobe(8) or kpartx(8) | + | ########################################################################################################################################## |
- | Syncing disks. | + | ########################################################################################################################################## |
- | [root@centos8 ~]# partprobe | + | ########################################################################################################################################## |
+ | ########################################################################################################################################## | ||
+ | ############################################################ | ||
</ | </ | ||
- | ====Options de la Commande | + | ===Modifier |
- | Les options | + | Lors du démarrage |
- | <code> | + | * Lancer un système d' |
- | [root@centos8 ~]# fdisk --help | + | * Lancer l' |
+ | * Lancer l’interface de la ligne de commande GRUB en appuyant sur la touche **c**. | ||
- | Usage: | + | En mode édition notez l' |
- | fdisk [options] < | + | |
- | fdisk [options] -l [< | + | |
- | Display or manipulate a disk partition table. | + | * **flèches** : se déplacer dans l' |
+ | * **Crtl-X** : démarrer avec la configuration modifiée, | ||
+ | * **echap** : abandonner les modifications et retourner à l' | ||
- | Options: | + | ====Chargeurs de Démarrages Alternatifs==== |
- | -b, --sector-size < | + | |
- | -B, --protect-boot | + | |
- | -c, --compatibility[=< | + | |
- | -L, --color[=< | + | |
- | | + | |
- | -l, --list | + | |
- | -o, --output < | + | |
- | -t, --type < | + | |
- | -u, --units[=< | + | |
- | -s, --getsz | + | |
- | | + | |
- | -w, --wipe < | + | |
- | -W, --wipe-partitions < | + | |
- | -C, --cylinders < | + | ===Systemd-boot=== |
- | -H, --heads < | + | |
- | -S, --sectors < | + | |
- | -h, --help display this help | + | Un Chargeur de Démarrage étroitement lié à Systemd ( voir plus bas ), celui-ci connaît actuellement un gain de popularité. |
- | -V, --version | + | |
- | Available output columns: | + | ===U-boot=== |
- | 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/ | + | |
- | bsd: Slice Start End Sectors Cylinders Size Type Bsize Cpg Fsize | + | |
- | sgi: Device Start End Sectors Cylinders Size Type Id Attrs | + | |
- | sun: Device Start End Sectors Cylinders Size Type Id Flags | + | |
- | For more details see fdisk(8). | + | Un Chargeur de Démarrage qui peut booter n' |
- | </ | + | |
- | =====Logical Volume Manager (LVM)===== | + | ===Le Projet Syslinux=== |
- | ====LAB #3 - Volumes Logiques Linéaires==== | + | ==SYSLINUX== |
- | Afin de mettre en place le LVM, vous avez besoin du paquet **lvm2** et du paquet **device-mapper**. | + | Un Chargeur |
- | Nous allons travailler sous RHEL/CentOS 8 avec les partitions suivantes : | + | ==EXTLINUX== |
- | < | + | Un Chargeur de Démarrage de petite taille qui sait booter des systèmes de fichier, EXT2, EXT3, EXT4 et BRTFS. |
- | / | + | |
- | / | + | |
- | / | + | |
- | </ | + | |
- | Pour initialiser le LVM saississez la commande suivante : | + | ==ISOLINUX== |
- | < | + | Un Chargeur de Démarrage pour booter des LiveCD et LiveDVD. Dans le cas d' |
- | [root@centos8 ~]# vgscan | + | |
- | Found volume group " | + | |
- | </ | + | |
- | Les options | + | * **isolinux.bin** qui contient l' |
+ | | ||
- | < | + | ==PXELINUX== |
- | [root@centos8 ~]# vgscan --longhelp | + | |
- | | + | Un Chargeur de Démarrage pour booter à partir d'un serveur réseau. Ce système utilise le standard **PXE** (//Pre-boot Execution Environment// |
- | vgscan | + | * **DHCP** pour attribuer une adresse IP à la machine et |
- | [ --ignorelockingfailure ] | + | |
- | [ --mknodes ] | + | |
- | [ --notifydbus ] | + | |
- | [ --reportformat basic|json ] | + | |
- | [ COMMON_OPTIONS ] | + | |
- | Common options for lvm: | + | ===Isodhpfx=== |
- | [ -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 ] | + | |
- | Common variables for lvm: | + | Un Chargeur de Démarrage hybride, appelé **isodhpfx.bin**, qui peut être chargé sur un disque **ou** une clef USB. Le fichier isodhpfx.bin est créé avec le programme **xorriso**. |
- | Variables in option or position args are capitalized, | + | |
- | e.g. PV, VG, LV, Size, Number, String, Tag. | + | |
- | PV | + | ====Initramfs==== |
- | 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 | + | Le fichier Initramfs |
- | 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 _< | + | |
- | 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 | + | |
- | capital letters mean multiple of 1000.) | + | |
- | </code> | + | |
- | + | ||
- | ===Physical Volume (PV)=== | + | |
- | + | ||
- | Pour créer le **PV** il convient d' | + | |
< | < | ||
- | [root@centos8 ~]# pvcreate | + | [root@centos8 ~]# cp /boot/initramfs-4.18.0-240.22.1.el8_3.x86_64.img |
- | | + | [root@centos8 ~]# cd /tmp |
- | | + | [root@centos8 tmp]# ls |
- | | + | cpio.list |
- | </ | + | custom |
+ | dateref | ||
+ | incremental.tar | ||
+ | mbr.save | ||
+ | systemd-private-9af7a2f7444849578f55b306bfd9f820-chronyd.service-iQiNzF | ||
+ | tblpart.save | ||
+ | test.cpio | ||
+ | test.print | ||
+ | test.tar | ||
+ | tmp.iso | ||
+ | vg0_backup | ||
- | Les options de la commande **pvcreate** sont : | + | [root@centos8 tmp]# mv custom custom.gz |
- | < | + | [root@centos8 |
- | [root@centos8 | + | |
- | pvcreate - Initialize physical volume(s) for use by LVM | + | |
- | pvcreate PV ... | + | [root@centos8 tmp]# mkdir initramfs |
- | [ -f|--force ] | + | |
- | [ -M|--metadatatype lvm2 ] | + | |
- | [ -u|--uuid String ] | + | |
- | [ -Z|--zero y|n ] | + | |
- | [ --dataalignment Size[k|UNIT] ] | + | |
- | [ --dataalignmentoffset Size[k|UNIT] ] | + | |
- | [ --bootloaderareasize Size[m|UNIT] ] | + | |
- | [ --labelsector Number ] | + | |
- | [ --pvmetadatacopies 0|1|2 ] | + | |
- | [ --metadatasize Size[m|UNIT] ] | + | |
- | [ --metadataignore y|n ] | + | |
- | [ --norestorefile ] | + | |
- | [ --setphysicalvolumesize Size[m|UNIT] ] | + | |
- | [ --reportformat basic|json ] | + | |
- | [ --restorefile String ] | + | |
- | [ COMMON_OPTIONS | + | |
- | Common options for lvm: | + | [root@centos8 tmp]# cd initramfs |
- | [ -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 | + | |
- | Common variables for lvm: | + | [root@centos8 initramfs]# cpio -cid -I ../custom |
- | Variables in option or position args are capitalized, | + | 216 blocks |
- | e.g. PV, VG, LV, Size, Number, String, Tag. | + | [root@centos8 initramfs]# ls |
- | + | bin dev etc init lib lib64 proc root run sbin shutdown | |
- | PV | + | |
- | Physical Volume name, a device path under /dev. | + | |
- | For commands managing physical extents, a PV positional arg | + | |
- | generally accepts a suffix indicating a range (or multiple ranges) | + | |
- | of PEs. When the first PE is omitted, it defaults to the start of | + | |
- | the device, and when the last PE is omitted it defaults to the end. | + | |
- | PV[:PE-PE]... is start and end range (inclusive), | + | |
- | PV[: | + | |
- | + | ||
- | 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 _< | + | |
- | 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 | + | |
- | capital letters mean multiple of 1000.) | + | |
</ | </ | ||
- | Pour visualiser le PV il convient d'utiliser la commande **pvdisplay** : | + | ===Examiner l'image existante=== |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# pvdisplay /dev/sdb6 /dev/sdb7 /dev/sdb9 | + | |
- | "/ | + | |
- | --- NEW Physical volume --- | + | |
- | PV Name / | + | |
- | VG Name | + | |
- | PV Size | + | |
- | Allocatable | + | |
- | PE Size | + | |
- | Total PE 0 | + | |
- | Free PE 0 | + | |
- | Allocated PE 0 | + | |
- | PV UUID | + | |
- | + | ||
- | "/ | + | |
- | --- NEW Physical volume --- | + | |
- | PV Name / | + | |
- | VG Name | + | |
- | PV Size | + | |
- | Allocatable | + | |
- | PE Size | + | |
- | Total PE 0 | + | |
- | Free PE 0 | + | |
- | Allocated PE 0 | + | |
- | PV UUID | + | |
- | + | ||
- | "/ | + | |
- | --- NEW Physical volume --- | + | |
- | PV Name / | + | |
- | VG Name | + | |
- | PV Size | + | |
- | Allocatable | + | |
- | PE Size | + | |
- | Total PE 0 | + | |
- | Free PE 0 | + | |
- | Allocated PE 0 | + | |
- | PV UUID | + | |
- | </ | + | |
- | Les options de la commande **pvdisplay** sont : | + | Pour examiner une image initramfs archivée, il convient d' |
< | < | ||
- | [root@centos8 | + | [root@centos8 |
- | | + | Image: custom: 25M |
+ | ======================================================================== | ||
+ | Early CPIO image | ||
+ | ======================================================================== | ||
+ | drwxr-xr-x 3 root | ||
+ | -rw-r--r-- | ||
+ | drwxr-xr-x | ||
+ | drwxr-xr-x | ||
+ | drwxr-xr-x | ||
+ | -rw-r--r-- | ||
+ | ======================================================================== | ||
+ | Version: dracut-049-95.git20200804.el8_3.4 | ||
- | pvdisplay | + | Arguments: |
- | [ -a|--all ] | + | |
- | [ -c|--colon ] | + | |
- | [ -C|--columns ] | + | |
- | [ -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 | + | |
- | Common options for lvm: | + | dracut modules: |
- | [ -d|--debug ] | + | bash |
- | [ -h|--help ] | + | systemd |
- | [ -q|--quiet ] | + | systemd-initrd |
- | [ -v|--verbose ] | + | nss-softokn |
- | [ -y|--yes ] | + | rngd |
- | [ -t|--test ] | + | i18n |
- | [ | + | network-legacy |
- | [ | + | network |
- | [ | + | ifcfg |
- | [ | + | drm |
- | [ | + | plymouth |
- | [ | + | prefixdevname |
- | [ | + | kernel-modules |
- | [ | + | kernel-modules-extra |
- | + | kernel-network-modules | |
- | Common variables for lvm: | + | resume |
- | | + | rootfs-block |
- | e.g. PV, VG, LV, Size, Number, String, Tag. | + | terminfo |
- | + | udev-rules | |
- | PV | + | biosdevname |
- | Physical Volume name, a device path under /dev. | + | dracut-systemd |
- | For commands managing physical extents, a PV positional arg | + | usrmount |
- | generally accepts a suffix indicating a range (or multiple ranges) | + | base |
- | of PEs. When the first PE is omitted, it defaults to the start of | + | fs-lib |
- | the device, and when the last PE is omitted it defaults to the end. | + | memstrack |
- | PV[:PE-PE]... is start and end range (inclusive), | + | microcode_ctl-fw_dir_override |
- | PV[:PE+PE]... is start and length range (counting from 0). | + | shutdown |
- | + | ======================================================================== | |
- | LV | + | drwxr-xr-x 12 root |
- | Logical Volume name. See lvm(8) for valid names. An LV positional | + | crw-r--r-- 1 root |
- | arg generally includes the VG name and LV name, e.g. VG/LV. | + | crw-r--r-- 1 root |
- | LV followed by _< | + | crw-r--r-- 1 root |
- | required. (raid represents raid< | + | crw-r--r-- 1 root |
- | The _new suffix indicates that the LV name is new. | + | crw-r--r-- |
- | + | lrwxrwxrwx | |
- | Tag | + | drwxr-xr-x |
- | Tag name. See lvm(8) for information about tag names and using | + | drwxr-xr-x |
- | tags in place of a VG, LV or PV. | + | -rw-r--r-- |
- | + | drwxr-xr-x | |
- | Select | + | drwxr-xr-x |
- | Select indicates that a required positional arg can be omitted | + | -rw-r--r-- |
- | if the --select option is used. No arg appears in this position. | + | --More-- |
- | + | ||
- | 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 | + | |
- | capital letters mean multiple of 1000.) | + | |
</ | </ | ||
- | ===Volume Group (VG) et Physical Extent (PE)=== | + | ===Le script init=== |
- | Pour créer un Volume Group dénommé | + | RHEL/CentOS 8 utilise le système de démarrage |
< | < | ||
- | [root@centos8 | + | [root@centos8 |
- | Volume group " | + | lrwxrwxrwx |
</ | </ | ||
- | Les options de la commande **vgcreate** sont : | + | ===Consulter le contenu d'un fichier dans initramfs=== |
- | < | + | Pour consulter le contenu d'un fichier inclus dans l' |
- | [root@centos8 ~]# vgcreate --help | + | |
- | vgcreate - Create a volume group | + | |
- | + | ||
- | vgcreate VG_new PV ... | + | |
- | [ -A|--autobackup y|n ] | + | |
- | [ -c|--clustered y|n ] | + | |
- | [ -l|--maxlogicalvolumes Number ] | + | |
- | [ -p|--maxphysicalvolumes Number ] | + | |
- | [ -M|--metadatatype lvm2 ] | + | |
- | [ -s|--physicalextentsize Size[m|UNIT] ] | + | |
- | [ -f|--force ] | + | |
- | [ -Z|--zero y|n ] | + | |
- | [ --addtag Tag ] | + | |
- | [ --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit ] | + | |
- | [ --metadataprofile String ] | + | |
- | [ --labelsector Number ] | + | |
- | [ --metadatasize Size[m|UNIT] ] | + | |
- | [ --pvmetadatacopies 0|1|2 ] | + | |
- | [ --vgmetadatacopies all|unmanaged|Number ] | + | |
- | [ --reportformat basic|json ] | + | |
- | [ --dataalignment Size[k|UNIT] ] | + | |
- | [ --dataalignmentoffset Size[k|UNIT] ] | + | |
- | [ --shared ] | + | |
- | [ --systemid String ] | + | |
- | [ --locktype sanlock|dlm|none ] | + | |
- | [ COMMON_OPTIONS ] | + | |
- | + | ||
- | 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. | + | |
- | </ | + | |
- | + | ||
- | Pour afficher les informations concernant **vg0**, il convient d' | + | |
< | < | ||
- | [root@centos8 | + | [root@centos8 |
- | | + | include ld.so.conf.d/*.conf |
- | VG Name vg0 | + | |
- | System ID | + | |
- | Format | + | |
- | Metadata Areas 3 | + | |
- | Metadata Sequence No 1 | + | |
- | VG Access | + | |
- | VG Status | + | |
- | MAX LV 0 | + | |
- | Cur LV 0 | + | |
- | Open LV 0 | + | |
- | Max PV 0 | + | |
- | Cur PV 3 | + | |
- | Act PV 3 | + | |
- | VG Size 880.00 MiB | + | |
- | PE Size 8.00 MiB | + | |
- | Total PE 110 | + | |
- | Alloc PE / Size 0 / 0 | + | |
- | Free PE / Size 110 / 880.00 MiB | + | |
- | VG UUID | + | |
</ | </ | ||
- | Les options | + | ====Processus |
- | < | + | Le processus de démarrage du Noyau Linux peut être divisé en 6 étapes : |
- | [root@centos8 ~]# vgdisplay --help | + | |
- | vgdisplay - Display volume group information | + | |
- | vgdisplay | + | ^ Etape ^ Description ^ |
- | [ -A|--activevolumegroups ] | + | | Chargement, configuration et exécution du chargeur du noyau | Le fichier **bootsect.s** est chargé en mémoire par le BIOS. Une fois configuré celui-ci charge le reste du noyau en mémoire |
- | [ -c|--colon ] | + | | Configuration des paramètres et bascule vers le mode 32 bits | Le fichier **boot.s** met en place un **[[http:// |
- | [ -C|--columns ] | + | | Décompression du Noyau | Le fichier **head.s** décompresse le noyau | |
- | [ -o|--options String ] | + | | Initialisation du noyau et de la mémoire |
- | [ -S|--select String ] | + | | Configuration du noyau | Le fichier **main.c** met en place les contraintes de mémoire et configure la mémoire virtuelle |
- | [ -s|--short ] | + | | Création du processus Init | Le fichier **main.c** crée le processus init | |
- | [ -O|--sort String | + | |
- | [ --aligned | + | |
- | [ | + | |
- | [ | + | |
- | [ --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: | + | La fonction **init_post()** essaie ensuite |
- | [ -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 ] | + | |
- | | + | |
- | </code> | + | |
+ | * /bin/init | ||
+ | * /bin/sh ==> /bin/bash ==> / | ||
- | ===Logical Volumes (LV)=== | + | Dans le cas d'un échec à ce stade le message **Kernel Panic** sera affiché. |
- | Pour créer un **Logical Volume** dénommé **lv0** dans le **Volume Group** **vg0**, il convient d' | + | =====Systemd===== |
- | < | + | Les systèmes de démarrage antérieurs à Systemd, **SysVinit** et **Upstart**, |
- | [root@centos8 ~]# lvcreate -L 350 -n lv0 vg0 | + | |
- | Rounding up size to full physical extent 352.00 MiB | + | |
- | Logical volume " | + | |
- | </ | + | |
- | <WRAP center round important 60%> | + | **Systemd** essaie, par contre, de démarrer autant de services en parallèle |
- | **Important** -Notez | + | |
- | </ | + | |
- | Les options | + | Au lieu de parler de scripts de démarrage et de niveaux d' |
- | < | + | * **.automount** - active la fonctionalité d' |
- | [root@centos8 ~]# lvcreate | + | * **.device** |
- | | + | * **.mount** |
+ | | ||
+ | * **.service** - démarre, arrête, redémarre ou recharge un service. | ||
+ | * **.scope** - gère des services. | ||
+ | * **.slice** - regroupe des Unités dans une arborescence afin de limiter des ressources en utilisant des CGroups. | ||
+ | * **.snapshot** - un état sauvegardé du gestionnaire Systemd. | ||
+ | * **.socket** - permet aux Unités d' | ||
+ | * **.swap** - encapsule une périphérique ou un fichier swap. | ||
+ | * **.timer** - déclenche l' | ||
+ | * **.target** - regroupe des Unités multiples afin qu' | ||
- | Create a linear LV. | + | Une Cible est en quelque sorte une **grande étape** dans le démarrage du système : |
- | lvcreate -L|--size Size[m|UNIT] VG | + | |
- | [ -l|--extents Number[PERCENT] ] | + | |
- | [ --type linear ] | + | |
- | [ COMMON_OPTIONS ] | + | |
- | [ PV ... ] | + | |
- | | + | |
- | | + | * **poweroff.target** |
- | [ -l|--extents Number[PERCENT] ] | + | |
- | [ -I|--stripesize Size[k|UNIT] ] | + | * **rescue.target** |
- | [ COMMON_OPTIONS ] | + | * **emergency.target** |
- | [ PV ... ] | + | * **multi-user.target** |
+ | * **graphical.target** | ||
+ | * **hibernate.target** - sauvegarde l' | ||
+ | * **reboot.target** - redémarre le système. | ||
- | Create a raid1 or mirror LV (infers --type raid1|mirror). | + | **Systemd** utilise des Cibles d'une manière similaire à ce que **SysVinit** utilise des niveaux d' |
- | 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 ... ] | + | |
- | + | ||
- | Create a raid LV (a specific raid level must be used, e.g. raid1). | + | |
- | lvcreate --type raid -L|--size Size[m|UNIT] VG | + | |
- | [ -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 ... ] | + | |
- | + | ||
- | Create a raid10 LV. | + | |
- | lvcreate -m|--mirrors Number -i|--stripes Number -L|--size Size[m|UNIT] VG | + | |
- | [ -l|--extents Number[PERCENT] ] | + | |
- | [ -I|--stripesize Size[k|UNIT] ] | + | |
- | [ -R|--regionsize Size[m|UNIT] ] | + | |
- | [ --minrecoveryrate Size[k|UNIT] ] | + | |
- | [ --maxrecoveryrate Size[k|UNIT] ] | + | |
- | [ COMMON_OPTIONS ] | + | |
- | [ PV ... ] | + | |
- | + | ||
- | Create a COW snapshot LV of an origin LV. | + | |
- | lvcreate -s|--snapshot -L|--size Size[m|UNIT] LV | + | |
- | [ -l|--extents Number[PERCENT] ] | + | |
- | [ -i|--stripes Number ] | + | |
- | [ -I|--stripesize Size[k|UNIT] ] | + | |
- | [ -c|--chunksize Size[k|UNIT] ] | + | |
- | [ --type snapshot ] | + | |
- | [ COMMON_OPTIONS ] | + | |
- | [ PV ... ] | + | |
- | + | ||
- | Create a thin pool. | + | |
- | lvcreate --type thin-pool -L|--size Size[m|UNIT] VG | + | |
- | [ -l|--extents Number[PERCENT] ] | + | |
- | [ -c|--chunksize Size[k|UNIT] ] | + | |
- | [ -i|--stripes Number ] | + | |
- | [ -I|--stripesize Size[k|UNIT] ] | + | |
- | [ --thinpool LV_new ] | + | |
- | [ --poolmetadatasize Size[m|UNIT] ] | + | |
- | [ --poolmetadataspare y|n ] | + | |
- | [ --discards passdown|nopassdown|ignore ] | + | |
- | [ --errorwhenfull y|n ] | + | |
- | [ COMMON_OPTIONS ] | + | |
- | [ PV ... ] | + | |
- | + | ||
- | Create a cache pool. | + | |
- | lvcreate --type cache-pool -L|--size Size[m|UNIT] VG | + | |
- | [ -l|--extents Number[PERCENT] ] | + | |
- | [ -H|--cache ] | + | |
- | [ -c|--chunksize Size[k|UNIT] ] | + | |
- | [ --poolmetadatasize Size[m|UNIT] ] | + | |
- | [ --poolmetadataspare y|n ] | + | |
- | [ --cachemode writethrough|writeback|passthrough ] | + | |
- | [ --cachepolicy String ] | + | |
- | [ --cachesettings String ] | + | |
- | [ --cachemetadataformat auto|1|2 ] | + | |
- | [ COMMON_OPTIONS ] | + | |
- | [ PV ... ] | + | |
- | + | ||
- | Create a thin LV in a thin pool (infers --type thin). | + | |
- | lvcreate -V|--virtualsize Size[m|UNIT] --thinpool LV_thinpool VG | + | |
- | [ -T|--thin ] | + | |
- | [ --type thin ] | + | |
- | [ --discards passdown|nopassdown|ignore ] | + | |
- | [ --errorwhenfull y|n ] | + | |
- | [ COMMON_OPTIONS ] | + | |
- | + | ||
- | Create a thin LV that is a snapshot of an existing thin LV | + | |
- | (infers --type thin). | + | |
- | lvcreate -s|--snapshot LV_thin | + | |
- | [ --type thin ] | + | |
- | [ --discards passdown|nopassdown|ignore ] | + | |
- | [ --errorwhenfull y|n ] | + | |
- | [ COMMON_OPTIONS ] | + | |
- | + | ||
- | Create a thin LV that is a snapshot of an external origin LV. | + | |
- | lvcreate --type thin --thinpool LV_thinpool LV | + | |
- | [ -T|--thin ] | + | |
- | [ -c|--chunksize Size[k|UNIT] ] | + | |
- | [ --poolmetadatasize Size[m|UNIT] ] | + | |
- | [ --poolmetadataspare y|n ] | + | |
- | [ --discards passdown|nopassdown|ignore ] | + | |
- | [ --errorwhenfull y|n ] | + | |
- | [ COMMON_OPTIONS ] | + | |
- | + | ||
- | Create a LV that returns VDO when used. | + | |
- | lvcreate --type vdo -L|--size Size[m|UNIT] VG | + | |
- | [ -l|--extents Number[PERCENT] ] | + | |
- | [ -V|--virtualsize Size[m|UNIT] ] | + | |
- | [ -i|--stripes Number ] | + | |
- | [ -I|--stripesize Size[k|UNIT] ] | + | |
- | [ --vdo ] | + | |
- | [ --vdopool LV_new ] | + | |
- | [ --compression y|n ] | + | |
- | [ --deduplication y|n ] | + | |
- | [ COMMON_OPTIONS ] | + | |
- | [ PV ... ] | + | |
- | + | ||
- | Create a thin LV, first creating a thin pool for it, | + | |
- | 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 ... ] | + | |
- | + | ||
- | Create a new LV, then attach the specified cachepool | + | |
- | which converts the new LV to type cache. | + | |
- | lvcreate --type cache -L|--size Size[m|UNIT] --cachepool LV_cachepool VG | + | |
- | [ -l|--extents Number[PERCENT] ] | + | |
- | [ -H|--cache ] | + | |
- | [ -c|--chunksize Size[k|UNIT] ] | + | |
- | [ -i|--stripes Number ] | + | |
- | [ -I|--stripesize Size[k|UNIT] ] | + | |
- | [ --poolmetadatasize Size[m|UNIT] ] | + | |
- | [ --poolmetadataspare y|n ] | + | |
- | [ --cachemode writethrough|writeback|passthrough ] | + | |
- | [ --cachepolicy String ] | + | |
- | [ --cachesettings String ] | + | |
- | [ --cachemetadataformat auto|1|2 ] | + | |
- | [ COMMON_OPTIONS ] | + | |
- | [ PV ... ] | + | |
- | + | ||
- | Create a new LV, then attach the specified cachevol | + | |
- | which converts the new LV to type cache. | + | |
- | lvcreate --type cache -L|--size Size[m|UNIT] --cachevol LV VG | + | |
- | [ -l|--extents Number[PERCENT] ] | + | |
- | [ -c|--chunksize Size[k|UNIT] ] | + | |
- | [ -i|--stripes Number ] | + | |
- | [ -I|--stripesize Size[k|UNIT] ] | + | |
- | [ --cachemode writethrough|writeback|passthrough ] | + | |
- | [ --cachepolicy String ] | + | |
- | [ --cachesettings String ] | + | |
- | [ --cachemetadataformat auto|1|2 ] | + | |
- | [ COMMON_OPTIONS ] | + | |
- | [ PV ... ] | + | |
- | + | ||
- | Create a new LV, then attach a cachevol created from | + | |
- | 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 ... ] | + | |
- | + | ||
- | 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 ... ] | + | |
- | + | ||
- | Create a new LV, then attach a cachevol created from | + | |
- | the specified cache device, which converts the | + | |
- | new LV to type writecache. | + | |
- | lvcreate --type writecache -L|--size Size[m|UNIT] --cachedevice PV VG | + | |
- | [ -l|--extents Number[PERCENT] ] | + | |
- | [ -i|--stripes Number ] | + | |
- | [ -I|--stripesize Size[k|UNIT] ] | + | |
- | [ --cachesize Size[m|UNIT] ] | + | |
- | [ --cachesettings String ] | + | |
- | [ COMMON_OPTIONS ] | + | |
- | [ PV ... ] | + | |
- | + | ||
- | Common options for command: | + | |
- | [ -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 ] | + | |
- | + | ||
- | 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. | + | |
- | </ | + | |
- | + | ||
- | Créez maintenant un répertoire dans /mnt pour monter lv0 : | + | |
< | < | ||
- | [root@centos8 ~]# mkdir /mnt/lvm | + | [root@centos8 ~]# ls -l /usr/lib/ |
- | </code> | + | lrwxrwxrwx. 1 root root 15 Apr 7 16:55 / |
+ | lrwxrwxrwx. 1 root root 13 Apr 7 16:55 / | ||
+ | lrwxrwxrwx. 1 root root 17 Apr 7 16:55 / | ||
+ | lrwxrwxrwx. 1 root root 17 Apr 7 16:55 / | ||
+ | lrwxrwxrwx. 1 root root 17 Apr 7 16:55 / | ||
+ | lrwxrwxrwx. 1 root root 16 Apr 7 16:55 / | ||
+ | lrwxrwxrwx. 1 root root 13 Apr 7 16:55 / | ||
- | Créez un système de fichiers en **ext3** sur /dev/vg0/lv0 : | + | /usr/lib/systemd/ |
+ | total 0 | ||
- | < | + | /usr/lib/systemd/ |
- | [root@centos8 ~]# mke2fs -j /dev/vg0/lv0 | + | total 0 |
- | mke2fs 1.45.6 (20-Mar-2020) | + | |
- | Creating filesystem with 360448 1k blocks and 90112 inodes | + | |
- | Filesystem UUID: 87b6d526-d379-4e0c-8984-94811f1cee33 | + | |
- | Superblock backups stored on blocks: | + | |
- | 8193, 24577, 40961, 57345, 73729, 204801, 221185 | + | |
- | Allocating group tables: done | + | / |
- | Writing inode tables: done | + | total 0 |
- | Creating journal (8192 blocks): done | + | |
- | Writing superblocks and filesystem accounting information: | + | |
- | </ | + | |
- | Montez votre lv0 : | + | / |
+ | total 0 | ||
- | < | + | /usr/lib/systemd/system/runlevel5.target.wants: |
- | [root@centos8 ~]# mount -t ext3 /dev/vg0/lv0 /mnt/lvm | + | total 0 |
</ | </ | ||
- | Vous allez maintenant copier le contenu de votre répertoire /home vers /mnt/lvm. | + | ====LAB #1 - La Commande systemctl==== |
- | Saisissez donc la commande | + | Pour visualiser la liste des Unités, il convient d' |
< | < | ||
- | [root@centos8 ~]# cp -a /home /mnt/lvm | + | [root@centos8 ~]# systemctl list-units |
+ | UNIT LOAD | ||
+ | proc-sys-fs-binfmt_misc.automount | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-pci0000: | ||
+ | sys-devices-platform-serial8250-tty-ttyS0.device | ||
+ | sys-devices-platform-serial8250-tty-ttyS1.device | ||
+ | sys-devices-platform-serial8250-tty-ttyS2.device | ||
+ | sys-devices-platform-serial8250-tty-ttyS3.device | ||
+ | sys-devices-virtual-block-dm\x2d0.device | ||
+ | sys-devices-virtual-block-dm\x2d1.device | ||
+ | sys-devices-virtual-net-virbr0.device | ||
+ | sys-devices-virtual-net-virbr0\x2dnic.device | ||
+ | sys-module-configfs.device | ||
+ | sys-subsystem-net-devices-enp0s3.device | ||
+ | sys-subsystem-net-devices-virbr0.device | ||
+ | sys-subsystem-net-devices-virbr0\x2dnic.device | ||
+ | -.mount | ||
+ | boot.mount | ||
+ | dev-hugepages.mount | ||
+ | dev-mqueue.mount | ||
+ | run-user-1000.mount | ||
+ | sys-kernel-config.mount | ||
+ | sys-kernel-debug.mount | ||
+ | sys-kernel-tracing.mount | ||
+ | var-lib-nfs-rpc_pipefs.mount | ||
+ | cups.path | ||
+ | systemd-ask-password-plymouth.path | ||
+ | systemd-ask-password-wall.path | ||
+ | init.scope | ||
+ | session-96.scope | ||
+ | atd.service | ||
+ | auditd.service | ||
+ | avahi-daemon.service | ||
+ | chronyd.service | ||
+ | crond.service | ||
+ | cups.service | ||
+ | dbus.service | ||
+ | dracut-shutdown.service | ||
+ | firewalld.service | ||
+ | lines 1-57 | ||
</ | </ | ||
- | Constatez ensuite le contenu de / | + | Pour consulter la liste des Unités inactifs, utilisez la commande suivante |
< | < | ||
- | [root@centos8 ~]# ls -l /mnt/lvm | + | [root@centos8 ~]# systemctl list-units --all | grep inactive | more |
- | total 14 | + | ● boot.automount |
- | drwxr-xr-x. 5 root root | + | proc-fs-nfsd.mount |
- | drwx------. | + | proc-sys-fs-binfmt_misc.mount |
+ | sys-fs-fuse-connections.mount | ||
+ | ● sysroot.mount | ||
+ | tmp.mount | ||
+ | | ||
+ | | ||
+ | ● apparmor.service | ||
+ | auth-rpcgss-module.service | ||
+ | cpupower.service | ||
+ | ● display-manager.service | ||
+ | dm-event.service | ||
+ | dnf-makecache.service | ||
+ | dracut-cmdline.service | ||
+ | dracut-initqueue.service | ||
+ | dracut-mount.service | ||
+ | dracut-pre-mount.service | ||
+ | dracut-pre-pivot.service | ||
+ | dracut-pre-trigger.service | ||
+ | dracut-pre-udev.service | ||
+ | ebtables.service | ||
+ | emergency.service | ||
+ | initrd-cleanup.service | ||
+ | initrd-parse-etc.service | ||
+ | initrd-switch-root.service | ||
+ | initrd-udevadm-cleanup-db.service | ||
+ | ● ip6tables.service | ||
+ | ● ipset.service | ||
+ | ● iptables.service | ||
+ | iscsi-onboot.service | ||
+ | iscsi.service | ||
+ | iscsid.service | ||
+ | iscsiuio.service | ||
+ | ldconfig.service | ||
+ | libvirt-guests.service | ||
+ | libvirtd.service | ||
+ | loadmodules.service | ||
+ | ● lvm2-activation.service | ||
+ | lvm2-lvmpolld.service | ||
+ | mdmonitor.service | ||
+ | microcode.service | ||
+ | ● network.service | ||
+ | nfs-blkmap.service | ||
+ | nfs-convert.service | ||
+ | nfs-idmapd.service | ||
+ | nfs-mountd.service | ||
+ | nfs-server.service | ||
+ | nfs-utils.service | ||
+ | nfsdcld.service | ||
+ | nftables.service | ||
+ | ● ntpd.service | ||
+ | ● ntpdate.service | ||
+ | plymouth-switch-root.service | ||
+ | rc-local.service | ||
+ | rescue.service | ||
+ | rpc-gssd.service | ||
+ | --More-- | ||
</ | </ | ||
- | Une particularité du volume logique est la capacité | + | Les points noirs au début |
< | < | ||
- | [root@centos8 ~]# df -h /mnt/lvm | + | [root@centos8 ~]# systemctl status ntpd |
- | Filesystem | + | Unit ntpd.service could not be found. |
- | / | + | |
</ | </ | ||
- | Dans la cas de notre exemple, la taille est de **333 Mo** avec **17 Mo** occupé. | + | Pour consulter |
- | + | ||
- | ====LAB #4 - Etendre un Volume Logique à Chaud==== | + | |
- | + | ||
- | Pour agrandir un volume logique, le paquet **lvm2** contient les commandes **lvextend** et **resize2fs** | + | |
< | < | ||
- | [root@centos8 ~]# lvextend | + | [root@centos8 ~]# systemctl list-unit-files | more |
- | | + | UNIT FILE STATE |
- | | + | proc-sys-fs-binfmt_misc.automount |
- | | + | -.mount |
+ | boot.mount | ||
+ | dev-hugepages.mount | ||
+ | dev-mqueue.mount | ||
+ | proc-fs-nfsd.mount | ||
+ | proc-sys-fs-binfmt_misc.mount | ||
+ | sys-fs-fuse-connections.mount | ||
+ | sys-kernel-config.mount | ||
+ | sys-kernel-debug.mount | ||
+ | tmp.mount | ||
+ | var-lib-machines.mount | ||
+ | var-lib-nfs-rpc_pipefs.mount | ||
+ | cups.path | ||
+ | systemd-ask-password-console.path static | ||
+ | systemd-ask-password-plymouth.path | ||
+ | systemd-ask-password-wall.path | ||
+ | session-96.scope | ||
+ | arp-ethers.service | ||
+ | atd.service | ||
+ | auditd.service | ||
+ | auth-rpcgss-module.service | ||
+ | autovt@.service | ||
+ | avahi-daemon.service | ||
+ | blk-availability.service | ||
+ | chrony-dnssrv@.service | ||
+ | chrony-wait.service | ||
+ | chronyd.service | ||
+ | cockpit-motd.service | ||
+ | cockpit-wsinstance-http-redirect.service | ||
+ | cockpit-wsinstance-http.service | ||
+ | cockpit-wsinstance-https-factory@.service | ||
+ | cockpit-wsinstance-https@.service | ||
+ | cockpit.service | ||
+ | console-getty.service | ||
+ | container-getty@.service | ||
+ | cpupower.service | ||
+ | crond.service | ||
+ | cups-browsed.service | ||
+ | cups.service | ||
+ | dbus-org.fedoraproject.FirewallD1.service | ||
+ | dbus-org.freedesktop.Avahi.service | ||
+ | dbus-org.freedesktop.hostname1.service | ||
+ | dbus-org.freedesktop.import1.service | ||
+ | dbus-org.freedesktop.locale1.service | ||
+ | dbus-org.freedesktop.login1.service | ||
+ | dbus-org.freedesktop.machine1.service | ||
+ | dbus-org.freedesktop.nm-dispatcher.service | ||
+ | dbus-org.freedesktop.portable1.service | ||
+ | dbus-org.freedesktop.timedate1.service | ||
+ | dbus.service | ||
+ | debug-shell.service | ||
+ | dm-event.service | ||
+ | dnf-makecache.service | ||
+ | dnsmasq.service | ||
+ | dracut-cmdline.service | ||
+ | --More-- | ||
</ | </ | ||
- | <WRAP center round important 60%> | + | Pour visualiser les Unités d'un type spécifique, |
- | **Important** - Notez que l'agrandissement du volume est un multiple du PE. | + | |
- | </ | + | |
- | + | ||
- | Les options de la commande | + | |
< | < | ||
- | [root@centos8 ~]# lvextend | + | [root@centos8 ~]# systemctl list-unit-files -t mount |
- | | + | UNIT FILE |
+ | -.mount | ||
+ | boot.mount | ||
+ | dev-hugepages.mount | ||
+ | dev-mqueue.mount | ||
+ | proc-fs-nfsd.mount | ||
+ | proc-sys-fs-binfmt_misc.mount static | ||
+ | sys-fs-fuse-connections.mount static | ||
+ | sys-kernel-config.mount | ||
+ | sys-kernel-debug.mount | ||
+ | tmp.mount | ||
+ | var-lib-machines.mount | ||
+ | var-lib-nfs-rpc_pipefs.mount | ||
- | Extend an LV by a specified size. | + | 12 unit files listed. |
- | lvextend -L|--size [+]Size[m|UNIT] LV | + | |
- | [ -l|--extents [+]Number[PERCENT] ] | + | |
- | [ -r|--resizefs ] | + | |
- | [ -i|--stripes Number ] | + | |
- | [ -I|--stripesize Size[k|UNIT] ] | + | |
- | [ --poolmetadatasize [+]Size[m|UNIT] ] | + | |
- | [ COMMON_OPTIONS ] | + | |
- | [ PV ... ] | + | |
- | + | ||
- | Extend an LV by specified PV extents. | + | |
- | lvextend LV PV ... | + | |
- | [ -r|--resizefs ] | + | |
- | [ -i|--stripes Number ] | + | |
- | [ -I|--stripesize Size[k|UNIT] ] | + | |
- | [ COMMON_OPTIONS ] | + | |
- | + | ||
- | Extend a pool metadata SubLV by a specified size. | + | |
- | lvextend --poolmetadatasize [+]Size[m|UNIT] LV_thinpool | + | |
- | [ -i|--stripes Number ] | + | |
- | [ -I|--stripesize Size[k|UNIT] ] | + | |
- | [ COMMON_OPTIONS ] | + | |
- | [ PV ... ] | + | |
- | + | ||
- | Extend an LV according to a predefined policy. | + | |
- | lvextend --usepolicies LV_snapshot_thinpool | + | |
- | [ -r|--resizefs ] | + | |
- | [ COMMON_OPTIONS ] | + | |
- | [ PV ... ] | + | |
- | + | ||
- | 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: | + | |
- | [ -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. | + | |
</ | </ | ||
- | Le volume ayant été agrandi, il est necessaire maintenant d' | + | Dans la colonne STATE on voit les mots **static** et **generated**. |
- | < | + | * STATE = static |
- | [root@centos8 ~]# resize2fs / | + | * Ceci implique que l' |
- | resize2fs 1.45.6 (20-Mar-2020) | + | |
- | Filesystem at / | + | |
- | old_desc_blocks = 2, new_desc_blocks = 2 | + | |
- | The filesystem on / | + | |
- | </ | + | |
- | Constatez maintenant la modification | + | * STATE = generated |
+ | * Ceci implique que le fichier a été généré automatiquement en utilisant les informations dans le fichier **/ | ||
< | < | ||
- | [root@centos8 ~]# df -h /mnt/lvm | + | [root@centos8 ~]# ls -l /lib/systemd/ |
- | Filesystem | + | -rwxr-xr-x. 1 root root 46096 Apr 7 16:56 /lib/systemd/system-generators/systemd-fstab-generator |
- | /dev/mapper/vg0-lv0 434M | + | |
</ | </ | ||
- | Vous noterez que la taille a augmentée mais que les données sont toujours présentes. | + | Il existe aussi d' |
- | + | ||
- | ====LAB #5 - Snapshots==== | + | |
- | + | ||
- | Un snapshot est un instantané | + | |
- | + | ||
- | Avant de commencer, créez un fichier de 10Mo dans le volume | + | |
< | < | ||
- | [root@centos8 ~]# dd if=/dev/zero of=/mnt/lvm/10M bs=1048576 count=10 | + | [root@centos8 ~]# ls -l /lib/systemd/system-generators |
- | 10+0 records in | + | total 508 |
- | 10+0 records out | + | -rwxr-xr-x. 1 root root 504 Jan 4 11:25 kdump-dep-generator.sh |
- | 10485760 bytes (10 MB, 10 MiB) copied, 0.0281282 s, 373 MB/s | + | -r-xr-xr-x. 1 root root 134976 Aug 17 2020 lvm2-activation-generator |
+ | -rwxr-xr-x. 1 root root 67792 Jul 20 2020 nfs-server-generator | ||
+ | -rwxr-xr-x. 1 root root 38216 Jul 20 2020 rpc-pipefs-generator | ||
+ | -rwxr-xr-x. 1 root root 743 Apr 23 2020 selinux-autorelabel-generator.sh | ||
+ | -rwxr-xr-x. 1 root root 33504 Apr 7 16:56 systemd-cryptsetup-generator | ||
+ | -rwxr-xr-x. 1 root root 16648 Apr 7 16:56 systemd-debug-generator | ||
+ | -rwxr-xr-x. 1 root root 46096 Apr 7 16:56 systemd-fstab-generator | ||
+ | -rwxr-xr-x. 1 root root 17064 Apr 7 16:56 systemd-getty-generator | ||
+ | -rwxr-xr-x. 1 root root 29432 Apr 7 16:56 systemd-gpt-auto-generator | ||
+ | -rwxr-xr-x. 1 root root 12568 Apr 7 16:56 systemd-hibernate-resume-generator | ||
+ | -rwxr-xr-x. 1 root root 12368 Apr 7 16:56 systemd-rc-local-generator | ||
+ | -rwxr-xr-x. 1 root root 12408 Apr 7 16:56 systemd-system-update-generator | ||
+ | -rwxr-xr-x. 1 root root 33544 Apr 7 16:56 systemd-sysv-generator | ||
+ | -rwxr-xr-x. 1 root root 17024 Apr 7 16:56 systemd-veritysetup-generator | ||
</ | </ | ||
- | Créez maintenant un snapshot | + | Les options de la commande **systemctl** sont : |
< | < | ||
- | [root@centos8 ~]# lvcreate | + | [root@centos8 ~]# systemctl |
- | | + | systemctl [OPTIONS...] {COMMAND} ... |
- | Logical volume " | + | |
- | </ | + | |
- | Pour avoir une confirmation de la création du snapshot, utilisez la commande **lvs** : | + | Query or send control commands to the systemd manager. |
- | < | + | -h --help |
- | [root@centos8 ~]# lvs | + | --version |
- | | + | |
- | | + | |
- | | + | -H --host=[USER@]HOST |
- | | + | Operate on remote host |
- | | + | |
- | </ | + | Operate on local container |
+ | -t --type=TYPE | ||
+ | | ||
+ | -p --property=NAME | ||
+ | | ||
+ | including dead/empty ones. To list all units installed on | ||
+ | the system, use the ' | ||
+ | --failed | ||
+ | | ||
+ | -r --recursive | ||
+ | --reverse | ||
+ | | ||
+ | queueing a new job | ||
+ | --show-types When showing sockets, explicitly show their type | ||
+ | --value When showing properties, only print the value | ||
+ | | ||
+ | When shutting down or sleeping, ignore inhibitors | ||
+ | | ||
+ | -s --signal=SIGNAL | ||
+ | --now Start or stop unit in addition to enabling or disabling it | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | --no-pager Do not pipe output into a pager | ||
+ | --no-ask-password | ||
+ | Do not ask for system passwords | ||
+ | | ||
+ | | ||
+ | reboot | ||
+ | -f --force | ||
+ | When shutting down, execute action immediately | ||
+ | | ||
+ | | ||
+ | directory | ||
+ | -n --lines=INTEGER | ||
+ | -o --output=STRING | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
- | <WRAP center round important 60%> | + | lines 1-57 |
- | **Important** | + | |
- | </ | + | |
- | + | ||
- | Les options de la commande **lvs** sont : | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# lvs --help | + | |
- | lvs - Display information about logical volumes | + | |
- | + | ||
- | lvs | + | |
- | [ -H|--history ] | + | |
- | [ -a|--all ] | + | |
- | [ -o|--options String ] | + | |
- | [ -S|--select String ] | + | |
- | [ -O|--sort String ] | + | |
- | [ --segments ] | + | |
- | [ --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 ... ] | + | |
- | + | ||
- | 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. | + | |
</ | </ | ||
- | Créez maintenant un répertoire pour monter le snapshot : | + | ====LAB #2 - Fichiers de Configuration==== |
- | < | + | ===2.1 - Fichiers de Configuration par Défaut=== |
- | [root@centos8 ~]# mkdir / | + | |
- | </ | + | |
- | Montez | + | Les fichiers de configuration des Cibles et fichiers de configuration des Unités installés par des paquets se trouvent dans le répertoire **/ |
< | < | ||
- | [root@centos8 ~]# mount /dev/vg0/testsnap | + | [root@centos8 ~]# pkg-config systemd --variable=systemdsystemunitdir |
+ | /usr/lib/systemd/system | ||
</ | </ | ||
- | |||
- | Comparez le volume d' | ||
< | < | ||
- | [root@centos8 ~]# ls -l /mnt/lvm | + | [root@centos8 ~]# ls -l /usr/lib/ |
- | total 10296 | + | total 1464 |
- | -rw-r--r--. 1 root root 10485760 Jun 24 04:41 10M | + | -rw-r--r--. 1 root root 275 Apr 26 2020 arp-ethers.service |
- | drwxr-xr-x. | + | -rw-r--r--. 1 root root 222 May 11 2019 atd.service |
- | drwx------. | + | -rw-r--r--. 1 root root 1512 Apr 23 2020 auditd.service |
- | [root@centos8 ~]# ls -l / | + | -rw-r--r--. 1 root root 628 Jul 20 2020 auth-rpcgss-module.service |
- | total 10296 | + | lrwxrwxrwx. 1 root root 14 Apr 7 16:55 autovt@.service -> getty@.service |
- | -rw-r--r--. 1 root root 10485760 | + | -rw-r--r--. 1 root root 1044 Nov 16 2020 avahi-daemon.service |
- | drwxr-xr-x. | + | -rw-r--r--. 1 root root 870 Nov 16 2020 avahi-daemon.socket |
- | drwx------. 2 root root | + | -rw-r--r--. 1 root root 956 Apr 7 16:54 basic.target |
+ | drwxr-xr-x. | ||
+ | -r--r--r--. 1 root root 408 Aug 17 2020 blk-availability.service | ||
+ | -rw-r--r--. 1 root root 419 Jun 22 2018 bluetooth.target | ||
+ | -rw-r--r--. 1 root root 455 Apr 7 16:54 boot-complete.target | ||
+ | -rw-r--r--. 1 root root 209 Nov 19 2019 chrony-dnssrv@.service | ||
+ | -rw-r--r--. 1 root root 138 Nov 19 2019 chrony-dnssrv@.timer | ||
+ | -rw-r--r--. 1 root root 491 Nov 19 2019 chronyd.service | ||
+ | -rw-r--r--. 1 root root 472 May 10 2019 chrony-wait.service | ||
+ | -rw-r--r--. 1 root root 222 Aug 24 2020 cockpit-motd.service | ||
+ | -rw-r--r--. 1 root root 835 Aug 24 2020 cockpit.service | ||
+ | -rw-r--r--. 1 root root 373 Aug 24 2020 cockpit.socket | ||
+ | -rw-r--r--. 1 root root 251 Aug 24 2020 cockpit-wsinstance-http-redirect.service | ||
+ | -rw-r--r--. 1 root root 233 Aug 24 2020 cockpit-wsinstance-http-redirect.socket | ||
+ | -rw-r--r--. 1 root root 221 Aug 24 2020 cockpit-wsinstance-http.service | ||
+ | -rw-r--r--. 1 root root 165 Aug 24 2020 cockpit-wsinstance-https-factory@.service | ||
+ | -rw-r--r--. 1 root root 244 Aug 24 2020 cockpit-wsinstance-https-factory.socket | ||
+ | -rw-r--r--. 1 root root 215 Aug 24 2020 cockpit-wsinstance-http.socket | ||
+ | -rw-r--r--. 1 root root 264 Aug 24 2020 cockpit-wsinstance-https@.service | ||
+ | -rw-r--r--. 1 root root 478 Aug 24 2020 cockpit-wsinstance-https@.socket | ||
+ | -rw-r--r--. 1 root root 1082 Apr 7 16:55 console-getty.service | ||
+ | -rw-r--r--. 1 root root 1263 Apr 7 16:55 container-getty@.service | ||
+ | -rw-r--r--. 1 root root 294 Apr 8 15:21 cpupower.service | ||
+ | -rw-r--r--. 1 root root 356 Nov 8 2019 crond.service | ||
+ | -rw-r--r--. 1 root root | ||
+ | -rw-r--r--. 1 root root 412 Jun 22 2018 cryptsetup.target | ||
+ | lrwxrwxrwx. 1 root root 13 Apr 7 16:55 ctrl-alt-del.target -> reboot.target | ||
+ | -rw-r--r--. 1 root root 234 Oct 4 2017 cups-browsed.service | ||
+ | -r--r--r--. 1 root root 142 Jun 15 2020 cups.path | ||
+ | -r--r--r--. 1 root root 248 Jun 15 2020 cups.service | ||
+ | -r--r--r--. 1 root root 136 Jun 15 2020 cups.socket | ||
+ | lrwxrwxrwx. 1 root root 25 Apr 7 16:55 dbus-org.freedesktop.hostname1.service -> systemd-hostnamed.service | ||
+ | lrwxrwxrwx. 1 root root 23 Apr 7 16:55 dbus-org.freedesktop.import1.service -> systemd-importd.service | ||
+ | lrwxrwxrwx. 1 root root 23 Apr 7 16:55 dbus-org.freedesktop.locale1.service -> systemd-localed.service | ||
+ | lrwxrwxrwx. 1 root root 22 Apr 7 16:55 dbus-org.freedesktop.login1.service -> systemd-logind.service | ||
+ | lrwxrwxrwx. 1 root root 24 Apr 7 16:55 dbus-org.freedesktop.machine1.service -> systemd-machined.service | ||
+ | lrwxrwxrwx. 1 root root 25 Apr 7 16:55 dbus-org.freedesktop.portable1.service -> systemd-portabled.service | ||
+ | lrwxrwxrwx. 1 root root 25 Apr 7 16:55 dbus-org.freedesktop.timedate1.service -> systemd-timedated.service | ||
+ | -rw-r--r--. 1 root root 380 Apr 7 12:08 dbus.service | ||
+ | -rw-r--r--. 1 root root 102 Apr 7 12:08 dbus.socket | ||
+ | drwxr-xr-x. | ||
+ | -rw-r--r--. 1 root root 1084 Apr 7 16:55 debug-shell.service | ||
+ | lrwxrwxrwx. 1 root root 16 Apr 7 16:55 default.target -> graphical.target | ||
+ | drwxr-xr-x. 2 root root | ||
+ | -rw-r--r--. 1 root root 750 Jun 22 2018 dev-hugepages.mount | ||
+ | -rw-r--r--. 1 root root 665 Jun 22 2018 dev-mqueue.mount | ||
+ | -r--r--r--. 1 root root 345 Aug 17 2020 dm-event.service | ||
+ | -r--r--r--. 1 root root 248 Aug 17 2020 dm-event.socket | ||
+ | -rw-r--r--. 1 root root 457 Jun 2 2020 dnf-makecache.service | ||
+ | --More-- | ||
</ | </ | ||
- | Supprimez maintenant | + | Certains fichiers de configuration sont créés à la volée dans le répertoire |
< | < | ||
- | [root@centos8 ~]# rm /mnt/lvm/10M | + | [root@centos8 ~]# ls -l /run/systemd/ |
- | rm: remove regular file '/ | + | total 0 |
</ | </ | ||
- | Constatez le résultat | + | Les fichiers |
< | < | ||
- | [root@centos8 ~]# df -Ph /mnt/lvm | + | [root@centos8 ~]# pkg-config systemd |
- | Filesystem | + | /usr/lib/systemd/user |
- | / | + | |
- | + | ||
- | [root@centos8 ~]# df -Ph / | + | |
- | Filesystem | + | |
- | / | + | |
- | + | ||
- | [root@centos8 ~]# lvs | + | |
- | LV | + | |
- | root | + | |
- | swap | + | |
- | lv0 vg0 owi-aos--- 456.00m | + | |
- | testsnap vg0 swi-aos--- | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round todo 60%> | + | |
- | **A Faire** - Restaurez le fichier 10M à partir du snapshot. | + | |
- | </ | + | |
- | + | ||
- | ====LAB #6 - Suppression des Volumes==== | + | |
- | + | ||
- | La suppression d'un volume logique se fait grace à la commande **lvremove** : | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# umount | + | |
- | [root@centos8 ~]# lvremove | + | |
- | Do you really want to remove active logical volume vg0/ | + | |
- | Logical volume " | + | |
- | [root@centos8 ~]# umount /mnt/lvm | + | |
- | [root@centos8 ~]# lvremove / | + | |
- | Do you really want to remove active logical volume vg0/lv0? [y/n]: y | + | |
- | Logical volume " | + | |
</ | </ | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | **Important** | + | **Important** |
</ | </ | ||
- | Les options de la commande | + | Prenons le cas du service |
< | < | ||
- | [root@centos8 ~]# lvremove --help | + | [root@centos8 ~]# cat / |
- | | + | [Unit] |
+ | Description=OpenSSH server daemon | ||
+ | Documentation=man: | ||
+ | After=network.target sshd-keygen.target | ||
+ | Wants=sshd-keygen.target | ||
- | lvremove VG|LV|Tag|Select ... | + | [Service] |
- | [ -A|--autobackup y|n ] | + | Type=notify |
- | [ -f|--force ] | + | EnvironmentFile=-/etc/crypto-policies/ |
- | [ -S|--select String ] | + | EnvironmentFile=-/ |
- | [ | + | ExecStart=/ |
- | [ | + | ExecReload=/ |
- | [ | + | KillMode=process |
- | [ COMMON_OPTIONS ] | + | Restart=on-failure |
+ | RestartSec=42s | ||
- | Common options for lvm: | + | [Install] |
- | [ -d|--debug | + | WantedBy=multi-user.target |
- | [ -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 | + | |
</ | </ | ||
- | Le Volume Group peut aussi être supprimé | + | Dans le fichier on peut noter la présence des lignes suivantes dans la section **[Unit]** |
- | < | + | * **Description=OpenSSH server daemon**, |
- | [root@centos8 ~]# vgremove vg0 | + | * Cette directive est utilisée pour donner une courte description des fonctionnalités de l' |
- | | + | |
- | </ | + | * Cette directive stipule les chapitres des manuels et les URLs contenant de l' |
+ | * **After=network.target sshd-keygen.target**, | ||
+ | * Cette directive indique les cibles qui devraient être atteintes et les Unités qui devraient être démarrées avant l' | ||
+ | * **Wants=sshd-keygen.target**, | ||
+ | * Cette directive stipule une dépendance douce. Autrement dit, Systemd essayera de démarrer l' | ||
- | Les options de la commande | + | Dans le fichier on peut aussi noter la présence des lignes suivantes dans la section |
- | < | + | * **Type=notify**, |
- | [root@centos8 ~]# vgremove | + | * Cette directive indique que le service informera Systemd quand son démarrage a terminé, |
- | | + | * **ExecStart=/ |
+ | * Cette directive définit l' | ||
+ | * **ExecReload=/ | ||
+ | * Cette directive indique la commande necéssaire pour redémarrer le service, | ||
+ | | ||
+ | * Cette directive indique comment les processus du service doivent être arrêtés. La valeur de **process** implique l' | ||
+ | * **Restart=on-failure**, | ||
+ | * Cette ligne indique que le service doit être re-démarré en cas d' | ||
+ | * **RestartSec=42s**, | ||
+ | * Cette directive stipule le temps d' | ||
- | vgremove VG|Tag|Select ... | + | Dernièrement on note la présence de la ligne suivante dans la section **[Install]** : |
- | [ -f|--force ] | + | |
- | [ -S|--select String ] | + | |
- | [ --noudevsync ] | + | |
- | [ --reportformat basic|json ] | + | |
- | [ COMMON_OPTIONS | + | |
- | | + | |
- | [ -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. | + | |
- | </ | + | |
- | Ainsi que le volume physique | + | Pour consulter **l' |
< | < | ||
- | [root@centos8 ~]# pvremove | + | [root@centos8 ~]# systemctl show sshd |
- | Labels on physical volume "/dev/sdb6" successfully wiped. | + | Type=notify |
- | | + | Restart=on-failure |
- | | + | NotifyAccess=main |
+ | RestartUSec=42s | ||
+ | TimeoutStartUSec=1min 30s | ||
+ | TimeoutStopUSec=1min 30s | ||
+ | RuntimeMaxUSec=infinity | ||
+ | WatchdogUSec=0 | ||
+ | WatchdogTimestamp=Thu 2021-06-03 15:09:54 EDT | ||
+ | WatchdogTimestampMonotonic=12502561 | ||
+ | PermissionsStartOnly=no | ||
+ | RootDirectoryStartOnly=no | ||
+ | RemainAfterExit=no | ||
+ | GuessMainPID=yes | ||
+ | MainPID=902 | ||
+ | ControlPID=0 | ||
+ | FileDescriptorStoreMax=0 | ||
+ | NFileDescriptorStore=0 | ||
+ | StatusErrno=0 | ||
+ | Result=success | ||
+ | UID=[not set] | ||
+ | GID=[not set] | ||
+ | NRestarts=0 | ||
+ | ExecMainStartTimestamp=Thu 2021-06-03 15:09:54 EDT | ||
+ | ExecMainStartTimestampMonotonic=12446178 | ||
+ | ExecMainExitTimestampMonotonic=0 | ||
+ | ExecMainPID=902 | ||
+ | ExecMainCode=0 | ||
+ | ExecMainStatus=0 | ||
+ | ExecStart={ path=/usr/sbin/sshd ; argv[]=/usr/sbin/sshd -D $OPTIONS $CRYPTO_POLICY ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 } | ||
+ | ExecReload={ path=/bin/kill ; argv[]=/ | ||
+ | Slice=system.slice | ||
+ | ControlGroup=/system.slice/sshd.service | ||
+ | MemoryCurrent=6270976 | ||
+ | CPUUsageNSec=[not set] | ||
+ | EffectiveCPUs= | ||
+ | EffectiveMemoryNodes= | ||
+ | TasksCurrent=1 | ||
+ | IPIngressBytes=18446744073709551615 | ||
+ | IPIngressPackets=18446744073709551615 | ||
+ | IPEgressBytes=18446744073709551615 | ||
+ | IPEgressPackets=18446744073709551615 | ||
+ | Delegate=no | ||
+ | CPUAccounting=no | ||
+ | CPUWeight=[not set] | ||
+ | StartupCPUWeight=[not set] | ||
+ | CPUShares=[not set] | ||
+ | StartupCPUShares=[not set] | ||
+ | CPUQuotaPerSecUSec=infinity | ||
+ | CPUQuotaPeriodUSec=infinity | ||
+ | AllowedCPUs= | ||
+ | AllowedMemoryNodes= | ||
+ | IOAccounting=no | ||
+ | IOWeight=[not set] | ||
+ | StartupIOWeight=[not set] | ||
+ | BlockIOAccounting=no | ||
+ | BlockIOWeight=[not set] | ||
+ | lines 1-57 | ||
</ | </ | ||
- | Les options de la commande | + | Pour consulter |
< | < | ||
- | [root@centos8 ~]# pvremove | + | [root@centos8 ~]# systemctl list-dependencies sshd.service |
- | | + | sshd.service |
- | + | ● ├─system.slice | |
- | | + | ● ├─sshd-keygen.target |
- | [ -f|--force ] | + | ● │ ├─sshd-keygen@ecdsa.service |
- | [ | + | ● │ ├─sshd-keygen@ed25519.service |
- | [ COMMON_OPTIONS ] | + | ● │ └─sshd-keygen@rsa.service |
- | + | ● └─sysinit.target | |
- | | + | ● |
- | [ -d|--debug | + | ● |
- | [ -h|--help ] | + | ● |
- | [ -q|--quiet ] | + | ● |
- | [ -v|--verbose ] | + | ● |
- | [ -y|--yes ] | + | ● |
- | [ -t|--test ] | + | ● |
- | [ | + | ● |
- | [ | + | ● |
- | [ | + | ● |
- | [ | + | ● |
- | [ | + | ● |
- | [ | + | ● |
- | [ | + | ● |
- | [ | + | ● |
- | + | ● | |
- | | + | ● |
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● | ||
+ | ● │ ├─-.mount | ||
+ | ● │ ├─boot.mount | ||
+ | ● │ └─systemd-remount-fs.service | ||
+ | ● | ||
+ | ● | ||
</ | </ | ||
- | ====LAB #7 - Volumes Logiques en Miroir==== | + | ===2.2 - Surchargement des Fichiers de Configuration par Défaut=== |
- | Re-créez maintenant votre Volume Group : | + | Les fichiers de configuration par défaut peuvent aussi être surchargés par des fichiers dans d' |
< | < | ||
- | [root@centos8 ~]# pvcreate | + | [root@centos8 ~]# pkg-config systemd --variable=systemdsystemunitpath |
- | Physical volume "/dev/sdb6" successfully created. | + | /etc/systemd/system:/etc/systemd/system:/run/systemd/system:/usr/local/lib/systemd/system:/usr/lib/systemd/system:/ |
- | Physical volume "/dev/sdb7" successfully created. | + | |
- | Physical volume "/dev/sdb9" successfully created. | + | |
- | + | ||
- | [root@centos8 ~]# vgcreate -s 8M vg0 /dev/sdb6 /dev/sdb7 /dev/sdb9 | + | |
- | Volume group " | + | |
</ | </ | ||
- | |||
- | Créez maintenant un Logical Volume en miroir grâce à l' | ||
< | < | ||
- | [root@centos8 ~]# lvcreate | + | [root@centos8 ~]# ls -l / |
- | | + | total 4 |
- | | + | drwxr-xr-x. 2 root root 31 May 8 2020 basic.target.wants |
+ | lrwxrwxrwx. | ||
+ | lrwxrwxrwx. 1 root root 44 Jun 3 14:02 dbus-org.freedesktop.Avahi.service -> / | ||
+ | lrwxrwxrwx. 1 root root 57 May 8 2020 dbus-org.freedesktop.nm-dispatcher.service -> / | ||
+ | lrwxrwxrwx. 1 root root 41 May 8 2020 dbus-org.freedesktop.timedate1.service -> / | ||
+ | lrwxrwxrwx. 1 root root 37 May 8 2020 default.target -> / | ||
+ | drwxr-xr-x. 2 root root 32 May 8 2020 getty.target.wants | ||
+ | drwxr-xr-x. 2 root root 4096 Jun 3 14:02 multi-user.target.wants | ||
+ | drwxr-xr-x. 2 root root 48 May 8 2020 network-online.target.wants | ||
+ | drwxr-xr-x. 2 root root 33 Apr 19 12:07 nfs-blkmap.service.requires | ||
+ | drwxr-xr-x. 2 root root 33 Apr 19 12:07 nfs-idmapd.service.requires | ||
+ | drwxr-xr-x. 2 root root 33 Apr 19 12:07 nfs-mountd.service.requires | ||
+ | drwxr-xr-x. 2 root root 33 Apr 19 12:07 nfs-server.service.requires | ||
+ | drwxr-xr-x. 2 root root 26 Jun 3 14:02 printer.target.wants | ||
+ | drwxr-xr-x. 2 root root 52 Apr 19 12:07 remote-fs.target.wants | ||
+ | drwxr-xr-x. 2 root root 33 Apr 19 12:07 rpc-gssd.service.requires | ||
+ | drwxr-xr-x. 2 root root 33 Apr 19 12:07 rpc-statd-notify.service.requires | ||
+ | drwxr-xr-x. 2 root root 33 Apr 19 12:07 rpc-statd.service.requires | ||
+ | drwxr-xr-x. 2 root root 260 Jun 3 14:02 sockets.target.wants | ||
+ | drwxr-xr-x. 2 root root 235 Apr 19 12:07 sysinit.target.wants | ||
+ | lrwxrwxrwx. 1 root root 39 May 8 2020 syslog.service -> / | ||
+ | lrwxrwxrwx. 1 root root 9 May 11 2019 systemd-timedated.service -> /dev/null | ||
+ | drwxr-xr-x. 2 root root 34 May 8 2020 timers.target.wants | ||
</ | </ | ||
- | Constatez maintenant la présence du miroir : | + | ====LAB |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# lvdisplay | + | |
- | | + | |
- | LV Path / | + | |
- | LV Name lv1 | + | |
- | VG Name vg0 | + | |
- | LV UUID lJQQWs-n05T-pxzi-Zq2R-UzRI-kYZf-hsNPYQ | + | |
- | LV Write Access | + | |
- | LV Creation host, time centos8.ittraining.loc, | + | |
- | LV Status | + | |
- | # open 0 | + | |
- | LV Size 104.00 MiB | + | |
- | Current LE 13 | + | |
- | Mirrored volumes | + | |
- | Segments | + | |
- | Allocation | + | |
- | Read ahead sectors | + | |
- | - currently set to | + | |
- | Block device | + | |
- | + | ||
- | --- Segments --- | + | |
- | Logical extents 0 to 12: | + | |
- | 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 | + | |
- | </ | + | |
- | Le miroir s'étend sur plusieurs volumes physiques | + | Pour avoir une évaluation du temps de démarrage, il convient d'utiliser la commande suivante |
< | < | ||
- | [root@centos8 ~]# pvdisplay | + | [root@centos8 ~]# systemd-analyze |
- | --- Physical volume --- | + | Startup finished in 1.665s (kernel) + 6.977s (initrd) + 8.458s (userspace) = 17.101s |
- | PV Name / | + | multi-user.target reached after 5.528s in userspace |
- | VG Name vg0 | + | |
- | PV Size 200.00 MiB / not usable 8.00 MiB | + | |
- | Allocatable | + | |
- | PE Size 8.00 MiB | + | |
- | Total PE 24 | + | |
- | Free PE 10 | + | |
- | Allocated PE 14 | + | |
- | PV UUID | + | |
- | + | ||
- | --- Physical Segments --- | + | |
- | Physical extent 0 to 0: | + | |
- | Logical volume / | + | |
- | Logical extents 0 to 0 | + | |
- | Physical extent 1 to 13: | + | |
- | Logical volume / | + | |
- | Logical extents 0 to 12 | + | |
- | Physical extent 14 to 23: | + | |
- | FREE | + | |
- | + | ||
- | --- Physical volume --- | + | |
- | PV Name / | + | |
- | VG Name vg0 | + | |
- | PV Size | + | |
- | | + | |
- | 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 | + | |
- | Physical extent 1 to 13: | + | |
- | Logical volume / | + | |
- | Logical extents 0 to 12 | + | |
- | Physical extent 14 to 36: | + | |
- | FREE | + | |
- | + | ||
- | --- Physical volume --- | + | |
- | PV Name / | + | |
- | VG Name vg0 | + | |
- | PV Size 400.00 MiB / not usable 8.00 MiB | + | |
- | Allocatable | + | |
- | PE Size 8.00 MiB | + | |
- | Total PE 49 | + | |
- | Free PE 49 | + | |
- | Allocated PE 0 | + | |
- | PV UUID | + | |
- | + | ||
- | --- Physical Segments --- | + | |
- | Physical extent 0 to 48: | + | |
- | FREE | + | |
</ | </ | ||
- | La suppression du miroir se fait en utilisant la commande | + | L' |
< | < | ||
- | [root@centos8 ~]# lvconvert | + | [root@centos8 ~]# systemd-analyze blame |
- | Are you sure you want to convert raid1 LV vg0/lv1 to type linear losing all resilience? [y/n]: y | + | 4.080s dracut-initqueue.service |
- | | + | 3.257s kdump.service |
+ | 1.727s tuned.service | ||
+ | 1.415s initrd-switch-root.service | ||
+ | 1.393s NetworkManager-wait-online.service | ||
+ | 1.116s systemd-machined.service | ||
+ | 1.111s dracut-cmdline.service | ||
+ | 850ms sssd.service | ||
+ | 791ms vdo.service | ||
+ | 713ms firewalld.service | ||
+ | 622ms lvm2-monitor.service | ||
+ | 605ms polkit.service | ||
+ | 508ms chronyd.service | ||
+ | 434ms avahi-daemon.service | ||
+ | 426ms systemd-logind.service | ||
+ | 417ms netcf-transaction.service | ||
+ | 410ms dracut-pre-udev.service | ||
+ | 295ms libvirtd.service | ||
+ | 275ms dnf-makecache.service | ||
+ | 243ms systemd-udevd.service | ||
+ | 221ms systemd-journald.service | ||
+ | 196ms systemd-tmpfiles-setup.service | ||
+ | 151ms dracut-pre-pivot.service | ||
+ | 139ms sysroot.mount | ||
+ | 139ms systemd-update-utmp-runlevel.service | ||
+ | 122ms systemd-vconsole-setup.service | ||
+ | 110ms lvm2-pvscan@8: | ||
+ | 98ms systemd-udev-trigger.service | ||
+ | 82ms gssproxy.service | ||
+ | 81ms cups.service | ||
+ | 79ms initrd-parse-etc.service | ||
+ | 77ms NetworkManager.service | ||
+ | 72ms lvm2-pvscan@8: | ||
+ | 69ms systemd-user-sessions.service | ||
+ | 68ms lvm2-pvscan@8: | ||
+ | 67ms unbound-anchor.service | ||
+ | 66ms rsyslog.service | ||
+ | 62ms boot.mount | ||
+ | 56ms sshd.service | ||
+ | 54ms smartd.service | ||
+ | 54ms systemd-fsck@dev-disk-by\x2duuid-2ae4c035\x2d9244\x2d458c\x2d82c5\x2da49ae169cdb6.service | ||
+ | 53ms user@1000.service | ||
+ | 52ms auditd.service | ||
+ | 51ms plymouth-quit.service | ||
+ | 49ms rngd-wake-threshold.service | ||
+ | 46ms import-state.service | ||
+ | 46ms systemd-tmpfiles-setup-dev.service | ||
+ | 43ms ksmtuned.service | ||
+ | 42ms plymouth-quit-wait.service | ||
+ | 42ms var-lib-nfs-rpc_pipefs.mount | ||
+ | 42ms rpc-statd-notify.service | ||
+ | 38ms plymouth-switch-root.service | ||
+ | 37ms systemd-remount-fs.service | ||
+ | 37ms plymouth-start.service | ||
+ | 33ms dev-disk-by\x2duuid-c8bb3f47\x2dd67f\x2d4b21\x2db781\x2d766899dc83d4.swap | ||
+ | 33ms systemd-tmpfiles-clean.service | ||
+ | 31ms dev-hugepages.mount | ||
+ | lines 1-57 | ||
</ | </ | ||
- | De même, il est possible | + | L' |
< | < | ||
- | [root@centos8 ~]# lvconvert | + | [root@centos8 ~]# systemd-analyze critical-chain sshd.service |
- | Are you sure you want to convert linear LV vg0/lv1 to raid1 with 2 images enhancing resilience? [y/n]: y | + | The time after the unit is active or started is printed after the " |
- | Logical volume vg0/lv1 successfully converted. | + | The time the unit takes to start is printed after the " |
- | </ | + | |
- | Supprimez de nouveau votre miroir : | + | sshd.service +56ms |
- | + | └─network.target @3.799s | |
- | < | + | |
- | [root@centos8 ~]# lvconvert | + | |
- | Are you sure you want to convert raid1 LV vg0/lv1 to type linear losing all resilience? [y/n]: y | + | └─firewalld.service @3.004s +713ms |
- | | + | └─polkit.service @2.397s +605ms |
+ | └─basic.target @2.392s | ||
+ | └─sockets.target @2.392s | ||
+ | └─sssd-kcm.socket @2.391s | ||
+ | └─sysinit.target @2.379s | ||
+ | └─systemd-update-utmp.service @2.370s +8ms | ||
+ | └─auditd.service @2.317s +52ms | ||
+ | └─systemd-tmpfiles-setup.service @2.118s +196ms | ||
+ | └─import-state.service @2.070s +46ms | ||
+ | └─local-fs.target @2.069s | ||
+ | └─boot.mount @2.006s +62ms | ||
+ | └─systemd-fsck@dev-disk-by\x2duuid-2ae4c035\x2d9244\x2d458c\x2d82c5\x2da49ae169cdb6.service @1.943s +54ms | ||
+ | | ||
+ | | ||
+ | └─dm-event.socket @1.317s | ||
+ | └─-.mount | ||
+ | └─system.slice | ||
+ | └─-.slice | ||
</ | </ | ||
- | Les options de la commande **lvconvert** sont : | + | Les options de la commande **systemd-analyze** sont : |
< | < | ||
- | [root@centos8 | + | [root@centos7 |
- | | + | systemd-analyze [OPTIONS...] {COMMAND} ... |
- | Convert LV to linear. | + | Process systemd profiling information |
- | lvconvert --type linear LV | + | |
- | [ COMMON_OPTIONS ] | + | |
- | [ PV ... ] | + | |
- | | + | |
- | | + | |
- | [ -I|--stripesize Size[k|UNIT] ] | + | |
- | [ -R|--regionsize Size[m|UNIT] ] | + | --user |
- | [ -i|--interval Number ] | + | |
- | [ | + | --require |
- | [ COMMON_OPTIONS ] | + | |
- | [ PV ... ] | + | When generating a dependency graph, filter only origins |
+ | or destinations, | ||
+ | | ||
+ | | ||
+ | | ||
+ | unless specified with a different unit, i.e. 50ms | ||
+ | | ||
- | Convert LV to type mirror (also see type raid1), | + | Commands: |
- | | + | |
- | [ -m|--mirrors [+|-]Number ] | + | |
- | [ -I|--stripesize Size[k|UNIT] ] | + | |
- | [ -R|--regionsize Size[m|UNIT] ] | + | |
- | [ -i|--interval Number ] | + | |
- | [ --stripes Number ] | + | |
- | [ --mirrorlog core|disk ] | + | |
- | [ COMMON_OPTIONS ] | + | |
- | [ PV ... ] | + | |
- | + | ||
- | | + | |
- | (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 ... ] | + | |
- | + | ||
- | Convert LV to raid1 or mirror, or change number | + | |
- | lvconvert -m|--mirrors [+|-]Number LV | + | |
- | [ -R|--regionsize Size[m|UNIT] ] | + | |
- | [ -i|--interval Number ] | + | |
- | [ --mirrorlog core|disk ] | + | |
- | [ COMMON_OPTIONS ] | + | |
- | [ PV ... ] | + | |
- | + | ||
- | Convert raid LV to change number of stripe images. | + | |
- | | + | |
- | [ -i|--interval Number ] | + | |
- | [ -R|--regionsize Size[m|UNIT] ] | + | |
- | [ -I|--stripesize Size[k|UNIT] ] | + | |
- | [ COMMON_OPTIONS ] | + | |
- | [ PV ... ] | + | |
- | + | ||
- | 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 ] | + | |
- | + | ||
- | 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 ... ] | + | |
- | + | ||
- | Split images from a raid1 LV and track changes to origin for later merge. | + | |
- | lvconvert --splitmirrors Number --trackchanges LV_cache_raid1 | + | |
- | [ COMMON_OPTIONS ] | + | |
- | [ PV ... ] | + | |
- | + | ||
- | Merge LV images that were split from a raid1 LV. | + | |
- | lvconvert --mergemirrors VG|LV_linear_raid|Tag ... | + | |
- | [ COMMON_OPTIONS ] | + | |
- | + | ||
- | Convert LV to a thin LV, using the original LV as an external origin. | + | |
- | | + | |
- | [ -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 ] | + | |
- | + | ||
- | Attach a cache pool to an LV, converts the LV to type cache. | + | |
- | lvconvert --type cache --cachepool LV LV_linear_striped_thinpool_vdo_vdopool_vdopooldata_raid | + | |
- | [ -H|--cache ] | + | |
- | [ -Z|--zero y|n ] | + | |
- | [ -r|--readahead auto|none|Number ] | + | |
- | [ -c|--chunksize Size[k|UNIT] ] | + | |
- | [ --cachemetadataformat auto|1|2 ] | + | |
- | [ --cachemode writethrough|writeback|passthrough ] | + | |
- | [ --cachepolicy String ] | + | |
- | [ --cachesettings String ] | + | |
- | [ --poolmetadata LV ] | + | |
- | [ --poolmetadatasize Size[m|UNIT] ] | + | |
- | [ --poolmetadataspare y|n ] | + | |
- | [ --metadataprofile String ] | + | |
- | [ COMMON_OPTIONS ] | + | |
- | + | ||
- | Attach a writecache to an LV, converts the LV to type writecache. | + | |
- | lvconvert --type writecache --cachevol LV LV_linear_striped_raid | + | |
- | [ --cachesettings String ] | + | |
- | [ COMMON_OPTIONS ] | + | |
- | + | ||
- | 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 ] | + | |
- | + | ||
- | 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 ] | + | |
- | + | ||
- | 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 ] | + | |
- | + | ||
- | 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. | + | |
- | lvconvert --type cache-pool LV_linear_striped_raid | + | |
- | [ -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 ] | + | |
- | [ PV ... ] | + | |
- | + | ||
- | Convert LV to type vdopool. | + | |
- | lvconvert --type vdo-pool LV_linear_striped_cache_raid | + | |
- | [ -n|--name LV_new ] | + | |
- | [ -V|--virtualsize Size[m|UNIT] ] | + | |
- | [ --compression y|n ] | + | |
- | [ --deduplication y|n ] | + | |
- | [ COMMON_OPTIONS ] | + | |
- | + | ||
- | Detach a cache from an LV. | + | |
- | lvconvert --splitcache LV_thinpool_cache_cachepool_vdopool_writecache | + | |
- | [ COMMON_OPTIONS ] | + | |
- | + | ||
- | Merge thin LV into its origin LV. | + | |
- | lvconvert --mergethin LV_thin ... | + | |
- | [ COMMON_OPTIONS ] | + | |
- | + | ||
- | Merge COW snapshot LV into its origin. | + | |
- | lvconvert --mergesnapshot LV_snapshot ... | + | |
- | [ -i|--interval Number ] | + | |
- | [ COMMON_OPTIONS ] | + | |
- | + | ||
- | Combine a former COW snapshot (second arg) with a former | + | |
- | origin LV (first arg) to reverse a splitsnapshot command. | + | |
- | lvconvert --type snapshot LV LV_linear_striped | + | |
- | [ -s|--snapshot ] | + | |
- | [ -c|--chunksize Size[k|UNIT] ] | + | |
- | [ -Z|--zero y|n ] | + | |
- | [ COMMON_OPTIONS ] | + | |
- | + | ||
- | | + | |
- | Repair a thin pool. | + | |
- | Repair a cache pool. | + | |
- | lvconvert --repair LV_thinpool_cache_cachepool_mirror_raid | + | |
- | [ -i|--interval Number ] | + | |
- | [ --usepolicies ] | + | |
- | [ --poolmetadataspare y|n ] | + | |
- | [ COMMON_OPTIONS ] | + | |
- | [ PV ... ] | + | |
- | + | ||
- | Replace specific PV(s) in a raid LV with another PV. | + | |
- | | + | |
- | [ COMMON_OPTIONS ] | + | |
- | [ PV ... ] | + | |
- | + | ||
- | Poll LV to continue conversion. | + | |
- | lvconvert --startpoll LV_mirror_raid | + | |
- | [ COMMON_OPTIONS ] | + | |
- | + | ||
- | Add or remove data integrity checksums to raid images. | + | |
- | lvconvert --raidintegrity y|n LV_raid | + | |
- | [ --raidintegritymode String ] | + | |
- | [ --raidintegrityblocksize Number ] | + | |
- | [ COMMON_OPTIONS ] | + | |
- | [ PV ... ] | + | |
- | + | ||
- | Common options | + | |
- | [ -b|--background ] | + | |
- | [ -f|--force ] | + | |
- | [ --alloc contiguous|cling|cling_by_tags|normal|anywhere|inherit ] | + | |
- | [ --noudevsync ] | + | |
- | + | ||
- | | + | |
- | [ -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. | + | |
</ | </ | ||
- | ====LAB #8 - Modifier les Attributs LVM==== | + | ====LAB #4 - Les Cibles Systemd==== |
- | En cas de présence d'un miroir, la commande **lvs** indique la présence du miroir dans la colonne **Attr** avec la lettre **m** : | + | Chaque Cible est décrite par un fichier de configuration |
< | < | ||
- | [root@centos8 ~]# lvs | + | [root@centos8 ~]# cat / |
- | | + | # SPDX-License-Identifier: LGPL-2.1+ |
- | root cl_centos8 | + | # |
- | | + | # This file is part of systemd. |
- | | + | # |
- | </ | + | # systemd is free software; you can redistribute it and/or modify it |
+ | # under the terms of the GNU Lesser General Public License as published by | ||
+ | # the Free Software Foundation; either version 2.1 of the License, or | ||
+ | # (at your option) any later version. | ||
- | <WRAP center round important 60%> | + | [Unit] |
- | Consultez **[[http:// | + | Description=Graphical Interface |
- | </ | + | Documentation=man:systemd.special(7) |
- | + | Requires=multi-user.target | |
- | La commande equivalente pour les Volume Groups est **vgs** | + | Wants=display-manager.service |
- | + | Conflicts=rescue.service rescue.target | |
- | < | + | After=multi-user.target rescue.service rescue.target display-manager.service |
- | [root@centos8 ~]# vgs | + | AllowIsolate=yes |
- | | + | |
- | cl_centos8 | + | |
- | | + | |
</ | </ | ||
- | <WRAP center round important 60%> | + | Dans ce fichier on peut noter la présence des lignes suivantes |
- | Consultez **[[http:// | + | |
- | </ | + | |
- | La commande equivalente pour les Physical Volumes est **pvs** : | + | * **Requires=multi-user.target**, |
+ | * Cette ligne indique que le **graphical.target** ne peut pas être atteint si le **multi-user.target** n'a pas été atteint au préalable, | ||
+ | * **After=multi-user.target rescue.service rescue.target display-manager.service**, | ||
+ | * Cette ligne indique le **multi-user.target** et **rescue.target** doivent d' | ||
+ | * **Conflicts=rescue.service rescue.target**, | ||
+ | * Cette ligne indique la Cible et le service en conflits avec le **graphical.target**, | ||
+ | * **Wants=display-manager.service**, | ||
+ | | ||
- | < | + | ===4.1 - Contrôler les dépendances d'une Cible=== |
- | [root@centos8 ~]# pvs | + | |
- | PV | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | </ | + | |
- | <WRAP center round important 60%> | + | Les dépendances |
- | Consultez **[[http:// | + | |
- | </ | + | |
- | + | ||
- | Les commandes **lvchange**, | + | |
- | + | ||
- | Par exemple, pour rendre inutilisable un Logical Volume, il convient | + | |
< | < | ||
- | [root@centos8 ~]# lvchange | + | [root@centos8 ~]# systemctl list-dependencies multi-user.target |
+ | multi-user.target | ||
+ | ● ├─atd.service | ||
+ | ● ├─auditd.service | ||
+ | ● ├─avahi-daemon.service | ||
+ | ● ├─chronyd.service | ||
+ | ● ├─crond.service | ||
+ | ● ├─cups.path | ||
+ | ● ├─cups.service | ||
+ | ● ├─dbus.service | ||
+ | ● ├─dnf-makecache.timer | ||
+ | ● ├─firewalld.service | ||
+ | ● ├─irqbalance.service | ||
+ | ● ├─kdump.service | ||
+ | ● ├─ksm.service | ||
+ | ● ├─ksmtuned.service | ||
+ | ● ├─libstoragemgmt.service | ||
+ | ● ├─libvirtd.service | ||
+ | ● ├─mcelog.service | ||
+ | ● ├─mdmonitor.service | ||
+ | ● ├─netcf-transaction.service | ||
+ | ● ├─NetworkManager.service | ||
+ | ● ├─plymouth-quit-wait.service | ||
+ | ● ├─plymouth-quit.service | ||
+ | ● ├─rpcbind.service | ||
+ | ● ├─rsyslog.service | ||
+ | ● ├─smartd.service | ||
+ | ● ├─sshd.service | ||
+ | ● ├─sssd.service | ||
+ | ● ├─systemd-ask-password-wall.path | ||
+ | ● ├─systemd-logind.service | ||
+ | ● ├─systemd-update-utmp-runlevel.service | ||
+ | ● ├─systemd-user-sessions.service | ||
+ | ● ├─tuned.service | ||
+ | ● ├─vdo.service | ||
+ | ● ├─basic.target | ||
+ | ● │ ├─-.mount | ||
+ | ● │ ├─microcode.service | ||
+ | ● │ ├─paths.target | ||
+ | ● │ ├─slices.target | ||
+ | ● │ │ ├─-.slice | ||
+ | ● │ │ └─system.slice | ||
+ | ● │ ├─sockets.target | ||
+ | ● │ │ ├─avahi-daemon.socket | ||
+ | ● │ │ ├─cups.socket | ||
+ | ● │ │ ├─dbus.socket | ||
+ | ● │ │ ├─dm-event.socket | ||
+ | ● │ │ ├─iscsid.socket | ||
+ | ● │ │ ├─iscsiuio.socket | ||
+ | ● │ │ ├─libvirtd-ro.socket | ||
+ | ● │ │ ├─libvirtd.socket | ||
+ | ● │ │ ├─rpcbind.socket | ||
+ | ● │ │ ├─sssd-kcm.socket | ||
+ | ● │ │ ├─systemd-coredump.socket | ||
+ | ● │ │ ├─systemd-initctl.socket | ||
+ | ● │ │ ├─systemd-journald-dev-log.socket | ||
+ | ● │ │ ├─systemd-journald.socket | ||
+ | ● │ │ ├─systemd-udevd-control.socket | ||
+ | lines 1-57 | ||
</ | </ | ||
- | Pour faire l' | + | Les points noirs au début |
- | < | + | * **Vert** implique que le service, la cible ou l' |
- | [root@centos8 ~]# lvchange -a y / | + | * **Blanc** implique le service, la cible ou l' |
- | </ | + | * **Rouge** implique que le service, la cible ou l' |
- | Les options de la commande **lvchange** sont : | + | Pour visualiser les Unités en état d' |
< | < | ||
- | [root@centos8 ~]# lvchange | + | [root@centos8 ~]# systemctl |
- | | + | 0 loaded units listed. |
- | + | To show all installed unit files use ' | |
- | Change a general LV attribute. | + | |
- | For options | + | |
- | 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 ] | + | |
- | + | ||
- | Resyncronize a mirror or raid LV. | + | |
- | Use to reset 'R' attribute on a not initially synchronized LV. | + | |
- | lvchange --resync VG|LV_mirror_raid|Tag|Select ... | + | |
- | [ -a|--activate y|n|ay ] | + | |
- | [ COMMON_OPTIONS ] | + | |
- | + | ||
- | Resynchronize or check a raid LV. | + | |
- | lvchange --syncaction check|repair VG|LV_raid|Tag|Select ... | + | |
- | [ COMMON_OPTIONS ] | + | |
- | + | ||
- | 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. | + | |
</ | </ | ||
- | ====LAB #9 - Volumes Logiques en Bandes==== | + | Les dépendances sont créés sous la forme de liens symboliques |
- | + | ||
- | 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. | + | |
- | + | ||
- | Saisissez donc la commande suivante | + | |
< | < | ||
- | [root@centos8 ~]# lvcreate | + | [root@centos8 ~]# ls -l /etc/systemd/system/multi-user.target.wants |
- | | + | total 0 |
- | | + | lrwxrwxrwx. 1 root root 35 May 8 2020 atd.service -> / |
- | | + | lrwxrwxrwx. 1 root root 38 May 8 2020 auditd.service -> / |
- | </code> | + | lrwxrwxrwx. 1 root root 44 Jun 3 14:02 avahi-daemon.service -> / |
- | + | lrwxrwxrwx. 1 root root 39 May 8 2020 chronyd.service -> / | |
- | Constatez la présence de vos bandes sur /dev/sda7 et sur /dev/sda9 : | + | lrwxrwxrwx. 1 root root 37 May 8 2020 crond.service -> /usr/lib/systemd/system/ |
- | + | lrwxrwxrwx. 1 root root 33 Jun 3 14:02 cups.path -> / | |
- | <code> | + | lrwxrwxrwx. 1 root root 36 Jun 3 14:02 cups.service |
- | [root@centos8 ~]# lvdisplay | + | lrwxrwxrwx. 1 root root 43 May 8 2020 dnf-makecache.timer |
- | --- Logical volume --- | + | lrwxrwxrwx. 1 root root 41 May 8 2020 firewalld.service -> /usr/lib/systemd/ |
- | | + | lrwxrwxrwx. 1 root root 42 May 8 2020 irqbalance.service |
- | | + | lrwxrwxrwx. 1 root root 37 May 8 2020 kdump.service -> /usr/ |
- | VG Name vg0 | + | lrwxrwxrwx. 1 root root 35 Apr 19 12:07 ksm.service |
- | LV UUID MmXbPt-ZF8u-rnIv-3YU9-m64J-RCz2-6NzAuG | + | lrwxrwxrwx. 1 root root 40 Apr 19 12:07 ksmtuned.service |
- | | + | lrwxrwxrwx. 1 root root 46 May 8 2020 libstoragemgmt.service -> / |
- | LV Creation host, time centos8.ittraining.loc, 2021-06-02 07:47:38 -0400 | + | lrwxrwxrwx. |
- | | + | lrwxrwxrwx. 1 root root 38 May 8 2020 mcelog.service -> / |
- | # open 0 | + | lrwxrwxrwx. 1 root root 41 May 8 2020 mdmonitor.service |
- | LV Size 112.00 MiB | + | lrwxrwxrwx. |
- | | + | lrwxrwxrwx. 1 root root 46 May 8 2020 NetworkManager.service |
- | Segments | + | lrwxrwxrwx. 1 root root 41 Apr 19 12:07 nfs-client.target |
- | | + | lrwxrwxrwx. 1 root root 40 May 8 2020 remote-fs.target |
- | Read ahead sectors | + | lrwxrwxrwx. 1 root root 39 Apr 19 12:07 rpcbind.service -> / |
- | - currently set to 8192 | + | lrwxrwxrwx. 1 root root 39 May 8 2020 rsyslog.service -> / |
- | Block device | + | lrwxrwxrwx. 1 root root 38 May 8 2020 smartd.service -> / |
- | + | lrwxrwxrwx. 1 root root 36 May 8 2020 sshd.service -> /usr/lib/ | |
- | | + | lrwxrwxrwx. |
- | | + | lrwxrwxrwx. 1 root root 37 May 8 2020 tuned.service -> /usr/lib/ |
- | | + | lrwxrwxrwx. 1 root root 35 May 8 2020 vdo.service -> / |
- | Stripes 2 | + | |
- | | + | |
- | | + | |
- | Physical volume /dev/sdb7 | + | |
- | | + | |
- | Stripe | + | |
- | | + | |
- | | + | |
+ | [root@centos8 ~]# ls -l / | ||
+ | total 0 | ||
+ | lrwxrwxrwx. 1 root root 15 Apr 7 12:08 dbus.service -> ../ | ||
+ | lrwxrwxrwx. 1 root root 15 Apr 7 16:55 getty.target -> ../ | ||
+ | lrwxrwxrwx. 1 root root 24 Oct 6 2020 plymouth-quit.service -> ../ | ||
+ | lrwxrwxrwx. 1 root root 29 Oct 6 2020 plymouth-quit-wait.service -> ../ | ||
+ | lrwxrwxrwx. 1 root root 33 Apr 7 16:55 systemd-ask-password-wall.path -> ../ | ||
+ | lrwxrwxrwx. 1 root root 25 Apr 7 16:55 systemd-logind.service -> ../ | ||
+ | lrwxrwxrwx. 1 root root 39 Apr 7 16:55 systemd-update-utmp-runlevel.service -> ../ | ||
+ | lrwxrwxrwx. 1 root root 32 Apr 7 16:55 systemd-user-sessions.service -> ../ | ||
</ | </ | ||
- | Utilisez maintenant la commande **lvs** pour visualiser les volumes physiques utilisés | + | ===4.2 - La Cible par Défaut=== |
- | < | + | ==Consulter la Cible par Défaut== |
- | [root@centos8 ~]# lvs -o +devices | + | |
- | LV | + | |
- | root cl_centos8 -wi-ao---- | + | |
- | swap cl_centos8 -wi-ao---- | + | |
- | lv1 vg0 -wi-a----- 104.00m | + | |
- | lv2 vg0 -wi-a----- 112.00m | + | |
- | </ | + | |
- | ====LAB #10 - Gérer les Métadonnées==== | + | Pour consulter la cible par défaut, il convient d' |
- | + | ||
- | Les métadonnées pour chaque Volume Group sont stockés dans un fichier texte au nom du Volume Group dans le répertoire | + | |
< | < | ||
- | [root@centos8 ~]# cat / | + | [root@centos8 ~]# systemctl get-default |
- | # Generated by LVM2 version 2.03.09(2)-RHEL8 (2020-05-28): | + | multi-user.target |
- | + | ||
- | contents = "Text Format Volume Group" | + | |
- | version = 1 | + | |
- | + | ||
- | description = " | + | |
- | + | ||
- | creation_host = " | + | |
- | creation_time = 1622634458 # | + | |
- | + | ||
- | vg0 { | + | |
- | id = " | + | |
- | seqno = 11 | + | |
- | format = " | + | |
- | status = [" | + | |
- | flags = [] | + | |
- | extent_size = 16384 # 8 Megabytes | + | |
- | max_lv = 0 | + | |
- | max_pv = 0 | + | |
- | metadata_copies = 0 | + | |
- | + | ||
- | physical_volumes { | + | |
- | + | ||
- | pv0 { | + | |
- | id = " | + | |
- | device = "/ | + | |
- | + | ||
- | status = [" | + | |
- | flags = [] | + | |
- | dev_size = 409600 # 200 Megabytes | + | |
- | pe_start = 2048 | + | |
- | pe_count = 24 # 192 Megabytes | + | |
- | } | + | |
- | + | ||
- | pv1 { | + | |
- | id = " | + | |
- | device = "/ | + | |
- | + | ||
- | status = [" | + | |
- | flags = [] | + | |
- | dev_size = 614400 # 300 Megabytes | + | |
- | pe_start = 2048 | + | |
- | pe_count = 37 # 296 Megabytes | + | |
- | } | + | |
- | + | ||
- | pv2 { | + | |
- | id = " | + | |
- | device = "/ | + | |
- | + | ||
- | status = [" | + | |
- | flags = [] | + | |
- | dev_size = 819200 # 400 Megabytes | + | |
- | pe_start = 2048 | + | |
- | pe_count = 49 # 392 Megabytes | + | |
- | } | + | |
- | } | + | |
- | + | ||
- | logical_volumes { | + | |
- | + | ||
- | lv1 { | + | |
- | id = " | + | |
- | status = [" | + | |
- | flags = [] | + | |
- | creation_time = 1622633848 # | + | |
- | creation_host = " | + | |
- | segment_count = 1 | + | |
- | + | ||
- | segment1 { | + | |
- | start_extent = 0 | + | |
- | extent_count = 13 # 104 Megabytes | + | |
- | + | ||
- | type = " | + | |
- | stripe_count = 1 # linear | + | |
- | + | ||
- | stripes = [ | + | |
- | " | + | |
- | ] | + | |
- | } | + | |
- | } | + | |
- | + | ||
- | lv2 { | + | |
- | id = " | + | |
- | status = [" | + | |
- | flags = [] | + | |
- | creation_time = 1622634458 # | + | |
- | creation_host = " | + | |
- | segment_count = 1 | + | |
- | + | ||
- | segment1 { | + | |
- | start_extent = 0 | + | |
- | extent_count = 14 # 112 Megabytes | + | |
- | + | ||
- | type = " | + | |
- | stripe_count = 2 | + | |
- | stripe_size = 128 # 64 Kilobytes | + | |
- | + | ||
- | stripes = [ | + | |
- | " | + | |
- | " | + | |
- | ] | + | |
- | } | + | |
- | } | + | |
- | } | + | |
- | + | ||
- | } | + | |
</ | </ | ||
- | Des archives sont créées lors de chaque modification d'un groupe de volumes et elles sont placés dans le répertoire | + | La Cible par défaut est représentée par le lien symbolique |
< | < | ||
- | [root@centos8 ~]# ls /etc/lvm/archive/ | + | [root@centos8 ~]# ls -l /etc/systemd/system/default.target |
- | vg0_00000-427117660.vg | + | lrwxrwxrwx. 1 root root 37 May 8 2020 / |
- | vg0_00001-1993147316.vg vg0_00003-1757437978.vg | + | |
</ | </ | ||
- | La commande **vgcfgbackup** est utilisée pour sauvegarder les métadonnées manuellement dans le fichier **/ | + | ==Modifier la Cible par Défaut== |
- | La commande | + | Pour modifier la Cible par défaut avec une prise en compte lors du **prochain** démarrage, il convient d'utiliser la commande |
< | < | ||
- | [root@centos8 ~]# vgcfgbackup vg0 | + | [root@centos8 ~]# systemctl set-default graphical.target |
- | | + | Removed / |
+ | Created symlink / | ||
+ | [root@centos8 ~]# ls -l / | ||
+ | lrwxrwxrwx. 1 root root 40 Jun 6 08:11 / | ||
+ | [root@centos8 ~]# systemctl set-default multi-user.target | ||
+ | Removed / | ||
+ | Created symlink / | ||
+ | [root@centos8 ~]# ls -l / | ||
+ | lrwxrwxrwx. 1 root root 41 Jun 6 08:11 / | ||
</ | </ | ||
- | Il est aussi possible de modifier l' | + | ==Modifier |
- | < | + | Il est possible |
- | [root@centos8 ~]# vgcfgbackup -f / | + | |
- | Volume group " | + | |
- | </ | + | |
- | + | ||
- | Par contre, toute sauvegarde en dehors des répertoires par défaut n'est pas visible dans la sortie | + | |
< | < | ||
- | [root@centos8 ~]# vgcfgrestore --list vg0 | + | [root@centos8 ~]# systemctl isolate rescue |
- | + | [root@centos8 ~]# systemctl | |
- | File: | + | rescue.target |
- | VG name: vg0 | + | [root@centos8 ~]# runlevel |
- | Description: | + | 3 1 |
- | Backup Time: Wed May 26 10:43:14 2021 | + | [root@centos8 ~]# who -r |
- | + | run-level 1 2021-06-15 04:22 | |
- | + | ||
- | File: | + | |
- | VG name: vg0 | + | |
- | Description: | + | |
- | | + | |
- | + | ||
- | + | ||
- | File: | + | |
- | VG name: vg0 | + | |
- | | + | |
- | | + | |
- | + | ||
- | + | ||
- | File: | + | |
- | VG name: vg0 | + | |
- | Description: | + | |
- | Backup Time: Wed May 26 22:19:25 2021 | + | |
- | + | ||
- | + | ||
- | File: | + | |
- | VG name: vg0 | + | |
- | Description: | + | |
- | Backup Time: Wed May 26 22:38:37 2021 | + | |
- | + | ||
- | + | ||
- | File: | + | |
- | VG name: vg0 | + | |
- | Description: | + | |
- | Backup Time: Wed May 26 22:42:18 2021 | + | |
- | + | ||
- | + | ||
- | File: | + | |
- | VG name: vg0 | + | |
- | Description: | + | |
- | Backup Time: Wed May 26 22:43:49 2021 | + | |
- | + | ||
- | + | ||
- | File: | + | |
- | VG name: vg0 | + | |
- | Description: | + | |
- | Backup Time: Wed Jun 2 07:37:07 2021 | + | |
- | + | ||
- | + | ||
- | File: | + | |
- | VG name: vg0 | + | |
- | Description: | + | |
- | Backup Time: Wed Jun 2 07: | + | |
- | + | ||
- | + | ||
- | File: | + | |
- | VG name: vg0 | + | |
- | Description: | + | |
- | Backup Time: Wed Jun 2 07:41:04 2021 | + | |
- | + | ||
- | + | ||
- | File: / | + | |
- | VG name: vg0 | + | |
- | Description: | + | |
- | Backup Time: Wed Jun 2 07:41:53 2021 | + | |
- | + | ||
- | + | ||
- | File: | + | |
- | VG name: vg0 | + | |
- | Description: | + | |
- | Backup Time: Wed Jun 2 07:42:23 2021 | + | |
- | + | ||
- | + | ||
- | File: | + | |
- | VG name: vg0 | + | |
- | Description: | + | |
- | Backup Time: Wed Jun 2 07:47:38 2021 | + | |
- | + | ||
- | + | ||
- | File: | + | |
- | VG name: vg0 | + | |
- | Description: | + | |
- | Backup Time: Wed Jun 2 07:50:57 2021 | + | |
</ | </ | ||
- | |||
- | =====Systèmes de Fichiers Journalisés===== | ||
- | |||
- | ====Présentation==== | ||
- | |||
- | Un journal est la partie d'un système de fichiers journalisé qui trace les opérations d' | ||
- | |||
- | L' | ||
- | |||
- | Sans un tel fichier journal, un outil de récupération de données après un arrêt brutal doit parcourir l' | ||
- | |||
- | 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:// | ||
- | </ | ||
- | |||
- | ====Ext3==== | ||
- | |||
- | Ext3 est une évolution de Ext2 et a pour principale différence d' | ||
- | |||
- | * être utilisé à partir d'une partition Ext2, sans avoir à sauvegarder et à restaurer des données, | ||
- | * utiliser tous les utilitaires de maintenance pour les systèmes de fichiers ext2, comme fsck, | ||
- | * utiliser le logiciel dump, ce qui n'est pas le cas avec %%ReiserFS%%. | ||
- | |||
- | Pour plus d' | ||
- | |||
- | ===Gestion d' | ||
- | |||
- | Notez maintenant le numéro de la dernière partition que vous avez précédemment créée : | ||
< | < | ||
- | [root@centos8 ~]# fdisk -l | + | [root@centos8 ~]# systemctl isolate multi-user |
- | Disk /dev/sdb: 4 GiB, 4294967296 bytes, 8388608 sectors | + | [root@centos8 ~]# systemctl list-units --type target | egrep " |
- | Units: sectors of 1 * 512 = 512 bytes | + | multi-user.target |
- | Sector size (logical/ | + | [root@centos8 ~]# runlevel |
- | I/O size (minimum/ | + | 1 3 |
- | Disklabel type: dos | + | [root@centos8 ~]# who -r |
- | Disk identifier: 0xb0dacb39 | + | run-level 3 2021-06-15 04:24 last=1 |
- | + | ||
- | Device | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | + | ||
- | + | ||
- | 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/ | + | |
</ | </ | ||
- | Créez un filesystem Ext3 sur /dev/sdb12 en utilisant la commande **mke2fs | + | ====LAB #5 - Gestion des Services==== |
- | < | + | ===5.1 - Gestion des Instances Uniques=== |
- | [root@centos8 ~]# mke2fs -j / | + | |
- | 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 | + | |
- | + | ||
- | Allocating group tables: done | + | |
- | Writing inode tables: done | + | |
- | Creating journal (4096 blocks): done | + | |
- | Writing superblocks and filesystem accounting information: | + | |
- | </ | + | |
- | Les options de la commande | + | Commencez par installer le paquet |
< | < | ||
- | [root@centos8 ~]# mke2fs --help | + | [root@centos8 ~]# dnf install httpd |
- | 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[, | + | |
- | [-t fs-type] [-T usage-type ] [-U UUID] [-e errors_behavior][-z undo_file] | + | |
- | [-jnqvDFSV] device [blocks-count] | + | |
</ | </ | ||
- | <WRAP center round important 60%> | + | Pour obtenir le détail sur un service donné, il convient d'utiliser |
- | **Important** : Lors de la mise en place d'un filesystem ext2/ | + | |
- | </ | + | |
- | + | ||
- | ===LAB #11 - Convertir un Système de Fichiers Ext3 en Ext2=== | + | |
- | + | ||
- | Pour vérifier si un système de fichiers Ext2 est journalisé, | + | |
< | < | ||
- | [root@centos8 ~]# dumpe2fs -h /dev/sdb12 | + | [root@centos8 ~]# systemctl status httpd.service |
- | dumpe2fs 1.45.6 (20-Mar-2020) | + | ● httpd.service |
- | Filesystem volume name: | + | Loaded: loaded |
- | Last mounted on: <not available> | + | Active: inactive |
- | Filesystem UUID: a2515f45-a32a-4e87-b7e6-170448f3f803 | + | Docs: man: |
- | Filesystem magic number: | + | |
- | Filesystem revision #: | + | |
- | 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:55:24 2021 | + | |
- | Mount count: | + | |
- | Maximum mount count: | + | |
- | Last checked: | + | |
- | Check interval: | + | |
- | Reserved blocks uid: | + | |
- | Reserved blocks gid: | + | |
- | First inode: | + | |
- | Inode size: | + | |
- | 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: | + | |
</ | </ | ||
- | <WRAP center round important 60%> | + | Dans le cas du service httpd ci-dessus, on peut constater que le statut est **disabled**. Le statut peut être une de 2 valeurs |
- | **Important** : Le drapeau **Filesystem features: | + | |
- | </ | + | |
- | Les options de cette commande sont : | + | * **disabled** - le service ne démarrera pas lors du prochain démarrage du système. |
+ | * **enabled** - le service démarrera lors du prochain démarrage du système. | ||
- | < | + | Il est possible de vérifier le statut en utilisant |
- | [root@centos8 ~]# dumpe2fs --help | + | |
- | dumpe2fs 1.45.6 (20-Mar-2020) | + | |
- | dumpe2fs: invalid option -- ' | + | |
- | Usage: dumpe2fs [-bfghimxV] [-o superblock=< | + | |
- | </ | + | |
- | + | ||
- | Pour supprimer | + | |
< | < | ||
- | [root@centos8 ~]# tune2fs | + | [root@centos8 ~]# systemctl is-enabled httpd.service |
- | tune2fs 1.45.6 (20-Mar-2020) | + | disabled |
</ | </ | ||
- | Les options de cette commande | + | Pour rendre le statut **enabled**, |
< | < | ||
- | [root@centos8 ~]# tune2fs --help | + | [root@centos8 ~]# systemctl enable httpd.service |
- | tune2fs 1.45.6 (20-Mar-2020) | + | Created symlink / |
- | 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[, | + | |
- | [-I new_inode_size] [-z undo_file] device | + | |
- | </ | + | |
- | Constatez le résultat de cette commande : | + | [root@centos8 ~]# systemctl is-enabled httpd.service |
+ | enabled | ||
- | < | + | [root@centos8 ~]# systemctl status httpd.service |
- | [root@centos8 ~]# dumpe2fs -h /dev/sdb12 | + | ● httpd.service |
- | dumpe2fs 1.45.6 (20-Mar-2020) | + | Loaded: loaded |
- | Filesystem volume name: | + | Active: inactive |
- | Last mounted on: < | + | Docs: man: |
- | 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: | + | |
- | Reserved blocks gid: | + | |
- | First inode: | + | |
- | Inode size: | + | |
- | Default directory hash: | + | |
- | Directory Hash Seed: faee0b81-0538-4c06-8d86-468bc0c760ac | + | |
- | Journal backup: | + | |
</ | </ | ||
- | <WRAP center round important 60%> | + | Dans le cas du service httpd ci-dessus, on peut maintenant constater |
- | **Important** : Notez que le drapeau | + | |
- | </ | + | |
- | Supprimez maintenant l' | + | * **inactive (dead)** - le service est arrêté. |
- | + | * **active(running** | |
- | < | + | * **active(exited)** - le service a terminé une configuration unique. |
- | [root@centos8 ~]# fsck / | + | * **active(waiting)** |
- | fsck from util-linux 2.32.1 | + | * **activating** |
- | e2fsck 1.45.6 (20-Mar-2020) | + | * **deactivating** - le service est en cours de désactivation. |
- | /dev/sdb12: clean, 11/51200 files, 8013/204800 blocks | + | * **failed** - le service a rencontré une erreur fatale. |
- | </ | + | |
- | Créez maintenant un point de montage pour / | + | Il est possible |
< | < | ||
- | [root@centos8 ~]# mkdir /mnt/sdb12 | + | [root@centos8 ~]# systemctl is-active httpd.service |
+ | inactive | ||
</ | </ | ||
- | Essayez de monter /dev/sdb12 en tant que système de fichiers Ext3. Vous obtiendrez un résultat similaire à celui-ci | + | Pour rendre l' |
< | < | ||
- | [root@centos8 ~]# mount -t ext3 /dev/sdb12 / | + | [root@centos8 ~]# systemctl start httpd.service |
- | mount: /mnt/sdb12: wrong fs type, bad option, bad superblock on /dev/sdb12, missing codepage or helper program, or other error. | + | |
</ | </ | ||
- | <WRAP center round important 60%> | + | Vérifiez ensuite |
- | **Important** : Notez l'erreur due au mauvais système de fichiers qui suit l' | + | |
- | </ | + | |
- | + | ||
- | Montez maintenant le système de fichiers en tant que Ext2 : | + | |
< | < | ||
- | [root@centos8 ~]# mount -t ext2 /dev/sdb12 /mnt/sdb12 | + | [root@centos8 ~]# systemctl is-active httpd.service |
- | </ | + | active |
- | ===LAB | + | [root@centos8 ~]# systemctl status httpd.service |
+ | ● httpd.service | ||
+ | | ||
+ | | ||
+ | Docs: man: | ||
+ | Main PID: 34382 (httpd) | ||
+ | | ||
+ | Tasks: 213 (limit: 23719) | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
- | Pour replacer le journal sur /dev/sdb12, il convient d' | + | Jun 06 15:33:05 centos8.ittraining.loc systemd[1]: Starting The Apache HTTP Server... |
- | + | Jun 06 15: | |
- | < | + | Jun 06 15:33:06 centos8.ittraining.loc httpd[34382]: |
- | [root@centos8 | + | |
- | + | ||
- | [root@centos8 | + | |
- | tune2fs 1.45.6 (20-Mar-2020) | + | |
- | Creating journal inode: done | + | |
</ | </ | ||
- | <WRAP center round important 60%> | + | Pour arrêter une Unité de service, utilisez |
- | **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. | + | |
- | + | ||
- | Créez un système de fichiers sur / | + | |
< | < | ||
- | [root@centos8 ~]# mke2fs | + | [root@centos8 ~]# systemctl stop httpd.service |
- | mke2fs 1.45.6 (20-Mar-2020) | + | [root@centos8 ~]# systemctl status httpd.service |
- | Creating filesystem with 512000 1k blocks and 0 inodes | + | ● httpd.service |
- | Filesystem UUID: 23327281-e88a-4da0-bafa-50ee10c52937 | + | |
- | Superblock backups stored | + | |
+ | Docs: man: | ||
+ | | ||
+ | Main PID: 34382 (code=exited, | ||
+ | Status: " | ||
- | Zeroing journal device: | + | Jun 06 15:33:05 centos8.ittraining.loc systemd[1]: Starting The Apache HTTP Server... |
+ | Jun 06 15:33:06 centos8.ittraining.loc systemd[1]: Started The Apache HTTP Server. | ||
+ | Jun 06 15:33:06 centos8.ittraining.loc httpd[34382]: | ||
+ | Jun 06 23:58:02 centos8.ittraining.loc systemd[1]: Stopping The Apache HTTP Server... | ||
+ | Jun 06 23:58:04 centos8.ittraining.loc systemd[1]: httpd.service: | ||
+ | Jun 06 23:58:04 centos8.ittraining.loc systemd[1]: Stopped The Apache HTTP Server. | ||
</ | </ | ||
- | <WRAP center round important 60%> | + | Pour désactiver un service au prochain démarrage du système, utilisez |
- | **Important** : Notez l' | + | |
- | </ | + | |
- | + | ||
- | Créez maintenant un système de fichiers Ext3 sur /dev/sdb12 en plaçant le journal sur / | + | |
< | < | ||
- | [root@centos8 ~]# mke2fs -j -J device=/dev/sdb11 /dev/sdb12 | + | [root@centos8 ~]# systemctl disable httpd.service |
- | mke2fs 1.45.6 (20-Mar-2020) | + | Removed |
- | Using journal device' | + | [root@centos8 ~]# systemctl status httpd.service |
- | /dev/sdb12 contains a ext3 file system | + | ● httpd.service |
- | last mounted on Wed Jun 2 08:03:11 2021 | + | Loaded: loaded (/usr/ |
- | Proceed anyway? | + | Active: inactive |
- | Creating filesystem with 204800 1k blocks and 51200 inodes | + | Docs: man:httpd.service(8) |
- | Filesystem UUID: 0e783411-6407-4cba-8db5-0e2729000c9e | + | |
- | Superblock backups stored on blocks: | + | |
- | 8193, 24577, 40961, 57345, 73729 | + | |
- | Allocating group tables: done | + | Jun 06 15:33:05 centos8.ittraining.loc systemd[1]: Starting The Apache HTTP Server... |
- | Writing inode tables: done | + | Jun 06 15:33:06 centos8.ittraining.loc systemd[1]: Started The Apache HTTP Server. |
- | Adding journal to device /dev/sdb11: done | + | Jun 06 15:33:06 centos8.ittraining.loc httpd[34382]: |
- | Writing superblocks and filesystem accounting information: done | + | Jun 06 23:58:02 centos8.ittraining.loc systemd[1]: Stopping The Apache HTTP Server... |
+ | Jun 06 23:58:04 centos8.ittraining.loc systemd[1]: httpd.service: | ||
+ | Jun 06 23:58:04 centos8.ittraining.loc systemd[1]: Stopped The Apache HTTP Server. | ||
</ | </ | ||
- | <WRAP center round important 60%> | + | ===5.2 - Gestion d'Instances Multiples=== |
- | **Important** : Notez que le journal a été placé sur /dev/sdb11 graĉe à l'utilisation de l' | + | |
- | </ | + | |
- | ===LAB #14 - Modifier la Fréquence | + | Systemd permet l' |
- | + | ||
- | Pour modifier la fréquence de vérification | + | |
< | < | ||
- | [root@centos8 ~]# tune2fs -i 100d /dev/sdb12 | + | [root@centos8 ~]# cat /usr/lib/ |
- | tune2fs 1.45.6 (20-Mar-2020) | + | # This is a template for httpd instances. |
- | Setting interval between checks to 8640000 seconds | + | # See httpd@.service(8) for more information. |
- | </ | + | |
- | Dernièrement, | + | [Unit] |
+ | Description=The Apache HTTP Server | ||
+ | After=network.target remote-fs.target nss-lookup.target | ||
+ | Documentation=man:httpd@.service(8) | ||
- | < | + | [Service] |
- | [root@centos8 ~]# dumpe2fs | + | Type=notify |
- | dumpe2fs 1.45.6 (20-Mar-2020) | + | Environment=LANG=C |
- | Filesystem UUID: 0e783411-6407-4cba-8db5-0e2729000c9e | + | Environment=HTTPD_INSTANCE=%i |
- | Journal UUID: | + | ExecStartPre=/bin/mkdir -m 710 -p / |
- | </code> | + | ExecStartPre=/ |
+ | ExecStart=/ | ||
+ | ExecReload=/ | ||
+ | # Send SIGWINCH for graceful stop | ||
+ | KillSignal=SIGWINCH | ||
+ | KillMode=mixed | ||
+ | PrivateTmp=true | ||
- | ====Ext4==== | + | [Install] |
- | + | WantedBy=multi-user.target | |
- | 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**. | + | |
- | + | ||
- | Ext4 n'est pas une évolution de Ext3. Cependant il a une compatibilité ascendante avec Ext3. | + | |
- | + | ||
- | Les fonctionnalités majeures d'Ext4 sont : | + | |
- | + | ||
- | * la gestion des volumes d'une taille allant jusqu' | + | |
- | * l' | + | |
- | + | ||
- | L' | + | |
- | + | ||
- | La compatibilité ascendante avec ext3 comprend : | + | |
- | + | ||
- | * la possibilité de monter une partition Ext3 en tant que partition Ext4, | + | |
- | * 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' | + | |
- | + | ||
- | Pour plus d' | + | |
- | + | ||
- | ===LAB #15 - Créer un Système de Fichiers Ext4=== | + | |
- | + | ||
- | Créez un système de fichiers Ext4 sur **/ | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# mkfs.ext4 / | + | |
- | mke2fs 1.45.6 (20-Mar-2020) | + | |
- | /dev/sdb11 contains a jbd file system | + | |
- | Proceed anyway? (y,N) y | + | |
- | 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 | + | |
- | + | ||
- | Allocating group tables: done | + | |
- | Writing inode tables: done | + | |
- | Creating journal (8192 blocks): done | + | |
- | Writing superblocks and filesystem accounting information: | + | |
</ | </ | ||
- | Les options | + | Une instance créée à partir |
< | < | ||
- | [root@centos8 ~]# mkfs.ext4 --help | + | httpd@< |
- | 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[, | + | |
- | [-t fs-type] [-T usage-type ] [-U UUID] [-e errors_behavior][-z undo_file] | + | |
- | [-jnqvDFSV] device [blocks-count] | + | |
</ | </ | ||
- | Consultez maintenant | + | Dans ce fichier on peut constater l' |
- | < | + | * %n : est remplacé par le nom complet échappé de l' |
- | [root@centos8 ~]# dumpe2fs /dev/sdb11 | more | + | * %N : est remplacé par le nom complet non-échappé de l' |
- | dumpe2fs 1.45.6 (20-Mar-2020) | + | * %p : est remplacé par le préfixe échappé de l' |
- | Filesystem volume name: < | + | * %P : est remplacé par le préfixe non-échappé de l' |
- | Last mounted on: < | + | |
- | Filesystem UUID: | + | * %I : est remplacé par le nom de l' |
- | Filesystem magic number: | + | * %f : est remplacé par le préfixe non-échappé ou le nom de l' |
- | Filesystem revision #: 1 (dynamic) | + | * %c : est remplacé par le CGroup de l' |
- | Filesystem features: | + | * %u : est remplacé par le nom de l' |
- | xtent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize meta | + | * %U : est remplacé par l'UID de l' |
- | data_csum | + | * %H : est remplacé par le nom d' |
- | Filesystem flags: signed_directory_hash | + | * %% : est remplacé" |
- | 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: 64 | + | |
- | Reserved GDT blocks: | + | |
- | --More-- | + | |
- | </ | + | |
- | ===LAB #16 - Ajouter une Etiquette au Système de Fichiers Ext4=== | + | Créez maintenant deux copies du fichier |
- | + | ||
- | Utilisez la commande | + | |
< | < | ||
- | [root@centos8 ~]# e2label | + | [root@centos8 ~]# cp /usr/lib/ |
- | [root@centos8 ~]# dumpe2fs | + | [root@centos8 ~]# cp /usr/lib/ |
- | dumpe2fs 1.45.6 (20-Mar-2020) | + | |
- | Filesystem volume name: | + | |
- | Last mounted on: <not available> | + | |
- | Filesystem UUID: 72a6ad08-7023-4561-adcb-d434e00afed1 | + | |
- | 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: | + | |
- | Errors behavior: | + | |
- | Filesystem OS type: | + | |
- | Inode count: | + | |
- | Block count: | + | |
- | Reserved block count: | + | |
- | Free blocks: | + | |
- | Free inodes: | + | |
- | First block: | + | |
- | Block size: | + | |
- | Fragment size: 1024 | + | |
- | Group descriptor size: 64 | + | |
- | Reserved GDT blocks: | + | |
- | --More-- | + | |
</ | </ | ||
- | <WRAP center round important 60%> | + | Créez |
- | **Important** - Notez que l' | + | |
- | </ | + | |
- | + | ||
- | Créez | + | |
< | < | ||
- | [root@centos8 ~]# mkdir /mnt/sdb11 | + | [root@centos8 ~]# cp /etc/httpd/ |
- | + | [root@centos8 ~]# cp /etc/httpd/conf/httpd.conf | |
- | [root@centos8 ~]# mount -t ext3 /dev/sdb11 /mnt/sdb11 | + | |
- | mount: | + | |
</ | </ | ||
- | <WRAP center round important 60%> | + | Editez la directive |
- | **Important** - Notez l' | + | |
- | </WRAP> | + | |
- | + | ||
- | Montez de nouveau | + | |
< | < | ||
- | [root@centos8 ~]# mount /dev/sdb11 /mnt/sdb11 | + | [root@centos8 ~]# vi /etc/httpd/conf/instance01.conf |
+ | [root@centos8 ~]# more / | ||
+ | # | ||
+ | # This is the main Apache HTTP server configuration file. It contains the | ||
+ | # configuration directives that give the server its instructions. | ||
+ | # See < | ||
+ | # In particular, see | ||
+ | # < | ||
+ | # for a discussion of each configuration directive. | ||
+ | # | ||
+ | # See the httpd.conf(5) man page for more information on this configuration, | ||
+ | # and httpd.service(8) on using and configuring the httpd service. | ||
+ | # | ||
+ | # Do NOT simply read the instructions in here without understanding | ||
+ | # what they do. They' | ||
+ | # consult the online docs. You have been warned. | ||
+ | # | ||
+ | # Configuration and logfile names: If the filenames you specify for many | ||
+ | # of the server' | ||
+ | # server will use that explicit path. If the filenames do *not* begin | ||
+ | # with "/", | ||
+ | # with ServerRoot set to '/ | ||
+ | # server as '/ | ||
+ | # interpreted as '/ | ||
- | [root@centos8 ~]# mount | grep sdb11 | + | # |
- | / | + | # ServerRoot: The top of the directory tree under which the server' |
- | </code> | + | # configuration, |
+ | # | ||
+ | # Do not add a slash at the end of the directory path. If you point | ||
+ | # ServerRoot at a non-local disk, be sure to specify a local disk on the | ||
+ | # Mutex directive, if file-based mutexes are used. If you wish to share the | ||
+ | # same ServerRoot for multiple httpd daemons, you will need to change at | ||
+ | # least PidFile. | ||
+ | # | ||
+ | ServerRoot "/etc/httpd" | ||
- | <WRAP center round important 60%> | + | # |
- | **Important** - Constatez que la partition a été monté en tant qu' | + | # Listen: Allows you to bind Apache to specific IP addresses and/or |
- | </WRAP> | + | # ports, instead of the default. See also the <VirtualHost> |
+ | # directive. | ||
+ | # | ||
+ | # Change this to Listen on specific IP addresses as shown below to | ||
+ | # prevent Apache from glomming onto all bound IP addresses. | ||
+ | # | ||
+ | #Listen 12.34.56.78: | ||
+ | Listen 8008 | ||
+ | PidFile | ||
- | ===LAB | + | # |
+ | # Dynamic Shared Object (DSO) Support | ||
+ | # | ||
+ | # To be able to use the functionality of a module which was built as a DSO you | ||
+ | # have to place corresponding `LoadModule' | ||
+ | # directives contained in it are actually available _before_ they are used. | ||
+ | # Statically compiled modules (those listed by `httpd -l') do not need | ||
+ | # to be loaded here. | ||
+ | # | ||
+ | # Example: | ||
+ | # LoadModule foo_module modules/ | ||
+ | --More--(19%) | ||
+ | </ | ||
- | Créez un système de fichiers ext3 sur /dev/sdb12 : | + | Editez la directive **Listen** du fichier **/etc/httpd/ |
< | < | ||
- | [root@centos8 ~]# mkfs.ext3 /dev/sdb12 | + | [root@centos8 ~]# vi / |
- | mke2fs 1.45.6 (20-Mar-2020) | + | [root@centos8 ~]# more /etc/httpd/ |
- | /dev/sdb12 contains a ext3 file system | + | # |
- | created on Wed Jun | + | # This is the main Apache HTTP server configuration file. It contains the |
- | Proceed anyway? | + | # configuration directives that give the server its instructions. |
- | Creating filesystem with 204800 1k blocks | + | # See < |
- | Filesystem UUID: b73322d4-f2e4-43bc-96ae-422d4584f3de | + | # In particular, see |
- | Superblock backups stored on blocks: | + | # <URL:http:// |
- | 8193, 24577, 40961, 57345, 73729 | + | # for a discussion of each configuration directive. |
+ | # | ||
+ | # See the httpd.conf(5) man page for more information on this configuration, | ||
+ | # and httpd.service(8) on using and configuring the httpd service. | ||
+ | # | ||
+ | # Do NOT simply read the instructions in here without understanding | ||
+ | # what they do. They' | ||
+ | # consult the online docs. You have been warned. | ||
+ | # | ||
+ | # Configuration | ||
+ | # of the server' | ||
+ | # server will use that explicit path. If the filenames do *not* begin | ||
+ | # with "/", | ||
+ | # with ServerRoot set to '/ | ||
+ | # server as '/ | ||
+ | # interpreted as '/ | ||
- | Allocating group tables: done | + | # |
- | Writing inode tables: done | + | # ServerRoot: The top of the directory tree under which the server' |
- | Creating journal (4096 blocks): done | + | # configuration, |
- | Writing superblocks | + | # |
- | </code> | + | # Do not add a slash at the end of the directory path. If you point |
+ | # ServerRoot at a non-local disk, be sure to specify a local disk on the | ||
+ | # Mutex directive, if file-based mutexes are used. If you wish to share the | ||
+ | # same ServerRoot for multiple httpd daemons, you will need to change at | ||
+ | # least PidFile. | ||
+ | # | ||
+ | ServerRoot "/etc/httpd" | ||
- | Montez maintenant **/ | + | # |
- | + | # Listen: Allows you to bind Apache to specific IP addresses and/or | |
- | <code> | + | # ports, instead of the default. See also the <VirtualHost> |
- | [root@centos8 ~]# mount /dev/sdb12 /mnt/sdb12 | + | # directive. |
- | + | # | |
- | [root@centos8 ~]# ls -l /mnt/sdb12 | + | # Change this to Listen on specific IP addresses as shown below to |
- | total 12 | + | # prevent Apache from glomming onto all bound IP addresses. |
- | drwx------. 2 root root 12288 Jun 2 08:42 lost+found | + | # |
+ | #Listen 12.34.56.78: | ||
+ | Listen 8009 | ||
+ | PidFile | ||
+ | # | ||
+ | # Dynamic Shared Object (DSO) Support | ||
+ | # | ||
+ | # To be able to use the functionality of a module which was built as a DSO you | ||
+ | # have to place corresponding `LoadModule' | ||
+ | # directives contained in it are actually available _before_ they are used. | ||
+ | # Statically compiled modules (those listed by `httpd | ||
+ | # to be loaded here. | ||
+ | # | ||
+ | # Example: | ||
+ | # LoadModule foo_module modules/ | ||
+ | --More--(19%) | ||
</ | </ | ||
- | Créez le fichier **/ | + | Démarrez les deux services |
< | < | ||
- | [root@centos8 ~]# touch /mnt/sdb12/check_file | + | [root@centos8 ~]# systemctl start httpd@instance01.service |
- | </code> | + | [root@centos8 ~]# systemctl status httpd@instance01.service |
+ | ● httpd@instance01.service - The Apache HTTP Server | ||
+ | | ||
+ | Active: active (running) since Mon 2021-06-07 01:40:43 EDT; 7s ago | ||
+ | Docs: man: | ||
+ | Process: 43854 ExecStartPre=/bin/chown root.apache / | ||
+ | Process: 43852 ExecStartPre=/ | ||
+ | Main PID: 43856 (httpd) | ||
+ | | ||
+ | Tasks: 213 (limit: 23719) | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
- | Injectez la chaine **check file** dans le fichier / | + | Jun 07 01:40:43 centos8.ittraining.loc systemd[1]: Starting The Apache HTTP Server... |
- | + | Jun 07 01:40:43 centos8.ittraining.loc systemd[1]: Started The Apache HTTP Server. | |
- | < | + | Jun 07 01:40:43 centos8.ittraining.loc httpd[43856]: |
- | [root@centos8 ~]# echo "check file" | + | [root@centos8 ~]# systemctl start httpd@instance02.service |
+ | [root@centos8 ~]# systemctl status httpd@instance02.service | ||
+ | ● httpd@instance02.service - The Apache HTTP Server | ||
+ | | ||
+ | | ||
+ | Docs: man: | ||
+ | Process: 43568 ExecStartPre=/ | ||
+ | Process: 43566 ExecStartPre=/ | ||
+ | Main PID: 43569 (httpd) | ||
+ | | ||
+ | Tasks: 213 (limit: 23719) | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
- | [root@centos8 | + | Jun 07 01:36:45 centos8.ittraining.loc systemd[1]: Starting The Apache HTTP Server... |
+ | Jun 07 01: | ||
+ | Jun 07 01:36:45 centos8.ittraining.loc httpd[43569]: Server configured, listening on: port 8009 | ||
</ | </ | ||
- | Exécutez e2fsck sur /dev/sda12 : | + | ===5.3 - Interdire la Modification du Statut d'un Service=== |
- | < | + | Il est possible d' |
- | [root@centos8 ~]# e2fsck / | + | |
- | e2fsck 1.45.6 (20-Mar-2020) | + | |
- | /dev/sdb12: clean, 12/51200 files, 12128/ | + | |
- | </ | + | |
- | + | ||
- | Convertissez / | + | |
< | < | ||
- | [root@centos8 ~]# tune2fs | + | [root@centos8 ~]# systemctl status httpd.service |
- | tune2fs 1.45.6 (20-Mar-2020) | + | ● httpd.service |
- | </ | + | |
+ | | ||
+ | Docs: man: | ||
- | Optimisez le système de fichiers | + | Jun 07 18:27:25 centos8.ittraining.loc httpd[58535]: |
+ | Jun 07 18:27:29 centos8.ittraining.loc systemd[1]: Stopping The Apache HTTP Server... | ||
+ | Jun 07 18:27:30 centos8.ittraining.loc systemd[1]: httpd.service: | ||
+ | Jun 07 18:27:30 centos8.ittraining.loc systemd[1]: Stopped The Apache HTTP Server. | ||
+ | Jun 07 18:27:32 centos8.ittraining.loc systemd[1]: Starting The Apache HTTP Server... | ||
+ | Jun 07 18:27:32 centos8.ittraining.loc systemd[1]: Started The Apache HTTP Server. | ||
+ | Jun 07 18:27:32 centos8.ittraining.loc httpd[58760]: | ||
+ | Jun 07 18:27:34 centos8.ittraining.loc systemd[1]: Stopping The Apache HTTP Server... | ||
+ | Jun 07 18:27:36 centos8.ittraining.loc systemd[1]: httpd.service: | ||
+ | Jun 07 18:27:36 centos8.ittraining.loc systemd[1]: Stopped The Apache HTTP Server. | ||
- | < | + | [root@centos8 ~]# systemctl mask httpd.service |
- | [root@centos8 ~]# e2fsck -fDC0 / | + | Created symlink |
- | e2fsck 1.45.6 (20-Mar-2020) | + | |
- | Pass 1: Checking inodes, blocks, and sizes | + | |
- | Pass 2: Checking directory structure | + | |
- | Pass 3: Checking directory connectivity | + | |
- | Pass 3A: Optimizing directories | + | |
- | Pass 4: Checking reference counts | + | |
- | Pass 5: Checking group summary information | + | |
- | | + | |
- | /dev/sdb12: ***** FILE SYSTEM WAS MODIFIED ***** | + | |
- | /dev/sdb12: 12/51200 files (0.0% non-contiguous), | + | |
- | </code> | + | |
- | Essayez de monter **/dev/sdb12** en tant qu' | + | [root@centos8 ~]# systemctl enable httpd.service |
+ | Failed to enable unit: Unit file /etc/systemd/ | ||
- | < | + | [root@centos8 ~]# systemctl start httpd.service |
- | [root@centos8 ~]# mount -t ext3 /dev/sdb12 /mnt/sdb12 | + | Failed to start httpd.service: Unit httpd.service is masked. |
- | mount: /mnt/sdb12: wrong fs type, bad option, bad superblock on /dev/sdb12, missing codepage or helper program, or other error. | + | |
</ | </ | ||
- | Montez /dev/sdb12 sans spécifier le type de fichiers Ext3 et vérifiez le contenu du fichier | + | Pour autoriser |
< | < | ||
- | [root@centos8 ~]# mount /dev/sdb12 /mnt/sdb12 | + | [root@centos8 ~]# systemctl unmask httpd.service |
+ | Removed | ||
- | [root@centos8 ~]# ls -l /mnt/sdb12 | + | [root@centos8 ~]# systemctl enable httpd.service |
- | total 14 | + | Created symlink |
- | -rw-r--r--. 1 root root 11 Jun 2 08:45 check_file | + | |
- | drwx------. 2 root root 12288 Jun 2 08:42 lost+found | + | |
- | [root@centos8 ~]# cat / | + | [root@centos8 ~]# systemctl start httpd.service |
- | check file | + | |
- | </ | + | |
- | Dernièrement, pour obtenir seul l'UUID du système de fichiers, utilisez les commandes **dumpe2fs** et **grep** | + | [root@centos8 ~]# systemctl status httpd.service |
+ | ● httpd.service - The Apache HTTP Server | ||
+ | | ||
+ | | ||
+ | Docs: man: | ||
+ | Main PID: 59101 (httpd) | ||
+ | | ||
+ | Tasks: 213 (limit: 23719) | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
- | < | + | Jun 07 18: |
- | [root@centos8 | + | Jun 07 18:30:59 centos8.ittraining.loc systemd[1]: Started The Apache HTTP Server. |
- | dumpe2fs | + | Jun 07 18:31:00 centos8.ittraining.loc httpd[59101]: |
- | Filesystem UUID: | + | |
- | + | ||
- | [root@centos8 | + | |
- | dumpe2fs 1.45.6 (20-Mar-2020) | + | |
- | Filesystem UUID: | + | |
</ | </ | ||
- | ====XFS==== | + | =====Arrêt |
- | + | ||
- | XFS est un système de fichiers 64-bit journalisé de haute performance crée par SGI pour son système d' | + | |
- | + | ||
- | <WRAP center round important 60%> | + | |
- | **Important** : Le système de fichiers XFS permet l' | + | |
- | </ | + | |
- | + | ||
- | Pour plus d' | + | |
- | + | ||
- | ===LAB #18 - Créer un Système de Fichiers XFS=== | + | |
- | Démontez | + | Sous RHEL / CentOS 8 les commandes **halt**, **poweroff**, |
< | < | ||
- | [root@centos8 ~]# umount | + | [root@centos8 ~]# ls -l /usr/sbin/ |
+ | lrwxrwxrwx. 1 root root 16 Apr 7 16:55 / | ||
+ | lrwxrwxrwx. 1 root root 16 Apr 7 16:55 / | ||
+ | lrwxrwxrwx. 1 root root 16 Apr 7 16:55 / | ||
+ | lrwxrwxrwx. 1 root root 16 Apr 7 16:55 / | ||
</ | </ | ||
- | Créez un système de fichiers XFS sur la partition **/ | + | La manière recommendée d' |
- | < | + | |
- | [root@centos8 ~]# mkfs.xfs -f / | + | * systemctl poweroff |
- | meta-data=/ | + | * systemctl reboot |
- | | + | * systemctl shutdown |
- | = | + | |
- | = | + | |
- | data | + | |
- | | + | |
- | naming | + | |
- | log =internal log | + | |
- | | + | |
- | realtime =none | + | |
- | </ | + | |
- | <WRAP center round important 60%> | + | Il est cependant toujours possibles d' |
- | **Important** - Notez l' | + | |
- | </ | + | |
- | Les options de cette commande sont : | + | ====La Commande shutdown==== |
- | < | + | Lors de l'arrêt de la machine, Linux procède, entre autre, aux tâches suivantes : |
- | [root@centos8 ~]# mkfs.xfs --help | + | |
- | mkfs.xfs: invalid option -- '-' | + | |
- | unknown option -- | + | |
- | Usage: mkfs.xfs | + | |
- | /* blocksize */ [-b size=num] | + | |
- | /* metadata */ [-m crc=0|1,finobt=0|1,uuid=xxx,rmapbt=0|1, | + | |
- | /* 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 file */ [-p fname] | + | |
- | /* quiet */ [-q] | + | |
- | /* realtime subvol */ [-r extsize=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). | + | |
- | < | + | |
- | </ | + | |
- | Consultez maintenant | + | * Il previent |
+ | * Il arrête tous les services, | ||
+ | * Il inscrit toutes les données sur disque, | ||
+ | * Il démonte les systèmes | ||
- | < | + | La commande utilisée pour arrêter le système est la commande **shutdown** : |
- | [root@centos8 ~]# xfs_info / | + | |
- | meta-data=/ | + | |
- | | + | |
- | | + | |
- | | + | |
- | data | + | |
- | | + | |
- | naming | + | |
- | log =internal log | + | |
- | | + | |
- | realtime =none | + | |
- | </ | + | |
- | Les options de cette commande sont : | + | shutdown [-t sec] [-HPrhkc] heure [message] |
- | < | + | ===Options |
- | [root@centos8 ~]# xfs_info --help | + | |
- | / | + | |
- | Usage: xfs_info [-V] [-t mtab] [mountpoint|device|file] | + | |
- | </ | + | |
- | + | ||
- | ===LAB #19 - Ajouter une Etiquette au Système | + | |
- | + | ||
- | Utilisez | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# xfs_admin -L my_xfs / | + | |
- | xfs_admin: /dev/sdb12 contains a mounted filesystem | + | |
- | + | ||
- | fatal error -- couldn' | + | |
- | + | ||
- | [root@centos8 ~]# umount / | + | |
- | + | ||
- | [root@centos8 ~]# xfs_admin -L my_xfs / | + | |
- | writing all SBs | + | |
- | new label = " | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round important 60%> | + | |
- | **Important** - Notez que la partition XFS doit être démonté pour pouvoir utiliser la commande **xfs_admin**. | + | |
- | </ | + | |
- | + | ||
- | Pour voir l' | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# xfs_admin -l / | + | |
- | label = " | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round important 60%> | + | |
- | **Important** - Notez que l' | + | |
- | </ | + | |
Les options de cette commande sont : | Les options de cette commande sont : | ||
< | < | ||
- | [root@centos8 ~]# xfs_admin | + | [root@centos8 ~]# shutdown |
- | / | + | shutdown |
- | Usage: xfs_admin | + | |
- | </ | + | |
- | Dernièrement, | + | Shut down the system. |
- | < | + | |
- | [root@centos8 ~]# xfs_admin | + | -H --halt |
- | UUID = 15db1b62-0866-4aa4-9ac1-3ac325a4e20f | + | -P --poweroff |
+ | -r --reboot | ||
+ | -h | ||
+ | -k | ||
+ | | ||
+ | | ||
</ | </ | ||
- | <WRAP center round important 60%> | + | L' |
- | **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. | + | |
- | </ | + | |
- | =====Autres Systèmes | + | ^ Valeur ^ Description ^ |
+ | | hh:mm | L' | ||
+ | | +m | Nombre | ||
+ | | now | L' | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | **Important** | + | **Important** |
</ | </ | ||
- | ====ReiserFS==== | + | L'option |
- | + | ||
- | %%ReiserFS%% permet : | + | |
- | + | ||
- | * de meilleurs temps d'accès à des sous-répertoires que Ext3, même ceux contenant des dizaines de milliers de fichiers, | + | |
- | | + | |
- | + | ||
- | Pour plus d' | + | |
- | + | ||
- | ====JFS==== | + | |
- | + | ||
- | JFS //Journaled File System// | + | |
- | + | ||
- | Pour plus d' | + | |
- | + | ||
- | ====Btrfs==== | + | |
- | + | ||
- | **[[https:// | + | |
- | + | ||
- | A noter sont les points suivants : | + | |
- | + | ||
- | * 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. | + | |
- | + | ||
- | =====Comparaison des Commandes par Système de Fichiers===== | + | |
- | + | ||
- | ^ Description ^ Ext3 ^ Ext4 ^ XFS ^ ReiserFS ^ JFS ^ Btrfs ^ | + | |
- | | Build a Linux filesystem | mkfs.ext3 (mke2fs -j) | mkfs.ext4 (mke4fs) | mkfs.xfs | mkfs.reiserfs (mkreiserfs) | mkfs.jfs (jfs_mkfs) | mkfs.btrfs | | + | |
- | | Check a Linux filesystem | e2fsck | e2fsck | xfs_check / xfs_repair | reiserfsck | jfs_fsck | btrfsck | | + | |
- | | Adjust tunable filesystem parameters Linux filesystems | tune2fs | tune2fs | xfs_admin | reiserfstune | jfs_tune | btrfs-show-super, | + | |
- | | 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 | | + | |
- | + | ||
- | =====LAB #20 - Créer un Système de Fichiers ISO===== | + | |
- | + | ||
- | ====La Commande mkisofs==== | + | |
- | + | ||
- | Pour créer un fichier ISO à partir d'une arborescence de fichiers, il convient d' | + | |
< | < | ||
- | [root@centos8 ~]# cd /tmp | + | [root@centos8 ~]# date && shutdown |
- | [root@centos8 tmp]# mkisofs | + | Mon Jun 7 18:58:26 EDT 2021 |
- | I: -input-charset not specified, using utf-8 (detected in locale settings) | + | Shutdown scheduled for Mon 2021-06-07 18:59:26 EDT, use ' |
- | 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) | + | |
</ | </ | ||
- | Le fichier ISO peut être monter en utilisant un périphérique de type **loop** : | + | ==== La Commande reboot==== |
- | < | + | Cette commande redémarre |
- | [root@centos8 tmp]# mount tmp.iso /mnt -o loop | + | |
- | mount: /mnt: WARNING: device write-protected, | + | |
- | [root@centos8 tmp]# ls /mnt | + | |
- | systemd-private-192104a9224f499286f5adb5754e9e04-chronyd.service-FI2YXs | + | |
- | [root@centos8 tmp]# ls | + | |
- | systemd-private-192104a9224f499286f5adb5754e9e04-chronyd.service-FI2YXs | + | |
- | </ | + | |
- | + | ||
- | Démontez maintenant | + | |
- | + | ||
- | < | + | |
- | [root@centos8 tmp]# cd ~ | + | |
- | [root@centos8 ~]# umount /tmp/tmp.iso | + | |
- | </ | + | |
- | ====Options de la Commande mkisofs==== | + | ===Options de la commande=== |
Les options de cette commande sont : | Les options de cette commande sont : | ||
< | < | ||
- | [root@centos8 ~]# mkisofs | + | [root@centos8 ~]# reboot |
- | Usage: genisoimage | + | reboot |
- | 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 | + | |
- | Report problems to debburn-devel@lists.alioth.debian.org. | + | Reboot the system. |
- | </ | + | |
- | =====Systèmes de Fichiers Chiffrés sous RHEL/CentOS 8===== | + | |
- | + | --halt | |
- | ====LAB #21 - Créer un Système de Fichiers Chiffré avec LUKS sous RHEL/CentOS 8===== | + | -p --poweroff |
- | + | --reboot | |
- | ===Présentation=== | + | -f --force |
- | + | -w --wtmp-only Don't halt/power-off/reboot, just write wtmp record | |
- | **LUKS** ( Linux Unified Key Setup ) permet de chiffrer l' | + | -d --no-wtmp |
- | + | | |
- | ===Mise en Place=== | + | |
- | + | ||
- | Remplissez la partition | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# shred -v --iterations=1 | + | |
- | shred: /dev/sdb12: pass 1/1 (random)... | + | |
</ | </ | ||
- | <WRAP center round important 60%> | + | ==== La Commande halt==== |
- | **Important** : L' | + | |
- | </ | + | |
- | Initialisez la partition avec LUKS : | + | Cette commande arrête le système. |
- | < | + | ===Options de la commande=== |
- | [root@centos8 ~]# cryptsetup --verbose --verify-passphrase luksFormat /dev/sdb12 | + | |
- | WARNING! | + | Les options |
- | ======== | + | |
- | This will overwrite data on /dev/sdb12 irrevocably. | + | |
- | + | ||
- | Are you sure? (Type ' | + | |
- | Enter passphrase for /dev/sdb12: fenestros123456789 | + | |
- | Verify passphrase: fenestros123456789 | + | |
- | Key slot 0 created. | + | |
- | Command successful. | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round important 60%> | + | |
- | **Important** : La passphrase ne sera pas en claire. Elle l'est ici pour vous montrer un mot de passe acceptable pour LUKS. | + | |
- | </ | + | |
- | + | ||
- | Ouvrez la partition LUKS en lui donnant le nom **sdb12** | + | |
< | < | ||
- | [root@centos8 ~]# cryptsetup luksOpen /dev/sdb12 sdb12 | + | [root@centos8 ~]# halt --help |
- | Enter passphrase for /dev/sdb12: fenestros123456789 | + | halt [OPTIONS...] |
- | </ | + | |
- | Vérifiez que le système voit la partition : | + | Halt the system. |
- | < | + | |
- | [root@centos8 ~]# ls -l /dev/mapper | grep sdb12 | + | |
- | lrwxrwxrwx. 1 root root 7 Jun 2 10:03 sdb12 -> ../dm-2 | + | -p --poweroff |
+ | | ||
+ | -f --force | ||
+ | -w --wtmp-only Don't halt/power-off/reboot, just write wtmp record | ||
+ | -d --no-wtmp | ||
+ | | ||
</ | </ | ||
- | Créez maintenant un système de fichiers sur **/ | + | ==== La Commande poweroff==== |
- | < | + | Cette commande arrête le système et coupe l' |
- | [root@centos8 ~]# mkfs.xfs / | + | |
- | meta-data=/ | + | |
- | | + | |
- | | + | |
- | | + | |
- | data | + | |
- | | + | |
- | naming | + | |
- | log =internal log | + | |
- | | + | |
- | realtime =none | + | |
- | </ | + | |
- | Montez | + | ===Options de la commande=== |
- | < | + | Les options de cette commande sont : |
- | [root@centos8 ~]# mount / | + | |
- | </ | + | |
- | + | ||
- | Vérifiez la présence du montage | + | |
< | < | ||
- | [root@centos8 ~]# df -h | grep sdb12 | + | [root@centos8 ~]# poweroff |
- | / | + | poweroff [OPTIONS...] |
- | </ | + | |
- | Editez le fichier **/ | + | Power off the system. |
- | < | + | --help Show this help |
- | [root@centos8 ~]# vi / | + | |
- | [root@centos8 ~]# cat / | + | -p --poweroff |
- | sdb12 /dev/sdb12 none | + | |
- | </ | + | -f --force |
- | + | -w --wtmp-only Don't halt/power-off/reboot, just write wtmp record | |
- | Modifiez le fichier **/ | + | -d --no-wtmp |
- | + | --no-wall | |
- | < | + | |
- | [root@centos8 ~]# vi / | + | |
- | [root@centos8 ~]# cat / | + | |
- | + | ||
- | # | + | |
- | # / | + | |
- | # 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 | + | |
- | / | + | |
- | </ | + | |
- | + | ||
- | Restaurer les SC par défaut de SELinux : | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# / | + | |
- | Relabeled /mnt/sdb12 from system_u: | + | |
- | </ | + | |
- | + | ||
- | Redémarrez votre machine | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# shutdown -r now | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round important 60%> | + | |
- | **Important** : Lors du démarrage de la machine virtuelle, le système devrait vous demander d' | + | |
- | </ | + | |
- | + | ||
- | ===Ajouter une deuxième Passphrase=== | + | |
- | + | ||
- | Pour ajouter une deuxième passphrase, utilisez la commande cryptsetup avec la sous-commande **luksAddKey** : | + | |
- | + | ||
- | < | + | |
- | [trainee@centos8 ~]$ su - | + | |
- | Password: fenestros | + | |
- | [root@centos8 ~]# cryptsetup luksAddKey / | + | |
- | Enter any existing passphrase: fenestros123456789 | + | |
- | Enter new passphrase for key slot: redhat123456789 | + | |
- | Verify passphrase: redhat123456789 | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round important 60%> | + | |
- | **Important** : Les passphrases ne seront pas en claire. Elle le sont ici pour vous montrer des mots de passe acceptables pour LUKS. | + | |
- | </ | + | |
- | + | ||
- | ===Supprimer une Passphrase=== | + | |
- | + | ||
- | Pour supprimer une passphrase, utilisez la commande cryptsetup avec la sous-commande **luksRemoveKey** : | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# cryptsetup luksRemoveKey / | + | |
- | Enter passphrase to be deleted: redhat123456789 | + | |
- | </ | + | |
- | + | ||
- | Avant de poursuivre, éditez les fichiers **/ | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# vi / | + | |
- | [root@centos8 ~]# cat / | + | |
- | + | ||
- | # | + | |
- | # / | + | |
- | # 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 | + | |
- | UUID=c8bb3f47-d67f-4b21-b781-766899dc83d4 swap swap defaults | + | |
- | + | ||
- | [root@centos8 ~]# vi /etc/crypttab | + | |
- | [root@centos8 ~]# cat / | + | |
- | [root@centos8 ~]# | + | |
- | </ | + | |
- | + | ||
- | =====Le Swap===== | + | |
- | + | ||
- | ====Taille du swap==== | + | |
- | + | ||
- | 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 ^ | + | |
- | | 4 Go ou moins | 2 Go | | + | |
- | | 4 Go à 16 Go | 4 Go | | + | |
- | | 16 Go à 64 Go | 8 Go | | + | |
- | | 64 Go à 256 Go | 16 Go | | + | |
- | + | ||
- | ====Partitions de swap==== | + | |
- | + | ||
- | Une partition de swap peut être créée sur : | + | |
- | + | ||
- | | + | |
- | * un RAID logiciel | + | |
- | * un Volume Logique | + | |
- | + | ||
- | ====La Commande swapon==== | + | |
- | + | ||
- | Pour préparer un espace de swap, il convient d' | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# swapon | + | |
- | Filename Type Size Used Priority | + | |
- | /dev/dm-1 | + | |
- | </code> | + | |
- | + | ||
- | <WRAP center round important 60%> | + | |
- | **Important** : Vous noterez que dans l' | + | |
- | </WRAP> | + | |
- | + | ||
- | ===Options de la Commande=== | + | |
- | + | ||
- | Les options de la commande swapon sont : | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# swapon --help | + | |
- | + | ||
- | Usage: | + | |
- | | + | |
- | + | ||
- | Enable devices and files for paging and swapping. | + | |
- | + | ||
- | Options: | + | |
- | -a, --all enable all swaps from /etc/fstab | + | |
- | -d, --discard[=< | + | |
- | -e, --ifexists | + | |
- | -f, --fixpgsz | + | |
- | -o, --options < | + | |
- | -p, --priority < | + | |
- | -s, --summary | + | |
- | | + | |
- | | + | |
- | --raw use the raw output format (with --show) | + | |
- | | + | |
- | -v, --verbose | + | |
- | + | ||
- | -h, --help | + | |
- | -V, --version | + | |
- | + | ||
- | The < | + | |
- | -L < | + | |
- | -U < | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | < | + | |
- | < | + | |
- | + | ||
- | 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). | + | |
- | </code> | + | |
- | + | ||
- | <WRAP center round important 60%> | + | |
- | **Important** : L' | + | |
- | </WRAP> | + | |
- | + | ||
- | ====La Commande swapoff==== | + | |
- | + | ||
- | Dans le cas de notre exemple, la partition de swap se trouve sur **/ | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# swapoff /dev/dm-1 | + | |
- | [root@centos8 ~]# swapon -s | + | |
- | [root@centos8 ~]# | + | |
- | </ | + | |
- | + | ||
- | ===Options de la Commande=== | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# swapoff --help | + | |
- | + | ||
- | Usage: | + | |
- | | + | |
- | + | ||
- | Disable devices and files for paging and swapping. | + | |
- | + | ||
- | Options: | + | |
- | -a, --all disable all swaps from / | + | |
- | -v, --verbose | + | |
- | + | ||
- | -h, --help | + | |
- | -V, --version | + | |
- | + | ||
- | The < | + | |
- | -L < | + | |
- | -U < | + | |
- | | + | |
- | | + | |
- | < | + | |
- | < | + | |
- | + | ||
- | For more details see swapoff(8). | + | |
- | </ | + | |
- | + | ||
- | ====LAB #22 - Créer un Fichier de Swap==== | + | |
- | + | ||
- | Sous Linux, vous pouvez aussi bien utiliser un fichier de swap qu'une partition. La mise en place de ce fichier est faite en utilisant la commande **dd**. | + | |
- | + | ||
- | La commande **dd** copie le fichier passé en entrée dans le fichier de sortie en limitant le nombre d' | + | |
- | + | ||
- | * **count** | + | |
- | * le nombre | + | |
- | * **bs** | + | |
- | * la taille du bloc à copier | + | |
- | + | ||
- | Dans le cas du fichier swap il convient d' | + | |
- | + | ||
- | Pour créer votre fichier de swap de 268Mo, appelé **swap**, saisissez la commande suivante : | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# dd if=/ | + | |
- | 256+0 records in | + | |
- | 256+0 records out | + | |
- | 268435456 bytes (268 MB, 256 MiB) copied, 0.103048 s, 2.6 GB/s | + | |
- | </ | + | |
- | + | ||
- | Pour préparer le fichier en tant qu' | + | |
- | + | ||
- | < | + | |
- | [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 le fichier avec une priorité de **1**, saisissez la commande suivante : | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# swapon -p1 /swap | + | |
- | swapon: /swap: insecure permissions 0644, 0600 suggested. | + | |
- | </ | + | |
- | + | ||
- | Pour visualiser les éspaces swap, saisissez la commande suivante : | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# swapon -s | + | |
- | Filename Type Size Used Priority | + | |
- | /swap file 262140 0 1 | + | |
- | / | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round important 60%> | + | |
- | **Important** : Le fichier de swap ayant une priorité de 1 sera utilisé avant la partition de swap ayant une priorité de -2. | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round important 60%> | + | |
- | **Important** : Pour activer le fichier swap d'une manière permanente, il convient d' | + | |
- | </ | + | |
- | + | ||
- | Désactivez maintenant le fichier swap : | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# swapoff /swap | + | |
- | [root@centos8 ~]# swapon -s | + | |
- | Filename Type Size Used Priority | + | |
- | / | + | |
- | </ | + | |
- | + | ||
- | Supprimez maintenant le fichier de swap : | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# rm /swap | + | |
- | rm: remove regular file '/ | + | |
</ | </ | ||
----- | ----- | ||
Copyright © 2024 Hugh Norris. | Copyright © 2024 Hugh Norris. |