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:avance:l102 [2021/06/25 09:42] – created admin | elearning:workbooks:centos:8:avance:l102 [2022/02/22 15:15] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
~~PDF: | ~~PDF: | ||
+ | |||
+ | Version : **2022.01** | ||
Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
- | ======LCF302 | + | ======LCF602 |
=====Contenu du Module===== | =====Contenu du Module===== | ||
- | * **LCF302 | + | * **LCF602 |
* Contenu du Module | * Contenu du Module | ||
- | * Concepts RAID | + | * Rôle du noyau |
- | * Disques en miroir | + | * LAB #1 - Modules |
- | * Bandes de données | + | * LAB #2 - Compilation et installation du noyau et des modules |
- | * Types de RAID | + | * 2.1 - Déplacer /home |
- | * RAID 0 - Concaténation | + | * 2.2 - Préparer l' |
- | * RAID 0 - Striping | + | * 2.3 - Préparer l' |
- | * RAID 1 - Miroir | + | * Le Fichier .config |
- | * RAID 1+0 - Striping en Miroir | + | * Le Fichier Makefile |
- | * RAID 2 - Miroir avec Contrôle d' | + | * 2.4 - Paramétrage du noyau |
- | * RAID 3 et 4 - Striping avec Parité | + | * 2.5 - Compiler le Noyau |
- | * RAID 5 - Striping avec Parité Distribuée | + | * 2.6 - Installer le Nouveau Noyau |
- | * Au délà de RAID 5 | + | * LAB #3 - Gestion des Quotas |
- | * RAID Logiciel sous RHEL/CentOS | + | * 3.1 - La Commande quotacheck |
- | * Préparation du disque | + | * 3.2 - La Commande edquota |
- | * Partitionnement | + | * 3.3 - La Commande quotaon |
- | * Mise en Place du RAID 5 Logiciel | + | * 3.4 - La Commande repquota |
+ | * 3.5 - La Commande quota | ||
+ | * 3.6 - La Commande warnquota | ||
- | =====Concepts RAID===== | + | =====Rôle du noyau===== |
- | Les solutions RAID ou //Redundant Array of Independent Disks// ou encore | + | Le noyau ou //kernel// est la partie du système d' |
- | Les solutions RAID sont issues | + | * la diminution de la taille |
+ | * 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, | + | < |
- | * Amélioration des performances, | + | [root@centos8 ~]# dnf update |
- | * Apporter la tolérance de panne. | + | ... |
+ | [root@centos8 ~]# reboot | ||
+ | </ | ||
- | Deux concepts sont fondamentaux à la compréhension des solutions RAID. | + | Identifiez ensuite le noyau utilisé par votre machine virtuelle : |
- | ====Disques en miroir==== | + | < |
+ | [root@centos8 ~]# uname -r | ||
+ | 4.18.0-305.7.1.el8_4.x86_64 | ||
+ | </ | ||
- | La technique des disques en miroir consiste à dupliquer l' | + | =====LAB #1 - Modules===== |
- | ====Bandes | + | Dans le cas d'une utilisation courante |
- | 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 | ||
+ | </ | ||
- | =====Types de RAID===== | + | Les commandes pour manipuler les modules sont : |
- | ====RAID 0 - Concaténation==== | + | * insmod |
+ | * rmmod | ||
+ | * lsmod | ||
+ | * modprobe | ||
- | Création de volume par récupération de l' | + | Par exemple : |
- | {{: | + | < |
+ | [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 | ||
+ | </ | ||
- | ===Avantages=== | + | 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 : |
- | * 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-- | ||
+ | </ | ||
- | ===Inconvénients=== | + | 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 : |
- | * 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> | ||
- | ====RAID 0 - Striping==== | + | Les dépendances des modules sont résolues par la commande **modprobe** grâce aux fichier **/ |
- | 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%) | ||
+ | </ | ||
- | {{:linux: | + | Il est possible d' |
- | ===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 | ||
- | * Pas de protection des données. | + | [root@centos8 ~]# cat / |
+ | # 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 | ||
+ | </ | ||
- | ====RAID 1 - Miroir==== | + | =====LAB #2 - Compilation et installation du noyau et des modules===== |
- | Création d'un volume où les disques sont en miroir. Quand les deux disques sont connectés | + | Activez le dépôt **CentOS-Linux-PowerTools** |
- | {{: | + | < |
+ | [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. | ||
- | ===Avantages=== | + | [powertools] |
+ | name=CentOS Linux $releasever - PowerTools | ||
+ | mirrorlist=http:// | ||
+ | # | ||
+ | gpgcheck=1 | ||
+ | enabled=1 | ||
+ | gpgkey=file:/// | ||
+ | </ | ||
- | * Protection des données contre une défaillance d'un disque. | + | Installez maintenant les paquets nécessaires : |
- | ===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 | ||
+ | ... | ||
+ | </ | ||
- | * Coûteux à cause de l' | + | ====2.1 - Déplacer /home==== |
- | ====RAID 1+0 - Striping | + | <WRAP center round alert 60%> |
+ | **Important** | ||
+ | </ | ||
- | Le RAID 1+0 ou encore | + | <WRAP center round todo 60%> |
+ | **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 | ||
+ | </ | ||
- | {{:linux: | + | Créez ensuite une seule partition sur **/ |
- | ===Avantages=== | + | < |
+ | [root@centos8 ~]# fdisk /dev/sdc | ||
- | * Protection des données contre une défaillance d'un disque. | + | Welcome to fdisk (util-linux 2.32.1). |
- | * Augmentation des performances d'E/S par écriture en parallèle sur les disques. | + | Changes will remain in memory only, until you decide to write them. |
+ | Be careful before using the write command. | ||
- | ===Inconvénients=== | + | Device does not contain a recognized partition table. |
+ | Created a new DOS disklabel with disk identifier 0xc321702b. | ||
- | | + | Command (m for help): n |
+ | Partition type | ||
+ | | ||
+ | | ||
+ | Select (default p): | ||
- | ====RAID 2 - Miroir avec Contrôle d' | + | Using default response p. |
+ | Partition number (1-4, default 1): | ||
+ | First sector (2048-41943039, | ||
+ | Last sector, +sectors or +size{K, | ||
- | 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. | + | Created a new partition 1 of type 'Linux' and of size 20 GiB. |
- | ====RAID 3 et 4 - Striping avec Parité==== | + | Command (m for help): w |
+ | The partition table has been altered. | ||
+ | Calling ioctl() to re-read partition table. | ||
+ | Syncing disks. | ||
+ | </ | ||
- | Les RAID 3 et 4 sont des technologies avec bandes | + | Créez maintenant un système |
- | {{: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 | ||
- | 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). | + | Allocating group tables: done |
+ | Writing inode tables: done | ||
+ | Creating journal (65536 blocks): done | ||
+ | Writing superblocks and filesystem accounting information: | ||
+ | </ | ||
- | 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. | + | Montez **/ |
- | ===Avantages=== | + | < |
+ | [root@centos8 ~]# mount /dev/sdc1 /mnt | ||
+ | </ | ||
- | * Protection des données contre une défaillance d'un disque. | + | Copiez le contenu de /home vers /mnt : |
- | ===Inconvénients=== | + | < |
+ | [root@centos8 ~]# cp -a /home/* /mnt | ||
+ | </ | ||
- | * Création d'un goulot d' | + | Démontez /dev/sdc1 et déplacez /home vers /root : |
- | ====RAID 5 - Striping avec Parité Distribuée==== | + | < |
+ | [root@centos8 ~]# umount /mnt | ||
+ | [root@centos8 ~]# mv /home /root | ||
+ | </ | ||
- | Le RAID 5 est une technologie avec bandes | + | Identifiez l' |
- | {{:linux:raid5.gif|}} | + | < |
+ | [root@centos8 ~]# ls -l / | ||
+ | lrwxrwxrwx. 1 root root 10 Jul 19 12:02 f76d6b66-985b-4a91-af9c-4987e8c1443c -> ../../sdc | ||
+ | [root@centos8 ~]# | ||
+ | </ | ||
- | ===Avantages=== | + | Editez le fichier **/ |
- | * Protection des données contre une défaillance d'un disque, | + | < |
- | * Evite le goulot d' | + | [root@centos8 ~]# vi / |
+ | [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 | ||
+ | </ | ||
- | * Lecture moins performante qu' | + | Créez le point de montage /home : |
- | ====Au délà de RAID 5==== | + | < |
+ | [root@centos8 ~]# mkdir /home | ||
+ | </ | ||
- | Il existe aussi deux autres technologies RAID, toute deux issues de la technologie RAID 5 : | + | Montez / |
- | * RAID 6 | + | < |
- | | + | [root@centos8 ~]# mount -a |
- | * RAID TP | + | [root@centos8 ~]# mount |
- | | + | 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> | ||
- | =====RAID Logiciel sous RHEL/CentOS===== | + | Notez la taille de /home : |
- | ====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**. | ||
+ | </ | ||
- | ===Partitionnement=== | + | ====2.2 - Préparer l' |
- | Suite à votre LAB de la leçon | + | Pour créer l' |
< | < | ||
- | [root@centos7 | + | [trainee@centos8 |
+ | ...> | ||
+ | [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. | ||
- | Disk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectors | + | rpmbuild/BUILD: |
- | Units = sectors of 1 * 512 = 512 bytes | + | total 8 |
- | Sector size (logical/ | + | drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 . |
- | I/O size (minimum/ | + | drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 .. |
- | Disk label type: dos | + | |
- | Disk identifier: 0x000c5a90 | + | |
- | | + | rpmbuild/RPMS: |
- | /dev/ | + | total 8 |
- | / | + | drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 . |
- | / | + | drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 .. |
- | / | + | |
- | / | + | rpmbuild/SOURCES: |
- | /dev/ | + | total 8 |
- | / | + | drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 . |
- | / | + | drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 .. |
- | / | + | |
- | /dev/ | + | rpmbuild/SPECS: |
- | /dev/ | + | total 8 |
- | / | + | 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 .. | ||
</ | </ | ||
- | ====Mise en Place du RAID 5 Logiciel==== | + | Téléchargez le rpm source |
- | 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 |
- | /dev/sda5 25085952 | + | CentOS |
- | / | + | |
- | / | + | |
- | / | + | |
- | </ | + | |
- | La création d'une unité RAID avec la commande **mdadm** se fait grâce aux options passées | + | [trainee@centos8 ~]$ wget https:// |
+ | --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 | ||
< | < | ||
- | mdadm --create <unité RAID> | + | [trainee@centos8 ~]$ su - |
+ | Mot de passe : fenestros | ||
+ | |||
+ | [root@centos8 ~]# dnf install yum-utils | ||
+ | ... | ||
+ | |||
+ | [root@centos8 ~]# yum-builddep / | ||
+ | ... | ||
</ | </ | ||
- | Par exemple, saisissez la commande suivante | + | Installez maintenant le paquet **kernel-4.18.0-305.7.1.el8_4.src.rpm** |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | mdadm: Defaulting to version 1.2 metadata | + | logout |
- | mdadm: array /dev/md1 started. | + | [trainee@centos8 ~]$ rpm -Uvh kernel-4.18.0-305.7.1.el8_4.src.rpm |
+ | 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 | ||
</ | </ | ||
- | Les options dans la ligne de commande | + | <WRAP center round important 60%> |
+ | **Important** - Les erreurs | ||
+ | </ | ||
- | ^ Option Courte ^ Option Longue ^ Description ^ | + | ====2.3 - Préparer l' |
- | | -l | - -level | Le niveau RAID - **linear, 0,1,2,4 ou 5** | | + | |
- | | -n | - -raid-devices=< | + | |
- | Les autres options de la commande | + | Naviguez vers le repertoire |
< | < | ||
- | [root@centos7 ~]# mdadm --help-options | + | [trainee@centos7 ~]$ cd ~/ |
- | Any parameter that does not start with '-' is treated as a device name | + | [trainee@centos7 SPECS]$ rpmbuild |
- | 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. | + | |
- | Some common options are: | + | A l'issu du processus, examinez l'arborescence |
- | --help | + | |
- | mode specific help message | + | |
- | --help-options | + | |
- | --version | + | |
- | --verbose | + | |
- | --quiet | + | |
- | --brief | + | |
- | --export | + | |
- | | + | |
- | --force | + | |
- | | + | < |
- | --build -B : Build an array without metadata | + | [trainee@centos8 SPECS]$ ls -la ~/ |
- | --create | + | total 812 |
- | --detail | + | drwxr-xr-x. |
- | --examine | + | drwxr-xr-x. |
- | --examine-bitmap | + | drwxr-xr-x. |
- | --examine-badblocks: Display list of known bad blocks on device | + | drwxr-xr-x. 3 trainee trainee |
- | --monitor | + | drwxr-xr-x. 2 trainee trainee |
- | --grow | + | -rw-r--r--. |
- | --incremental | + | -rw-r--r--. |
- | --query -Q : Display general information about how a | + | drwxr-xr-x. |
- | device relates to the md driver | + | -rw-r--r--. |
- | --auto-detect | + | -rw-r--r--. |
+ | 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. | ||
</ | </ | ||
- | Les //modes majeurs// | + | ===Le Fichier .config=== |
+ | |||
+ | Changez | ||
< | < | ||
- | [root@centos7 | + | [trainee@centos8 SPECS]$ cd ~/rpmbuild/BUILD/kernel-*/linux-*/ |
- | 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. | + | |
- | For detailed help on the above major modes use --help after the mode | + | Copiez le fichier **configs/ |
- | e.g. | + | |
- | | + | < |
- | For general help on options use | + | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ cp configs/ |
- | mdadm --help-options | + | |
</ | </ | ||
- | Dernièrement, | + | Mettez à jour le fichier .config par rapport à la configuration actuelle du noyau : |
< | < | ||
- | [root@centos7 ~]# mdadm --assemble --help | + | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ make oldconfig |
- | Usage: mdadm --assemble device options... | + | scripts/ |
- | mdadm --assemble --scan options... | + | # |
+ | # configuration written to .config | ||
+ | # | ||
+ | </ | ||
- | This usage assembles one or more raid arrays from pre-existing | + | <WRAP center round important 60%> |
- | components. | + | **Important** |
- | 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. | + | |
- | The md device is given on the command line, is found listed in the | + | 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 : |
- | 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. | + | |
- | The different combinations of these are as follows: | + | * make config |
- | If the --scan option is not given, then only devices and identities | + | * make menuconfig |
- | listed on the command line are considered. | + | * make xconfig |
- | The first device will be the array device, and the remainder will be | + | |
- | examined when looking for components. | + | Exécutez la commande **make menuconfig** : |
- | 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 | + | < |
- | every array listed in the config file is considered for assembly. | + | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ make menuconfig |
- | 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 | ||
+ | # | ||
+ | </ | ||
- | If the --scan option is given as well as one or more devices, then | + | Dans l' |
- | Those devices are md devices that are to be assembled. | + | |
- | and components are determined from the config file. | + | |
- | If mdadm can not find all of the components for an array, it will assemble | + | * **y**, |
- | it but not activate it unless --run or --scan is given. | + | * la fonctionalité est incluse dans le noyau monolithique ou dans le cas d'une dépendance d'un module, dans le module concerné, |
- | | + | |
- | components" | + | * la fonctionalité est incluse en tant que module, |
- | as recorded in the superblock. | + | * **n**, |
- | the missing device is not a new problem, it will still be assembled. | + | * la fonctionalité n'est pas incluse. |
- | is only newly missing devices that cause the array not to be started. | + | |
- | Options that are valid with --assemble (-A) are: | + | <WRAP center round important 60%> |
- | --bitmap= | + | **Important** |
- | --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 | + | |
</ | </ | ||
- | Constatez maintenant les informations concernant | + | Vérifiez que le fichier **.config** a été" |
< | < | ||
- | [root@centos7 ~]# cat / | + | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ ls -a |
- | Personalities : [raid6] [raid5] [raid4] | + | . certs configs |
- | md1 : active raid5 sda11[3] sda8[1] sda5[0] | + | .. |
- | | + | arch |
- | + | block .config | |
- | unused devices: < | + | |
</ | </ | ||
- | Grâce à la commande mdadm, il est possible d' | + | Consultez ce fichier |
< | < | ||
- | [root@centos7 ~]# mdadm --query /dev/md1 | + | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ more .config |
- | /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%) | ||
</ | </ | ||
- | L' | + | ===Le Fichier Makefile=== |
+ | |||
+ | 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' | ||
< | < | ||
- | [root@centos7 ~]# mdadm --detail /dev/md1 | + | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ more Makefile |
- | /dev/md1: | + | # SPDX-License-Identifier: GPL-2.0 |
- | Version : 1.2 | + | VERSION = 4 |
- | | + | PATCHLEVEL = 18 |
- | Raid Level : raid5 | + | SUBLEVEL = 0 |
- | Array Size : 1021952 (998.17 MiB 1046.48 MB) | + | EXTRAVERSION = |
- | Used Dev Size : 510976 (499.08 MiB 523.24 MB) | + | NAME = Merciless Moray |
- | Raid Devices : 3 | + | |
- | Total Devices : 3 | + | |
- | Persistence : Superblock is persistent | + | |
- | Update Time : Tue Aug 2 15:10:17 2016 | + | # |
- | State : clean | + | # DRM backport version |
- | Active Devices : 3 | + | # |
- | Working Devices : 3 | + | RHEL_DRM_VERSION = 5 |
- | Failed Devices : 0 | + | RHEL_DRM_PATCHLEVEL = 9 |
- | Spare Devices : 0 | + | RHEL_DRM_SUBLEVEL = 14 |
- | | + | # *DOCUMENTATION* |
- | Chunk Size : 512K | + | # To see a list of typical targets execute "make help" |
+ | # 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. | ||
- | Name : centos7.fenestros.loc: | + | # That's our default target when none is given on the command line |
- | UUID : fd8bac53: | + | PHONY := _all |
- | Events | + | _all: |
- | Number | + | # o Do not use make's built-in rules and variables |
- | 0 | + | # |
- | 1 | + | # o Look for make include files relative to root of kernel src |
- | 3 | + | MAKEFLAGS += -rR --include-dir=$(CURDIR) |
+ | |||
+ | # 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%) | ||
</ | </ | ||
- | Notez la ligne **Persistence : Superblock is persistent**. En effet, cette implémentation | + | <WRAP center round important 60%> |
+ | **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 | ||
+ | </ | ||
- | <WRAP center round todo> | + | ====2.4 - Paramétrage du noyau==== |
- | 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 | ||
</ | </ | ||
- | Cependant, il necéssaire de renseigner | + | A l'issu du processus, les RPMs se trouvent dans le répertoire |
< | < | ||
- | [root@centos7 ~]# echo ' | + | ... |
- | [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: / | ||
+ | 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' | ||
< | < | ||
- | [root@centos7 ~]# mdadm --examine | + | [trainee@centos8 x86_64]$ df -h |
- | /dev/sda5: | + | Filesystem |
- | Magic : a92b4efc | + | devtmpfs |
- | Version : 1.2 | + | tmpfs 1.9G |
- | Feature Map : 0x0 | + | tmpfs |
- | Array UUID : fd8bac53: | + | tmpfs 1.9G |
- | Name : centos7.fenestros.loc:1 | + | / |
- | | + | / |
- | Raid Level : raid5 | + | tmpfs 374M |
- | Raid Devices : 3 | + | tmpfs 374M 1.2M 373M |
+ | / | ||
+ | </ | ||
- | Avail Dev Size : 1021952 (499.08 MiB 523.24 MB) | + | ====2.6 - Installer le Nouveau Noyau==== |
- | Array Size : 1021952 (998.17 MiB 1046.48 MB) | + | |
- | Data Offset : 2048 sectors | + | |
- | Super Offset : 8 sectors | + | |
- | | + | |
- | State : clean | + | |
- | Device UUID : 4569e15e: | + | |
- | Update Time : Tue Aug | + | Installez maintenant les paquets **kernel***. L' |
- | Bad Block Log : 512 entries available at offset 72 sectors | + | |
- | | + | |
- | | + | |
- | | + | < |
- | Chunk Size : 512K | + | [root@centos8 x86_64]# dnf localinstall kernel-*.rpm |
+ | 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 ce stade il est intéressant de noter comment réagir lors d'une défaillance d'un disque. Dans notre cas nous allons indiquer au système que la partition /dev/sda5 est devenue défaillante | + | A l'issu de l'installation, |
< | < | ||
- | [root@centos7 ~]# mdadm --manage --set-faulty /dev/md1 /dev/sda5 | + | [root@centos7 ~]# reboot |
- | mdadm: set /dev/sda5 faulty in /dev/md1 | + | |
</ | </ | ||
- | L' | + | Connectez-vous en tant que trainee et devenez root. Listez ensuite les noyaux installés |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | /dev/md1: | + | kernel-modules-4.18.0-305.3.1.el8.x86_64 |
- | | + | kernel-tools-4.18.0-305.7.1.el8.i2tch.x86_64 |
- | | + | kernel-headers-4.18.0-305.7.1.el8.i2tch.x86_64 |
- | Raid Level : raid5 | + | kernel-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64 |
- | Array Size : 1021952 (998.17 MiB 1046.48 MB) | + | kernel-debug-core-4.18.0-305.7.1.el8.i2tch.x86_64 |
- | Used Dev Size : 510976 (499.08 MiB 523.24 MB) | + | kernel-modules-internal-4.18.0-305.7.1.el8.i2tch.x86_64 |
- | Raid Devices : 3 | + | kernel-modules-4.18.0-305.7.1.el8_4.x86_64 |
- | Total Devices : 3 | + | kernel-debug-modules-4.18.0-305.7.1.el8.i2tch.x86_64 |
- | | + | 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 | ||
+ | </ | ||
- | Update Time : Tue Aug 2 15:14:59 2016 | + | Constatez l' |
- | State : clean, degraded | + | |
- | | + | |
- | Working Devices : 2 | + | |
- | | + | |
- | Spare Devices : 0 | + | |
- | | + | < |
- | Chunk Size : 512K | + | [root@centos8 ~]# grep i2tch / |
+ | saved_entry=95bd69e34a7444a7b58cb74fbfb86df2-4.18.0-305.7.1.el8.i2tch.x86_64 | ||
+ | </ | ||
- | | + | Dernièrement, |
- | UUID : fd8bac53: | + | |
- | | + | |
- | Number | + | < |
- | 0 | + | [root@centos8 ~]# uname -r |
- | | + | 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 ~]# | ||
</ | </ | ||
- | Il est maintenant nécessaire | + | Avant de mettre en place des quotas, configurer SELINUX en mode **permissive** afin de ne pas avoir d' |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | mdadm: hot removed /dev/sda5 from /dev/md1 | + | Enforcing |
+ | [root@centos8 ~]# setenforce permissive | ||
+ | [root@centos8 ~]# getenforce | ||
+ | Permissive | ||
+ | [root@centos8 ~]# | ||
</ | </ | ||
- | A l' | + | Editez ensuite le fichier |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | /dev/md1: | + | [root@centos8 ~]# cat /etc/sysconfig/ |
- | 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 | + | |
- | Update Time : Tue Aug 2 15:16:41 2016 | + | # This file controls the state of SELinux on the system. |
- | | + | # SELINUX= can take one of these three values: |
- | Active Devices : 2 | + | # |
- | Working Devices : 2 | + | # |
- | Failed Devices : 0 | + | # |
- | Spare Devices | + | SELINUX=permissive |
+ | # 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 | + | < |
- | 0 | + | [root@centos8 ~]# rpm -qa | grep quota |
- | 1 | + | quota-4.04-12.el8.x86_64 |
- | 3 | + | quota-nls-4.04-12.el8.noarch |
</ | </ | ||
- | Constatez maintenant l' | + | Editez le fichier **/ |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | Personalities : [raid6] [raid5] [raid4] | + | [root@centos8 ~]# cat /etc/fstab |
- | md1 : active raid5 sda11[3] sda8[1] | + | |
- | | + | # |
- | + | # / | |
- | unused devices: < | + | # 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 | ||
</ | </ | ||
- | <WRAP center round important> | + | Redémarrez la VM : |
- | 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' | ||
</ | </ | ||
- | Pour ajouter un autre disque à notre RAID afin de remplacer /dev/sda5 il convient d' | + | ====3.3 |
+ | |||
+ | Appliquez maintenant les quotas | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | mdadm: added /dev/sda10 | + | |
</ | </ | ||
- | L' | + | Les options |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | /dev/md1: | + | quotaon: Usage: |
- | | + | |
- | | + | |
- | 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 | + | |
- | Update Time : Tue Aug 2 15:19:06 2016 | + | -a, --all turn quotas on for all filesystems |
- | State : clean | + | -f, --off turn quotas off |
- | Active Devices : 3 | + | -u, --user |
- | Working Devices : 3 | + | -g, --group |
- | Failed Devices : 0 | + | -P, --project |
- | | + | -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 | + | |
- | Name : centos7.fenestros.loc:1 (local to host centos7.fenestros.loc) | + | Quand l' |
- | UUID : fd8bac53: | + | |
- | | + | |
- | Number | + | 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' |
- | | + | |
- | 1 | + | <WRAP center round important 60%> |
- | 3 | + | **important** - La commande pour désactivez les quotas est **quotaoff**. |
+ | </ | ||
+ | |||
+ | ====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 | ||
+ | | ||
</ | </ | ||
- | Naturellement, | + | <WRAP center round important 60%> |
+ | **Important** - Notez que l' | ||
+ | </ | ||
+ | |||
+ | Les options de la commande **repquota** sont : | ||
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | [root@centos7 | + | repquota: Utility for reporting quotas. |
- | [root@centos7 | + | Usage: |
- | DEVICES | + | repquota [-vugsi] [-c|C] [-t|n] [-F quotaformat] [-O (default | xml | csv)] (-a | mntpoint) |
- | 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 © 2022 Hugh Norris. |
- | <div align=" | + | |
- | Copyright © 2020 Hugh Norris. | + | |
- | </ | + |