Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
elearning:workbooks:debian:10:junior:l121 [2023/08/24 11:03] – created admin | elearning:workbooks:debian:10:junior:l121 [2024/03/08 10:36] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
~~PDF: | ~~PDF: | ||
- | Version : **2022.01** | + | Version : **2024.01** |
Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
- | ======LDF512 - Gestion | + | ======LDF512 - Gestion des Disques Avancée - Raid Logiciel====== |
=====Contenu du Module===== | =====Contenu du Module===== | ||
- | * **LDF512 - Gestion | + | * **LDF512 - Gestion |
* Contenu du Module | * Contenu du Module | ||
- | * Rôle du noyau | + | * Concepts RAID |
- | * LAB #1 - Compilation et installation du noyau | + | * Disques en miroir |
- | * 1.1 - Déplacer /home | + | * Bandes de données |
- | * 1.2 - Télécharger le Code Source du Noyau | + | * Types de RAID |
- | * 1.3 - Configurer le Noyau | + | * RAID 0 - Concaténation |
- | * 1.4 - Compiler le Noyau | + | * RAID 0 - Striping |
- | * 1.5 - Installer le Nouveau Noyau | + | * RAID 1 - Miroir |
- | * 1.6 - Désinstaller un Noyau | + | * RAID 1+0 - Striping en Miroir |
- | * LAB #2 - Mise à Jour du Noyau avec le Gestionnaire des Paquets | + | * RAID 2 - Miroir |
- | * LAB #3 - Gestion des Quotas | + | * RAID 3 et 4 - Striping avec Parité |
- | * 3.1 - La Commande quotacheck | + | * RAID 5 - Striping avec Parité Distribuée |
- | * 3.2 - La Commande edquota | + | * Au délà de RAID 5 |
- | * 3.3 - La Commande quotaon | + | * RAID Logiciel sous Debian |
- | * 3.4 - La Commande repquota | + | * Préparation du disque |
- | * 3.5 - La Commande quota | + | * Partitionnement |
- | * 3.6 - La Commande warnquota | + | * Mise en Place du RAID 5 Logiciel |
- | =====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 identifier le noyau utilisé par votre machine : | + | * Addition des capacités, |
+ | * Amélioration des performances, | ||
+ | * Apporter la tolérance de panne. | ||
- | < | + | Deux concepts sont fondamentaux à la compréhension des solutions RAID. |
- | root@debian11: | + | |
- | 5.10.0-13-amd64 | + | |
- | </ | + | |
- | Dans le cas d'une utilisation courante de Linux, il est cependant préférable de faire appel aux **modules**. Les modules se trouvent dans le répertoire **/ | + | ====Disques en miroir==== |
- | < | + | La technique des disques en miroir consiste à dupliquer l' |
- | root@debian11: | + | |
- | kernel | + | |
- | modules.alias | + | |
- | </ | + | |
- | Les commandes pour manipuler les modules sont : | + | ====Bandes de données==== |
- | * insmod | + | La technique des bandes de données, autrement appelée //data striping// consiste à couper les données à enregistrer en segments séquentiels et contigus pour les enregistrer sur plusieurs disques physiques. L' |
- | * rmmod | + | |
- | * lsmod | + | |
- | * modprobe | + | |
- | Par exemple : | + | =====Types de RAID===== |
- | < | + | ====RAID |
- | root@debian11: | + | |
- | Module | + | |
- | rfkill | + | |
- | raid456 | + | |
- | async_raid6_recov | + | |
- | async_memcpy | + | |
- | async_pq | + | |
- | async_xor | + | |
- | async_tx | + | |
- | md_mod | + | |
- | sg | + | |
- | virtio_balloon | + | |
- | joydev | + | |
- | qemu_fw_cfg | + | |
- | pcspkr | + | |
- | serio_raw | + | |
- | evdev 28672 2 | + | |
- | ecryptfs | + | |
- | parport_pc | + | |
- | ppdev 24576 0 | + | |
- | lp | + | |
- | parport | + | |
- | fuse 167936 | + | |
- | configfs | + | |
- | ip_tables | + | |
- | x_tables | + | |
- | autofs4 | + | |
- | ext4 921600 | + | |
- | crc16 16384 1 ext4 | + | |
- | mbcache | + | |
- | jbd2 151552 | + | |
- | hid_generic | + | |
- | btrfs 1568768 | + | |
- | usbhid | + | |
- | hid | + | |
- | blake2b_generic | + | |
- | xor 24576 2 async_xor, | + | |
- | raid6_pq | + | |
- | libcrc32c | + | |
- | crc32c_generic | + | |
- | usb_storage | + | |
- | dm_mod | + | |
- | sd_mod | + | |
- | t10_pi | + | |
- | crc_t10dif | + | |
- | crct10dif_generic | + | |
- | crct10dif_common | + | |
- | sr_mod | + | |
- | cdrom 73728 1 sr_mod | + | |
- | virtio_net | + | |
- | net_failover | + | |
- | failover | + | |
- | virtio_scsi | + | |
- | bochs_drm | + | |
- | ata_generic | + | |
- | drm_vram_helper | + | |
- | uhci_hcd | + | |
- | drm_ttm_helper | + | |
- | ttm | + | |
- | ehci_hcd | + | |
- | drm_kms_helper | + | |
- | cec 61440 1 drm_kms_helper | + | |
- | psmouse | + | |
- | drm | + | |
- | usbcore | + | |
- | ata_piix | + | |
- | virtio_pci | + | |
- | libata | + | |
- | virtio_ring | + | |
- | virtio | + | |
- | i2c_piix4 | + | |
- | scsi_mod | + | |
- | usb_common | + | |
- | floppy | + | |
- | button | + | |
- | </ | + | |
- | Pour ajouter | + | Création de volume par récupération de l' |
- | < | + | {{:linux: |
- | root@debian11:~# modprobe bonding | + | |
- | root@debian11: | + | ===Avantages=== |
- | Module | + | |
- | bonding | + | |
- | rfkill | + | |
- | raid456 | + | |
- | async_raid6_recov | + | |
- | async_memcpy | + | |
- | async_pq | + | |
- | async_xor | + | |
- | async_tx | + | |
- | md_mod | + | |
- | </ | + | |
- | 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=== |
- | root@debian11: | + | |
- | root@debian11: | + | |
- | Module | + | |
- | rfkill | + | |
- | raid456 | + | |
- | async_raid6_recov | + | |
- | async_memcpy | + | |
- | async_pq | + | |
- | async_xor | + | |
- | async_tx | + | |
- | md_mod | + | |
- | sg | + | |
- | </ | + | |
- | Les dépendances | + | * Pas de protection |
+ | | ||
- | < | + | ====RAID 0 - Striping==== |
- | root@debian11: | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | mmon.ko kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | crypto/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | --More--(0%) | + | |
- | [q] | + | |
- | </ | + | |
- | Il est possible | + | Création de volume sur plusieurs disques afin d' |
- | < | + | {{:linux:raid0s.gif|}} |
- | root@debian11:~# modinfo bonding | + | |
- | filename: / | + | |
- | author: | + | |
- | description: | + | |
- | license: | + | |
- | alias: | + | |
- | depends: | + | |
- | retpoline: | + | |
- | intree: | + | |
- | name: | + | |
- | vermagic: | + | |
- | sig_id: | + | |
- | signer: | + | |
- | sig_key: | + | |
- | sig_hashalgo: | + | |
- | signature: | + | |
- | EC: | + | |
- | 77: | + | |
- | CD: | + | |
- | 29: | + | |
- | F1: | + | |
- | 84: | + | |
- | 73: | + | |
- | 9D: | + | |
- | 4A: | + | |
- | D7: | + | |
- | 85: | + | |
- | 0D: | + | |
- | 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, | + | ===Avantages=== |
- | < | + | * Augmentation des performances d'E/S par écriture en parallèle sur les disques. |
- | root@debian11: | + | |
- | mdadm.conf | + | |
- | root@debian11: | + | ===Inconvénients=== |
- | # mdadm module configuration file | + | |
- | # set start_ro=1 to make newly assembled arrays read-only initially, | + | |
- | # to prevent metadata writes. | + | |
- | # resume-from-disk to work - new boot should not perform writes | + | |
- | # because it will be done behind the back of the system being | + | |
- | # resumed. | + | |
- | options md_mod start_ro=1 | + | * Pas de protection des données. |
- | </ | + | |
- | =====LAB #1 - Compilation et installation du noyau===== | + | ====RAID 1 - Miroir==== |
- | Commencez par installer | + | Création d'un volume où les disques sont en miroir. Quand les deux disques sont connectés à des contrôleurs de disques différents, |
- | < | + | {{:linux:raid1m.gif|}} |
- | root@debian11:~# apt-get update | + | |
- | Hit:1 http:// | + | |
- | Get:2 http:// | + | |
- | Get:3 http:// | + | |
- | Fetched 83.5 kB in 1s (158 kB/s) | + | |
- | Reading package lists... Done | + | |
- | root@debian11: | + | ===Avantages=== |
- | </ | + | |
- | ====1.1 - Déplacer /home==== | + | * Protection des données contre une défaillance d'un disque. |
- | Créez une seule partition sur **/ | + | ===Inconvénients=== |
- | < | + | * Coûteux à cause de l' |
- | root@debian11: | + | |
- | Welcome to fdisk (util-linux 2.36.1). | + | ====RAID |
- | Changes will remain in memory only, until you decide to write them. | + | |
- | Be careful before using the write command. | + | |
- | Device does not contain a recognized partition table. | + | Le RAID 1+0 ou encore 0+1 est une technique qui réunit le RAID 0 et le RAID 1. On l' |
- | Created a new DOS disklabel with disk identifier 0xa10c368d. | + | |
- | Command (m for help): n | + | {{:linux:raid10.gif|}} |
- | Partition type | + | |
- | | + | |
- | | + | |
- | Select (default p): | + | |
- | Using default response p. | + | ===Avantages=== |
- | Partition number (1-4, default 1): | + | |
- | First sector (2048-134217727, | + | |
- | Last sector, +/-sectors or +/ | + | |
- | Created a new partition 1 of type 'Linux' | + | * Protection des données contre une défaillance d'un disque. |
+ | * Augmentation des performances d'E/S par écriture en parallèle sur les disques. | ||
- | Command (m for help): w | + | ===Inconvénients=== |
- | The partition table has been altered. | + | |
- | Calling ioctl() to re-read partition table. | + | |
- | Syncing disks. | + | |
- | </ | + | |
- | Créez maintenant un système | + | * Coûteux à cause de l' |
- | < | + | ====RAID |
- | root@debian11: | + | |
- | mke2fs 1.46.2 (28-Feb-2021) | + | |
- | Discarding device blocks: done | + | |
- | Creating filesystem with 16776960 4k blocks and 4194304 inodes | + | |
- | Filesystem UUID: 24f1821e-1d5b-4256-8ee3-c9ee6b382ddc | + | |
- | Superblock backups stored on blocks: | + | |
- | 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, | + | |
- | 4096000, 7962624, 11239424 | + | |
- | Allocating group tables: done | + | Le RAID 2 est une technique de miroir avec contrôle de correction d' |
- | Writing inode tables: done | + | |
- | Creating journal | + | |
- | Writing superblocks and filesystem accounting information: | + | |
- | </ | + | |
- | Editez le fichier **/ | + | ====RAID 3 et 4 - Striping avec Parité==== |
- | < | + | Les RAID 3 et 4 sont des technologies avec bandes de parité distribuées sur un seul disque |
- | root@debian11:~# vi / | + | |
- | root@debian11: | + | |
- | # | + | |
- | # This is the sshd server system-wide configuration file. See | + | {{: |
- | # sshd_config(5) for more information. | + | |
- | # This sshd was compiled with PATH=/ | + | En RAID 3, la taille des segments n’est pas modifiable et est fixée à 512 octets (en RAID 3 : un segment |
- | # The strategy used for options in the default sshd_config shipped with | + | 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. |
- | # OpenSSH is to specify options with their default value where | + | |
- | # possible, but leave them commented. | + | |
- | # default value. | + | |
- | Include / | + | ===Avantages=== |
- | #Port 22 | + | * Protection des données contre une défaillance d'un disque. |
- | # | + | |
- | # | + | |
- | # | + | |
- | #HostKey / | + | ===Inconvénients=== |
- | #HostKey / | + | |
- | #HostKey / | + | |
- | # Ciphers and keying | + | * Création d'un goulot d' |
- | #RekeyLimit default none | + | |
- | # Logging | + | ====RAID 5 - Striping avec Parité Distribuée==== |
- | # | + | |
- | #LogLevel INFO | + | |
- | # Authentication: | + | Le RAID 5 est une technologie avec bandes de parité distribuées sur plusieurs disques |
- | # | + | {{: |
- | PermitRootLogin yes | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | ... | + | ===Avantages=== |
- | </ | + | |
- | Re-démarrez | + | * Protection des données contre une défaillance d'un disque, |
+ | * Evite le goulot d' | ||
- | < | + | ===Inconvénients=== |
- | root@debian11: | + | |
- | root@debian11: | + | |
- | ● ssh.service - OpenBSD Secure Shell server | + | |
- | | + | |
- | | + | |
- | Docs: man: | + | |
- | | + | |
- | Process: 2793 ExecStartPre=/ | + | |
- | Main PID: 2794 (sshd) | + | |
- | Tasks: 1 (limit: 4656) | + | |
- | | + | |
- | CPU: 25ms | + | |
- | | + | |
- | | + | |
- | May 01 15:35:50 debian11 systemd[1]: Starting OpenBSD Secure Shell server... | + | * Lecture moins performante qu' |
- | May 01 15:35:50 debian11 sshd[2794]: Server listening on 0.0.0.0 port 22. | + | |
- | May 01 15:35:50 debian11 sshd[2794]: Server listening on :: port 22. | + | |
- | May 01 15:35:50 debian11 systemd[1]: Started OpenBSD Secure Shell server. | + | |
- | </ | + | |
- | <WRAP center round todo> | + | ====Au délà de RAID 5==== |
- | **A Faire** - Déconnectez-vous en ssh. Connectez-vous directement en tant que root en ssh. | + | |
- | </ | + | |
- | Montez **/ | + | Il existe aussi deux autres technologies RAID, toute deux issues de la technologie RAID 5 : |
- | < | + | * RAID 6 |
- | root@debian11: | + | |
- | </code> | + | * RAID TP |
+ | * //Disk Striping with Triple Distributed Parity// | ||
- | Copiez le contenu de /home vers /mnt : | + | =====RAID Logiciel sous Debian===== |
- | < | + | ====Préparation du disque==== |
- | root@debian11: | + | |
- | </ | + | |
- | Démontez /dev/sdb1 : | + | ===Partitionnement=== |
- | < | + | Suite à votre LAB de la leçon **Gestion des Disques et le Swap**, votre disque comporte 12 partitions |
- | root@debian11: | + | |
- | </ | + | |
- | + | ||
- | Identifiez l' | + | |
< | < | ||
- | root@debian11:~# ls -l / | + | root@debian8:~# fdisk -l |
- | lrwxrwxrwx 1 root root 10 May 1 15:31 24f1821e-1d5b-4256-8ee3-c9ee6b382ddc -> ../ | + | |
- | </ | + | |
- | Editez le fichier **/etc/fstab** en ajoutant la ligne pour le montage de /home : | + | Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors |
+ | Units: sectors of 1 * 512 = 512 bytes | ||
+ | Sector size (logical/physical): 512 bytes / 512 bytes | ||
+ | I/O size (minimum/ | ||
+ | Disklabel type: dos | ||
+ | Disk identifier: 0xac1e8183 | ||
- | < | + | Device |
- | root@debian11: | + | /dev/sda1 * 2048 20482047 20480000 |
- | root@debian11: | + | /dev/sda2 |
- | # /etc/fstab: static file system information. | + | /dev/sda5 |
- | # | + | / |
- | # Use ' | + | / |
- | # device; this may be used with UUID= as a more robust way to name devices | + | /dev/sda8 |
- | # that works even if disks are added and removed. See fstab(5). | + | /dev/ |
- | # | + | /dev/ |
- | # systemd generates mount units based on this file, see systemd.mount(5). | + | /dev/sda11 28332032 29308927 |
- | # Please run ' | + | /dev/sda12 29310976 30287871 |
- | # | + | /dev/sda13 30289920 30699519 |
- | # <file system> <mount point> | + | |
- | # / was on /dev/sda1 during installation | + | |
- | UUID=9887a74f-a680-4bde-8f04-db5ae9ea186e | + | |
- | UUID=24f1821e-1d5b-4256-8ee3-c9ee6b382ddc | + | |
- | # swap was on /dev/sda5 during installation | + | |
- | UUID=1f9439f5-4b19-49b1-b292-60c2c674cee9 none swap sw 0 0 | + | |
- | /dev/sr0 | + | |
</ | </ | ||
- | Créez le point de montage /home : | + | ====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 : |
- | root@debian11:~# rm -rf /home | + | |
- | root@debian11: | + | |
- | </ | + | |
- | Montez /dev/sdb1 : | + | <file> |
- | + | /dev/sda6 | |
- | <code> | + | /dev/sda9 |
- | root@debian11: | + | /dev/sda11 28332032 29308927 |
- | + | /dev/sda12 29310976 30287871 | |
- | root@debian11: | + | </file> |
- | sysfs on /sys type sysfs (rw, | + | |
- | proc on /proc type proc (rw, | + | |
- | udev on /dev type devtmpfs (rw, | + | |
- | devpts on /dev/pts type devpts (rw, | + | |
- | tmpfs on /run type tmpfs (rw, | + | |
- | /dev/sda1 on / type ext4 (rw, | + | |
- | securityfs on / | + | |
- | tmpfs on /dev/shm type tmpfs (rw, | + | |
- | tmpfs on /run/lock type tmpfs (rw, | + | |
- | cgroup2 on / | + | |
- | pstore on / | + | |
- | none on /sys/fs/bpf type bpf (rw, | + | |
- | systemd-1 on / | + | |
- | mqueue on /dev/mqueue type mqueue (rw, | + | |
- | debugfs on / | + | |
- | hugetlbfs on / | + | |
- | tracefs on / | + | |
- | configfs on / | + | |
- | fusectl on / | + | |
- | tmpfs on /run/user/0 type tmpfs (rw, | + | |
- | /dev/sdb1 on /home type ext4 (rw, | + | |
- | </code> | + | |
- | Notez la taille de /home : | + | La création d'une unité RAID avec la commande **mdadm** se fait grâce aux options passées en arguments à la commande |
< | < | ||
- | root@debian11: | + | mdadm --create <unité RAID> [options] <unités physiques> |
- | Filesystem | + | |
- | udev 1.9G | + | |
- | tmpfs | + | |
- | / | + | |
- | tmpfs | + | |
- | tmpfs | + | |
- | tmpfs | + | |
- | / | + | |
</ | </ | ||
- | <WRAP center round todo> | + | Sous Debian 8, mdadm n'est pas installé par défaut |
- | **A Faire** - Fermez la session de root et connectez-vous en tant que trainee en ssh. | + | |
- | </ | + | |
- | + | ||
- | ====1.2 - Télécharger le Code Source du Noyau==== | + | |
- | + | ||
- | Le code source | + | |
< | < | ||
- | trainee@debian11:~$ wget https://mirrors.edge.kernel.org/pub/linux/kernel/v5.x/linux-5.11.1.tar.gz | + | root@debian8:~# apt-get install mdadm |
+ | Reading package lists... Done | ||
+ | Building dependency tree | ||
+ | Reading state information... Done | ||
+ | The following NEW packages will be installed: | ||
+ | mdadm | ||
+ | 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. | ||
+ | Need to get 432 kB of archives. | ||
+ | After this operation, 1,233 kB of additional disk space will be used. | ||
+ | Get:1 http://ftp.fr.debian.org/debian/ jessie/main mdadm amd64 3.3.2-5+deb8u1 [432 kB] | ||
+ | Fetched 432 kB in 3s (123 kB/s) | ||
+ | Preconfiguring packages ... | ||
+ | Selecting previously unselected package mdadm. | ||
+ | (Reading database ... 82568 files and directories currently installed.) | ||
+ | Preparing to unpack .../mdadm_3.3.2-5+deb8u1_amd64.deb ... | ||
+ | Unpacking mdadm (3.3.2-5+deb8u1) ... | ||
+ | Processing triggers for man-db (2.7.0.2-5) ... | ||
+ | Processing triggers for systemd (215-17+deb8u4) ... | ||
+ | Setting up mdadm (3.3.2-5+deb8u1) ... | ||
+ | Generating mdadm.conf... done. | ||
+ | update-initramfs: | ||
+ | update-rc.d: | ||
+ | update-rc.d: | ||
+ | Processing triggers for systemd (215-17+deb8u4) ... | ||
+ | Processing triggers for initramfs-tools (0.120+deb8u1) ... | ||
+ | update-initramfs: | ||
+ | W: mdadm: / | ||
+ | W: mdadm: no arrays defined in configuration file | ||
</ | </ | ||
- | Désarchivez le tar.xz que vous avez téléchargé | + | Saisissez maintenant la commande suivante |
< | < | ||
- | trainee@debian8:~$ tar xf linux-5.11.1.tar.gz | + | root@debian8:~# mdadm --create /dev/md1 --level=5 --raid-devices=3 /dev/sda6 /dev/sda9 / |
+ | mdadm: Defaulting to version | ||
+ | mdadm: array /dev/md1 started. | ||
</ | </ | ||
- | Notez que l' | + | Les options dans la ligne de commande sont : |
- | < | + | ^ Option Courte ^ Option Longue ^ Description ^ |
- | trainee@debian11: | + | | -l | - -level | Le niveau RAID - **linear, 0,1,2,4 ou 5** | |
- | 1.2G ./linux-5.11.1 | + | | -n | - -raid-devices=<nombre> | Le nombre de périphériques actifs dans le RAID | |
- | </code> | + | |
- | ====1.3 - Configurer le Noyau==== | + | Les autres options de la commande |
- | + | ||
- | Le fichier **Makefile** contient le nom du noyau et spécifie les informations suivantes : | + | |
- | + | ||
- | * 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@debian11:~$ cat ./linux-5.11.1/ | + | root@debian8:~# mdadm --help-options |
- | # SPDX-License-Identifier: GPL-2.0 | + | Any parameter that does not start with '-' is treated as a device name |
- | VERSION = 5 | + | or, for --examine-bitmap, |
- | PATCHLEVEL = 11 | + | The first such name is often the name of an md device. |
- | SUBLEVEL = 1 | + | names are often names of component devices. |
- | EXTRAVERSION = | + | |
- | NAME = 💕 Valentine' | + | |
- | # *DOCUMENTATION* | + | Some common options are: |
- | # To see a list of typical targets execute " | + | --help |
- | # More info can be located in ./README | + | mode specific help message |
- | </ | + | |
+ | --version | ||
+ | --verbose | ||
+ | --quiet | ||
+ | --brief | ||
+ | --export | ||
+ | | ||
+ | --force | ||
- | <WRAP center round important> | + | --assemble |
- | **Important** | + | --build |
- | </ | + | --create |
- | + | | |
- | Utilisez maintenant la commande **make defconfig** pour créer le fichier de configuration .config | + | |
- | + | | |
- | < | + | |
- | trainee@debian11: | + | |
- | Password: fenestros | + | |
- | root@debian11: | + | |
- | root@debian11:/ | + | |
- | | + | device relates to the md driver |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | HOSTCC | + | |
- | HOSTLD | + | |
- | *** Default configuration is based on ' | + | |
- | # | + | |
- | # configuration written to .config | + | |
- | # | + | |
</ | </ | ||
- | Ce fichier est configuré par une des trois commandes suivantes : | + | Les //modes majeurs// de la commande |
- | + | ||
- | | + | |
- | | + | |
- | | + | |
- | + | ||
- | Dans ce fichier, vous pouvez constater la présence de lignes correspondantes | + | |
- | + | ||
- | * **y** | + | |
- | * la fonctionnalité est incluse dans le noyau monolithique ou dans le cas d'une dépendance d'un module, dans le module concerné, | + | |
- | * **m** | + | |
- | * la fonctionnalité est incluse en tant que module, | + | |
- | * **n** | + | |
- | * la fonctionnalité n'est pas incluse. Cette option est rarement visible car dans bien les cas, la fonctionnalité est simplement commentée dans le fichier lui-même. | + | |
< | < | ||
- | root@debian11:/ | + | root@debian8:~# mdadm --help |
- | # | + | mdadm is used for building, managing, and monitoring |
- | # Automatically generated file; DO NOT EDIT. | + | Linux md devices (aka RAID arrays) |
- | # Linux/x86 5.11.1 Kernel Configuration | + | Usage: mdadm --create device options... |
- | # | + | |
- | CONFIG_CC_VERSION_TEXT=" | + | mdadm --assemble device options... |
- | CONFIG_CC_IS_GCC=y | + | |
- | CONFIG_GCC_VERSION=100201 | + | mdadm --build device options... |
- | CONFIG_LD_VERSION=235020000 | + | |
- | CONFIG_CLANG_VERSION=0 | + | mdadm --manage device options... |
- | CONFIG_LLD_VERSION=0 | + | make changes to an existing array. |
- | CONFIG_CC_CAN_LINK=y | + | |
- | CONFIG_CC_CAN_LINK_STATIC=y | + | |
- | CONFIG_CC_HAS_ASM_GOTO=y | + | mdadm --grow options device |
- | CONFIG_CC_HAS_ASM_INLINE=y | + | |
- | CONFIG_IRQ_WORK=y | + | mdadm --incremental device |
- | CONFIG_BUILDTIME_TABLE_SORT=y | + | |
- | CONFIG_THREAD_INFO_IN_TASK=y | + | mdadm --monitor options... |
+ | | ||
+ | mdadm device options... | ||
+ | | ||
+ | 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 |
- | # General setup | + | e.g. |
- | # | + | mdadm --assemble --help |
- | CONFIG_INIT_ENV_ARG_LIMIT=32 | + | For general help on options use |
- | # CONFIG_COMPILE_TEST is not set | + | mdadm --help-options |
- | CONFIG_LOCALVERSION="" | + | |
- | # CONFIG_LOCALVERSION_AUTO is not set | + | |
- | CONFIG_BUILD_SALT="" | + | |
- | CONFIG_HAVE_KERNEL_GZIP=y | + | |
- | CONFIG_HAVE_KERNEL_BZIP2=y | + | |
- | CONFIG_HAVE_KERNEL_LZMA=y | + | |
- | CONFIG_HAVE_KERNEL_XZ=y | + | |
- | CONFIG_HAVE_KERNEL_LZO=y | + | |
- | CONFIG_HAVE_KERNEL_LZ4=y | + | |
- | CONFIG_HAVE_KERNEL_ZSTD=y | + | |
- | CONFIG_KERNEL_GZIP=y | + | |
- | # CONFIG_KERNEL_BZIP2 is not set | + | |
- | # CONFIG_KERNEL_LZMA is not set | + | |
- | # CONFIG_KERNEL_XZ is not set | + | |
- | # CONFIG_KERNEL_LZO is not set | + | |
- | # CONFIG_KERNEL_LZ4 is not set | + | |
- | # CONFIG_KERNEL_ZSTD is not set | + | |
- | CONFIG_DEFAULT_INIT="" | + | |
- | CONFIG_DEFAULT_HOSTNAME=" | + | |
- | CONFIG_SWAP=y | + | |
- | CONFIG_SYSVIPC=y | + | |
- | CONFIG_SYSVIPC_SYSCTL=y | + | |
- | CONFIG_POSIX_MQUEUE=y | + | |
- | CONFIG_POSIX_MQUEUE_SYSCTL=y | + | |
- | # CONFIG_WATCH_QUEUE is not set | + | |
- | CONFIG_CROSS_MEMORY_ATTACH=y | + | |
- | CONFIG_USELIB=y | + | |
- | CONFIG_AUDIT=y | + | |
- | CONFIG_HAVE_ARCH_AUDITSYSCALL=y | + | |
- | CONFIG_AUDITSYSCALL=y | + | |
- | + | ||
- | # | + | |
- | # IRQ subsystem | + | |
- | # | + | |
- | CONFIG_GENERIC_IRQ_PROBE=y | + | |
- | --More--(1%) | + | |
- | [q] | + | |
</ | </ | ||
- | ====1.4 - Compiler le Noyau==== | + | Dernièrement, |
- | + | ||
- | La compilation du noyau peut prendre beaucoup | + | |
< | < | ||
- | root@debian11:/ | + | root@debian8:~# mdadm --assemble --help |
- | ... | + | Usage: mdadm --assemble device options... |
- | dpkg-buildpackage: | + | mdadm --assemble --scan options... |
- | CLEAN | + | |
- | CLEAN | + | |
- | CLEAN | + | |
- | CLEAN | + | |
- | CLEAN | + | |
- | CLEAN | + | |
- | CLEAN | + | |
- | CLEAN | + | |
- | CLEAN | + | |
- | CLEAN | + | |
- | CLEAN lib | + | |
- | CLEAN | + | |
- | CLEAN | + | |
- | CLEAN | + | |
- | CLEAN usr | + | |
- | CLEAN | + | |
- | CLEAN | + | |
- | CLEAN | + | |
- | CLEAN | + | |
- | </ | + | |
- | A l'issu du processus, les paquets du nouveau noyau se trouvent dans le répertoire **/ | + | This usage assembles one or more raid arrays from pre-existing |
+ | 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. | ||
- | < | + | The md device is given on the command line, is found listed in the |
- | root@debian11:/ | + | config file, or can be deduced from the array identity. |
- | root@debian11:/ | + | The array identity is determined either from the --uuid, --name, or |
- | Desktop | + | --super-minor commandline arguments, from the config file, |
- | Documents | + | or from the first component device on the command line. |
- | Downloads | + | |
- | </ | + | |
- | ====1.5 - Installer le Noyau==== | + | The different combinations of these are as follows: |
+ | If the --scan option is not given, then only devices and identities | ||
+ | | ||
+ | The first device will be the array device, and the remainder will be | ||
+ | | ||
+ | If an explicit identity is given with --uuid or --super-minor, | ||
+ | only devices with a superblock which matches that identity is considered, | ||
+ | | ||
- | Installez maintenant les paquets **deb** : | + | If the --scan option is given, and no devices are listed, then |
+ | 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. This can | ||
+ | be disabled using the ' | ||
- | < | + | If the --scan option is given as well as one or more devices, then |
- | root@debian11:/ | + | Those devices are md devices that are to be assembled. Their identity |
- | </ | + | and components are determined from the config file. |
- | Constatez la création d'un nouveau grub.cfg : | + | If mdadm can not find all of the components for an array, it will assemble |
+ | it but not activate it unless --run or --scan is given. | ||
+ | | ||
+ | | ||
+ | as recorded in the superblock. | ||
+ | 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. | ||
- | < | + | Options that are valid with --assemble (-A) are: |
- | root@debian11:/ | + | |
- | echo ' | + | --uuid= |
- | linux / | + | have this uuid are excluded |
- | | + | --super-minor= |
- | | + | |
- | echo ' | + | |
- | | + | --config= |
- | | + | |
- | menuentry ' | + | --run -R : Try to start the array even if not enough devices |
- | echo ' | + | for a full array are present |
- | | + | |
- | initrd | + | : out-of-date. This involves modifying the superblocks. |
+ | | ||
+ | --no-degraded | ||
+ | | ||
</ | </ | ||
- | ====1.6 - Désinstaller un Noyau==== | + | Constatez maintenant |
- | + | ||
- | Lister | + | |
< | < | ||
- | root@debian11:/home/trainee# dpkg -l | grep -i " | + | root@debian8:~# cat /proc/mdstat |
- | linux-image-5.10.0-13-amd64 | + | Personalities : [raid6] [raid5] [raid4] |
- | linux-image-5.11.1 | + | md1 : active raid5 sda11[3] sda9[1] sda6[0] |
- | linux-image-amd64 | + | |
+ | |||
+ | unused devices: < | ||
</ | </ | ||
- | Le noyau se désinstalle comme tout autre paquet | + | Grâce à la commande mdadm, il est possible d' |
< | < | ||
- | root@debian11:/ | + | root@debian8:~# mdadm --query /dev/md1 |
- | Reading package lists... Done | + | /dev/md1: 952.16MiB raid5 3 devices, |
- | Building dependency tree... Done | + | |
- | Reading state information... Done | + | |
- | The following packages will be REMOVED: | + | |
- | linux-image-5.11.1* | + | |
- | 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. | + | |
- | After this operation, 15.1 MB disk space will be freed. | + | |
- | (Reading database ... 118012 files and directories currently installed.) | + | |
- | Removing linux-image-5.11.1 (5.11.1-1) ... | + | |
- | update-initramfs: | + | |
- | Generating grub configuration file ... | + | |
- | Found background image: | + | |
- | Found linux image: / | + | |
- | Found initrd image: / | + | |
- | done | + | |
- | (Reading database ... 117967 files and directories currently installed.) | + | |
- | Purging configuration files for linux-image-5.11.1 (5.11.1-1) ... | + | |
</ | </ | ||
- | Vérifiez que le fichier grub.cfg a été modifié | + | L' |
< | < | ||
- | root@debian11:/ | + | root@debian8:~# mdadm --query |
- | root@debian11:/home/trainee# | + | /dev/md1: 952.16MiB raid5 3 devices, 0 spares. Use mdadm --detail for more detail. |
- | </code> | + | root@debian8:~# mdadm --detail |
+ | /dev/md1: | ||
+ | Version : 1.2 | ||
+ | Creation Time : Wed Aug 3 13:20:07 2016 | ||
+ | Raid Level : raid5 | ||
+ | Array Size : 974848 (952.16 MiB 998.24 MB) | ||
+ | Used Dev Size : 487424 (476.08 MiB 499.12 MB) | ||
+ | Raid Devices : 3 | ||
+ | Total Devices : 3 | ||
+ | Persistence : Superblock is persistent | ||
- | Dernièrement, | + | Update Time : Wed Aug 3 13:20:16 2016 |
+ | State : clean | ||
+ | | ||
+ | Working Devices : 3 | ||
+ | | ||
+ | Spare Devices : 0 | ||
- | < | + | |
- | root@debian11:/ | + | Chunk Size : 512K |
- | linux-image-5.10.0-13-amd64 | + | |
- | linux-image-amd64 | + | |
- | </ | + | |
- | =====LAB #2 - Mise à Jour du Noyau avec le Gestionnaire des Paquets===== | + | Name : debian8: |
+ | UUID : 41b8799a: | ||
+ | | ||
- | Afin d' | + | Number |
- | + | 0 | |
- | < | + | 1 |
- | root@debian11: | + | 3 |
- | deb http://deb.debian.org/ | + | |
- | root@debian11:/ | + | |
- | deb-src http://deb.debian.org/debian unstable main contrib non-free | + | |
</ | </ | ||
- | Afin de ne faire que des mises à jour du **noyau** à partir | + | Notez la ligne **Persistence : Superblock is persistent**. En effet, cette implémentation |
- | <code> | + | <WRAP center round todo> |
- | root@debian11:/ | + | Recherchez la signification des termes Layout, Chunk size, Major et Minor. |
- | root@debian11: | + | </WRAP> |
- | Package: * | + | |
- | Pin: release a=bullseye | + | |
- | Pin-Priority: | + | |
- | Package: linux-image-amd64 | + | Cependant, il necéssaire de renseigner le fichier **/etc/ |
- | Pin: release a=unstable | + | |
- | Pin-Priority: | + | |
- | + | ||
- | Package: | + | |
- | Pin: release a=unstable | + | |
- | Pin-Priority: | + | |
- | </code> | + | |
- | + | ||
- | Mettez | + | |
< | < | ||
- | root@debian11:/ | + | root@debian8:~# echo ' |
- | Hit:1 http://security.debian.org/debian-security bullseye-security InRelease | + | root@debian8:~# mdadm --detail --scan >> |
- | Hit:2 http://deb.debian.org/debian bullseye InRelease | + | root@debian8:~# cat /etc/mdadm/mdadm.conf |
- | Get:3 http://deb.debian.org/debian bullseye-updates InRelease [39.4 kB] | + | DEVICES |
- | Get:4 http://deb.debian.org/ | + | ARRAY /dev/md1 metadata=1.2 name=debian8:1 UUID=41b8799a:e24feb35:39e9aa3a:ec920626 |
- | Get:5 http:// | + | |
- | Get:6 http://deb.debian.org/ | + | |
- | Get:7 http://deb.debian.org/ | + | |
- | Get:8 http://deb.debian.org/debian unstable/main amd64 Packages [9,154 kB] | + | |
- | Get:9 http://deb.debian.org/ | + | |
- | Get:10 http://deb.debian.org/ | + | |
- | Get:11 http:// | + | |
- | Get:12 http:// | + | |
- | Get:13 http:// | + | |
- | Fetched 26.3 MB in 5s (4,955 kB/s) | + | |
- | Reading package lists... Done | + | |
- | Building dependency tree... Done | + | |
- | Reading state information... Done | + | |
- | 2 packages can be upgraded. Run 'apt list --upgradable' | + | |
</ | </ | ||
- | Installez ensuite les mises-à-jour du noyau : | + | Chaque unité peut être examinée individuellement |
< | < | ||
- | root@debian11:/ | + | root@debian8:~# mdadm --examine /dev/sda6 |
- | </code> | + | /dev/sda6: |
+ | Magic : a92b4efc | ||
+ | Version : 1.2 | ||
+ | Feature Map : 0x0 | ||
+ | Array UUID : 41b8799a: | ||
+ | Name : debian8: | ||
+ | Creation Time : Wed Aug 3 13:20:07 2016 | ||
+ | Raid Level : raid5 | ||
+ | Raid Devices : 3 | ||
- | Re-démarrez votre VM : | + | Avail Dev Size : 974848 (476.08 MiB 499.12 MB) |
+ | Array Size : 974848 (952.16 MiB 998.24 MB) | ||
+ | Data Offset : 2048 sectors | ||
+ | Super Offset : 8 sectors | ||
+ | | ||
+ | State : clean | ||
+ | Device UUID : be46c991: | ||
- | < | + | Update Time : Wed Aug 3 13:20:16 2016 |
- | root@debian11:/ | + | Bad Block Log : 512 entries available at offset 72 sectors |
- | </ | + | Checksum : 16f72803 - correct |
+ | | ||
- | Connectez-vous de nouveau à la VM et contrôlez la version du noyau : | + | |
+ | Chunk Size : 512K | ||
- | < | + | |
- | trainee@debian11:~$ uname -a | + | Array State : AAA (' |
- | Linux debian11 5.17.0-1-amd64 #1 SMP PREEMPT Debian 5.17.3-1 (2022-04-18) x86_64 GNU/Linux | + | |
</ | </ | ||
- | Déconnectez-vous et re-connectez-vous directement en tant que root. | + | A ce stade il est intéressant |
- | + | ||
- | =====LAB #3 - Gestion des Quotas===== | + | |
- | + | ||
- | Sous Linux il est possible | + | |
- | quotas par partition. L'administrateur met souvent des quotas en place sur l'arborescence de /home pour limiter l' | + | |
- | + | ||
- | Commencez par vérifiez | + | |
< | < | ||
- | root@debian11:~# dpkg --get-selections | grep quota | + | root@debian8:~# mdadm --manage |
- | root@debian11:~# apt -y install quota | + | mdadm: set /dev/sda6 faulty in /dev/md1 |
</ | </ | ||
- | Editez | + | L' |
< | < | ||
- | root@debian11:~# vi /etc/fstab | + | root@debian8:~# mdadm --detail |
- | root@debian11: | + | /dev/md1: |
- | # /etc/fstab: static file system information. | + | |
- | # | + | |
- | # Use ' | + | Raid Level : raid5 |
- | # device; this may be used with UUID= as a more robust way to name devices | + | Array Size : 974848 |
- | # that works even if disks are added and removed. See fstab(5). | + | Used Dev Size : 487424 (476.08 MiB 499.12 MB) |
- | # | + | Raid Devices : 3 |
- | # systemd generates mount units based on this file, see systemd.mount(5). | + | |
- | # Please run ' | + | |
- | # | + | |
- | # <file system> <mount point> | + | |
- | # / was on /dev/sda1 during installation | + | |
- | UUID=9887a74f-a680-4bde-8f04-db5ae9ea186e / | + | |
- | UUID=24f1821e-1d5b-4256-8ee3-c9ee6b382ddc /home | + | |
- | # swap was on /dev/sda5 during installation | + | |
- | UUID=1f9439f5-4b19-49b1-b292-60c2c674cee9 none swap sw 0 0 | + | |
- | / | + | |
- | </ | + | |
- | Démontez puis remontez /home : | + | Update Time : Wed Aug 3 13:27:53 2016 |
+ | State : clean, degraded | ||
+ | | ||
+ | Working Devices : 2 | ||
+ | | ||
+ | Spare Devices : 0 | ||
- | < | + | |
- | root@debian11:~# umount /home | + | Chunk Size : 512K |
- | root@debian11:~# mount -a | + | |
- | </ | + | |
- | Vérifiez ensuite que les options soient prises en compte | + | |
+ | UUID : 41b8799a: | ||
+ | | ||
- | < | + | Number |
- | root@debian11: | + | |
- | sysfs /sys sysfs rw, | + | |
- | proc /proc proc rw, | + | 3 |
- | udev /dev devtmpfs rw, | + | |
- | devpts /dev/pts devpts rw, | + | |
- | tmpfs /run tmpfs rw, | + | |
- | /dev/sda1 / ext4 rw, | + | |
- | securityfs / | + | |
- | tmpfs /dev/shm tmpfs rw, | + | |
- | tmpfs /run/lock tmpfs rw, | + | |
- | cgroup2 / | + | |
- | pstore / | + | |
- | bpf /sys/fs/bpf bpf rw, | + | |
- | systemd-1 / | + | |
- | mqueue | + | |
- | hugetlbfs | + | |
- | tracefs / | + | |
- | debugfs / | + | |
- | configfs / | + | |
- | fusectl / | + | |
- | tmpfs /run/user/0 tmpfs rw, | + | |
- | /dev/sdb1 /home ext4 rw, | + | |
- | </ | + | |
- | ====3.1 | + | |
- | + | ||
- | Pour activer les quotas sur /home, il convient d' | + | |
- | + | ||
- | < | + | |
- | root@debian11: | + | |
- | quotacheck: Your kernel probably supports ext4 quota feature but you are using external quota files. Please switch your filesystem to use ext4 quota feature as external quota files on ext4 are deprecated. | + | |
- | quotacheck: Scanning /dev/sdb1 [/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 7199 directories and 81583 files | + | |
- | quotacheck: Old file not found. | + | |
- | quotacheck: Old file not found. | + | |
</ | </ | ||
- | Les options | + | Il est maintenant nécessaire |
< | < | ||
- | root@debian11:~# quotacheck | + | root@debian8:~# mdadm --manage |
- | Utility for checking and repairing quota files. | + | mdadm: hot removed /dev/sda6 from /dev/md1 |
- | 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 | + | A l' |
< | < | ||
- | root@debian11:~# ls -la /home | + | root@debian8:~# mdadm --detail |
- | total 44 | + | /dev/md1: |
- | drwxr-xr-x | + | Version : 1.2 |
- | drwxr-xr-x 20 root root | + | |
- | -rw------- | + | Raid Level : raid5 |
- | -rw------- | + | Array Size : 974848 (952.16 MiB 998.24 MB) |
- | drwx------ | + | |
- | drwxr-xr-x 15 trainee trainee | + | Raid Devices |
- | </ | + | |
+ | | ||
- | Créez maintenant un utilisateur **fenestros** avec le mot de passe **fenestros** | + | Update Time : Wed Aug 3 13:29:30 2016 |
+ | State : clean, degraded | ||
+ | | ||
+ | Working Devices : 2 | ||
+ | | ||
+ | Spare Devices : 0 | ||
- | < | + | |
- | root@debian11:~# groupadd fenestros && useradd | + | Chunk Size : 512K |
- | root@debian11:~# passwd fenestros | + | |
- | New password: fenestros | + | |
- | Retype new password: fenestros | + | |
- | passwd: password updated successfully | + | |
- | </ | + | |
- | ====3.2 - La Commande edquota==== | + | Name : debian8: |
+ | UUID : 41b8799a: | ||
+ | | ||
- | Mettez en place maintenant un quota de 10Mo pour l' | + | Number |
- | + | 0 | |
- | < | + | 1 |
- | root@debian8: | + | |
- | root@debian8: | + | |
- | root@debian8: | + | |
</ | </ | ||
- | L'éditeur **vi** se lance et vous obtiendrez un résultat similaire à celui-ci : | + | Constatez maintenant l'existance |
- | + | ||
- | < | + | |
- | Disk quotas for user fenestros (uid 1001): | + | |
- | Filesystem | + | |
- | / | + | |
- | </ | + | |
- | + | ||
- | Modifiez ce fichier ainsi : | + | |
- | + | ||
- | < | + | |
- | Disk quotas for user fenestros (uid 1001): | + | |
- | Filesystem | + | |
- | / | + | |
- | </ | + | |
- | + | ||
- | Les options | + | |
< | < | ||
- | root@debian11:~# edquota --help | + | root@debian8:~# cat / |
- | edquota: Usage: | + | Personalities |
- | edquota | + | md1 : active raid5 sda11[3] sda9[1] |
- | | + | |
- | | + | |
- | edquota | + | unused devices: < |
- | | + | |
- | + | ||
- | -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> | <WRAP center round important> | ||
- | **Important** - Pour mettre en place un quota par group, la procédure est similaire. Il suffit d' | + | Notez que le RAID a été démarré avec 2 unités au lieu de trois. |
</ | </ | ||
- | ====3.3 | + | Pour ajouter un autre disque à notre RAID afin de remplacer /dev/sda6 il convient d' |
- | + | ||
- | Appliquez maintenant les quotas | + | |
< | < | ||
- | root@debian11:~# quotaon | + | root@debian8:~# mdadm --manage --add /dev/md1 / |
+ | mdadm: added /dev/sda12 | ||
</ | </ | ||
- | Les options | + | L' |
< | < | ||
- | root@debian11:~# quotaon | + | root@debian8:~# mdadm --manage --add /dev/md1 /dev/sda12 |
- | quotaon: Usage: | + | mdadm: added /dev/sda12 |
- | | + | root@debian8: |
- | | + | /dev/md1: |
+ | | ||
+ | Creation Time : Wed Aug 3 13:20:07 2016 | ||
+ | Raid Level : raid5 | ||
+ | Array Size : 974848 (952.16 MiB 998.24 MB) | ||
+ | Used Dev Size : 487424 (476.08 MiB 499.12 MB) | ||
+ | Raid Devices : 3 | ||
+ | Total Devices : 3 | ||
+ | Persistence : Superblock is persistent | ||
- | -a, --all turn quotas on for all filesystems | + | Update Time : Wed Aug 3 13:35:24 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 : debian8: |
+ | UUID : 41b8799a: | ||
+ | | ||
- | 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> | + | 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@debian11: | + | |
- | *** 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 -- 241004 | + | |
- | trainee | + | |
- | | + | |
</ | </ | ||
- | <WRAP center round important> | + | Naturellement, |
- | **Important** - Notez que l' | + | |
- | </ | + | |
- | + | ||
- | Les options de la commande | + | |
< | < | ||
- | root@debian11:~# repquota --help | + | root@debian8:~# echo ' |
- | repquota: Utility for reporting quotas. | + | root@debian8:~# mdadm --detail |
- | Usage: | + | root@debian8: |
- | repquota [-vugsi] [-c|C] [-t|n] [-F quotaformat] [-O (default | xml | csv)] (-a | mntpoint) | + | DEVICES /dev/sda12 /dev/sda9 /dev/sda11 |
- | + | ARRAY /dev/md1 metadata=1.2 name=debian8:1 UUID=41b8799a: | |
- | -v, --verbose | + | |
- | -u, --user | + | |
- | -g, --group | + | |
- | -P, --project | + | |
- | -s, --human-readable[=units] | + | |
- | | + | |
- | an optional argument in format [kgt],[kgt] where | + | |
- | the first character specifies space units and the | + | |
- | second character specifies inode units | + | |
- | -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 | + | |
- | quotas | + | |
- | -h, --help | + | |
- | -V, --version | + | |
- | + | ||
- | Bugs to jack@suse.cz | + | |
</ | </ | ||
- | ====3.5 - La Commande quota==== | ||
- | |||
- | Pour visualiser les quotas d'un utilisateur spécifique, | ||
- | |||
- | < | ||
- | root@debian11: | ||
- | Disk quotas for user fenestros (uid 1001): no limited resources used | ||
- | |||
- | root@debian11: | ||
- | |||
- | fenestros@debian11: | ||
- | |||
- | fenestros@debian11: | ||
- | logout | ||
- | |||
- | root@debian11: | ||
- | Disk quotas for user fenestros (uid 1001): | ||
- | | ||
- | / | ||
- | </ | ||
- | |||
- | Les options de la commande **quota** sont : | ||
- | |||
- | < | ||
- | root@debian11: | ||
- | 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 [-qvswim] [-l | [-Q | -A]] [-F quotaformat] -P projectname ... | ||
- | quota [-qvswugPQm] [-F quotaformat] -f filesystem ... | ||
- | |||
- | -u, --user | ||
- | -g, --group | ||
- | -P, --project | ||
- | -q, --quiet | ||
- | -v, --verbose | ||
- | -s, --human-readable[=units] | ||
- | ...). Units can be also specified explicitely by | ||
- | an optional argument in format [kgt],[kgt] where | ||
- | the first character specifies space units and the | ||
- | second character specifies inode units | ||
- | --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 | ||
- | filesystems | ||
- | --filesystem=path | ||
- | filesystem, remaining command line arguments | ||
- | are still treated as user/ | ||
- | -A, --all-nfs | ||
- | -m, --no-mixed-pathnames | ||
- | --show-mntpoint | ||
- | --hide-device | ||
- | -h, --help | ||
- | -V, --version | ||
- | |||
- | Bugs to: jack@suse.cz | ||
- | </ | ||
- | |||
- | ====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. | ||
- | |||
- | Les options de la commande **warnquota** sont : | ||
- | |||
- | < | ||
- | root@debian11: | ||
- | warnquota: Usage: | ||
- | warnquota [-ugsid] [-F quotaformat] [-c configfile] [-q quotatabfile] [-a adminsfile] [filesystem...] | ||
- | |||
- | -u, --user | ||
- | -g, --group | ||
- | -s, --human-readable[=units] | ||
- | GB, ...). Units can be also specified | ||
- | explicitely by an optional argument in format | ||
- | [kgt],[kgt] where the first character specifies | ||
- | space units and the second character specifies | ||
- | inode units | ||
- | -i, --no-autofs | ||
- | -d, --no-details | ||
- | -F, --format=formatname | ||
- | -c, --config=config-file | ||
- | -q, --quota-tab=quotatab-file | ||
- | -a, --admins-file=admins-file | ||
- | -I, --ignore-config-errors | ||
- | -h, --help | ||
- | -V, --version | ||
- | |||
- | warnquota: Bugs to jack@suse.cz | ||
- | </ | ||
----- | ----- | ||
- | Copyright © 2022 Hugh Norris. | + | Copyright © 2024 Hugh Norris. |