Différences
Ci-dessous, les différences entre deux révisions de la page.
elearning:workbooks:debian:10:avance:l102 [2022/04/29 07:57] – created admin | elearning:workbooks:debian:10:avance:l102 [2022/05/02 08:14] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
~~PDF: | ~~PDF: | ||
+ | |||
+ | Version : **2022.01** | ||
Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
- | ======LDF302 | + | ======LDF602 |
=====Contenu du Module===== | =====Contenu du Module===== | ||
- | * **LDF302 | + | * **LDF602 |
- | * Contenu | + | * 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 | + | |
- | =====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. | ||
- | * Addition des capacités, | + | Commencez par identifier le noyau utilisé par votre machine : |
- | * 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 | ||
+ | </ | ||
- | ====Disques en miroir==== | + | 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 **/ |
- | La technique des disques en miroir consiste à dupliquer l' | + | < |
+ | root@debian11: | ||
+ | kernel | ||
+ | modules.alias | ||
+ | </ | ||
- | ====Bandes de données==== | + | Les commandes pour manipuler les modules sont : |
- | 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' | + | * insmod |
+ | * rmmod | ||
+ | * lsmod | ||
+ | * modprobe | ||
- | =====Types de RAID===== | + | Par exemple : |
- | ====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 | ||
+ | </ | ||
- | Création de volume par récupération de l' | + | Pour ajouter |
- | {{:linux: | + | < |
+ | root@debian11:~# modprobe bonding | ||
- | ===Avantages=== | + | root@debian11: |
+ | 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 | ||
+ | </ | ||
- | * Pas de protection | + | Les dépendances |
- | | + | |
- | ====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] | ||
+ | </ | ||
- | Création de volume sur plusieurs disques afin d' | + | Il est possible |
- | {{: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: | ||
+ | </ | ||
- | ===Avantages=== | + | Dernièrement, |
- | * Augmentation des performances d'E/S par écriture en parallèle sur les disques. | + | < |
+ | root@debian11: | ||
+ | mdadm.conf | ||
- | ===Inconvénients=== | + | root@debian11: |
+ | # 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. | ||
- | * Pas de protection des données. | + | options md_mod start_ro=1 |
+ | </ | ||
- | ====RAID 1 - Miroir==== | + | =====LAB #1 - Compilation et installation du noyau===== |
- | 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, | + | Commencez par installer |
- | {{: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 | ||
- | ===Avantages=== | + | root@debian11: |
+ | </ | ||
- | * Protection des données contre une défaillance d'un disque. | + | ====1.1 - Déplacer /home==== |
- | ===Inconvénients=== | + | Créez une seule partition sur **/ |
- | * Coûteux à cause de l' | + | < |
+ | root@debian11: | ||
- | ====RAID 1+0 - Striping en Miroir==== | + | Welcome to fdisk (util-linux 2.36.1). |
+ | Changes will remain in memory only, until you decide to write them. | ||
+ | Be careful before using the write command. | ||
- | Le RAID 1+0 ou encore 0+1 est une technique qui réunit le RAID 0 et le RAID 1. On l' | + | Device does not contain a recognized partition table. |
+ | Created a new DOS disklabel with disk identifier 0xa10c368d. | ||
- | {{:linux:raid10.gif|}} | + | Command (m for help): n |
+ | Partition type | ||
+ | | ||
+ | | ||
+ | Select (default p): | ||
- | ===Avantages=== | + | Using default response p. |
+ | Partition number (1-4, default 1): | ||
+ | First sector (2048-134217727, | ||
+ | Last sector, +/-sectors or +/ | ||
- | * Protection des données contre une défaillance d'un disque. | + | Created a new partition 1 of type 'Linux' |
- | * Augmentation des performances d'E/S par écriture en parallèle sur les disques. | + | |
- | ===Inconvénients=== | + | Command (m for help): w |
+ | The partition table has been altered. | ||
+ | Calling ioctl() to re-read partition table. | ||
+ | Syncing disks. | ||
+ | </ | ||
- | * Coûteux à cause de l' | + | Créez maintenant un système |
- | ====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 | ||
- | Le RAID 2 est une technique de miroir avec contrôle de correction d' | + | Allocating group tables: done |
+ | Writing inode tables: done | ||
+ | Creating journal | ||
+ | Writing superblocks and filesystem accounting information: | ||
+ | </ | ||
- | ====RAID 3 et 4 - Striping avec Parité==== | + | Editez le fichier **/ |
- | 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. | ||
- | En RAID 3, la taille des segments n’est pas modifiable et est fixée à 512 octets (en RAID 3 : un segment | + | # This sshd was compiled with PATH=/ |
- | 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. | + | # The strategy used for options in the default sshd_config shipped with |
+ | # OpenSSH is to specify options with their default value where | ||
+ | # possible, but leave them commented. | ||
+ | # default value. | ||
- | ===Avantages=== | + | Include / |
- | * Protection des données contre une défaillance d'un disque. | + | #Port 22 |
+ | # | ||
+ | # | ||
+ | # | ||
- | ===Inconvénients=== | + | #HostKey / |
+ | #HostKey / | ||
+ | #HostKey / | ||
- | * Création d'un goulot d' | + | # Ciphers and keying |
+ | #RekeyLimit default none | ||
- | ====RAID 5 - Striping avec Parité Distribuée==== | + | # Logging |
+ | # | ||
+ | #LogLevel INFO | ||
- | Le RAID 5 est une technologie avec bandes de parité distribuées sur plusieurs disques | + | # Authentication: |
- | {{: | + | # |
+ | PermitRootLogin yes | ||
+ | # | ||
+ | # | ||
+ | # | ||
- | ===Avantages=== | + | ... |
+ | </ | ||
- | * Protection des données contre une défaillance d'un disque, | + | Re-démarrez |
- | * 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 | ||
+ | | ||
+ | | ||
- | * Lecture moins performante qu' | + | May 01 15:35:50 debian11 systemd[1]: Starting OpenBSD Secure Shell server... |
+ | 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. | ||
+ | </ | ||
- | ====Au délà de RAID 5==== | + | <WRAP center round todo> |
+ | **A Faire** - Déconnectez-vous en ssh. Connectez-vous directement en tant que root en ssh. | ||
+ | </ | ||
- | Il existe aussi deux autres technologies RAID, toute deux issues de la technologie RAID 5 : | + | Montez **/ |
- | * RAID 6 | + | < |
- | | + | root@debian11: |
- | * RAID TP | + | </code> |
- | * //Disk Striping with Triple Distributed Parity// | + | |
- | =====RAID Logiciel sous Debian===== | + | Copiez le contenu de /home vers /mnt : |
- | ====Préparation du disque==== | + | < |
+ | root@debian11: | ||
+ | </ | ||
- | ===Partitionnement=== | + | Démontez /dev/sdb1 : |
- | Suite à votre LAB de la leçon **Gestion des Disques et le Swap**, votre disque comporte 12 partitions | + | < |
+ | root@debian11: | ||
+ | </ | ||
+ | |||
+ | Identifiez l' | ||
< | < | ||
- | root@debian8:~# fdisk -l | + | root@debian11:~# ls -l / |
+ | lrwxrwxrwx 1 root root 10 May 1 15:31 24f1821e-1d5b-4256-8ee3-c9ee6b382ddc -> ../ | ||
+ | </ | ||
- | Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 sectors | + | Editez le fichier **/etc/fstab** en ajoutant la ligne pour le montage de /home : |
- | 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 | + | < |
- | /dev/sda1 * 2048 20482047 20480000 | + | root@debian11: |
- | /dev/sda2 | + | root@debian11: |
- | /dev/sda5 | + | # /etc/fstab: static file system information. |
- | / | + | # |
- | / | + | # Use ' |
- | /dev/sda8 | + | # device; this may be used with UUID= as a more robust way to name devices |
- | /dev/ | + | # that works even if disks are added and removed. See fstab(5). |
- | /dev/ | + | # |
- | /dev/sda11 28332032 29308927 | + | # systemd generates mount units based on this file, see systemd.mount(5). |
- | /dev/sda12 29310976 30287871 | + | # Please run ' |
- | /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 | ||
</ | </ | ||
- | ====Mise en Place du RAID 5 Logiciel==== | + | Créez le point de montage /home : |
- | 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/sda6 | + | |
- | / | + | |
- | / | + | |
- | / | + | |
- | </ | + | |
- | 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: | ||
+ | |||
+ | root@debian11: | ||
+ | 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, | ||
+ | </ | ||
+ | |||
+ | Notez la taille de /home : | ||
< | < | ||
- | mdadm --create <unité RAID> [options] <unités physiques> | + | root@debian11: |
+ | Filesystem | ||
+ | udev 1.9G | ||
+ | tmpfs | ||
+ | / | ||
+ | tmpfs | ||
+ | tmpfs | ||
+ | tmpfs | ||
+ | / | ||
</ | </ | ||
- | Sous Debian 8, mdadm n'est pas installé par défaut | + | <WRAP center round todo> |
+ | **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 | ||
< | < | ||
- | root@debian8:~# apt-get install mdadm | + | trainee@debian11:~$ wget https://www.kernel.org/ |
- | Reading package lists... Done | + | --2022-05-01 15:46: |
- | Building dependency tree | + | Resolving www.kernel.org |
- | Reading state information... Done | + | Connecting to www.kernel.org (www.kernel.org)|145.40.68.75|:443... connected. |
- | The following NEW packages will be installed: | + | HTTP request sent, awaiting response... 301 Moved Permanently |
- | mdadm | + | Location: https:// |
- | 0 upgraded, | + | --2022-05-01 15: |
- | Need to get 432 kB of archives. | + | Resolving mirrors.edge.kernel.org |
- | After this operation, 1,233 kB of additional disk space will be used. | + | Connecting to mirrors.edge.kernel.org |
- | Get:1 http://ftp.fr.debian.org/debian/ jessie/main mdadm amd64 3.3.2-5+deb8u1 [432 kB] | + | HTTP request sent, awaiting response... 200 OK |
- | Fetched 432 kB in 3s (123 kB/s) | + | Length: 186370882 |
- | Preconfiguring packages | + | Saving |
- | Selecting previously unselected package mdadm. | + | |
- | (Reading database | + | linux-5.11.1.tar.gz 100%[====================================================================================================================> |
- | Preparing to unpack | + | |
- | Unpacking mdadm (3.3.2-5+deb8u1) | + | 2022-05-01 15:47:01 (83.4 MB/s) - ‘linux-5.11.1.tar.gz’ saved [186370882/ |
- | Processing triggers for man-db (2.7.0.2-5) ... | + | |
- | Processing triggers for systemd | + | |
- | Setting up mdadm (3.3.2-5+deb8u1) ... | + | |
- | Generating mdadm.conf... done. | + | |
- | update-initramfs: deferring update | + | |
- | update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults | + | |
- | update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults | + | |
- | Processing triggers for systemd (215-17+deb8u4) | + | |
- | Processing triggers for initramfs-tools (0.120+deb8u1) | + | |
- | update-initramfs: | + | |
- | W: mdadm: /etc/ | + | |
- | W: mdadm: no arrays defined in configuration file | + | |
</ | </ | ||
- | Saisissez maintenant la commande suivante | + | Désarchivez le tar.xz que vous avez téléchargé |
< | < | ||
- | root@debian8:~# mdadm --create /dev/md1 --level=5 --raid-devices=3 /dev/sda6 /dev/sda9 / | + | trainee@debian8:~$ tar xf linux-5.11.1.tar.gz |
- | mdadm: Defaulting to version | + | |
- | mdadm: array /dev/md1 started. | + | |
</ | </ | ||
- | Les options dans la ligne de commande sont : | + | Notez que l' |
- | ^ Option Courte ^ Option Longue ^ Description ^ | + | < |
- | | -l | - -level | Le niveau RAID - **linear, 0,1,2,4 ou 5** | | + | trainee@debian11: |
- | | -n | - -raid-devices=<nombre> | Le nombre de périphériques actifs dans le RAID | | + | 1.2G ./linux-5.11.1 |
+ | </code> | ||
- | Les autres options de la commande | + | ====1.3 - Configurer le Noyau==== |
+ | |||
+ | 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' | ||
< | < | ||
- | root@debian8:~# mdadm --help-options | + | trainee@debian11:~$ cat ./linux-5.11.1/ |
- | Any parameter that does not start with '-' is treated as a device name | + | # SPDX-License-Identifier: GPL-2.0 |
- | or, for --examine-bitmap, | + | VERSION = 5 |
- | The first such name is often the name of an md device. | + | PATCHLEVEL = 11 |
- | names are often names of component devices. | + | SUBLEVEL = 1 |
+ | EXTRAVERSION = | ||
+ | NAME = 💕 Valentine' | ||
- | Some common options are: | + | # *DOCUMENTATION* |
- | --help | + | # To see a list of typical targets execute " |
- | mode specific help message | + | # More info can be located in ./README |
- | | + | </ |
- | --version | + | |
- | --verbose | + | |
- | --quiet | + | |
- | --brief | + | |
- | --export | + | |
- | | + | |
- | --force | + | |
- | --assemble | + | <WRAP center round important> |
- | --build | + | **Important** |
- | --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 | ||
+ | # | ||
</ | </ | ||
- | Les //modes majeurs// de la commande | + | Ce fichier est configuré par une des trois commandes suivantes : |
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | Dans ce fichier, vous pouvez constater la présence de lignes correspondantes | ||
+ | |||
+ | * **y** | ||
+ | * la fonctionalité est incluse dans le noyau monolithique ou dans le cas d'une dépendance d'un module, dans le module concerné, | ||
+ | * **m** | ||
+ | * la fonctionalité est incluse en tant que module, | ||
+ | * **n** | ||
+ | * la fonctionalité n'est pas incluse. Cette option est rarement visible car dans bien les cas, la fonctionalité est simplement commentée dans le fichier lui-même. | ||
< | < | ||
- | root@debian8:~# mdadm --help | + | root@debian11:/ |
- | mdadm is used for building, managing, and monitoring | + | # |
- | Linux md devices (aka RAID arrays) | + | # Automatically generated file; DO NOT EDIT. |
- | Usage: mdadm --create device options... | + | # Linux/x86 5.11.1 Kernel Configuration |
- | | + | # |
- | mdadm --assemble device options... | + | CONFIG_CC_VERSION_TEXT=" |
- | | + | CONFIG_CC_IS_GCC=y |
- | mdadm --build device options... | + | CONFIG_GCC_VERSION=100201 |
- | Create or assemble an array without metadata. | + | CONFIG_LD_VERSION=235020000 |
- | | + | CONFIG_CLANG_VERSION=0 |
- | make changes to an existing array. | + | CONFIG_LLD_VERSION=0 |
- | mdadm --misc options... devices | + | CONFIG_CC_CAN_LINK=y |
- | | + | CONFIG_CC_CAN_LINK_STATIC=y |
- | mdadm --grow options device | + | CONFIG_CC_HAS_ASM_GOTO=y |
- | | + | CONFIG_CC_HAS_ASM_INLINE=y |
- | mdadm --incremental device | + | CONFIG_IRQ_WORK=y |
- | | + | CONFIG_BUILDTIME_TABLE_SORT=y |
- | mdadm --monitor options... | + | CONFIG_THREAD_INFO_IN_TASK=y |
- | | + | |
- | mdadm device options... | + | # |
- | | + | # General setup |
- | Any parameter that does not start with ' | + | # |
- | or, for --examine-bitmap, | + | CONFIG_INIT_ENV_ARG_LIMIT=32 |
- | The first such name is often the name of an md device. | + | # CONFIG_COMPILE_TEST is not set |
- | names are often names of component devices. | + | CONFIG_LOCALVERSION="" |
+ | # CONFIG_LOCALVERSION_AUTO | ||
+ | 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 | ||
+ | # 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 | ||
- | For detailed help on the above major modes use --help after the mode | + | # |
- | e.g. | + | # IRQ subsystem |
- | mdadm --assemble | + | # |
- | For general help on options use | + | CONFIG_GENERIC_IRQ_PROBE=y |
- | mdadm --help-options | + | --More--(1%) |
+ | [q] | ||
</ | </ | ||
- | Dernièrement, | + | ====1.4 - Compiler le Noyau==== |
+ | |||
+ | La compilation du noyau peut prendre beaucoup | ||
< | < | ||
- | root@debian8:~# mdadm --assemble --help | + | root@debian11:/ |
- | Usage: mdadm --assemble device options... | + | ... |
- | mdadm --assemble --scan options... | + | dpkg-buildpackage: |
+ | CLEAN | ||
+ | CLEAN | ||
+ | CLEAN | ||
+ | CLEAN | ||
+ | CLEAN | ||
+ | CLEAN | ||
+ | CLEAN | ||
+ | CLEAN | ||
+ | CLEAN | ||
+ | CLEAN | ||
+ | CLEAN lib | ||
+ | CLEAN | ||
+ | CLEAN | ||
+ | CLEAN | ||
+ | CLEAN usr | ||
+ | CLEAN | ||
+ | CLEAN | ||
+ | CLEAN | ||
+ | CLEAN | ||
+ | </ | ||
- | This usage assembles one or more raid arrays from pre-existing | + | A l'issu du processus, les paquets du nouveau noyau se trouvent dans le répertoire **/ |
- | 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 | + | < |
- | config file, or can be deduced from the array identity. | + | root@debian11:/ |
- | The array identity is determined either from the --uuid, --name, or | + | root@debian11:/ |
- | --super-minor commandline arguments, from the config file, | + | Desktop |
- | or from the first component device on the command line. | + | Documents |
+ | Downloads | ||
+ | </ | ||
- | The different combinations of these are as follows: | + | ====1.5 - Installer le Noyau==== |
- | 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, | + | |
- | | + | |
- | If the --scan option is given, and no devices are listed, then | + | Installez maintenant les paquets **deb** : |
- | 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 | + | < |
- | Those devices are md devices that are to be assembled. Their identity | + | root@debian11:/ |
- | and components are determined from the config file. | + | </ |
- | If mdadm can not find all of the components for an array, it will assemble | + | Constatez la création d'un nouveau grub.cfg : |
- | 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:/ |
- | --uuid= | + | echo ' |
- | have this uuid are excluded | + | linux / |
- | --super-minor= | + | |
- | | + | |
- | | + | echo ' |
- | --config= | + | |
- | | + | |
- | --run -R : Try to start the array even if not enough devices | + | menuentry ' |
- | for a full array are present | + | echo ' |
- | | + | |
- | : out-of-date. This involves modifying the superblocks. | + | initrd |
- | | + | |
- | --no-degraded | + | |
- | | + | |
</ | </ | ||
- | Constatez maintenant | + | ====1.6 - Désinstaller un Noyau==== |
+ | |||
+ | Lister | ||
< | < | ||
- | root@debian8:~# cat /proc/mdstat | + | root@debian11:/home/trainee# dpkg -l | grep -i " |
- | Personalities : [raid6] [raid5] [raid4] | + | linux-image-5.10.0-13-amd64 |
- | md1 : active raid5 sda11[3] sda9[1] sda6[0] | + | linux-image-5.11.1 |
- | | + | linux-image-amd64 |
- | + | ||
- | unused devices: < | + | |
</ | </ | ||
- | Grâce à la commande mdadm, il est possible d' | + | Le noyau se désinstalle comme tout autre paquet |
< | < | ||
- | root@debian8:~# mdadm --query /dev/md1 | + | root@debian11:/ |
- | /dev/md1: 952.16MiB raid5 3 devices, | + | Reading package lists... Done |
+ | 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) ... | ||
</ | </ | ||
- | L' | + | Vérifiez que le fichier grub.cfg a été modifié |
< | < | ||
- | root@debian8:~# mdadm --query | + | root@debian11:/ |
- | /dev/md1: 952.16MiB raid5 3 devices, 0 spares. Use mdadm --detail for more detail. | + | root@debian11:/home/trainee# |
- | root@debian8:~# mdadm --detail | + | </code> |
- | /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 | + | |
- | Update Time : Wed Aug 3 13:20:16 2016 | + | Dernièrement, |
- | State : clean | + | |
- | | + | |
- | Working Devices : 3 | + | |
- | | + | |
- | Spare Devices : 0 | + | |
- | | + | < |
- | Chunk Size : 512K | + | root@debian11:/ |
+ | linux-image-5.10.0-13-amd64 | ||
+ | linux-image-amd64 | ||
+ | </ | ||
- | Name : debian8: | + | =====LAB #2 - Mise à Jour du Noyau avec le Gestionnaire des Paquets===== |
- | UUID : 41b8799a: | + | |
- | | + | |
- | Number | + | Afin d' |
- | 0 | + | |
- | 1 | + | < |
- | 3 | + | root@debian11: |
+ | deb http://deb.debian.org/ | ||
+ | root@debian11:/ | ||
+ | deb-src http://deb.debian.org/debian unstable main contrib non-free | ||
</ | </ | ||
- | Notez la ligne **Persistence : Superblock is persistent**. En effet, cette implémentation | + | Afin de ne faire que des mises à jour du **noyau** à partir |
- | <WRAP center round todo> | + | <code> |
- | Recherchez la signification des termes Layout, Chunk size, Major et Minor. | + | root@debian11:/ |
- | </WRAP> | + | root@debian11: |
+ | Package: * | ||
+ | Pin: release a=bullseye | ||
+ | Pin-Priority: | ||
- | Cependant, il necéssaire de renseigner le fichier **/etc/ | + | Package: linux-image-amd64 |
+ | Pin: release a=unstable | ||
+ | Pin-Priority: | ||
+ | |||
+ | Package: | ||
+ | Pin: release a=unstable | ||
+ | Pin-Priority: | ||
+ | </code> | ||
+ | |||
+ | Mettez | ||
< | < | ||
- | root@debian8:~# echo ' | + | root@debian11:/ |
- | root@debian8:~# mdadm --detail --scan >> | + | Hit:1 http://security.debian.org/debian-security bullseye-security InRelease |
- | root@debian8:~# cat /etc/mdadm/mdadm.conf | + | Hit:2 http://deb.debian.org/debian bullseye InRelease |
- | DEVICES | + | Get:3 http://deb.debian.org/debian bullseye-updates InRelease [39.4 kB] |
- | ARRAY /dev/md1 metadata=1.2 name=debian8:1 UUID=41b8799a:e24feb35:39e9aa3a:ec920626 | + | Get:4 http://deb.debian.org/ |
+ | 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' | ||
</ | </ | ||
- | Chaque unité peut être examinée individuellement | + | Installez ensuite les mises-à-jour du noyau : |
< | < | ||
- | root@debian8:~# mdadm --examine /dev/sda6 | + | root@debian11:/ |
- | /dev/sda6: | + | </code> |
- | 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 | + | |
- | Avail Dev Size : 974848 (476.08 MiB 499.12 MB) | + | Re-démarrez votre VM : |
- | 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 | + | < |
- | Bad Block Log : 512 entries available at offset 72 sectors | + | root@debian11:/ |
- | Checksum : 16f72803 - correct | + | </ |
- | | + | |
- | | + | Connectez-vous de nouveau à la VM et contrôlez la version du noyau : |
- | Chunk Size : 512K | + | |
- | | + | < |
- | Array State : AAA (' | + | trainee@debian11:~$ uname -a |
+ | Linux debian11 5.17.0-1-amd64 #1 SMP PREEMPT Debian 5.17.3-1 (2022-04-18) x86_64 GNU/Linux | ||
</ | </ | ||
- | A ce stade il est intéressant | + | Déconnectez-vous et re-connectez-vous directement en tant que root. |
+ | |||
+ | =====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@debian8:~# mdadm --manage | + | root@debian11:~# dpkg --get-selections | grep quota |
- | mdadm: set /dev/sda6 faulty in /dev/md1 | + | root@debian11:~# apt -y install quota |
</ | </ | ||
- | L' | + | Editez |
< | < | ||
- | root@debian8:~# mdadm --detail | + | root@debian11:~# vi /etc/fstab |
- | /dev/md1: | + | root@debian11: |
- | | + | # /etc/fstab: static file system information. |
- | | + | # |
- | Raid Level : raid5 | + | # Use ' |
- | Array Size : 974848 | + | # device; this may be used with UUID= as a more robust way to name devices |
- | Used Dev Size : 487424 (476.08 MiB 499.12 MB) | + | # that works even if disks are added and removed. See fstab(5). |
- | 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 | ||
+ | / | ||
+ | </ | ||
- | Update Time : Wed Aug 3 13:27:53 2016 | + | Démontez puis remontez /home : |
- | State : clean, degraded | + | |
- | | + | |
- | Working Devices : 2 | + | |
- | | + | |
- | Spare Devices : 0 | + | |
- | | + | < |
- | Chunk Size : 512K | + | root@debian11:~# umount /home |
+ | root@debian11:~# mount -a | ||
+ | </ | ||
- | | + | Vérifiez ensuite que les options soient prises en compte |
- | UUID : 41b8799a: | + | |
- | | + | |
- | Number | + | < |
- | | + | root@debian11: |
- | | + | sysfs /sys sysfs rw, |
- | 3 | + | proc /proc proc rw, |
+ | 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. | ||
</ | </ | ||
- | Il est maintenant nécessaire | + | Les options |
< | < | ||
- | root@debian8:~# mdadm --manage | + | root@debian11:~# quotacheck |
- | mdadm: hot removed /dev/sda6 from /dev/md1 | + | 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 | ||
</ | </ | ||
- | A l' | + | Les quotas ont été activés et les fichier **aquota.user** et **aquota.group** ont été créés dans le répertoire /home : |
< | < | ||
- | root@debian8:~# mdadm --detail | + | root@debian11:~# ls -la /home |
- | /dev/md1: | + | total 44 |
- | Version : 1.2 | + | drwxr-xr-x |
- | | + | drwxr-xr-x 20 root root |
- | Raid Level : raid5 | + | -rw------- |
- | Array Size : 974848 (952.16 MiB 998.24 MB) | + | -rw------- |
- | | + | drwx------ |
- | Raid Devices | + | drwxr-xr-x 15 trainee trainee |
- | | + | </ |
- | | + | |
- | Update Time : Wed Aug 3 13:29:30 2016 | + | Créez maintenant un utilisateur **fenestros** avec le mot de passe **fenestros** |
- | State : clean, degraded | + | |
- | | + | |
- | Working Devices : 2 | + | |
- | | + | |
- | Spare Devices : 0 | + | |
- | | + | < |
- | Chunk Size : 512K | + | root@debian11:~# groupadd fenestros && useradd |
+ | root@debian11:~# passwd fenestros | ||
+ | New password: fenestros | ||
+ | Retype new password: fenestros | ||
+ | passwd: password updated successfully | ||
+ | </ | ||
- | Name : debian8: | + | ====3.2 - La Commande edquota==== |
- | UUID : 41b8799a: | + | |
- | | + | |
- | Number | + | Mettez en place maintenant un quota de 10Mo pour l' |
- | 0 | + | |
- | 1 | + | < |
- | | + | root@debian8: |
+ | root@debian8: | ||
+ | root@debian8: | ||
</ | </ | ||
- | Constatez maintenant l'existance | + | L'éditeur **vi** se lance et vous obtiendrez un résultat similaire à celui-ci : |
+ | |||
+ | < | ||
+ | Disk quotas for user fenestros (uid 1001): | ||
+ | Filesystem | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | Modifiez ce fichier ainsi : | ||
+ | |||
+ | < | ||
+ | Disk quotas for user fenestros (uid 1001): | ||
+ | Filesystem | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | Les options | ||
< | < | ||
- | root@debian8:~# cat / | + | root@debian11:~# edquota --help |
- | Personalities | + | edquota: Usage: |
- | md1 : active raid5 sda11[3] sda9[1] | + | edquota |
- | | + | |
- | + | | |
- | unused devices: < | + | edquota |
+ | | ||
+ | |||
+ | -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> | ||
- | Notez que le RAID a été démarré avec 2 unités au lieu de trois. | + | **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/sda6 il convient d' | + | ====3.3 |
+ | |||
+ | Appliquez maintenant les quotas | ||
< | < | ||
- | root@debian8:~# mdadm --manage --add /dev/md1 / | + | root@debian11:~# quotaon |
- | mdadm: added /dev/sda12 | + | |
</ | </ | ||
- | L' | + | Les options |
< | < | ||
- | root@debian8:~# mdadm --manage --add /dev/md1 /dev/sda12 | + | root@debian11:~# quotaon |
- | mdadm: added /dev/sda12 | + | quotaon: Usage: |
- | 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 | + | |
- | Update Time : Wed Aug 3 13:35:24 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 : debian8: | + | Quand l' |
- | UUID : 41b8799a: | + | |
- | | + | |
- | 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> |
- | 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@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 | ||
+ | | ||
</ | </ | ||
- | Naturellement, | + | <WRAP center round important> |
+ | **Important** - Notez que l' | ||
+ | </ | ||
+ | |||
+ | Les options de la commande | ||
< | < | ||
- | root@debian8:~# echo ' | + | root@debian11:~# repquota --help |
- | root@debian8:~# mdadm --detail | + | repquota: Utility for reporting quotas. |
- | root@debian8: | + | Usage: |
- | DEVICES /dev/sda12 /dev/sda9 /dev/sda11 | + | repquota [-vugsi] [-c|C] [-t|n] [-F quotaformat] [-O (default | xml | csv)] (-a | mntpoint) |
- | 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. |
- | <div align=" | + | |
- | Copyright © 2020 Hugh Norris.< | + | |
- | </ | + | |
- | </ | + | |
- | ----- | + |