Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédente | |||
| elearning:workbooks:centos:8:avance:l111 [2023/12/08 14:47] – created admin | elearning:workbooks:centos:8:avance:l111 [2023/12/08 14:48] (Version actuelle) – admin | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| ~~PDF: | ~~PDF: | ||
| - | |||
| - | Version : **2023.01** | ||
| Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
| - | ======LCF602 - Gestion | + | ======LCF602 - Gestion |
| =====Contenu du Module===== | =====Contenu du Module===== | ||
| - | * **LCF602 - Gestion | + | * **LCF602 - Gestion |
| * Contenu du Module | * Contenu du Module | ||
| - | * Rôle du noyau | + | * Concepts RAID |
| - | * LAB #1 - Modules | + | * Disques en miroir |
| - | * LAB #2 - Compilation et installation du noyau et des modules | + | * Bandes de données |
| - | * 2.1 - Déplacer /home | + | * Types de RAID |
| - | * 2.2 - Préparer l' | + | * RAID 0 - Concaténation |
| - | * 2.3 - Préparer l' | + | * RAID 0 - Striping |
| - | * Le Fichier .config | + | * RAID 1 - Miroir |
| - | * Le Fichier Makefile | + | * RAID 1+0 - Striping en Miroir |
| - | * 2.4 - Paramétrage du noyau | + | * RAID 2 - Miroir avec Contrôle d' |
| - | * 2.5 - Compiler le Noyau | + | * RAID 3 et 4 - Striping avec Parité |
| - | * 2.6 - Installer le Nouveau Noyau | + | * RAID 5 - Striping avec Parité Distribuée |
| - | * LAB #3 - Gestion des Quotas | + | * Au délà de RAID 5 |
| - | * 3.1 - La Commande quotacheck | + | * RAID Logiciel sous RHEL/CentOS |
| - | * 3.2 - La Commande edquota | + | * Préparation du disque |
| - | * 3.3 - La Commande quotaon | + | * Partitionnement |
| - | * 3.4 - La Commande repquota | + | * Mise en Place du RAID 5 Logiciel |
| - | * 3.5 - La Commande quota | + | |
| - | * 3.6 - La Commande warnquota | + | |
| - | =====Rôle du noyau===== | + | =====Concepts RAID===== |
| - | Le noyau ou //kernel// est la partie du système d' | + | Les solutions RAID ou //Redundant Array of Independent Disks// ou encore |
| - | * la diminution de la taille | + | Les solutions RAID sont issues |
| - | * la prise en charge de nouveau matériel, | + | |
| - | * l'ajout de fonctionnalités, | + | |
| - | * l' | + | |
| - | * la correction | + | |
| - | * le besoin d'une fonctionnalité expérimentale. | + | |
| - | + | ||
| - | Commencez par mettre à jour CentOS 8 : | + | |
| - | < | + | * Addition des capacités, |
| - | [root@centos8 ~]# dnf update | + | * Amélioration des performances, |
| - | ... | + | * Apporter la tolérance de panne. |
| - | [root@centos8 ~]# reboot | + | |
| - | </ | + | |
| - | Identifiez ensuite le noyau utilisé par votre machine virtuelle : | + | Deux concepts sont fondamentaux à la compréhension des solutions RAID. |
| - | < | + | ====Disques en miroir==== |
| - | [root@centos8 ~]# uname -r | + | |
| - | 4.18.0-305.7.1.el8_4.x86_64 | + | |
| - | </ | + | |
| - | =====LAB #1 - Modules===== | + | La technique des disques en miroir consiste à dupliquer l' |
| - | Dans le cas d'une utilisation courante | + | ====Bandes |
| - | < | + | La technique des bandes de données, autrement appelée |
| - | [root@centos8 ~]# ls /lib/modules/`uname -r`/ | + | |
| - | bls.conf | + | |
| - | build modules.builtin.bin | + | |
| - | config | + | |
| - | kernel | + | |
| - | modules.alias | + | |
| - | modules.alias.bin | + | |
| - | modules.block | + | |
| - | </ | + | |
| - | Les commandes pour manipuler les modules sont : | + | =====Types de RAID===== |
| - | * insmod | + | ====RAID 0 - Concaténation==== |
| - | * rmmod | + | |
| - | * lsmod | + | |
| - | * modprobe | + | |
| - | Par exemple : | + | Création de volume par récupération de l' |
| - | < | + | {{: |
| - | [root@centos8 ~]# lsmod | + | |
| - | Module | + | |
| - | xt_CHECKSUM | + | |
| - | ipt_MASQUERADE | + | |
| - | xt_conntrack | + | |
| - | ipt_REJECT | + | |
| - | nft_compat | + | |
| - | nf_nat_tftp | + | |
| - | nft_objref | + | |
| - | nf_conntrack_tftp | + | |
| - | nft_counter | + | |
| - | tun 53248 1 | + | |
| - | bridge | + | |
| - | stp 16384 1 bridge | + | |
| - | llc 16384 2 bridge, | + | |
| - | nft_fib_inet | + | |
| - | nft_fib_ipv4 | + | |
| - | nft_fib_ipv6 | + | |
| - | nft_fib | + | |
| - | nft_reject_inet | + | |
| - | nf_reject_ipv4 | + | |
| - | nf_reject_ipv6 | + | |
| - | nft_reject | + | |
| - | nft_ct | + | |
| - | nf_tables_set | + | |
| - | nft_chain_nat | + | |
| - | nf_nat | + | |
| - | nf_conntrack | + | |
| - | nf_defrag_ipv6 | + | |
| - | nf_defrag_ipv4 | + | |
| - | ip_set | + | |
| - | nf_tables | + | |
| - | nfnetlink | + | |
| - | sunrpc | + | |
| - | ext4 761856 | + | |
| - | mbcache | + | |
| - | jbd2 131072 | + | |
| - | virtio_balloon | + | |
| - | pcspkr | + | |
| - | i2c_piix4 | + | |
| - | joydev | + | |
| - | ip_tables | + | |
| - | xfs 1515520 | + | |
| - | libcrc32c | + | |
| - | sr_mod | + | |
| - | sd_mod | + | |
| - | cdrom 65536 1 sr_mod | + | |
| - | t10_pi | + | |
| - | sg | + | |
| - | ata_generic | + | |
| - | bochs_drm | + | |
| - | drm_vram_helper | + | |
| - | drm_kms_helper | + | |
| - | syscopyarea | + | |
| - | sysfillrect | + | |
| - | sysimgblt | + | |
| - | fb_sys_fops | + | |
| - | drm_ttm_helper | + | |
| - | ttm | + | |
| - | drm | + | |
| - | ahci | + | |
| - | libahci | + | |
| - | virtio_net | + | |
| - | net_failover | + | |
| - | ata_piix | + | |
| - | serio_raw | + | |
| - | failover | + | |
| - | libata | + | |
| - | dm_mirror | + | |
| - | dm_region_hash | + | |
| - | dm_log | + | |
| - | dm_mod | + | |
| - | fuse 151552 | + | |
| - | </ | + | |
| - | Pour ajouter un module, on peut utiliser la commande **insmod** ou **modprobe**. Cette dernière ajoute non seulement le module passé en argument mais également ses dépendances : | + | ===Avantages=== |
| - | < | + | * Récupération de l' |
| - | [root@centos8 ~]# modprobe bonding | + | |
| - | [root@centos8 ~]# lsmod | more | + | |
| - | Module | + | |
| - | bonding | + | |
| - | xt_CHECKSUM | + | |
| - | ipt_MASQUERADE | + | |
| - | xt_conntrack | + | |
| - | ipt_REJECT | + | |
| - | nft_compat | + | |
| - | nf_nat_tftp | + | |
| - | nft_objref | + | |
| - | nf_conntrack_tftp | + | |
| - | nft_counter | + | |
| - | tun 53248 1 | + | |
| - | bridge | + | |
| - | stp 16384 1 bridge | + | |
| - | llc 16384 2 bridge, | + | |
| - | nft_fib_inet | + | |
| - | nft_fib_ipv4 | + | |
| - | nft_fib_ipv6 | + | |
| - | nft_fib | + | |
| - | nft_reject_inet | + | |
| - | nf_reject_ipv4 | + | |
| - | nf_reject_ipv6 | + | |
| - | --More-- | + | |
| - | </ | + | |
| - | Pour supprimer un module, on peut utiliser la commande **rmmod** ou **modprobe -r**. Cette dernière essaie de supprimer les dépendances non-utilisées : | + | ===Inconvénients=== |
| - | < | + | * Pas de protection des données, |
| - | [root@centos8 ~]# modprobe -r bonding | + | |
| - | [root@centos8 ~]# lsmod | more | + | |
| - | Module | + | |
| - | xt_CHECKSUM | + | |
| - | ipt_MASQUERADE | + | |
| - | xt_conntrack | + | |
| - | ipt_REJECT | + | |
| - | nft_compat | + | |
| - | nf_nat_tftp | + | |
| - | nft_objref | + | |
| - | nf_conntrack_tftp | + | |
| - | nft_counter | + | |
| - | tun 53248 1 | + | |
| - | bridge | + | |
| - | stp 16384 1 bridge | + | |
| - | llc 16384 2 bridge,stp | + | |
| - | nft_fib_inet | + | |
| - | nft_fib_ipv4 | + | |
| - | nft_fib_ipv6 | + | |
| - | nft_fib | + | |
| - | nft_reject_inet | + | |
| - | nf_reject_ipv4 | + | |
| - | nf_reject_ipv6 | + | |
| - | nft_reject | + | |
| - | --More-- | + | |
| - | </code> | + | |
| - | Les dépendances des modules sont résolues par la commande **modprobe** grâce aux fichier **/ | + | ====RAID 0 - Striping==== |
| - | < | + | Création de volume sur plusieurs disques afin d' |
| - | [root@centos8 ~]# more /lib/ | + | |
| - | kernel/ | + | |
| - | kernel/ | + | |
| - | kernel/ | + | |
| - | kernel/ | + | |
| - | kernel/ | + | |
| - | kernel/ | + | |
| - | kernel/ | + | |
| - | kernel/ | + | |
| - | kernel/ | + | |
| - | kernel/ | + | |
| - | xz kernel/ | + | |
| - | kernel/ | + | |
| - | kernel/ | + | |
| - | kernel/ | + | |
| - | kernel/ | + | |
| - | kernel/ | + | |
| - | kernel/ | + | |
| - | kernel/ | + | |
| - | kernel/ | + | |
| - | kernel/ | + | |
| - | _64.ko.xz | + | |
| - | kernel/ | + | |
| - | --More--(0%) | + | |
| - | </ | + | |
| - | Il est possible d' | + | {{:linux: |
| - | < | + | ===Avantages=== |
| - | [root@centos8 ~]# modinfo bonding | + | |
| - | filename: | + | |
| - | author: | + | |
| - | description: | + | |
| - | license: | + | |
| - | alias: | + | |
| - | rhelversion: | + | |
| - | srcversion: | + | |
| - | depends: | + | |
| - | intree: | + | |
| - | name: | + | |
| - | vermagic: | + | |
| - | sig_id: | + | |
| - | signer: | + | |
| - | sig_key: | + | |
| - | sig_hashalgo: | + | |
| - | signature: | + | |
| - | B7: | + | |
| - | 3F: | + | |
| - | BE: | + | |
| - | 44: | + | |
| - | DE: | + | |
| - | 7F: | + | |
| - | D8: | + | |
| - | BA: | + | |
| - | B8: | + | |
| - | 8F: | + | |
| - | 58: | + | |
| - | 6E: | + | |
| - | 50: | + | |
| - | 2F: | + | |
| - | CA: | + | |
| - | 0C: | + | |
| - | A6: | + | |
| - | AE: | + | |
| - | 59: | + | |
| - | parm: | + | |
| - | parm: | + | |
| - | parm: | + | |
| - | parm: | + | |
| - | parm: | + | |
| - | parm: | + | |
| - | parm: | + | |
| - | parm: | + | |
| - | parm: | + | |
| - | parm: | + | |
| - | parm: | + | |
| - | parm: | + | |
| - | parm: | + | |
| - | parm: | + | |
| - | parm: | + | |
| - | parm: | + | |
| - | parm: | + | |
| - | parm: | + | |
| - | parm: | + | |
| - | parm: | + | |
| - | parm: | + | |
| - | parm: | + | |
| - | parm: | + | |
| - | parm: | + | |
| - | </ | + | |
| - | Dernièrement, | + | |
| - | < | + | ===Inconvénients=== |
| - | [root@centos8 ~]# ls / | + | |
| - | firewalld-sysctls.conf | + | |
| - | kvm.conf | + | |
| - | [root@centos8 ~]# cat / | + | * Pas de protection des données. |
| - | # Setting modprobe kvm_intel/ | + | |
| - | # only enables Nested Virtualization until the next reboot or | + | |
| - | # module reload. Uncomment the option applicable | + | |
| - | # to your system below to enable the feature permanently. | + | |
| - | # | + | |
| - | # User changes in this file are preserved across upgrades. | + | |
| - | # | + | |
| - | # For Intel | + | |
| - | #options kvm_intel nested=1 | + | |
| - | # | + | |
| - | # For AMD | + | |
| - | #options kvm_amd nested=1 | + | |
| - | </ | + | |
| - | =====LAB #2 - Compilation et installation du noyau et des modules===== | + | ====RAID 1 - Miroir==== |
| - | Activez le dépôt **CentOS-Linux-PowerTools** | + | Création d'un volume où les disques sont en miroir. Quand les deux disques sont connectés |
| - | < | + | {{: |
| - | [root@centos8 ~]# vi / | + | |
| - | [root@centos8 ~]# cat / | + | |
| - | # CentOS-Linux-PowerTools.repo | + | |
| - | # | + | |
| - | # The mirrorlist system uses the connecting IP address of the client and the | + | |
| - | # update status of each mirror to pick current mirrors that are geographically | + | |
| - | # close to the client. | + | |
| - | # manually picking other mirrors. | + | |
| - | # | + | |
| - | # If the mirrorlist does not work for you, you can try the commented out | + | |
| - | # baseurl line instead. | + | |
| - | [powertools] | + | ===Avantages=== |
| - | name=CentOS Linux $releasever - PowerTools | + | |
| - | mirrorlist=http:// | + | |
| - | # | + | |
| - | gpgcheck=1 | + | |
| - | enabled=1 | + | |
| - | gpgkey=file:/// | + | |
| - | </ | + | |
| - | Installez maintenant les paquets nécessaires : | + | * Protection des données contre une défaillance d'un disque. |
| - | < | + | ===Inconvénients=== |
| - | [root@centos8 ~]# dnf groupinstall " | + | |
| - | ... | + | |
| - | [root@centos8 ~]# dnf install asciidoc audit-libs-devel bash bc binutils binutils-devel bison diffutils elfutils elfutils-devel elfutils-libelf-devel findutils flex gawk gcc gettext gzip hmaccalc hostname make module-init-tools ncurses-devel net-tools newt-devel numactl-devel openssl patch pciutils-devel perl perl-ExtUtils-Embed pesign redhat-rpm-config rpm-build rpmdevtools sh-utils tar xmlto xz zlib-devel | + | |
| - | ... | + | |
| - | </ | + | |
| - | ====2.1 - Déplacer /home==== | + | * Coûteux à cause de l' |
| - | <WRAP center round alert 60%> | + | ====RAID 1+0 - Striping |
| - | **Important** | + | |
| - | </ | + | |
| - | <WRAP center round todo 60%> | + | Le RAID 1+0 ou encore |
| - | **A faire** - **Déconnectez-vous** de votre session **CentOS8_SSH_10.0.2.45** et re-connectez-vous à la VM en tant que root en utilisant la connexion | + | |
| - | </ | + | |
| - | Créez ensuite une seule partition sur **/ | + | {{:linux: |
| - | < | + | ===Avantages=== |
| - | [root@centos8 ~]# fdisk /dev/sdc | + | |
| - | Welcome to fdisk (util-linux 2.32.1). | + | * Protection des données contre une défaillance d'un disque. |
| - | Changes will remain in memory only, until you decide to write them. | + | * Augmentation des performances d'E/S par écriture en parallèle sur les disques. |
| - | Be careful before using the write command. | + | |
| - | Device does not contain a recognized partition table. | + | ===Inconvénients=== |
| - | Created a new DOS disklabel with disk identifier 0xc321702b. | + | |
| - | Command (m for help): n | + | |
| - | Partition type | + | |
| - | | + | |
| - | | + | |
| - | Select (default p): | + | |
| - | Using default response p. | + | ====RAID 2 - Miroir avec Contrôle d' |
| - | Partition number (1-4, default 1): | + | |
| - | First sector (2048-41943039, | + | |
| - | Last sector, +sectors or +size{K, | + | |
| - | Created a new partition 1 of type 'Linux' and of size 20 GiB. | + | Le RAID 2 est une technique de miroir avec contrôle de correction d'erreurs (EEC). De nos jours cette technique est peu utilisée, ayant été remplacée par les RAID 3, 4 et 5. |
| - | Command (m for help): w | + | ====RAID 3 et 4 - Striping avec Parité==== |
| - | The partition table has been altered. | + | |
| - | Calling ioctl() to re-read partition table. | + | |
| - | Syncing disks. | + | |
| - | </ | + | |
| - | Créez maintenant un système | + | Les RAID 3 et 4 sont des technologies avec bandes |
| - | < | + | {{:linux:raid34.gif|}} |
| - | [root@centos8 ~]# mkfs.ext4 /dev/sdc1 | + | |
| - | mke2fs 1.45.6 (20-Mar-2020) | + | |
| - | Discarding device blocks: done | + | |
| - | Creating filesystem with 16776960 4k blocks and 4194304 inodes | + | |
| - | Filesystem UUID: dc92c0d7-919b-4fff-8719-53e9e7e628dd | + | |
| - | Superblock backups stored on blocks: | + | |
| - | 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, | + | |
| - | 4096000, 7962624, 11239424 | + | |
| - | Allocating group tables: done | + | En RAID 3, la taille des segments n’est pas modifiable et est fixée à 512 octets (en RAID 3 : un segment = un secteur de disque dur = 512 octets). |
| - | Writing inode tables: done | + | |
| - | Creating journal (65536 blocks): done | + | |
| - | Writing superblocks and filesystem accounting information: | + | |
| - | </ | + | |
| - | Montez **/ | + | En RAID 4, la taille des segments est variable et se modifie en temps réel. Cela implique que les informations de parité doivent être mise à jour à chaque écriture afin de vérifier si la taille des segments a été modifiée. |
| - | < | + | ===Avantages=== |
| - | [root@centos8 ~]# mount /dev/sdc1 /mnt | + | |
| - | </ | + | |
| - | Copiez le contenu de /home vers /mnt : | + | * Protection des données contre une défaillance d'un disque. |
| - | < | + | ===Inconvénients=== |
| - | [root@centos8 ~]# cp -a /home/* /mnt | + | |
| - | </ | + | |
| - | Démontez /dev/sdc1 et déplacez /home vers /root : | + | * Création d'un goulot d' |
| - | < | + | ====RAID 5 - Striping avec Parité Distribuée==== |
| - | [root@centos8 ~]# umount /mnt | + | |
| - | [root@centos8 ~]# mv /home /root | + | |
| - | </ | + | |
| - | Identifiez l' | + | Le RAID 5 est une technologie avec bandes |
| - | < | + | {{:linux:raid5.gif|}} |
| - | [root@centos8 ~]# ls -l / | + | |
| - | lrwxrwxrwx. 1 root root 10 Jul 19 12:02 f76d6b66-985b-4a91-af9c-4987e8c1443c -> ../../sdc | + | |
| - | [root@centos8 ~]# | + | |
| - | </ | + | |
| - | Editez le fichier **/ | + | ===Avantages=== |
| - | < | + | * Protection des données contre une défaillance d'un disque, |
| - | [root@centos8 ~]# vi / | + | * Evite le goulot d' |
| - | [root@centos8 ~]# cat /etc/fstab | + | |
| - | # | + | ===Inconvénients=== |
| - | # / | + | |
| - | # Created by anaconda on Wed Jun 16 06:21:32 2021 | + | |
| - | # | + | |
| - | # 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=1c04981e-5317-4b73-9695-3ce25246835d /boot | + | |
| - | / | + | |
| - | UUID=f76d6b66-985b-4a91-af9c-4987e8c1443c /home | + | |
| - | </ | + | |
| - | Créez le point de montage /home : | + | * Lecture moins performante qu' |
| - | < | + | ====Au délà de RAID 5==== |
| - | [root@centos8 ~]# mkdir /home | + | |
| - | </ | + | |
| - | Montez / | + | Il existe aussi deux autres technologies RAID, toute deux issues de la technologie RAID 5 : |
| - | < | + | * RAID 6 |
| - | [root@centos8 ~]# mount -a | + | |
| - | [root@centos8 ~]# mount | + | * RAID TP |
| - | sysfs on /sys type sysfs (rw, | + | |
| - | proc on /proc type proc (rw, | + | |
| - | devtmpfs on /dev type devtmpfs (rw, | + | |
| - | securityfs on /sys/ | + | |
| - | tmpfs on /dev/shm type tmpfs (rw, | + | |
| - | devpts on /dev/pts type devpts (rw, | + | |
| - | tmpfs on /run type tmpfs (rw, | + | |
| - | tmpfs on / | + | |
| - | cgroup on / | + | |
| - | pstore on / | + | |
| - | bpf on /sys/fs/bpf type bpf (rw, | + | |
| - | cgroup on / | + | |
| - | cgroup on / | + | |
| - | cgroup on / | + | |
| - | cgroup on / | + | |
| - | cgroup on / | + | |
| - | cgroup on / | + | |
| - | cgroup on / | + | |
| - | cgroup on / | + | |
| - | cgroup on / | + | |
| - | cgroup on / | + | |
| - | cgroup on / | + | |
| - | none on / | + | |
| - | configfs on / | + | |
| - | / | + | |
| - | selinuxfs on / | + | |
| - | mqueue on /dev/mqueue type mqueue (rw, | + | |
| - | hugetlbfs on / | + | |
| - | debugfs on / | + | |
| - | systemd-1 on / | + | |
| - | fusectl on / | + | |
| - | /dev/sda1 on /boot type ext4 (rw, | + | |
| - | sunrpc on / | + | |
| - | tmpfs on / | + | |
| - | tmpfs on / | + | |
| - | gvfsd-fuse on / | + | |
| - | tmpfs on /run/user/0 type tmpfs (rw, | + | |
| - | gvfsd-fuse on / | + | |
| - | /dev/sdc1 on /home type ext4 (rw, | + | |
| - | </code> | + | |
| - | Notez la taille de /home : | + | =====RAID Logiciel sous RHEL/CentOS===== |
| - | < | + | ====Préparation du disque==== |
| - | [root@centos8 ~]# df -h | + | |
| - | Filesystem | + | |
| - | devtmpfs | + | |
| - | tmpfs 1.9G | + | |
| - | tmpfs 1.9G 9.4M 1.9G 1% /run | + | |
| - | tmpfs 1.9G | + | |
| - | / | + | |
| - | / | + | |
| - | tmpfs 374M | + | |
| - | tmpfs 374M 1.2M 373M 1% / | + | |
| - | / | + | |
| - | </ | + | |
| - | + | ||
| - | <WRAP center round todo 60%> | + | |
| - | **A faire** - **Déconnectez-vous** de votre session **CentOS8_ROOT_10.0.2.45** et re-connectez-vous à la VM en tant que trainee en utilisant la connexion **CentOS8_SSH_10.0.2.45**. | + | |
| - | </ | + | |
| - | ====2.2 - Préparer l' | + | ===Partitionnement=== |
| - | Pour créer l' | + | Suite à votre LAB de la leçon |
| < | < | ||
| - | [trainee@centos8 | + | [root@centos7 |
| - | ...> | + | |
| - | [trainee@centos8 ~]$ ls -laR rpmbuild/ | + | |
| - | rpmbuild/: | + | |
| - | total 28 | + | |
| - | drwxrwxr-x. | + | |
| - | drwxr-xr-x. 17 trainee trainee 4096 Jul 19 12:10 .. | + | |
| - | drwxrwxr-x. | + | |
| - | drwxrwxr-x. | + | |
| - | drwxrwxr-x. | + | |
| - | drwxrwxr-x. | + | |
| - | drwxrwxr-x. | + | |
| - | rpmbuild/BUILD: | + | Disk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectors |
| - | total 8 | + | Units = sectors of 1 * 512 = 512 bytes |
| - | drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 . | + | Sector size (logical/ |
| - | drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 .. | + | I/O size (minimum/ |
| + | Disk label type: dos | ||
| + | Disk identifier: 0x000c5a90 | ||
| - | rpmbuild/RPMS: | + | |
| - | total 8 | + | /dev/ |
| - | drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 . | + | / |
| - | drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 .. | + | / |
| - | + | / | |
| - | rpmbuild/SOURCES: | + | / |
| - | total 8 | + | /dev/ |
| - | drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 . | + | / |
| - | drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 .. | + | / |
| - | + | / | |
| - | rpmbuild/SPECS: | + | /dev/ |
| - | total 8 | + | /dev/ |
| - | drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 . | + | / |
| - | drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 .. | + | |
| - | + | ||
| - | rpmbuild/SRPMS: | + | |
| - | total 8 | + | |
| - | drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 . | + | |
| - | drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 .. | + | |
| </ | </ | ||
| - | Téléchargez le rpm source | + | ====Mise en Place du RAID 5 Logiciel==== |
| - | < | + | Dans le cas de cet exemple les quatre partitions concernées par la mise en place d'un RAID 5 sont : |
| - | [trainee@centos8 ~]$ uname -a | + | |
| - | Linux centos8.ittraining.loc 4.18.0-305.7.1.el8_4.x86_64 #1 SMP Tue Jun 29 21:55:12 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux | + | |
| - | [trainee@centos8 ~]$ cat /etc/centos-release | + | < |
| - | CentOS | + | /dev/sda5 25085952 |
| + | / | ||
| + | / | ||
| + | / | ||
| + | </ | ||
| - | [trainee@centos8 ~]$ wget https:// | + | La création d'une unité RAID avec la commande **mdadm** se fait grâce aux options passées |
| - | --2021-07-14 02: | + | |
| - | Resolving vault.centos.org (vault.centos.org)... 81.171.33.194, | + | |
| - | Connecting to vault.centos.org (vault.centos.org)|81.171.33.194|: | + | |
| - | HTTP request sent, awaiting response... 200 OK | + | |
| - | Length: 123000617 (117M) [application/ | + | |
| - | Saving to: ‘kernel-4.18.0-305.7.1.el8_4.src.rpm’ | + | |
| - | + | ||
| - | kernel-4.18.0-305.7.1. 100%[===========================> | + | |
| - | + | ||
| - | 2021-07-14 02:55:33 (1.49 MB/s) - ‘kernel-4.18.0-305.7.1.el8_4.src.rpm’ saved [123000617/ | + | |
| - | </ | + | |
| - | + | ||
| - | Installez maintenant les dépendances pour le rpm source | + | |
| < | < | ||
| - | [trainee@centos8 ~]$ su - | + | mdadm --create <unité RAID> |
| - | Mot de passe : fenestros | + | |
| - | + | ||
| - | [root@centos8 ~]# dnf install yum-utils | + | |
| - | ... | + | |
| - | + | ||
| - | [root@centos8 ~]# yum-builddep / | + | |
| - | ... | + | |
| </ | </ | ||
| - | Installez maintenant le paquet **kernel-4.18.0-305.7.1.el8_4.src.rpm** | + | Par exemple, saisissez la commande suivante |
| < | < | ||
| - | [root@centos8 | + | [root@centos7 |
| - | logout | + | mdadm: Defaulting to version 1.2 metadata |
| - | [trainee@centos8 ~]$ rpm -Uvh kernel-4.18.0-305.7.1.el8_4.src.rpm | + | mdadm: array /dev/md1 started. |
| - | Updating | + | |
| - | | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | ################################# | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| - | warning: user mockbuild does not exist - using root | + | |
| - | warning: group mockbuild does not exist - using root | + | |
| </ | </ | ||
| - | <WRAP center round important 60%> | + | Les options dans la ligne de commande |
| - | **Important** - Les erreurs | + | |
| - | </ | + | |
| - | ====2.3 | + | ^ Option Courte ^ Option Longue ^ Description ^ |
| + | | -l | - -level | Le niveau RAID - **linear, 0,1,2,4 ou 5** | | ||
| + | | -n | - -raid-devices=< | ||
| - | Naviguez vers le repertoire | + | Les autres options de la commande |
| < | < | ||
| - | [trainee@centos7 ~]$ cd ~/ | + | [root@centos7 ~]# mdadm --help-options |
| - | [trainee@centos7 SPECS]$ rpmbuild | + | Any parameter that does not start with '-' is treated as a device name |
| - | ... | + | or, for --examine-bitmap, a file name. |
| - | </ | + | The first such name is often the name of an md device. |
| + | names are often names of component devices. | ||
| - | A l'issu du processus, examinez l'arborescence | + | Some common options are: |
| + | --help | ||
| + | mode specific help message | ||
| + | --help-options | ||
| + | --version | ||
| + | --verbose | ||
| + | --quiet | ||
| + | --brief | ||
| + | --export | ||
| + | | ||
| + | --force | ||
| - | < | + | |
| - | [trainee@centos8 SPECS]$ ls -la ~/ | + | --build -B : Build an array without metadata |
| - | total 812 | + | --create |
| - | drwxr-xr-x. | + | --detail |
| - | drwxr-xr-x. | + | --examine |
| - | drwxr-xr-x. | + | --examine-bitmap |
| - | drwxr-xr-x. 3 trainee trainee | + | --examine-badblocks: Display list of known bad blocks on device |
| - | drwxr-xr-x. 2 trainee trainee | + | --monitor |
| - | -rw-r--r--. | + | --grow |
| - | -rw-r--r--. | + | --incremental |
| - | drwxr-xr-x. | + | --query -Q : Display general information about how a |
| - | -rw-r--r--. | + | device relates to the md driver |
| - | -rw-r--r--. | + | --auto-detect |
| - | drwxr-xr-x. 4 trainee trainee | + | |
| - | drwxr-xr-x. 119 trainee trainee | + | |
| - | drwxr-xr-x. 137 trainee trainee | + | |
| - | drwxr-xr-x. | + | |
| - | drwxr-xr-x. | + | |
| - | -rw-r--r--. | + | |
| - | -rw-r--r--. | + | |
| - | -rw-r--r--. 1 trainee trainee | + | |
| - | -rw-r--r--. | + | |
| - | -rw-r--r--. | + | |
| - | drwxr-xr-x. | + | |
| - | drwxr-xr-x. 2 trainee trainee | + | |
| - | drwxr-xr-x. 2 trainee trainee | + | |
| - | -rw-r--r--. | + | |
| - | -rw-r--r--. | + | |
| - | drwxr-xr-x. | + | |
| - | drwxr-xr-x. 20 trainee trainee | + | |
| - | drwxr-xr-x. 5 trainee trainee | + | |
| - | -rw-r--r--. | + | |
| - | -rw-r--r--. | + | |
| - | -rw-r--r--. | + | |
| - | -rw-r--r--. | + | |
| - | -rw-r--r--. | + | |
| - | drwxr-xr-x. | + | |
| - | drwxr-xr-x. | + | |
| - | -rw-r--r--. | + | |
| - | drwxr-xr-x. | + | |
| - | -rw-r--r--. | + | |
| - | drwxr-xr-x. | + | |
| - | drwxr-xr-x. | + | |
| - | drwxr-xr-x. 26 trainee trainee | + | |
| - | drwxr-xr-x. 33 trainee trainee | + | |
| - | drwxr-xr-x. 2 trainee trainee | + | |
| - | drwxr-xr-x. | + | |
| </ | </ | ||
| - | ===Le Fichier .config=== | + | Les //modes majeurs// |
| - | + | ||
| - | Changez | + | |
| < | < | ||
| - | [trainee@centos8 SPECS]$ cd ~/rpmbuild/BUILD/kernel-*/linux-*/ | + | [root@centos7 |
| - | </ | + | mdadm is used for building, managing, and monitoring |
| + | Linux md devices (aka RAID arrays) | ||
| + | Usage: mdadm --create device options... | ||
| + | Create a new array from unused devices. | ||
| + | mdadm --assemble device options... | ||
| + | Assemble a previously created array. | ||
| + | mdadm --build device options... | ||
| + | Create or assemble an array without metadata. | ||
| + | mdadm --manage device options... | ||
| + | make changes to an existing array. | ||
| + | mdadm --misc options... devices | ||
| + | report on or modify various md related devices. | ||
| + | mdadm --grow options device | ||
| + | resize/reshape an active array | ||
| + | mdadm --incremental device | ||
| + | add/remove a device to/from an array as appropriate | ||
| + | | ||
| + | | ||
| + | mdadm device options... | ||
| + | Shorthand for --manage. | ||
| + | Any parameter that does not start with ' | ||
| + | or, for --examine-bitmap, | ||
| + | The first such name is often the name of an md device. | ||
| + | names are often names of component devices. | ||
| - | Copiez le fichier **configs/ | + | For detailed help on the above major modes use --help after the mode |
| - | + | e.g. | |
| - | < | + | |
| - | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ cp configs/ | + | For general help on options use |
| + | mdadm --help-options | ||
| </ | </ | ||
| - | Mettez à jour le fichier .config par rapport à la configuration actuelle du noyau : | + | Dernièrement, |
| < | < | ||
| - | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ make oldconfig | + | [root@centos7 ~]# mdadm --assemble --help |
| - | scripts/ | + | Usage: mdadm --assemble device options... |
| - | # | + | mdadm --assemble --scan options... |
| - | # configuration written to .config | + | |
| - | # | + | |
| - | </ | + | |
| - | <WRAP center round important 60%> | + | This usage assembles one or more raid arrays from pre-existing |
| - | **Important** | + | components. |
| - | </ | + | For each array, mdadm needs to know the md device, the identity of |
| + | the array, and a number of sub devices. These can be found in a number | ||
| + | of ways. | ||
| - | La configuration du noyau se trouve dans un fichier dénommé **.config**. Le fichier **.config** est généré par une des trois commandes suivantes et ne doit **pas** être édité manuellement : | + | The md device is given on the command line, is found listed in the |
| + | config file, or can be deduced from the array identity. | ||
| + | The array identity is determined either from the --uuid, --name, or | ||
| + | --super-minor commandline arguments, from the config | ||
| + | or from the first component device on the command line. | ||
| - | * make config | + | The different combinations of these are as follows: |
| - | * make menuconfig | + | If the --scan option is not given, then only devices and identities |
| - | * make xconfig | + | listed on the command line are considered. |
| - | + | The first device will be the array device, and the remainder will be | |
| - | Exécutez la commande **make menuconfig** : | + | examined when looking for components. |
| + | If an explicit identity is given with --uuid or --super-minor, | ||
| + | only devices with a superblock which matches that identity is considered, | ||
| + | | ||
| - | < | + | If the --scan option is given, and no devices are listed, then |
| - | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ make menuconfig | + | every array listed in the config file is considered for assembly. |
| - | | + | The identity of candidate devices are determined from the config file. |
| - | | + | After these arrays are assembled, mdadm will look for other devices |
| - | | + | that could form further arrays and tries to assemble them. |
| - | | + | be disabled |
| - | HOSTCC | + | |
| - | | + | |
| - | HOSTCC | + | |
| - | HOSTCC | + | |
| - | HOSTLD | + | |
| - | scripts/ | + | |
| - | # | + | |
| - | # using defaults found in /boot/config-4.18.0-305.7.1.el8_4.x86_64 | + | |
| - | # | + | |
| - | </ | + | |
| - | Dans l' | + | If the --scan option is given as well as one or more devices, then |
| + | Those devices are md devices that are to be assembled. | ||
| + | and components are determined from the config file. | ||
| - | * **y**, | + | If mdadm can not find all of the components for an array, it will assemble |
| - | * la fonctionalité est incluse dans le noyau monolithique ou dans le cas d'une dépendance d'un module, dans le module concerné, | + | it but not activate it unless --run or --scan is given. |
| - | | + | |
| - | * la fonctionalité est incluse en tant que module, | + | components" |
| - | * **n**, | + | as recorded in the superblock. |
| - | * la fonctionalité n'est pas incluse. | + | the missing device is not a new problem, it will still be assembled. |
| + | is only newly missing devices that cause the array not to be started. | ||
| - | <WRAP center round important 60%> | + | Options that are valid with --assemble (-A) are: |
| - | **Important** | + | --bitmap= |
| - | </ | + | --uuid= |
| - | + | have this uuid are excluded | |
| - | Sauvegardez simplement la configuration actuelle et sortez de l' | + | |
| - | + | choosing devices to use. | |
| - | < | + | --name= |
| - | *** End of the configuration. | + | |
| - | *** Execute | + | |
| + | | ||
| + | for a full array are present | ||
| + | --force | ||
| + | : out-of-date. | ||
| + | | ||
| + | --no-degraded | ||
| + | --readonly | ||
| </ | </ | ||
| - | Vérifiez que le fichier **.config** a été" | + | Constatez maintenant les informations concernant |
| < | < | ||
| - | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ ls -a | + | [root@centos7 ~]# cat / |
| - | . certs configs | + | Personalities : [raid6] [raid5] [raid4] |
| - | .. | + | md1 : active raid5 sda11[3] sda8[1] sda5[0] |
| - | arch | + | |
| - | block .config | + | |
| + | unused devices: < | ||
| </ | </ | ||
| - | Consultez ce fichier | + | Grâce à la commande mdadm, il est possible d' |
| < | < | ||
| - | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ more .config | + | [root@centos7 ~]# mdadm --query /dev/md1 |
| - | # | + | /dev/md1: 998.17MiB raid5 3 devices, |
| - | # Automatically generated file; DO NOT EDIT. | + | |
| - | # Linux/x86 4.18.0 Kernel Configuration | + | |
| - | # | + | |
| - | + | ||
| - | # | + | |
| - | # Compiler: gcc (GCC) 8.4.1 20200928 (Red Hat 8.4.1-1) | + | |
| - | # | + | |
| - | CONFIG_64BIT=y | + | |
| - | CONFIG_X86_64=y | + | |
| - | CONFIG_X86=y | + | |
| - | CONFIG_INSTRUCTION_DECODER=y | + | |
| - | CONFIG_OUTPUT_FORMAT=" | + | |
| - | CONFIG_ARCH_DEFCONFIG=" | + | |
| - | CONFIG_LOCKDEP_SUPPORT=y | + | |
| - | CONFIG_STACKTRACE_SUPPORT=y | + | |
| - | CONFIG_MMU=y | + | |
| - | CONFIG_ARCH_MMAP_RND_BITS_MIN=28 | + | |
| - | CONFIG_ARCH_MMAP_RND_BITS_MAX=32 | + | |
| - | CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 | + | |
| - | CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16 | + | |
| - | CONFIG_GENERIC_ISA_DMA=y | + | |
| - | CONFIG_GENERIC_BUG=y | + | |
| - | CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y | + | |
| - | CONFIG_GENERIC_HWEIGHT=y | + | |
| - | CONFIG_ARCH_MAY_HAVE_PC_FDC=y | + | |
| - | CONFIG_GENERIC_CALIBRATE_DELAY=y | + | |
| - | CONFIG_ARCH_HAS_CPU_RELAX=y | + | |
| - | CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y | + | |
| - | CONFIG_ARCH_HAS_FILTER_PGPROT=y | + | |
| - | CONFIG_HAVE_SETUP_PER_CPU_AREA=y | + | |
| - | CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y | + | |
| - | CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y | + | |
| - | CONFIG_ARCH_HIBERNATION_POSSIBLE=y | + | |
| - | CONFIG_ARCH_SUSPEND_POSSIBLE=y | + | |
| - | CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y | + | |
| - | CONFIG_ARCH_WANT_GENERAL_HUGETLB=y | + | |
| - | CONFIG_ZONE_DMA32=y | + | |
| - | CONFIG_AUDIT_ARCH=y | + | |
| - | CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y | + | |
| - | CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y | + | |
| - | CONFIG_HAVE_INTEL_TXT=y | + | |
| - | CONFIG_X86_64_SMP=y | + | |
| - | --More--(0%) | + | |
| </ | </ | ||
| - | ===Le Fichier Makefile=== | + | L' |
| - | + | ||
| - | Le fichier | + | |
| - | + | ||
| - | * VERSION, | + | |
| - | * PATCHLEVEL, | + | |
| - | * SUBLEVEL, | + | |
| - | * EXTRAVERSION. | + | |
| - | + | ||
| - | Les trois premières informations sont gérées par **kernel.org** et Linus Torvalds en personne tandis que l' | + | |
| < | < | ||
| - | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ more Makefile | + | [root@centos7 ~]# mdadm --detail /dev/md1 |
| - | # SPDX-License-Identifier: GPL-2.0 | + | /dev/md1: |
| - | VERSION = 4 | + | Version : 1.2 |
| - | PATCHLEVEL = 18 | + | |
| - | SUBLEVEL = 0 | + | Raid Level : raid5 |
| - | EXTRAVERSION = | + | Array Size : 1021952 (998.17 MiB 1046.48 MB) |
| - | NAME = Merciless Moray | + | Used Dev Size : 510976 (499.08 MiB 523.24 MB) |
| + | Raid Devices : 3 | ||
| + | Total Devices : 3 | ||
| + | Persistence : Superblock is persistent | ||
| - | # | + | Update Time : Tue Aug 2 15:10:17 2016 |
| - | # DRM backport version | + | State : clean |
| - | # | + | Active Devices : 3 |
| - | RHEL_DRM_VERSION = 5 | + | Working Devices : 3 |
| - | RHEL_DRM_PATCHLEVEL = 9 | + | Failed Devices : 0 |
| - | RHEL_DRM_SUBLEVEL = 14 | + | Spare Devices : 0 |
| - | # *DOCUMENTATION* | + | |
| - | # To see a list of typical targets execute "make help" | + | Chunk Size : 512K |
| - | # More info can be located in ./README | + | |
| - | # Comments in this file are targeted only to the developer, do not | + | |
| - | # expect to learn how to build the kernel reading this file. | + | |
| - | # That's our default target when none is given on the command line | + | Name : centos7.fenestros.loc: |
| - | PHONY := _all | + | UUID : fd8bac53: |
| - | _all: | + | Events |
| - | # o Do not use make's built-in rules and variables | + | Number |
| - | # | + | 0 |
| - | # o Look for make include files relative to root of kernel src | + | 1 |
| - | MAKEFLAGS += -rR --include-dir=$(CURDIR) | + | 3 |
| - | + | ||
| - | # Avoid funny character set dependencies | + | |
| - | unexport LC_ALL | + | |
| - | LC_COLLATE=C | + | |
| - | LC_NUMERIC=C | + | |
| - | export LC_COLLATE LC_NUMERIC | + | |
| - | + | ||
| - | # Avoid interference with shell env settings | + | |
| - | unexport GREP_OPTIONS | + | |
| - | + | ||
| - | # Set RHEL variables | + | |
| - | # Use this spot to avoid future merge conflicts | + | |
| - | include Makefile.rhelver | + | |
| - | + | ||
| - | # We are using a recursive build, so we need to do a little thinking | + | |
| - | --Plus--(2%) | + | |
| </ | </ | ||
| - | <WRAP center round important 60%> | + | Notez la ligne **Persistence : Superblock is persistent**. En effet, cette implémentation |
| - | **Important** - La version 2.6 du noyau a vu le jour en **2003**. Les **SUBLEVEL** se suivaient régulièrement. Avec la version 2.6 du noyau, la valeur paire du **PATCHLEVEL** indiquait que le noyau était stable. Quand vous recompilez le noyau à partir des sources, vous devez modifier la valeur | + | |
| - | </ | + | |
| - | ====2.4 - Paramétrage du noyau==== | + | <WRAP center round todo> |
| - | + | Recherchez la signification | |
| - | Insérez la sortie de la commande **uname -i** sur la première ligne du fichier .config : | + | |
| - | + | ||
| - | < | + | |
| - | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ uname -i | + | |
| - | x86_64 | + | |
| - | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ vi .config | + | |
| - | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ head .config | + | |
| - | # x86_64 | + | |
| - | # | + | |
| - | # Automatically generated file; DO NOT EDIT. | + | |
| - | # Linux/x86 4.18.0 Kernel Configuration | + | |
| - | # | + | |
| - | + | ||
| - | # | + | |
| - | # Compiler: gcc (GCC) 8.4.1 20200928 (Red Hat 8.4.1-1) | + | |
| - | # | + | |
| - | CONFIG_64BIT=y | + | |
| - | </ | + | |
| - | + | ||
| - | Renommez le fichier .config en le plaçant dans le répertoire **~/ | + | |
| - | + | ||
| - | < | + | |
| - | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ cp .config ~/ | + | |
| - | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ ls ~/ | + | |
| - | centos-ca-secureboot.der | + | |
| - | centos-dup.x509 | + | |
| - | centos-kpatch.x509 | + | |
| - | centos.pem | + | |
| - | centossecureboot001.der | + | |
| - | centossecureboot201.der | + | |
| - | centossecurebootca2.der | + | |
| - | check-kabi | + | |
| - | config-x86_64-generic | + | |
| - | </ | + | |
| - | + | ||
| - | Copiez le contenu du répertoire **configs** vers le répertoire **~/ | + | |
| - | + | ||
| - | < | + | |
| - | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ cp configs/* ~/ | + | |
| - | </ | + | |
| - | + | ||
| - | Editez la directive **buildid** dans le fichier **~/ | + | |
| - | + | ||
| - | < | + | |
| - | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ cd ~/ | + | |
| - | + | ||
| - | [trainee@centos8 SPECS]$ vi kernel.spec | + | |
| - | + | ||
| - | [trainee@centos8 SPECS]$ head -n 50 kernel.spec | + | |
| - | # We have to override the new %%install behavior because, well... the kernel is special. | + | |
| - | %global __spec_install_pre %{___build_pre} | + | |
| - | + | ||
| - | # At the time of this writing (2019-03), RHEL8 packages use w2.xzdio | + | |
| - | # compression for rpms (xz, level 2). | + | |
| - | # Kernel has several large (hundreds of mbytes) rpms, they take ~5 mins | + | |
| - | # to compress by single-threaded xz. Switch to threaded compression, | + | |
| - | # and from level 2 to 3 to keep compressed sizes close to " | + | |
| - | # | + | |
| - | # NB: if default compression in / | + | |
| - | # this one might need tweaking (e.g. if default changes to w3.xzdio, | + | |
| - | # change below to w4T.xzdio): | + | |
| - | %define _binary_payload w3T.xzdio | + | |
| - | + | ||
| - | # For a kernel released for public testing, released_kernel should be 1. | + | |
| - | # For internal testing builds during development, | + | |
| - | %global released_kernel 1 | + | |
| - | + | ||
| - | %global distro_build 305 | + | |
| - | + | ||
| - | # Sign the x86_64 kernel for secure boot authentication | + | |
| - | %ifarch x86_64 aarch64 | + | |
| - | %global signkernel 1 | + | |
| - | %else | + | |
| - | %global signkernel 0 | + | |
| - | %endif | + | |
| - | + | ||
| - | # Sign modules on all arches | + | |
| - | %global signmodules 1 | + | |
| - | + | ||
| - | # Compress modules only for architectures that build modules | + | |
| - | %ifarch noarch | + | |
| - | %global zipmodules 0 | + | |
| - | %else | + | |
| - | %global zipmodules 1 | + | |
| - | %endif | + | |
| - | + | ||
| - | %if %{zipmodules} | + | |
| - | %global zipsed -e ' | + | |
| - | %endif | + | |
| - | + | ||
| - | %define buildid .i2tch | + | |
| - | + | ||
| - | %define rpmversion 4.18.0 | + | |
| - | %define pkgrelease 305.7.1.el8_4 | + | |
| - | + | ||
| - | # allow pkg_release to have configurable %%{?dist} tag | + | |
| - | %define specrelease 305.7.1%{? | + | |
| - | + | ||
| - | %define pkg_release %{specrelease}%{? | + | |
| - | </ | + | |
| - | + | ||
| - | ====2.5 - Compiler le Noyau==== | + | |
| - | + | ||
| - | La compilation du noyau peut prendre beaucoup de temps (~5 heures). La commande utilisée est la suivante : | + | |
| - | + | ||
| - | < | + | |
| - | [trainee@centos7 SPECS]$ rpmbuild -bb --target=`uname -m` kernel.spec 2> build-err.log | tee build-out.log & | + | |
| - | </ | + | |
| - | + | ||
| - | <WRAP center round important 60%> | + | |
| - | **Important** - La compilation peut prendre | + | |
| </ | </ | ||
| - | A l'issu du processus, les RPMs se trouvent dans le répertoire | + | Cependant, il necéssaire de renseigner |
| < | < | ||
| - | ... | + | [root@centos7 ~]# echo ' |
| - | Wrote: | + | [root@centos7 ~]# mdadm --detail |
| - | Wrote: | + | [root@centos7 ~]# cat /etc/mdadm.conf |
| - | Wrote: / | + | DEVICES |
| - | Wrote: | + | ARRAY /dev/md1 metadata=1.2 name=centos7.fenestros.loc:1 UUID=fd8bac53:1457a4f4:30feab84:e0f9d8e0 |
| - | Wrote: | + | |
| - | Wrote: | + | |
| - | Wrote: | + | |
| - | Wrote: / | + | |
| - | Wrote: / | + | |
| - | Wrote: / | + | |
| - | Wrote: / | + | |
| - | Wrote: / | + | |
| - | Wrote: / | + | |
| - | Wrote: / | + | |
| - | Wrote: / | + | |
| - | Wrote: / | + | |
| - | Wrote: / | + | |
| - | Wrote: / | + | |
| - | Wrote: / | + | |
| - | Wrote: / | + | |
| - | Wrote: / | + | |
| - | Wrote: / | + | |
| - | Wrote: / | + | |
| - | Wrote: / | + | |
| - | Wrote: / | + | |
| - | Wrote: / | + | |
| - | Wrote: / | + | |
| - | Wrote: / | + | |
| - | Wrote: / | + | |
| - | Executing(%clean): | + | |
| - | + | ||
| - | [1]+ Done rpmbuild -bb --target=`uname -m` kernel.spec 2> build-err.log | tee build-out.log | + | |
| </ | </ | ||
| - | < | + | Chaque unité |
| - | [trainee@centos8 SPECS]$ cd ../RPMS | + | |
| - | [trainee@centos8 RPMS]$ ls | + | |
| - | x86_64 | + | |
| - | [trainee@centos8 RPMS]$ cd x86_64/ | + | |
| - | [trainee@centos8 x86_64]$ ls | + | |
| - | bpftool-4.18.0-305.7.1.el8.i2tch.x86_64.rpm | + | |
| - | bpftool-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm | + | |
| - | kernel-4.18.0-305.7.1.el8.i2tch.x86_64.rpm | + | |
| - | kernel-core-4.18.0-305.7.1.el8.i2tch.x86_64.rpm | + | |
| - | kernel-cross-headers-4.18.0-305.7.1.el8.i2tch.x86_64.rpm | + | |
| - | kernel-debug-4.18.0-305.7.1.el8.i2tch.x86_64.rpm | + | |
| - | kernel-debug-core-4.18.0-305.7.1.el8.i2tch.x86_64.rpm | + | |
| - | kernel-debug-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm | + | |
| - | kernel-debug-devel-4.18.0-305.7.1.el8.i2tch.x86_64.rpm | + | |
| - | kernel-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm | + | |
| - | </ | + | |
| - | + | ||
| - | Notez que la génération du nouveau noyau peut consommer jusqu' | + | |
| < | < | ||
| - | [trainee@centos8 x86_64]$ df -h | + | [root@centos7 ~]# mdadm --examine |
| - | Filesystem | + | /dev/sda5: |
| - | devtmpfs | + | Magic : a92b4efc |
| - | tmpfs 1.9G | + | Version : 1.2 |
| - | tmpfs | + | Feature Map : 0x0 |
| - | tmpfs 1.9G | + | Array UUID : fd8bac53: |
| - | / | + | Name : centos7.fenestros.loc:1 |
| - | / | + | |
| - | tmpfs 374M | + | Raid Level : raid5 |
| - | tmpfs 374M 1.2M 373M | + | Raid Devices : 3 |
| - | / | + | |
| - | </ | + | |
| - | ====2.6 - Installer le Nouveau Noyau==== | + | Avail Dev Size : 1021952 (499.08 MiB 523.24 MB) |
| + | Array Size : 1021952 (998.17 MiB 1046.48 MB) | ||
| + | Data Offset : 2048 sectors | ||
| + | Super Offset : 8 sectors | ||
| + | | ||
| + | State : clean | ||
| + | Device UUID : 4569e15e: | ||
| - | Installez maintenant les paquets **kernel***. L' | + | Update Time : Tue Aug |
| + | Bad Block Log : 512 entries available at offset 72 sectors | ||
| + | | ||
| + | | ||
| - | < | + | |
| - | [root@centos8 x86_64]# dnf localinstall kernel-*.rpm | + | Chunk Size : 512K |
| - | Last metadata expiration check: 2:25:32 ago on Tue 20 Jul 2021 08:37:00 EDT. | + | |
| - | Dependencies resolved. | + | |
| - | =============================================================================================================================================================================================================== | + | |
| - | | + | |
| - | =============================================================================================================================================================================================================== | + | |
| - | Installing: | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | Downgrading: | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| - | Transaction Summary | + | |
| - | =============================================================================================================================================================================================================== | + | Array State : AAA (' |
| - | Install | + | |
| - | Downgrade | + | |
| - | + | ||
| - | Total size: 1.6 G | + | |
| - | Is this ok [y/N]: y | + | |
| </ | </ | ||
| - | A l' | + | A ce stade il est intéressant |
| < | < | ||
| - | [root@centos7 ~]# reboot | + | [root@centos7 ~]# mdadm --manage --set-faulty /dev/md1 /dev/sda5 |
| + | mdadm: set /dev/sda5 faulty in /dev/md1 | ||
| </ | </ | ||
| - | Connectez-vous en tant que trainee et devenez root. Listez ensuite les noyaux installés | + | L' |
| < | < | ||
| - | [root@centos8 | + | [root@centos7 |
| - | kernel-modules-4.18.0-305.3.1.el8.x86_64 | + | /dev/md1: |
| - | kernel-tools-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
| - | kernel-headers-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
| - | kernel-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64 | + | Raid Level : raid5 |
| - | kernel-debug-core-4.18.0-305.7.1.el8.i2tch.x86_64 | + | Array Size : 1021952 (998.17 MiB 1046.48 MB) |
| - | kernel-modules-internal-4.18.0-305.7.1.el8.i2tch.x86_64 | + | Used Dev Size : 510976 (499.08 MiB 523.24 MB) |
| - | kernel-modules-4.18.0-305.7.1.el8_4.x86_64 | + | Raid Devices : 3 |
| - | kernel-debug-modules-4.18.0-305.7.1.el8.i2tch.x86_64 | + | Total Devices : 3 |
| - | kernel-devel-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
| - | kernel-tools-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
| - | kernel-tools-libs-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
| - | kernel-debug-modules-internal-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
| - | kernel-cross-headers-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
| - | kernel-core-4.18.0-305.7.1.el8_4.x86_64 | + | |
| - | kernel-devel-4.18.0-305.7.1.el8_4.x86_64 | + | |
| - | kernel-debuginfo-common-x86_64-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
| - | kernel-debug-modules-extra-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
| - | kernel-debug-devel-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
| - | kernel-tools-libs-devel-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
| - | kernel-modules-extra-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
| - | kernel-4.18.0-305.7.1.el8_4.x86_64 | + | |
| - | kernel-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
| - | kernel-core-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
| - | kernel-selftests-internal-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
| - | kernel-debug-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
| - | kernel-debug-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
| - | kernel-4.18.0-305.3.1.el8.x86_64 | + | |
| - | kernel-core-4.18.0-305.3.1.el8.x86_64 | + | |
| - | kernel-modules-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
| - | kernel-ipaclones-internal-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
| - | </ | + | |
| - | Constatez l' | + | Update Time : Tue Aug 2 15:14:59 2016 |
| + | State : clean, degraded | ||
| + | | ||
| + | Working Devices : 2 | ||
| + | | ||
| + | Spare Devices : 0 | ||
| - | < | + | |
| - | [root@centos8 ~]# grep i2tch / | + | Chunk Size : 512K |
| - | saved_entry=95bd69e34a7444a7b58cb74fbfb86df2-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
| - | </ | + | |
| - | Dernièrement, | + | |
| + | UUID : fd8bac53: | ||
| + | | ||
| - | < | + | Number |
| - | [root@centos8 ~]# uname -r | + | 0 |
| - | 4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
| - | </code> | + | |
| - | + | ||
| - | =====LAB #3 - Gestion des Quotas===== | + | |
| - | + | ||
| - | Sous Linux il est possible de mettre en place des quotas par utilisateur et par groupe. Ceci étant, Linux ne sait pas gérer des quotas par répertoire, | + | |
| - | quotas par partition. L' | + | |
| - | + | ||
| - | Déconnectez-vous et reconnectez-vous **directement** en tant que root : | + | |
| - | + | ||
| - | < | + | |
| - | root@computeXX: | + | |
| - | root@10.0.2.45' | + | |
| - | Activate the web console with: systemctl enable --now cockpit.socket | + | |
| - | Last login: Wed Jul 21 11:14:31 2021 | + | |
| - | [root@centos8 ~]# | + | |
| </ | </ | ||
| - | Avant de mettre en place des quotas, configurer SELINUX en mode **permissive** afin de ne pas avoir d' | + | Il est maintenant nécessaire |
| < | < | ||
| - | [root@centos8 | + | [root@centos7 |
| - | Enforcing | + | mdadm: hot removed /dev/sda5 from /dev/md1 |
| - | [root@centos8 ~]# setenforce permissive | + | |
| - | [root@centos8 ~]# getenforce | + | |
| - | Permissive | + | |
| - | [root@centos8 ~]# | + | |
| </ | </ | ||
| - | Editez ensuite le fichier | + | A l' |
| < | < | ||
| - | [root@centos8 | + | [root@centos7 |
| - | [root@centos8 ~]# cat /etc/sysconfig/ | + | /dev/md1: |
| + | Version : 1.2 | ||
| + | Creation Time : Tue Aug 2 15:10:12 2016 | ||
| + | Raid Level : raid5 | ||
| + | Array Size : 1021952 (998.17 MiB 1046.48 MB) | ||
| + | Used Dev Size : 510976 (499.08 MiB 523.24 MB) | ||
| + | Raid Devices : 3 | ||
| + | Total Devices : 2 | ||
| + | Persistence : Superblock is persistent | ||
| - | # This file controls the state of SELinux on the system. | + | Update Time : Tue Aug 2 15:16:41 2016 |
| - | # SELINUX= can take one of these three values: | + | |
| - | # | + | Active Devices : 2 |
| - | # | + | Working Devices : 2 |
| - | # | + | Failed Devices : 0 |
| - | SELINUX=permissive | + | Spare Devices |
| - | # SELINUXTYPE= can take one of these three values: | + | |
| - | # | + | |
| - | # | + | |
| - | # mls - Multi Level Security protection. | + | |
| - | SELINUXTYPE=targeted | + | |
| - | </ | + | |
| + | Chunk Size : 512K | ||
| - | Commencez par vérifiez que le paquet **quota** est bien installé | + | |
| + | UUID : fd8bac53: | ||
| + | | ||
| - | < | + | Number |
| - | [root@centos8 ~]# rpm -qa | grep quota | + | 0 |
| - | quota-4.04-12.el8.x86_64 | + | 1 |
| - | quota-nls-4.04-12.el8.noarch | + | 3 |
| </ | </ | ||
| - | Editez le fichier **/ | + | Constatez maintenant l' |
| < | < | ||
| - | [root@centos8 | + | [root@centos7 |
| - | [root@centos8 ~]# cat /etc/fstab | + | Personalities : [raid6] [raid5] [raid4] |
| - | + | md1 : active raid5 sda11[3] sda8[1] | |
| - | # | + | |
| - | # / | + | |
| - | # Created by anaconda on Wed Jun 16 06:21:32 2021 | + | unused devices: < |
| - | # | + | |
| - | # 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=1c04981e-5317-4b73-9695-3ce25246835d /boot | + | |
| - | / | + | |
| - | UUID=f76d6b66-985b-4a91-af9c-4987e8c1443c /home | + | |
| </ | </ | ||
| - | Redémarrez la VM : | + | <WRAP center round important> |
| - | + | Notez que le RAID a été démarré | |
| - | <code> | + | |
| - | [root@centos8 ~]# reboot | + | |
| - | </ | + | |
| - | + | ||
| - | Reconnectez-vous **directement** en tant que root : | + | |
| - | + | ||
| - | < | + | |
| - | root@computeXX: | + | |
| - | root@10.0.2.45' | + | |
| - | Activate the web console with: systemctl enable --now cockpit.socket | + | |
| - | + | ||
| - | Last login: Wed Jul 21 11:19:46 2021 | + | |
| - | [root@centos8 ~]# | + | |
| - | </ | + | |
| - | + | ||
| - | Vérifiez ensuite que les options **usrquota** et **grpquota** soient prises en compte : | + | |
| - | + | ||
| - | < | + | |
| - | [root@centos8 ~]# cat /etc/mtab | grep /home | + | |
| - | /dev/sdc1 /home ext4 rw, | + | |
| - | </ | + | |
| - | + | ||
| - | ====3.1 - La Commande quotacheck==== | + | |
| - | + | ||
| - | Pour activer les quotas sur /home, il convient d' | + | |
| - | + | ||
| - | < | + | |
| - | [root@centos8 ~]# quotacheck -cugvm -f /dev/sdc1 | + | |
| - | quotacheck: Your kernel probably supports journaled quota but you are not using it. Consider switching to journaled quota to avoid running quotacheck after an unclean shutdown. | + | |
| - | quotacheck: Scanning /dev/sdc1 [/home] done | + | |
| - | quotacheck: Cannot stat old user quota file / | + | |
| - | quotacheck: Cannot stat old group quota file / | + | |
| - | quotacheck: Cannot stat old user quota file / | + | |
| - | quotacheck: Cannot stat old group quota file / | + | |
| - | quotacheck: Checked 6763 directories and 129772 files | + | |
| - | quotacheck: Old file not found. | + | |
| - | quotacheck: Old file not found. | + | |
| - | </ | + | |
| - | + | ||
| - | Les options de la commande quotacheck sont : | + | |
| - | + | ||
| - | < | + | |
| - | [root@centos8 ~]# quotacheck --help | + | |
| - | Utility for checking and repairing quota files. | + | |
| - | quotacheck [-gucbfinvdmMR] [-F < | + | |
| - | + | ||
| - | -u, --user | + | |
| - | -g, --group | + | |
| - | -c, --create-files | + | |
| - | -b, --backup | + | |
| - | -f, --force | + | |
| - | -i, --interactive | + | |
| - | -n, --use-first-dquot | + | |
| - | -v, --verbose | + | |
| - | -d, --debug | + | |
| - | -m, --no-remount | + | |
| - | -M, --try-remount | + | |
| - | continue even if it fails | + | |
| - | -R, --exclude-root | + | |
| - | -F, --format=formatname | + | |
| - | -a, --all check all filesystems | + | |
| - | -h, --help | + | |
| - | -V, --version | + | |
| - | + | ||
| - | Bugs to jack@suse.cz | + | |
| - | </ | + | |
| - | + | ||
| - | Les quotas ont été activés et les fichier **aquota.user** et **aquota.group** ont été créés dans le répertoire /home : | + | |
| - | + | ||
| - | < | + | |
| - | [root@centos8 ~]# ls -la /home | + | |
| - | total 40 | + | |
| - | drwxr-xr-x. | + | |
| - | dr-xr-xr-x. 17 root root 224 Jul 19 12:05 .. | + | |
| - | -rw-------. | + | |
| - | -rw-------. | + | |
| - | drwx------. | + | |
| - | drwxr-xr-x. 17 trainee trainee | + | |
| - | </ | + | |
| - | + | ||
| - | Créez maintenant un utilisateur **fenestros** | + | |
| - | + | ||
| - | < | + | |
| - | [root@centos8 ~]# groupadd fenestros && useradd fenestros -c FenestrOs -d / | + | |
| - | [root@centos8 ~]# passwd fenestros | + | |
| - | Changing password for user fenestros. | + | |
| - | New password: | + | |
| - | BAD PASSWORD: The password contains the user name in some form | + | |
| - | Retype new password: | + | |
| - | passwd: all authentication tokens updated successfully. | + | |
| - | </ | + | |
| - | + | ||
| - | ====3.2 - La Commande edquota==== | + | |
| - | + | ||
| - | Mettez en place maintenant un quota de 10Mo pour l' | + | |
| - | + | ||
| - | < | + | |
| - | [root@centos8 ~]# edquota -u fenestros -f /home | + | |
| - | </ | + | |
| - | + | ||
| - | L' | + | |
| - | + | ||
| - | < | + | |
| - | Disk quotas for user fenestros (uid 1001): | + | |
| - | Filesystem | + | |
| - | / | + | |
| - | </ | + | |
| - | + | ||
| - | Modifiez ce fichier ainsi : | + | |
| - | + | ||
| - | < | + | |
| - | Disk quotas for user fenestros (uid 1001): | + | |
| - | Filesystem | + | |
| - | / | + | |
| - | </ | + | |
| - | + | ||
| - | Sauvegardez et quittez le fichier. | + | |
| - | + | ||
| - | Les options de la commande **edquota** sont : | + | |
| - | + | ||
| - | < | + | |
| - | [root@centos8 ~]# edquota --help | + | |
| - | edquota: Usage: | + | |
| - | edquota [-rm] [-u] [-F formatname] [-p username] [-f filesystem] username ... | + | |
| - | edquota [-rm] -g [-F formatname] [-p groupname] [-f filesystem] groupname ... | + | |
| - | edquota [-rm] -P [-F formatname] [-p projectname] [-f filesystem] projectname ... | + | |
| - | edquota [-u|g|-P] [-F formatname] [-f filesystem] -t | + | |
| - | edquota [-u|g|-P] [-F formatname] [-f filesystem] -T username|groupname|projectname ... | + | |
| - | + | ||
| - | -u, --user | + | |
| - | -g, --group | + | |
| - | -P, --project | + | |
| - | -r, --remote | + | |
| - | -m, --no-mixed-pathnames | + | |
| - | -F, --format=formatname | + | |
| - | -p, --prototype=name | + | |
| - | --always-resolve | + | |
| - | composed only of digits | + | |
| - | -f, --filesystem=filesystem | + | |
| - | -t, --edit-period | + | |
| - | -T, --edit-times | + | |
| - | -h, --help | + | |
| - | -V, --version | + | |
| - | + | ||
| - | Bugs to: jack@suse.cz | + | |
| - | </ | + | |
| - | + | ||
| - | <WRAP center round important 60%> | + | |
| - | **Important** - Pour mettre en place un quota par group, la procédure est similaire. Il suffit d' | + | |
| </ | </ | ||
| - | ====3.3 | + | Pour ajouter un autre disque à notre RAID afin de remplacer /dev/sda5 il convient d' |
| - | + | ||
| - | Appliquez maintenant les quotas | + | |
| < | < | ||
| - | [root@centos8 | + | [root@centos7 |
| + | mdadm: added /dev/sda10 | ||
| </ | </ | ||
| - | Les options | + | L' |
| < | < | ||
| - | [root@centos8 | + | [root@centos7 |
| - | quotaon: Usage: | + | /dev/md1: |
| - | | + | |
| - | | + | |
| + | Raid Level : raid5 | ||
| + | Array Size : 1021952 (998.17 MiB 1046.48 MB) | ||
| + | Used Dev Size : 510976 (499.08 MiB 523.24 MB) | ||
| + | Raid Devices : 3 | ||
| + | Total Devices : 3 | ||
| + | Persistence : Superblock is persistent | ||
| - | -a, --all turn quotas on for all filesystems | + | Update Time : Tue Aug 2 15:19:06 2016 |
| - | -f, --off turn quotas off | + | State : clean |
| - | -u, --user | + | Active Devices : 3 |
| - | -g, --group | + | Working Devices : 3 |
| - | -P, --project | + | Failed Devices : 0 |
| - | -p, --print-state | + | |
| - | -x, --xfs-command=cmd | + | |
| - | -F, --format=formatname | + | |
| - | -v, --verbose | + | |
| - | -h, --help | + | |
| - | -V, --version | + | |
| - | </ | + | |
| - | De cette manière vous avez mis en place un quota **souple** pour fenestros de 8 000 Ko et un quota **stricte** de 10 000 Ko. | + | |
| + | Chunk Size : 512K | ||
| - | Quand l' | + | Name : centos7.fenestros.loc:1 (local to host centos7.fenestros.loc) |
| + | UUID : fd8bac53: | ||
| + | | ||
| - | Il est à noter que vous pouvez soit mettre en place un quota en taille, soit mettre en place un quota basé sur le nombre d' | + | Number |
| - | + | | |
| - | <WRAP center round important 60%> | + | 1 |
| - | **important** - La commande pour désactivez les quotas est **quotaoff**. | + | 3 |
| - | </ | + | |
| - | + | ||
| - | ====3.4 - La Commande repquota==== | + | |
| - | + | ||
| - | Pour visualiser les quotas utilisez la commande **repquota** : | + | |
| - | + | ||
| - | < | + | |
| - | [root@centos8 ~]# repquota | + | |
| - | *** Report for user quotas on device | + | |
| - | Block grace time: 7days; Inode grace time: 7days | + | |
| - | Block limits | + | |
| - | User used soft hard grace used soft hard grace | + | |
| - | ---------------------------------------------------------------------- | + | |
| - | root -- 20 | + | |
| - | trainee | + | |
| - | | + | |
| </ | </ | ||
| - | <WRAP center round important 60%> | + | Naturellement, |
| - | **Important** - Notez que l' | + | |
| - | </ | + | |
| - | + | ||
| - | Les options de la commande **repquota** sont : | + | |
| < | < | ||
| - | [root@centos8 | + | [root@centos7 |
| - | repquota: Utility for reporting quotas. | + | [root@centos7 |
| - | Usage: | + | [root@centos7 |
| - | repquota [-vugsi] [-c|C] [-t|n] [-F quotaformat] [-O (default | xml | csv)] (-a | mntpoint) | + | DEVICES |
| - | + | ARRAY /dev/md1 metadata=1.2 name=centos7.fenestros.loc:1 UUID=fd8bac53:1457a4f4:30feab84:e0f9d8e0 | |
| - | -v, --verbose | + | |
| - | -u, --user | + | |
| - | -g, --group | + | |
| - | -P, --project | + | |
| - | -s, --human-readable | + | |
| - | -t, --truncate-names | + | |
| - | -p, --raw-grace | + | |
| - | -n, --no-names | + | |
| - | -i, --no-autofs | + | |
| - | -c, --cache | + | |
| - | -C, --no-cache | + | |
| - | -F, --format=formatname | + | |
| - | -O, --output=format | + | |
| - | -a, --all | + | |
| - | -h, --help | + | |
| - | -V, --version | + | |
| - | + | ||
| - | Bugs to jack@suse.cz | + | |
| - | </code> | + | |
| - | + | ||
| - | ====3.5 - La Commande quota==== | + | |
| - | + | ||
| - | Pour visualiser les quotas d'un utilisateur spécifique, | + | |
| - | + | ||
| - | <code> | + | |
| - | [root@centos8 ~]# quota fenestros | + | |
| - | Disk quotas for user fenestros (uid 1001): no limited resources used | + | |
| - | [root@centos8 ~]# su - fenestros | + | |
| - | [fenestros@centos8 ~]$ touch test | + | |
| - | [fenestros@centos8 ~]$ exit | + | |
| - | logout | + | |
| - | [root@centos8 ~]# quota fenestros | + | |
| - | Disk quotas for user fenestros (uid 1001): | + | |
| - | | + | |
| - | | + | |
| - | </ | + | |
| - | + | ||
| - | Les options de la commande **quota** sont : | + | |
| - | + | ||
| - | < | + | |
| - | [root@centos8 | + | |
| - | quota: Usage: quota [-guPqvswim] [-l | [-Q | -A]] [-F quotaformat] | + | |
| - | quota [-qvswim] [-l | [-Q | -A]] [-F quotaformat] -u username ... | + | |
| - | quota [-qvswim] [-l | [-Q | -A]] [-F quotaformat] -g groupname ... | + | |
| - | quota [-qvswugPQm] [-F quotaformat] -f filesystem ... | + | |
| - | + | ||
| - | -u, --user | + | |
| - | -g, --group | + | |
| - | -P, --project | + | |
| - | -q, --quiet | + | |
| - | -v, --verbose | + | |
| - | -s, --human-readable | + | |
| - | --always-resolve | + | |
| - | composed of only digits | + | |
| - | -w, --no-wrap | + | |
| - | -p, --raw-grace | + | |
| - | -l, --local-only | + | |
| - | -Q, --quiet-refuse | + | |
| - | not respond | + | |
| - | -i, --no-autofs | + | |
| - | -F, --format=formatname | + | |
| - | -f, --filesystem-list | + | |
| - | -A, --all-nfs | + | |
| - | -m, --no-mixed-pathnames | + | |
| - | --show-mntpoint | + | |
| - | --hide-device | + | |
| - | -h, --help | + | |
| - | -V, --version | + | |
| - | + | ||
| - | Bugs to: jack@suse.cz | + | |
| - | </code> | + | |
| - | + | ||
| - | ====3.6 - La Commande warnquota==== | + | |
| - | + | ||
| - | La commande **warnquota** vérifie le ou les disques et envoie un message par mail à tout utilisateur qui a dépassé la limite soft. Elle est enrègle générale appelée par un job cron. Cependant elle peut aussi est appelée d'une manière intéractive. | + | |
| - | + | ||
| - | Sous RHEL/ | + | |
| - | + | ||
| - | < | + | |
| - | [root@centos8 | + | |
| - | /usr/bin/which: no warnquota in (/usr/local/sbin:/usr/local/bin:/usr/ | + | |
| - | </ | + | |
| - | + | ||
| - | Installez donc le paquet **quota-warnquota** : | + | |
| - | + | ||
| - | < | + | |
| - | [root@centos7 | + | |
| - | ... | + | |
| - | </ | + | |
| - | + | ||
| - | Les options de la commande **warnquota** sont : | + | |
| - | + | ||
| - | < | + | |
| - | [root@centos8 ~]# warnquota --help | + | |
| - | warnquota: Usage: | + | |
| - | warnquota [-ugsid] [-F quotaformat] [-c configfile] [-q quotatabfile] [-a adminsfile] [filesystem...] | + | |
| - | + | ||
| - | -u, --user | + | |
| - | -g, --group | + | |
| - | -s, --human-readable | + | |
| - | -i, --no-autofs | + | |
| - | -d, --no-details | + | |
| - | -F, --format=formatname | + | |
| - | -c, --config=config-file | + | |
| - | -q, --quota-tab=quotatab-file | + | |
| - | -a, --admins-file=admins-file | + | |
| - | -h, --help | + | |
| - | -v, --version | + | |
| - | + | ||
| - | warnquota: Bugs to jack@suse.cz | + | |
| </ | </ | ||
| ----- | ----- | ||
| - | Copyright © 2023 Hugh Norris. | + | < |
| + | <div align=" | ||
| + | Copyright © 2020 Hugh Norris. | ||
| + | </ | ||