Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
elearning:workbooks:debian:10:junior:l121 [2023/08/24 11:03] – created adminelearning:workbooks:debian:10:junior:l121 [2024/03/08 10:36] (Version actuelle) admin
Ligne 1: Ligne 1:
 ~~PDF:LANDSCAPE~~ ~~PDF:LANDSCAPE~~
  
-Version : **2022.01**+Version : **2024.01**
  
 Dernière mise-à-jour : ~~LASTMOD~~ Dernière mise-à-jour : ~~LASTMOD~~
  
-======LDF512 - Gestion du Noyau et des Quotas======+======LDF512 - Gestion des Disques Avancée - Raid Logiciel======
  
 =====Contenu du Module===== =====Contenu du Module=====
  
-  * **LDF512 - Gestion du Noyau et des Quotas**+  * **LDF512 - Gestion Avancée des Disques - Raid Logiciel**
     * 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 avec Contrôle d'Erreurs 
-    LAB #3 - Gestion des Quotas +      RAID 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'exploitation qui gère les entrées/sorties avec des périphériques. Dans certains cas il est préférable de recompiler le noyau de LinuxLa motivation de cette recompilation peut être :+Les solutions RAID ou //Redundant Array of Independent Disks// ou encore //Redundant Array of Inexpensive Disks// permettent la combinaison de plusieurs disques de façon à ce que ceux-ci soient vu comme un seul disque logique.
  
-  * la diminution de la taille du noyau, +Les solutions RAID sont issues du travail fourni par l'université de Berkeley en Californie sur un projet de tolérances de pannesLes systèmes RAID offre maintenant plusieurs avantages :
-  * la prise en charge de nouveau matériel, +
-  * l'ajout de fonctionnalités, +
-  * l'optimisation du code, +
-  * la correction de bogues, +
-  * 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.
  
-<code> +Deux concepts sont fondamentaux à la compréhension des solutions RAID.
-root@debian11:~# uname -r +
-5.10.0-13-amd64 +
-</code>+
  
-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 **/lib/modules/<version-du-noyau>** :+====Disques en miroir====
  
-<code> +La technique des disques en miroir consiste à dupliquer l'écriture des données sur plusieurs disquesLe miroir peut être géré par un logiciel ou par du matériel.
-root@debian11:~# ls /lib/modules/`uname -r`/ +
-kernel         modules.alias.bin  modules.builtin.alias.bin  modules.builtin.modinfo  modules.dep.bin  modules.order    modules.symbols +
-modules.alias  modules.builtin    modules.builtin.bin        modules.dep              modules.devname  modules.softdep  modules.symbols.bin +
-</code>+
  
-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'ensemble des segments constitue alors un disque logique ou //striped disk//. Cette technique peut être améliorée en déposant une bande de parité, calculée à partir des données des autres bandes, afin de pouvoir reconstituer une bande de données défaillante.
-  * rmmod +
-  * lsmod +
-  * modprobe+
  
-Par exemple :+=====Types de RAID=====
  
-<code> +====RAID - Concaténation====
-root@debian11:~# lsmod +
-Module                  Size  Used by +
-rfkill                 28672 +
-raid456               180224 +
-async_raid6_recov      24576  1 raid456 +
-async_memcpy           20480  2 raid456,async_raid6_recov +
-async_pq               20480  2 raid456,async_raid6_recov +
-async_xor              20480  3 async_pq,raid456,async_raid6_recov +
-async_tx               20480  5 async_pq,async_memcpy,async_xor,raid456,async_raid6_recov +
-md_mod                180224  1 raid456 +
-sg                     36864  0 +
-virtio_balloon         24576 +
-joydev                 28672 +
-qemu_fw_cfg            20480  0 +
-pcspkr                 16384 +
-serio_raw              20480  0 +
-evdev                  28672  2 +
-ecryptfs              122880 +
-parport_pc             40960 +
-ppdev                  24576  0 +
-lp                     20480 +
-parport                69632  3 parport_pc,lp,ppdev +
-fuse                  167936 +
-configfs               57344 +
-ip_tables              32768  0 +
-x_tables               53248  1 ip_tables +
-autofs4                53248  2 +
-ext4                  921600 +
-crc16                  16384  1 ext4 +
-mbcache                16384  1 ext4 +
-jbd2                  151552  1 ext4 +
-hid_generic            16384  0 +
-btrfs                1568768 +
-usbhid                 65536 +
-hid                   147456  2 usbhid,hid_generic +
-blake2b_generic        20480  0 +
-xor                    24576  2 async_xor,btrfs +
-raid6_pq              122880  4 async_pq,btrfs,raid456,async_raid6_recov +
-libcrc32c              16384  2 btrfs,raid456 +
-crc32c_generic         16384 +
-usb_storage            81920  0 +
-dm_mod                163840 +
-sd_mod                 61440  10 +
-t10_pi                 16384  1 sd_mod +
-crc_t10dif             20480  1 t10_pi +
-crct10dif_generic      16384  1 +
-crct10dif_common       16384  2 crct10dif_generic,crc_t10dif +
-sr_mod                 28672 +
-cdrom                  73728  1 sr_mod +
-virtio_net             61440 +
-net_failover           24576  1 virtio_net +
-failover               16384  1 net_failover +
-virtio_scsi            24576  8 +
-bochs_drm              16384  0 +
-ata_generic            16384  0 +
-drm_vram_helper        20480  1 bochs_drm +
-uhci_hcd               53248 +
-drm_ttm_helper         16384  1 drm_vram_helper +
-ttm                   114688  2 drm_vram_helper,drm_ttm_helper +
-ehci_hcd               98304 +
-drm_kms_helper        278528  4 drm_vram_helper,bochs_drm +
-cec                    61440  1 drm_kms_helper +
-psmouse               184320 +
-drm                   618496  6 drm_kms_helper,drm_vram_helper,bochs_drm,drm_ttm_helper,ttm +
-usbcore               323584  4 usbhid,usb_storage,ehci_hcd,uhci_hcd +
-ata_piix               36864 +
-virtio_pci             28672 +
-libata                290816  2 ata_piix,ata_generic +
-virtio_ring            36864  4 virtio_balloon,virtio_scsi,virtio_pci,virtio_net +
-virtio                 16384  4 virtio_balloon,virtio_scsi,virtio_pci,virtio_net +
-i2c_piix4              28672  0 +
-scsi_mod              262144  6 virtio_scsi,sd_mod,usb_storage,libata,sg,sr_mod +
-usb_common             16384  3 usbcore,ehci_hcd,uhci_hcd +
-floppy                 90112 +
-button                 24576 +
-</code>+
  
-Pour ajouter un module, on peut utiliser la commande **insmod** ou **modprobe**Cette dernière ajoute non seulement le module passé en argument mais également ses dépendances :+Création de volume par récupération de l'espace libre sur un ou plusieurs disques. Le principe de la concaténation est la création d'un volume à bandes où chaque bande est une tranche.
  
-<code> +{{:linux:raid0c.gif|}}
-root@debian11:~# modprobe bonding+
  
-root@debian11:~# lsmod | head +===Avantages===
-Module                  Size  Used by +
-bonding               192512 +
-rfkill                 28672 +
-raid456               180224 +
-async_raid6_recov      24576  1 raid456 +
-async_memcpy           20480  2 raid456,async_raid6_recov +
-async_pq               20480  2 raid456,async_raid6_recov +
-async_xor              20480  3 async_pq,raid456,async_raid6_recov +
-async_tx               20480  5 async_pq,async_memcpy,async_xor,raid456,async_raid6_recov +
-md_mod                180224  1 raid456 +
-</code>+
  
-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 :+  Récupération de l'espace disque.
  
-<code> +===Inconvénients===
-root@debian11:~# modprobe -r bonding +
-root@debian11:~# lsmod | head +
-Module                  Size  Used by +
-rfkill                 28672 +
-raid456               180224 +
-async_raid6_recov      24576  1 raid456 +
-async_memcpy           20480  2 raid456,async_raid6_recov +
-async_pq               20480  2 raid456,async_raid6_recov +
-async_xor              20480  3 async_pq,raid456,async_raid6_recov +
-async_tx               20480  5 async_pq,async_memcpy,async_xor,raid456,async_raid6_recov +
-md_mod                180224  1 raid456 +
-sg                     36864 +
-</code>+
  
-Les dépendances des modules sont résolues par la commande **modprobe** grâce aux fichier **/lib/modules/<version-du-noyau>/modules.dep**. Ce dernier peut être créé manuellement grâce à la commande **depmod** :+  * Pas de protection des données, 
 +  Pas d'augmentation des performances d'E/S.
  
-<code> +====RAID 0 Striping====
-root@debian11:~# more /lib/modules/`uname -r`/modules.dep +
-kernel/arch/x86/events/amd/power.ko: +
-kernel/arch/x86/events/intel/intel-uncore.ko: +
-kernel/arch/x86/events/intel/intel-cstate.ko: +
-kernel/arch/x86/events/rapl.ko: +
-kernel/arch/x86/kernel/cpu/mce/mce-inject.ko: +
-kernel/arch/x86/kernel/msr.ko: +
-kernel/arch/x86/kernel/cpuid.ko: +
-kernel/arch/x86/crypto/glue_helper.ko: +
-kernel/arch/x86/crypto/twofish-x86_64.ko: kernel/crypto/twofish_common.ko +
-kernel/arch/x86/crypto/twofish-x86_64-3way.ko: kernel/arch/x86/crypto/twofish-x86_64.ko kernel/crypto/twofish_common.ko kernel/arch/x86/crypto/glue_helper.ko +
-kernel/arch/x86/crypto/twofish-avx-x86_64.ko: kernel/crypto/crypto_simd.ko kernel/crypto/cryptd.ko kernel/arch/x86/crypto/twofish-x86_64-3way.ko kernel/arch/x86/crypto/twofish-x86_64.ko kernel/crypto/twofish_co +
-mmon.ko kernel/arch/x86/crypto/glue_helper.ko +
-kernel/arch/x86/crypto/serpent-sse2-x86_64.ko: kernel/crypto/serpent_generic.ko kernel/crypto/crypto_simd.ko kernel/crypto/cryptd.ko kernel/arch/x86/crypto/glue_helper.ko +
-kernel/arch/x86/crypto/serpent-avx-x86_64.ko: kernel/crypto/serpent_generic.ko kernel/crypto/crypto_simd.ko kernel/crypto/cryptd.ko kernel/arch/x86/crypto/glue_helper.ko +
-kernel/arch/x86/crypto/serpent-avx2.ko: kernel/arch/x86/crypto/serpent-avx-x86_64.ko kernel/crypto/serpent_generic.ko kernel/crypto/crypto_simd.ko kernel/crypto/cryptd.ko kernel/arch/x86/crypto/glue_helper.ko +
-kernel/arch/x86/crypto/des3_ede-x86_64.ko: kernel/lib/crypto/libdes.ko +
-kernel/arch/x86/crypto/camellia-x86_64.ko: kernel/arch/x86/crypto/glue_helper.ko +
-kernel/arch/x86/crypto/camellia-aesni-avx-x86_64.ko: kernel/arch/x86/crypto/camellia-x86_64.ko kernel/crypto/crypto_simd.ko kernel/crypto/cryptd.ko kernel/arch/x86/crypto/glue_helper.ko +
-kernel/arch/x86/crypto/camellia-aesni-avx2.ko: kernel/arch/x86/crypto/camellia-aesni-avx-x86_64.ko kernel/arch/x86/crypto/camellia-x86_64.ko kernel/crypto/crypto_simd.ko kernel/crypto/cryptd.ko kernel/arch/x86/ +
-crypto/glue_helper.ko +
-kernel/arch/x86/crypto/blowfish-x86_64.ko: kernel/crypto/blowfish_common.ko +
-kernel/arch/x86/crypto/cast5-avx-x86_64.ko: kernel/crypto/cast5_generic.ko kernel/crypto/cast_common.ko kernel/crypto/crypto_simd.ko kernel/crypto/cryptd.ko +
-kernel/arch/x86/crypto/cast6-avx-x86_64.ko: kernel/crypto/cast6_generic.ko kernel/crypto/cast_common.ko kernel/crypto/crypto_simd.ko kernel/crypto/cryptd.ko kernel/arch/x86/crypto/glue_helper.ko +
-kernel/arch/x86/crypto/aegis128-aesni.ko: kernel/crypto/crypto_simd.ko kernel/crypto/cryptd.ko +
-kernel/arch/x86/crypto/chacha-x86_64.ko: kernel/lib/crypto/libchacha.ko +
-kernel/arch/x86/crypto/aesni-intel.ko: kernel/lib/crypto/libaes.ko kernel/crypto/crypto_simd.ko kernel/crypto/cryptd.ko kernel/arch/x86/crypto/glue_helper.ko +
-kernel/arch/x86/crypto/sha1-ssse3.ko: +
-kernel/arch/x86/crypto/sha256-ssse3.ko: +
-kernel/arch/x86/crypto/sha512-ssse3.ko: kernel/crypto/sha512_generic.ko +
-kernel/arch/x86/crypto/blake2s-x86_64.ko: kernel/lib/crypto/libblake2s-generic.ko +
-kernel/arch/x86/crypto/ghash-clmulni-intel.ko: kernel/crypto/cryptd.ko +
-kernel/arch/x86/crypto/crc32c-intel.ko: +
-kernel/arch/x86/crypto/crc32-pclmul.ko: +
-kernel/arch/x86/crypto/crct10dif-pclmul.ko: kernel/crypto/crct10dif_common.ko +
-kernel/arch/x86/crypto/poly1305-x86_64.ko: +
-kernel/arch/x86/crypto/curve25519-x86_64.ko: kernel/lib/crypto/libcurve25519-generic.ko +
-kernel/arch/x86/kvm/kvm.ko: kernel/virt/lib/irqbypass.ko +
-kernel/arch/x86/kvm/kvm-intel.ko: kernel/arch/x86/kvm/kvm.ko kernel/virt/lib/irqbypass.ko +
-kernel/arch/x86/kvm/kvm-amd.ko: kernel/drivers/crypto/ccp/ccp.ko kernel/drivers/char/hw_random/rng-core.ko kernel/arch/x86/kvm/kvm.ko kernel/virt/lib/irqbypass.ko +
-kernel/mm/hwpoison-inject.ko: +
-kernel/mm/zsmalloc.ko: +
-kernel/mm/z3fold.ko: +
-kernel/fs/nfs_common/nfs_acl.ko: kernel/net/sunrpc/sunrpc.ko +
-kernel/fs/nfs_common/grace.ko: +
-kernel/fs/nfs_common/nfs_ssc.ko: +
-kernel/fs/quota/quota_v1.ko: +
-kernel/fs/quota/quota_v2.ko: kernel/fs/quota/quota_tree.ko +
-kernel/fs/quota/quota_tree.ko: +
-kernel/fs/nls/nls_cp437.ko: +
-kernel/fs/nls/nls_cp737.ko: +
-kernel/fs/nls/nls_cp775.ko: +
-kernel/fs/nls/nls_cp850.ko: +
-kernel/fs/nls/nls_cp852.ko: +
-kernel/fs/nls/nls_cp855.ko: +
-kernel/fs/nls/nls_cp857.ko: +
-kernel/fs/nls/nls_cp860.ko: +
-kernel/fs/nls/nls_cp861.ko: +
-kernel/fs/nls/nls_cp862.ko: +
---More--(0%) +
-[q] +
-</code>+
  
-Il est possible d'obtenir des informations sur un module grâce à la commande **modinfo** :+Création de volume sur plusieurs disques afin d'augmenter les performances d'E/S. Le principe du striping est la création d'un volume à bandes réparties sur plusieurs tranches. La taille de la bande doit être fonction des données à écrire sur le volume (16k, 32k, 64k, etc.) Cette taille est choisie à la création du volume.
  
-<code> +{{:linux:raid0s.gif|}}
-root@debian11:~# modinfo bonding +
-filename      /lib/modules/5.10.0-13-amd64/kernel/drivers/net/bonding/bonding.ko +
-author:         Thomas Davis, tadavis@lbl.gov and many others +
-description:    Ethernet Channel Bonding Driver +
-license:        GPL +
-alias:          rtnl-link-bond +
-depends:         +
-retpoline:      Y +
-intree:         Y +
-name:           bonding +
-vermagic:       5.10.0-13-amd64 SMP mod_unload modversions  +
-sig_id:         PKCS#+
-signer:         Debian Secure Boot CA +
-sig_key:        4B:6E:F5:AB:CA:66:98:25:17:8E:05:2C:84:66:7C:CB:C0:53:1F:8C +
-sig_hashalgo:   sha256 +
-signature:      52:9F:34:1A:E8:04:22:2E:4C:92:17:82:D2:22:83:59:38:E2:EB:D6: +
-                EC:81:C3:CD:F8:C1:B9:5F:FC:C2:6D:27:BC:7B:91:13:87:5B:2E:92: +
-                77:36:A1:3D:F8:41:5C:9B:1D:62:E1:90:F7:48:F4:4E:7E:85:F5:54: +
-                CD:51:99:A6:C4:E0:FB:2C:4F:D6:5F:11:15:93:7E:30:62:A9:FA:46: +
-                29:90:B2:58:A4:B4:34:8B:EA:EF:14:AD:D6:5D:6C:4D:03:C9:AC:0F: +
-                F1:28:A0:65:3C:AA:C8:CA:83:59:25:F3:09:20:F2:74:7F:5A:7D:BB: +
-                84:17:57:F5:E6:16:E5:CB:A9:A3:0C:F0:A9:04:4A:B2:63:98:80:30: +
-                73:EE:39:3A:86:3E:67:3C:2F:5C:38:1E:35:F9:79:6C:F6:60:7B:B5: +
-                9D:3C:EA:0D:0F:23:E1:EC:EA:42:4C:EF:EC:AB:3E:07:D3:35:D7:E4: +
-                4A:E4:D1:7A:50:F8:C1:50:5E:93:0C:A2:7D:D1:77:E2:3A:97:74:BA: +
-                D7:38:7E:C0:4C:36:66:00:78:03:E0:E3:20:46:70:13:7D:15:10:3A: +
-                85:B7:CB:10:3B:9A:DF:1A:4E:64:3D:BF:EC:21:7B:B1:4C:37:CE:30: +
-                0D:90:FE:73:87:20:40:83:60:02:0F:4F:4D:85:78:E7 +
-parm:           max_bonds:Max number of bonded devices (int) +
-parm:           tx_queues:Max number of transmit queues (default = 16) (int) +
-parm:           num_grat_arp:Number of peer notifications to send on failover event (alias of num_unsol_na) (int) +
-parm:           num_unsol_na:Number of peer notifications to send on failover event (alias of num_grat_arp) (int) +
-parm:           miimon:Link check interval in milliseconds (int) +
-parm:           updelay:Delay before considering link up, in milliseconds (int) +
-parm:           downdelay:Delay before considering link down, in milliseconds (int) +
-parm:           use_carrier:Use netif_carrier_ok (vs MII ioctls) in miimon; 0 for off, 1 for on (default) (int) +
-parm:           mode:Mode of operation; 0 for balance-rr, 1 for active-backup, 2 for balance-xor, 3 for broadcast, 4 for 802.3ad, 5 for balance-tlb, 6 for balance-alb (charp) +
-parm:           primary:Primary network device to use (charp) +
-parm:           primary_reselect:Reselect primary slave once it comes up; 0 for always (default), 1 for only if speed of primary is better, 2 for only on active slave failure (charp) +
-parm:           lacp_rate:LACPDU tx rate to request from 802.3ad partner; 0 for slow, 1 for fast (charp) +
-parm:           ad_select:802.3ad aggregation selection logic; 0 for stable (default), 1 for bandwidth, 2 for count (charp) +
-parm:           min_links:Minimum number of available links before turning on carrier (int) +
-parm:           xmit_hash_policy:balance-alb, balance-tlb, balance-xor, 802.3ad hashing method; 0 for layer 2 (default), 1 for layer 3+4, 2 for layer 2+3, 3 for encap layer 2+3, 4 for encap layer 3+4 (charp) +
-parm:           arp_interval:arp interval in milliseconds (int) +
-parm:           arp_ip_target:arp targets in n.n.n.n form (array of charp) +
-parm:           arp_validate:validate src/dst of ARP probes; 0 for none (default), 1 for active, 2 for backup, 3 for all (charp) +
-parm:           arp_all_targets:fail on any/all arp targets timeout; 0 for any (default), 1 for all (charp) +
-parm:           fail_over_mac:For active-backup, do not set all slaves to the same MAC; 0 for none (default), 1 for active, 2 for follow (charp) +
-parm:           all_slaves_active:Keep all frames received on an interface by setting active flag for all slaves; 0 for never (default), 1 for always. (int) +
-parm:           resend_igmp:Number of IGMP membership reports to send on link failure (int) +
-parm:           packets_per_slave:Packets to send per slave in balance-rr mode; 0 for a random slave, 1 packet per slave (default), >1 packets per slave. (int) +
-parm:           lp_interval:The number of seconds between instances where the bonding driver sends learning packets to each slaves peer switch. The default is 1. (uint) +
-</code>+
  
-Dernièrement, les fichiers dans le repertoire **/etc/modprobe.d** sont utilisés pour spécifier les options éventuelles à passer aux modules lors de leur chargement ainsi que les alias utilisés pour leur faire référence :+===Avantages===
  
-<code> +  * Augmentation des performances d'E/S par écriture en parallèle sur les disques.
-root@debian11:~# ls /etc/modprobe.d +
-mdadm.conf+
  
-root@debian11:~# cat /etc/modprobe.d/mdadm.conf  +===Inconvénients===
-# mdadm module configuration file +
-# set start_ro=1 to make newly assembled arrays read-only initially, +
-# to prevent metadata writes.  This is needed in order to allow +
-# resume-from-disk to work - new boot should not perform writes +
-# because it will be done behind the back of the system being +
-# resumed.  See http://bugs.debian.org/415441 for details.+
  
-options md_mod start_ro=1 +  * Pas de protection des données.
-</code>+
  
-=====LAB #1 - Compilation et installation du noyau=====+====RAID 1 - Miroir====
  
-Commencez par installer les paquets necessaires :+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, on parle de //duplexing// :
  
-<code> +{{:linux:raid1m.gif|}}
-root@debian11:~# apt-get update +
-Hit:1 http://deb.debian.org/debian bullseye InRelease +
-Get:2 http://deb.debian.org/debian bullseye-updates InRelease [39.4 kB] +
-Get:3 http://security.debian.org/debian-security bullseye-security InRelease [44.1 kB] +
-Fetched 83.5 kB in 1s (158 kB/s)               +
-Reading package lists..Done+
  
-root@debian11:~# apt-get -y install build-essential linux-source bc kmod cpio flex libncurses5-dev libelf-dev libssl-dev dwarves debconf-utils dpkg-dev debhelper ncurses-dev +===Avantages===
-</code>+
  
-====1.1 - Déplacer /home====+  * Protection des données contre une défaillance d'un disque.
  
-Créez une seule partition sur **/dev/sdb** :+===Inconvénients===
  
-<code> +  * Coûteux à cause de l'augmentation du nombre de disques.
-root@debian11:~# fdisk /dev/sdb+
  
-Welcome to fdisk (util-linux 2.36.1). +====RAID 1+0 - Striping en Miroir====
-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 1On l'appelle aussi un RAID **exotique**:
-Created a new DOS disklabel with disk identifier 0xa10c368d.+
  
-Command (m for help)+{{:linux:raid10.gif|}}
-Partition type +
-     primary (0 primary, 0 extended, 4 free) +
-     extended (container for logical partitions) +
-Select (default p)+
  
-Using default response p. +===Avantages===
-Partition number (1-4, default 1):  +
-First sector (2048-134217727, default 2048):  +
-Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-134217727, default 134217727): +
  
-Created a new partition 1 of type 'Linuxand of size 64 GiB.+  * 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. +
-</code>+
  
-Créez maintenant un système de fichiers ext4 sur **/dev/sdb1** :+  * Coûteux à cause de l'augmentation du nombre de disques.
  
-<code> +====RAID 2 - Miroir avec Contrôle d'Erreurs====
-root@debian11:~# mkfs.ext4 /dev/sdb1 +
-mke2fs 1.46.(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'erreurs (EEC). De nos jours cette technique est peu utilisée, ayant été remplacée par les RAID 3, 4 et 5.
-Writing inode tables: done                             +
-Creating journal (65536 blocks): done +
-Writing superblocks and filesystem accounting information: done  +
-</code>+
  
-Editez le fichier **/etc/ssh/sshd_config** et modifiez la directive **PermitRootLogin** :+====RAID 3 et 4 - Striping avec Parité====
  
-<code> +Les RAID 3 et 4 sont des technologies avec bandes de parité distribuées sur un seul disque :
-root@debian11:~# vi /etc/ssh/sshd_config +
-root@debian11:~# cat /etc/ssh/sshd_config +
-#       $OpenBSD: sshd_config,v 1.103 2018/04/09 20:41:22 tj Exp $+
  
-# This is the sshd server system-wide configuration file.  See +{{:linux:raid34.gif|}}
-# sshd_config(5) for more information.+
  
-# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin+En RAID 3, la taille des segments n’est pas modifiable et est fixée à 512 octets (en RAID 3 : un segment un secteur de disque dur = 512 octets).
  
-# The strategy used for options in the default sshd_config shipped with +En RAID 4la taille des segments est variable et se modifie en temps réelCela 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 +
-# possiblebut leave them commented Uncommented options override the +
-# default value.+
  
-Include /etc/ssh/sshd_config.d/*.conf+===Avantages===
  
-#Port 22 +  * Protection des données contre une défaillance d'un disque.
-#AddressFamily any +
-#ListenAddress 0.0.0.0 +
-#ListenAddress ::+
  
-#HostKey /etc/ssh/ssh_host_rsa_key +===Inconvénients===
-#HostKey /etc/ssh/ssh_host_ecdsa_key +
-#HostKey /etc/ssh/ssh_host_ed25519_key+
  
-# Ciphers and keying +  * Création d'un goulot d'étranglement des données à cause de l'écriture des données de parité sur un seul disque.
-#RekeyLimit default none+
  
-# Logging +====RAID 5 - Striping avec Parité Distribuée====
-#SyslogFacility AUTH +
-#LogLevel INFO+
  
-# Authentication:+Le RAID 5 est une technologie avec bandes de parité distribuées sur plusieurs disques :
  
-#LoginGraceTime 2m +{{:linux:raid5.gif|}}
-PermitRootLogin yes  +
-#StrictModes yes +
-#MaxAuthTries 6 +
-#MaxSessions 10+
  
-... +===Avantages===
-</code>+
  
-Re-démarrez le serveur ssh :+  * Protection des données contre une défaillance d'un disque, 
 +  * Evite le goulot d'étranglement d'un seul disque de parité.
  
-<code> +===Inconvénients===
-root@debian11:~# systemctl restart sshd +
-root@debian11:~# systemctl status sshd +
-● ssh.service - OpenBSD Secure Shell server +
-     Loaded: loaded (/lib/systemd/system/ssh.service; enabled; vendor preset: enabled) +
-     Active: active (running) since Sun 2022-05-01 15:35:50 CEST; 6s ago +
-       Docs: man:sshd(8) +
-             man:sshd_config(5) +
-    Process: 2793 ExecStartPre=/usr/sbin/sshd -t (code=exited, status=0/SUCCESS) +
-   Main PID: 2794 (sshd) +
-      Tasks: 1 (limit: 4656) +
-     Memory: 1.1M +
-        CPU: 25ms +
-     CGroup: /system.slice/ssh.service +
-             └─2794 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups+
  
-May 01 15:35:50 debian11 systemd[1]: Starting OpenBSD Secure Shell server... +  * Lecture moins performante qu'avec RAID 3 et 4.
-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. +
-</code>+
  
-<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. +
-</WRAP>+
  
-Montez **/dev/sdb1** sur /mnt :+Il existe aussi deux autres technologies RAID, toute deux issues de la technologie RAID 5 :
  
-<code> +  * RAID 6 
-root@debian11:~# mount /dev/sdb1 /mnt +    //Disk Striping with Double Distributed Parity/
-</code>+  * RAID TP 
 +    * //Disk Striping with Triple Distributed Parity//
  
-Copiez le contenu de /home vers /mnt :+=====RAID Logiciel sous Debian=====
  
-<code> +====Préparation du disque====
-root@debian11:~# cp -a /home/* /mnt +
-</code>+
  
-Démontez /dev/sdb1 :+===Partitionnement===
  
-<code> +Suite à votre LAB de la leçon **Gestion des Disques et le Swap**, votre disque comporte 12 partitions :
-root@debian11:~# umount /mnt +
-</code> +
- +
-Identifiez l'UUID de /dev/sdb1 :+
  
 <code> <code>
-root@debian11:~# ls -l /dev/disk/by-uuid/ | grep sdb1 +root@debian8:~# fdisk -l
-lrwxrwxrwx 1 root root 10 May  1 15:31 24f1821e-1d5b-4256-8ee3-c9ee6b382ddc -> ../../sdb1 +
-</code>+
  
-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/optimal): 512 bytes / 512 bytes 
 +Disklabel type: dos 
 +Disk identifier0xac1e8183
  
-<code> +Device     Boot    Start      End  Sectors  Size Id Type 
-root@debian11:~# vi /etc/fstab +/dev/sda1  *        2048 20482047 20480000  9.8G 83 Linux 
-root@debian11:~# cat /etc/fstab +/dev/sda2       20482048 41938943 21456896 10.2G  5 Extended 
-/etc/fstab: static file system information. +/dev/sda5       20484096 24578047  4093952    2G 82 Linux swap / Solaris 
-+/dev/sda6       24610816 25587711   976896  477M fd Linux raid autodetect 
-# Use 'blkid' to print the universally unique identifier for a +/dev/sda7       25589760 25980927   391168  191M 8e Linux LVM 
-# device; this may be used with UUID= as a more robust way to name devices +/dev/sda8       25982976 26568703   585728  286M 8e Linux LVM 
-# that works even if disks are added and removed. See fstab(5). +/dev/sda9       26570752 27547647   976896  477M fd Linux raid autodetect 
-+/dev/sda10      27549696 28329983   780288  381M 8e Linux LVM 
-# systemd generates mount units based on this file, see systemd.mount(5). +/dev/sda11      28332032 29308927   976896  477M fd Linux raid autodetect 
-# Please run 'systemctl daemon-reload' after making changes here. +/dev/sda12      29310976 30287871   976896  477M fd Linux raid autodetect 
-+/dev/sda13      30289920 30699519   409600  200M 83 Linux
-# <file system> <mount point>   <type>  <options>       <dump>  <pass> +
-# / was on /dev/sda1 during installation +
-UUID=9887a74f-a680-4bde-8f04-db5ae9ea186e               ext4    errors=remount-ro 0       1 +
-UUID=24f1821e-1d5b-4256-8ee3-c9ee6b382ddc /home           ext4    defaults      0 0 +
-# swap was on /dev/sda5 during installation +
-UUID=1f9439f5-4b19-49b1-b292-60c2c674cee9 none            swap    sw              0       0 +
-/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto           0+
 </code> </code>
  
-Créez le point de montage /home :+====Mise en Place du RAID 5 Logiciel====
  
-<code> +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:~# mkdir /home +
-</code>+
  
-Montez /dev/sdb1 : +<file
- +/dev/sda6       24610816 25587711   976896  477M fd Linux raid autodetect 
-<code+/dev/sda9       26570752 27547647   976896  477M fd Linux raid autodetect 
-root@debian11:~# mount -a +/dev/sda11      28332032 29308927   976896  477M fd Linux raid autodetect 
- +/dev/sda12      29310976 30287871   976896  477M fd Linux raid autodetect 
-root@debian11:~# mount +</file>
-sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime) +
-proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) +
-udev on /dev type devtmpfs (rw,nosuid,relatime,size=1986968k,nr_inodes=496742,mode=755) +
-devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000) +
-tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=402560k,mode=755) +
-/dev/sda1 on / type ext4 (rw,relatime,errors=remount-ro) +
-securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime) +
-tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) +
-tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k) +
-cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot) +
-pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime) +
-none on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700) +
-systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=11732) +
-mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime) +
-debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime) +
-hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M) +
-tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime) +
-configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime) +
-fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime) +
-tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=402556k,nr_inodes=100639,mode=700) +
-/dev/sdb1 on /home type ext4 (rw,relatime) +
-</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 :
  
 <code> <code>
-root@debian11:~# df -+mdadm --create <unité RAID> [options] <unités physiques>
-Filesystem      Size  Used Avail Use% Mounted on +
-udev            1.9G      1.9G   0% /dev +
-tmpfs           394M  892K  393M   1% /run +
-/dev/sda1        31G  4.1G   25G  14% / +
-tmpfs           2.0G      2.0G   0% /dev/shm +
-tmpfs           5.0M      5.0M   0% /run/lock +
-tmpfs           394M   36K  394M   1% /run/user/+
-/dev/sdb1        63G  1.4M   60G   1% /home+
 </code> </code>
  
-<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. +
-</WRAP> +
- +
-====1.2 - Télécharger le Code Source du Noyau==== +
- +
-Le code source est disponible sur le site **www.kernel.org** :+
  
 <code> <code>
-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/debianjessie/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: deferring update (trigger activated) 
 +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: Generating /boot/initrd.img-3.16.0-4-amd64 
 +W: mdadm: /etc/mdadm/mdadm.conf defines no arrays. 
 +W: mdadm: no arrays defined in configuration file
 </code> </code>
  
-Désarchivez le tar.xz que vous avez téléchargé :+Saisissez maintenant la commande suivante :
  
 <code> <code>
-trainee@debian8:~$ tar xf linux-5.11.1.tar.gz+root@debian8:~# mdadm --create /dev/md1 --level=--raid-devices=3 /dev/sda6 /dev/sda9 /dev/sda11 
 +mdadm: Defaulting to version 1.2 metadata 
 +mdadm: array /dev/md1 started.
 </code> </code>
  
-Notez que l'occupation disque du code source du noyau linux-5.11.1 est de 1.2 Go :+Les options dans la ligne de commande sont :
  
-<code> +^ Option Courte ^ Option Longue ^ Description ^ 
-trainee@debian11:~$ du -hs ./linux-5.11.1 +-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 **mdadm** peuvent être visualisées grâce à la commande suivante :
- +
-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'EXTRAVERSION est gérée par Debian :+
  
 <code> <code>
-trainee@debian11:~$ cat ./linux-5.11.1/Makefile | head +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, a file name
-PATCHLEVEL = 11 +The first such name is often the name of an md device.  Subsequent 
-SUBLEVEL = 1 +names are often names of component devices.
-EXTRAVERSION = +
-NAME = 💕 Valentine's Day Edition 💕+
  
-# *DOCUMENTATION* +Some common options are: 
-# To see a list of typical targets execute "make help" +  --help        -h   : General help message or, after above option, 
-# More info can be located in ./README +                       mode specific help message 
-</code>+  --help-options     : This help message 
 +  --version     -V   : Print version information for mdadm 
 +  --verbose     -v   : Be more verbose about what is happening 
 +  --quiet       -q   : Don't print un-necessary messages 
 +  --brief       -b   : Be less verbose, more brief 
 +  --export      -Y   : With --detail, --detail-platform or --examine use 
 +                       key=value format for easy import into environment 
 +  --force       -f   : Override normal checks and be more forceful
  
-<WRAP center round important> +  --assemble    -A   Assemble an array 
-**Important** La version 2.6 du noyau a vu le jour en **2003**. Les **SUBLEVEL** se suivaient régulièrement. Avec la version 2.6 du noyau, la valeur paire du **PATCHLEVEL** indiquait que le noyau était stable. Quand vous recompilez le noyau à partir des sources, vous devez modifier la valeur de l'EXTRAVERSION.  Le passage à la version 3.0 fut décidé par Linus Torvalds à l'occasion des 20 ans du noyau Linux. +  --build       -B   Build an array without metadata 
-</WRAP> +  --create      -C   Create a new array 
- +  --detail      -D   : Display details of an array 
-Utilisez maintenant la commande **make defconfig** pour créer le fichier de configuration .config +  --examine     -E   : Examine superblock on an array component 
- +  --examine-bitmap -X: Display the detail of a bitmap file 
-<code> +  --examine-badblocks: Display list of known bad blocks on device 
-trainee@debian11:~$ su - +  --monitor     -F   : monitor (follow) some arrays 
-Passwordfenestros +  --grow        -G   : resizereshape and array 
-root@debian11:~# cd /home/trainee/linux-5.11.1/ +  --incremental -I   : add/remove a single device to/from an array as appropriate 
-root@debian11:/home/trainee/linux-5.11.1# make defconfig +  --query       -Q   : Display general information about how a 
-  HOSTCC  scripts/basic/fixdep +                       device relates to the md driver 
-  HOSTCC  scripts/kconfig/conf.o +  --auto-detect      : Start arrays auto-detected by the kernel
-  HOSTCC  scripts/kconfig/confdata.o +
-  HOSTCC  scripts/kconfig/expr.o +
-  LEX     scripts/kconfig/lexer.lex.c +
-  YACC    scripts/kconfig/parser.tab.[ch] +
-  HOSTCC  scripts/kconfig/lexer.lex.o +
-  HOSTCC  scripts/kconfig/parser.tab.o +
-  HOSTCC  scripts/kconfig/preprocess.o +
-  HOSTCC  scripts/kconfig/symbol.o +
-  HOSTCC  scripts/kconfig/util.o +
-  HOSTLD  scripts/kconfig/conf +
-*** Default configuration is based on 'x86_64_defconfig' +
-+
-# configuration written to .config +
-#+
 </code> </code>
  
-Ce fichier est configuré par une des trois commandes suivantes : +Les //modes majeurs// de la commande **mdadm** peuvent être visualisés grâce à la commande suivante :
- +
-  make config +
-  make menuconfig +
-  make xconfig +
- +
-Dans ce fichier, vous pouvez constater la présence de lignes correspondantes à des fonctionalités suivies par une lettre ou une valeur. Dans le cas d'une lettre, la signification est la suivante : +
- +
-  * **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.+
  
 <code> <code>
-root@debian11:/home/trainee/linux-5.11.1# more .config  +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... 
-# +            Create a new array from unused devices. 
-CONFIG_CC_VERSION_TEXT="gcc (Debian 10.2.1-6) 10.2.1 20210110" +       mdadm --assemble device options..
-CONFIG_CC_IS_GCC=y +            Assemble a previously created array. 
-CONFIG_GCC_VERSION=100201 +       mdadm --build device options... 
-CONFIG_LD_VERSION=235020000 +            Create or assemble an array without metadata. 
-CONFIG_CLANG_VERSION=0 +       mdadm --manage device options..
-CONFIG_LLD_VERSION=0 +            make changes to an existing array. 
-CONFIG_CC_CAN_LINK=y +       mdadm --misc options... devices 
-CONFIG_CC_CAN_LINK_STATIC=y +            report on or modify various md related devices. 
-CONFIG_CC_HAS_ASM_GOTO=y +       mdadm --grow options device 
-CONFIG_CC_HAS_ASM_INLINE=y +            resize/reshape an active array 
-CONFIG_IRQ_WORK=y +       mdadm --incremental device 
-CONFIG_BUILDTIME_TABLE_SORT=y +            add/remove a device to/from an array as appropriate 
-CONFIG_THREAD_INFO_IN_TASK=y+       mdadm --monitor options... 
 +            Monitor one or more array for significant changes. 
 +       mdadm device options... 
 +            Shorthand for --manage. 
 +Any parameter that does not start with '-' is treated as a device name 
 +or, for --examine-bitmap, a file name. 
 +The first such name is often the name of an md device.  Subsequent 
 +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="(none)" +
-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]+
 </code> </code>
  
-====1.4 - Compiler le Noyau==== +Dernièrement, chaque //mode majeur// dispose de son propre aide :
- +
-La compilation du noyau peut prendre beaucoup de temps. La commande utilisée est la suivante :+
  
 <code> <code>
-root@debian11:/home/trainee/linux-5.11.1# make deb-pkg clean +root@debian8:~# mdadm --assemble --help 
-... +Usage: mdadm --assemble device options... 
-dpkg-buildpackage: info: full upload (original source is included) +       mdadm --assemble --scan options...
-  CLEAN   arch/x86/entry/vdso +
-  CLEAN   arch/x86/kernel/cpu +
-  CLEAN   arch/x86/kernel +
-  CLEAN   arch/x86/realmode/rm +
-  CLEAN   arch/x86/lib +
-  CLEAN   certs +
-  CLEAN   drivers/firmware/efi/libstub +
-  CLEAN   drivers/scsi +
-  CLEAN   drivers/tty/vt +
-  CLEAN   drivers/video/logo +
-  CLEAN   lib +
-  CLEAN   net/wireless +
-  CLEAN   security/selinux +
-  CLEAN   usr/include +
-  CLEAN   usr +
-  CLEAN   arch/x86/boot/compressed +
-  CLEAN   arch/x86/boot +
-  CLEAN   arch/x86/tools +
-  CLEAN   vmlinux.symvers modules.builtin modules.builtin.modinfo +
-</code>+
  
-A l'issu du processusles paquets du nouveau noyau se trouvent dans le répertoire **/home/trainee** :+This usage assembles one or more raid arrays from pre-existing 
 +components. 
 +For each arraymdadm 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.
  
-<code> +The md device is given on the command line, is found listed in the 
-root@debian11:/home/trainee/linux-5.11.1# cd .+config file, or can be deduced from the array identity
-root@debian11:/home/trainee# ls +The array identity is determined either from the --uuid, --name, or 
-Desktop    linux-5.11.1                           linux-5.11.1_5.11.1-1.diff.gz    linux-5.11.1.tar.gz                      linux-libc-dev_5.11.1-1_amd64.deb  Public +--super-minor commandline arguments, from the config file, 
-Documents  linux-5.11.1_5.11.1-1_amd64.buildinfo  linux-5.11.1_5.11.1-1.dsc        linux-headers-5.11.1_5.11.1-1_amd64.deb  Music                              Templates +or from the first component device on the command line.
-Downloads  linux-5.11.1_5.11.1-1_amd64.changes    linux-5.11.1_5.11.1.orig.tar.gz  linux-image-5.11.1_5.11.1-1_amd64.deb    Pictures                           Videos +
-</code>+
  
-====1.Installer le Noyau====+The different combinations of these are as follows: 
 + If the --scan option is not given, then only devices and identities 
 + listed on the command line are considered. 
 + The first device will be the array device, and the remainder will be 
 + examined when looking for components. 
 + If an explicit identity is given with --uuid or --super-minor, then 
 + only devices with a superblock which matches that identity is considered, 
 + otherwise every device listed 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 'AUTO' option in the config file.
  
-<code> + If the --scan option is given as well as one or more devices, then 
-root@debian11:/home/trainee# dpkg -i /home/trainee/linux*.deb + Those devices are md devices that are to be assembled Their identity 
-</code>+ 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.  To preserve this 
 + behaviour even with --scan, add --no-degraded.  Note that "all of the 
 + components" means as many as were present the last time the array was running 
 + as recorded in the superblock.  If the array was already degraded, and 
 + the missing device is not a new problem, it will still be assembled.  It 
 + is only newly missing devices that cause the array not to be started.
  
-<code> +Options that are valid with --assemble (-A) are: 
-root@debian11:/home/trainee# grep 5.11.1 /boot/grub/grub.cfg +  --bitmap=          : bitmap file to use with the array 
-        echo    'Loading Linux 5.11.1 ...' +  --uuid=       -u   : uuid of array to assembleDevices which don'
-        linux   /boot/vmlinuz-5.11.1 root=UUID=9887a74f-a680-4bde-8f04-db5ae9ea186e ro  quiet +                       have this uuid are excluded 
-        initrd  /boot/initrd.img-5.11.1 +  --super-minor= -m  : minor number to look for in super-block when 
-        menuentry 'Debian GNU/Linux, with Linux 5.11.1' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.11.1-advanced-9887a74f-a680-4bde-8f04-db5ae9ea186e'+                       choosing devices to use. 
-                echo    'Loading Linux 5.11.1 ...' +  --name=       -N   : Array name to look for in super-block
-                linux   /boot/vmlinuz-5.11.1 root=UUID=9887a74f-a680-4bde-8f04-db5ae9ea186e ro  quiet +  --config    -c   : config file 
-                initrd  /boot/initrd.img-5.11.1 +  --scan        -s   : scan config file for missing information 
-        menuentry 'Debian GNU/Linux, with Linux 5.11.1 (recovery mode)' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-5.11.1-recovery-9887a74f-a680-4bde-8f04-db5ae9ea186e+  --run         -R   : Try to start the array even if not enough devices 
-                echo    'Loading Linux 5.11.1 ...' +                       for a full array are present 
-                linux   /boot/vmlinuz-5.11.1 root=UUID=9887a74f-a680-4bde-8f04-db5ae9ea186e ro single  +  --force       -f   : Assemble the array even if some superblocks appear 
-                initrd  /boot/initrd.img-5.11.1+                     : out-of-date This involves modifying the superblocks. 
 +  --update=     -U   : Update superblock: try '---update=?for option list
 +  --no-degraded      : Assemble but do not start degraded arrays. 
 +  --readonly    -o   : Mark the array as read-onlyNo resync will start
 </code> </code>
  
-====1.6 - Désinstaller un Noyau==== +Constatez maintenant les informations concernant le RAID 5 créé :
- +
-Lister les noyaux installés :+
  
 <code> <code>
-root@debian11:/home/trainee# dpkg -l | grep -i "linux-image*" | awk '{print $2}' +root@debian8:~# cat /proc/mdstat 
-linux-image-5.10.0-13-amd64 +Personalities : [raid6] [raid5] [raid4]  
-linux-image-5.11.+md1 : active raid5 sda11[3] sda9[1] sda6[0] 
-linux-image-amd64+      974848 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU] 
 +       
 +unused devices: <none>
 </code> </code>
  
-Le noyau se désinstalle comme tout autre paquet :+Grâce à la commande mdadm, il est possible d'obtenir d'avantage d'informations :
  
 <code> <code>
-root@debian11:/home/traineeapt-get -y purge "linux-image-5.11.1" +root@debian8:~mdadm --query /dev/md1 
-Reading package lists... Done +/dev/md1952.16MiB raid5 3 devices, sparesUse mdadm --detail for more detail.
-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: Deleting /boot/initrd.img-5.11.1 +
-Generating grub configuration file ... +
-Found background image: /usr/share/images/desktop-base/desktop-grub.png +
-Found linux image/boot/vmlinuz-5.10.0-13-amd64 +
-Found initrd image: /boot/initrd.img-5.10.0-13-amd64 +
-done +
-(Reading database ... 117967 files and directories currently installed.) +
-Purging configuration files for linux-image-5.11.1 (5.11.1-1) ...+
 </code> </code>
  
-Vérifiez que le fichier grub.cfg a été modifié :+L'option **- -detail** produit le résultat suivant :
  
 <code> <code>
-root@debian11:/home/traineegrep 5.11.1 /boot/grub/grub.cfg +root@debian8:~mdadm --query /dev/md1 
-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 
 +/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, listez les noyaux disponibles :+    Update Time Wed Aug  3 13:20:16 2016 
 +          State : clean  
 + Active Devices : 3 
 +Working Devices : 3 
 + Failed Devices : 0 
 +  Spare Devices : 0
  
-<code> +         Layout left-symmetric 
-root@debian11:/home/trainee# dpkg -l | grep -i "linux-image*" | awk '{print $2}' +     Chunk Size : 512K
-linux-image-5.10.0-13-amd64 +
-linux-image-amd64 +
-</code>+
  
-=====LAB #2 - Mise à Jour du Noyau avec le Gestionnaire des Paquets=====+           Name : debian8: (local to host debian8) 
 +           UUID : 41b8799a:e24feb35:39e9aa3a:ec920626 
 +         Events : 18
  
-Afin d'obtenir la **dernière version du noyau pré-compliée** par Debian, il convient d'ajouter les dépôts **unstable** : +    Number   Major   Minor   RaidDevice State 
- +       0              6        0      active sync   /dev/sda6 
-<code> +       1              9        1      active sync   /dev/sda9 
-root@debian11:/home/trainee# echo "deb http://deb.debian.org/debian unstable main contrib non-free" | sudo tee -a /etc/apt/sources.list +       3             11        2      active sync   /dev/sda11
-deb http://deb.debian.org/debian unstable main contrib non-free +
-root@debian11:/home/trainee# echo "deb-src http://deb.debian.org/debian unstable main contrib non-free" | sudo tee -a /etc/apt/sources.list +
-deb-src http://deb.debian.org/debian unstable main contrib non-free+
 </code> </code>
  
-Afin de ne faire que des mises à jour du **noyau** à partir de ce dépôt, créez le fichier **/etc/apt/preferences** :+Notez la ligne **Persistence : Superblock is persistent**. En effet, cette implémentation de RAID inscrit les caractéristiques du volume dans un //super bloc// persistant en début de chaque unité de type bloc dans le volume.
  
-<code+<WRAP center round todo
-root@debian11:/home/trainee# vi /etc/apt/preferences +Recherchez la signification des termes Layout, Chunk size, Major et Minor. 
-root@debian11:/home/trainee# cat /etc/apt/preferences +</WRAP>
-Package: * +
-Pin: release a=bullseye +
-Pin-Priority: 500+
  
-Package: linux-image-amd64 +Cependant, il necéssaire de renseigner le fichier **/etc/mdadm/mdadm.conf** afin que le RAID soit contruit à chaque démarrage :
-Pin: release a=unstable +
-Pin-Priority: 1000 +
- +
-Package: * +
-Pin: release a=unstable +
-Pin-Priority: 100 +
-</code> +
- +
-Mettez à jour apt :+
  
 <code> <code>
-root@debian11:/home/traineeapt update +root@debian8:~echo 'DEVICES /dev/sda6 /dev/sda9 /dev/sda11' > /etc/mdadm/mdadm.conf 
-Hit:1 http://security.debian.org/debian-security bullseye-security InRelease +root@debian8:~# mdadm --detail --scan >> /etc/mdadm/mdadm.conf  
-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 /dev/sda6 /dev/sda9 /dev/sda11 
-Get:4 http://deb.debian.org/debian unstable InRelease [165 kB] +ARRAY /dev/md1 metadata=1.2 name=debian8:1 UUID=41b8799a:e24feb35:39e9aa3a:ec920626
-Get:5 http://deb.debian.org/debian unstable/contrib Sources [57.6 kB] +
-Get:6 http://deb.debian.org/debian unstable/main Sources [9,700 kB] +
-Get:7 http://deb.debian.org/debian unstable/non-free Sources [89.6 kB] +
-Get:8 http://deb.debian.org/debian unstable/main amd64 Packages [9,154 kB] +
-Get:9 http://deb.debian.org/debian unstable/main Translation-en [6,780 kB] +
-Get:10 http://deb.debian.org/debian unstable/contrib amd64 Packages [65.4 kB] +
-Get:11 http://deb.debian.org/debian unstable/contrib Translation-en [55.9 kB] +
-Get:12 http://deb.debian.org/debian unstable/non-free amd64 Packages [112 kB] +
-Get:13 http://deb.debian.org/debian unstable/non-free Translation-en [103 kB] +
-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' to see them.+
 </code> </code>
  
-Installez ensuite les mises-à-jour du noyau :+Chaque unité peut être examinée individuellement :
  
 <code> <code>
-root@debian11:/home/traineeapt -y  upgrade +root@debian8:~mdadm --examine /dev/sda6 
-</code>+/dev/sda6: 
 +          Magic : a92b4efc 
 +        Version : 1.2 
 +    Feature Map : 0x0 
 +     Array UUID : 41b8799a:e24feb35:39e9aa3a:ec920626 
 +           Name : debian8: (local to host 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 
 +   Unused Space : before=1960 sectors, after=0 sectors 
 +          State : clean 
 +    Device UUID : be46c991:3ad0ce5e:0bf2ec4e:1de865aa
  
-<code> +    Update Time : Wed Aug  3 13:20:16 2016 
-root@debian11:/home/trainee# reboot +  Bad Block Log 512 entries available at offset 72 sectors 
-</code>+       Checksum : 16f72803 - correct 
 +         Events : 18
  
-Connectez-vous de nouveau à la VM et contrôlez la version du noyau :+         Layout : left-symmetric 
 +     Chunk Size 512K
  
-<code> +   Device Role : Active device 0 
-trainee@debian11:~$ uname -a +   Array State AAA ('A' == active, '.' == missing, 'R' == replacing)
-Linux debian11 5.17.0-1-amd64 #1 SMP PREEMPT Debian 5.17.3-1 (2022-04-18x86_64 GNU/Linux+
 </code> </code>
  
-Déconnectez-vous et re-connectez-vous directement en tant que root. +A ce stade il est intéressant de noter comment réagir lors d'une défaillance d'un disqueDans notre cas nous allons indiquer au système que la partition /dev/sda6 est devenue défaillante :
- +
-=====LAB #3 - Gestion des Quotas===== +
- +
-Sous Linux il est possible de mettre en place des quotas par utilisateur et par groupe. Ceci étant, Linux ne sait pas gérer des quotas par répertoire, uniquement des  +
-quotas par partition. L'administrateur met souvent des quotas en place sur l'arborescence de /home pour limiter l'espace de stockage occupé par les utilisateurs. +
- +
-Commencez par vérifiez que le paquet **quota** est bien installé :+
  
 <code> <code>
-root@debian11:~# dpkg --get-selections | grep quota +root@debian8:~# mdadm --manage --set-faulty /dev/md1 /dev/sda6 
-root@debian11:~# apt -y install quota+mdadmset /dev/sda6 faulty in /dev/md1
 </code> </code>
  
-Editez le fichier **/etc/fstab** en ajoutant les options **usrquota** et **grpquota** à la ligne **/home** :+L'utilisation de la ligne de commande suivante nous confirme le statut de /dev/sda6 :
  
 <code> <code>
-root@debian11:~# vi /etc/fstab +root@debian8:~# mdadm --detail /dev/md1 
-root@debian11:~# cat /etc/fstab +/dev/md1: 
-# /etc/fstabstatic file system information+        Version 1.2 
-# +  Creation Time : Wed Aug  3 13:20:07 2016 
-# Use 'blkid' to print the universally unique identifier for a +     Raid Level : raid5 
-# device; this may be used with UUID= as a more robust way to name devices +     Array Size : 974848 (952.16 MiB 998.24 MB
-# 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). +  Total Devices : 3 
-# Please run 'systemctl daemon-reload' after making changes here+    Persistence : Superblock is persistent
-# +
-# <file system> <mount point>   <type>  <options>       <dump>  <pass> +
-# / was on /dev/sda1 during installation +
-UUID=9887a74f-a680-4bde-8f04-db5ae9ea186e /               ext4    errors=remount-ro 0       1 +
-UUID=24f1821e-1d5b-4256-8ee3-c9ee6b382ddc /home           ext4    defaults,usrquota,grpquota    0 0 +
-# swap was on /dev/sda5 during installation +
-UUID=1f9439f5-4b19-49b1-b292-60c2c674cee9 none            swap    sw              0       0 +
-/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto           0 +
-</code>+
  
-Démontez puis remontez /home :+    Update Time Wed Aug  3 13:27:53 2016 
 +          State : clean, degraded  
 + Active Devices : 2 
 +Working Devices : 2 
 + Failed Devices : 1 
 +  Spare Devices : 0
  
-<code> +         Layout left-symmetric 
-root@debian11:~# umount /home +     Chunk Size 512K
-root@debian11:~# mount -a +
-</code>+
  
-Vérifiez ensuite que les options soient prises en compte :+           Name debian8: (local to host debian8) 
 +           UUID : 41b8799a:e24feb35:39e9aa3a:ec920626 
 +         Events : 20
  
-<code> +    Number   Major   Minor   RaidDevice State 
-root@debian11:~# cat /etc/mtab +                                removed 
-sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0 +             8        9             active sync   /dev/sda9 
-proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0 +       3             11        2      active sync   /dev/sda11
-udev /dev devtmpfs rw,nosuid,relatime,size=1976600k,nr_inodes=494150,mode=755,inode64 0 0 +
-devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0 +
-tmpfs /run tmpfs rw,nosuid,nodev,noexec,relatime,size=402384k,mode=755,inode64 0 0 +
-/dev/sda1 / ext4 rw,relatime,errors=remount-ro 0 0 +
-securityfs /sys/kernel/security securityfs rw,nosuid,nodev,noexec,relatime 0 0 +
-tmpfs /dev/shm tmpfs rw,nosuid,nodev,inode64 0 0 +
-tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k,inode64 0 0 +
-cgroup2 /sys/fs/cgroup cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot 0 0 +
-pstore /sys/fs/pstore pstore rw,nosuid,nodev,noexec,relatime 0 0 +
-bpf /sys/fs/bpf bpf rw,nosuid,nodev,noexec,relatime,mode=700 0 0 +
-systemd-/proc/sys/fs/binfmt_misc autofs rw,relatime,fd=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=13172 0 0 +
-mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0 +
-hugetlbfs /dev/hugepages hugetlbfs rw,relatime,pagesize=2M 0 0 +
-tracefs /sys/kernel/tracing tracefs rw,nosuid,nodev,noexec,relatime 0 0 +
-debugfs /sys/kernel/debug debugfs rw,nosuid,nodev,noexec,relatime 0 0 +
-configfs /sys/kernel/config configfs rw,nosuid,nodev,noexec,relatime 0 0 +
-fusectl /sys/fs/fuse/connections fusectl rw,nosuid,nodev,noexec,relatime 0 0 +
-tmpfs /run/user/0 tmpfs rw,nosuid,nodev,relatime,size=402380k,nr_inodes=100595,mode=700,inode64 0 0 +
-/dev/sdb1 /home ext4 rw,relatime,quota,usrquota,grpquota 0 0 +
-</code>+
  
-====3.1 La Commande quotacheck==== +                    6             faulty   /dev/sda6
- +
-Pour activer les quotas sur /home, il convient d'utiliser la commande **quotacheck** : +
- +
-<code> +
-root@debian11:~# quotacheck -cugvm -f /dev/sdb1 +
-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 /home/aquota.user: No such file or directory. Usage will not be subtracted. +
-quotacheck: Cannot stat old group quota file /home/aquota.group: No such file or directory. Usage will not be subtracted. +
-quotacheck: Cannot stat old user quota file /home/aquota.user: No such file or directory. Usage will not be subtracted. +
-quotacheck: Cannot stat old group quota file /home/aquota.group: No such file or directory. Usage will not be subtracted. +
-quotacheck: Checked 7199 directories and 81583 files +
-quotacheck: Old file not found. +
-quotacheck: Old file not found.+
 </code> </code>
  
-Les options de la commande quotacheck sont :+Il est maintenant nécessaire de supprimer /dev/sda6 de notre RAID 5 :
  
 <code> <code>
-root@debian11:~# quotacheck --help +root@debian8:~# mdadm --manage --remove /dev/md1 /dev/sda6 
-Utility for checking and repairing quota files. +mdadm: hot removed /dev/sda6 from /dev/md1
-quotacheck [-gucbfinvdmMR] [-F <quota-format>] filesystem|-a +
- +
--u, --user                check user files +
--g, --group               check group files +
--c, --create-files        create new quota files +
--b, --backup              create backups of old quota files +
--f, --force               force check even if quotas are enabled +
--i, --interactive         interactive mode +
--n, --use-first-dquot     use the first copy of duplicated structure +
--v, --verbose             print more information +
--d, --debug               print even more messages +
--m, --no-remount          do not remount filesystem read-only +
--M, --try-remount         try remounting filesystem read-only, +
-                          continue even if it fails +
--R, --exclude-root        exclude root when checking all filesystems +
--F, --format=formatname   check quota files of specific format +
--a, --all                 check all filesystems +
--h, --help                display this message and exit +
--V, --version             display version information and exit +
- +
-Bugs to jack@suse.cz+
 </code> </code>
  
-Les quotas ont été activés et les fichier **aquota.user** et **aquota.group** ont été créés dans le répertoire /home :+A l'examen de notre RAID, on constate que /dev/sda6 a été supprimé :
  
 <code> <code>
-root@debian11:~# ls -la /home +root@debian8:~# mdadm --detail /dev/md1 
-total 44 +/dev/md1: 
-drwxr-xr-x  4 root    root     4096 May  1 18:05 . +        Version : 1.2 
-drwxr-xr-x 20 root    root     4096 May  1 17:41 .. +  Creation Time : Wed Aug  3 13:20:07 2016 
--rw-------  1 root    root     7168 May  1 18:05 aquota.group +     Raid Level raid5 
--rw-------  1 root    root     7168 May  1 18:05 aquota.user +     Array Size 974848 (952.16 MiB 998.24 MB) 
-drwx------  2 root    root    16384 May  1 15:31 lost+found +  Used Dev Size 487424 (476.08 MiB 499.12 MB) 
-drwxr-xr-x 15 trainee trainee  4096 May  1 16:28 trainee +   Raid Devices 3 
-</code>+  Total Devices 2 
 +    Persistence : Superblock is persistent
  
-Créez maintenant un utilisateur **fenestros** avec le mot de passe **fenestros** :+    Update Time Wed Aug  3 13:29:30 2016 
 +          State : clean, degraded  
 + Active Devices : 2 
 +Working Devices : 2 
 + Failed Devices : 0 
 +  Spare Devices : 0
  
-<code> +         Layout left-symmetric 
-root@debian11:~# groupadd fenestros && useradd -m fenestros -c FenestrOs -d /home/fenestros -g fenestros -s /bin/bash +     Chunk Size 512K
-root@debian11:~# passwd fenestros +
-New password: fenestros +
-Retype new password: fenestros +
-passwd: password updated successfully +
-</code>+
  
-====3.2 - La Commande edquota====+           Name : debian8: (local to host debian8) 
 +           UUID : 41b8799a:e24feb35:39e9aa3a:ec920626 
 +         Events : 21
  
-Mettez en place maintenant un quota de 10Mo pour l'utilisateur **fenestros** : +    Number   Major   Minor   RaidDevice State 
- +       0              0        0      removed 
-<code> +       1              9        1      active sync   /dev/sda9 
-root@debian8:~# EDITOR=/usr/bin/vi +                   11        2      active sync   /dev/sda11
-root@debian8:~# export EDITOR +
-root@debian8:~# edquota -u fenestros -f /home+
 </code> </code>
  
-L'éditeur **vi** se lance et vous obtiendrez un résultat similaire à celui-ci : +Constatez maintenant l'existance de votre RAID :
- +
-<file> +
-Disk quotas for user fenestros (uid 1001): +
-  Filesystem                   blocks       soft       hard     inodes     soft     hard +
-  /dev/sdb1                                  0          0          0        0        0 +
-</file> +
- +
-Modifiez ce fichier ainsi : +
- +
-<file> +
-Disk quotas for user fenestros (uid 1001): +
-  Filesystem                   blocks       soft       hard     inodes     soft     hard +
-  /dev/sdb1                               8000      10000          0        0        0 +
-</file> +
- +
-Les options de la commande **edquota** sont :+
  
 <code> <code>
-root@debian11:~# edquota --help +root@debian8:~# cat /proc/mdstat 
-edquotaUsage: +Personalities : [raid6] [raid5] [raid4]  
-        edquota [-rm] [-u] [-F formatname[-p username] [-f filesystem] username ... +md1 : active raid5 sda11[3sda9[1
-        edquota [-rm-g [-F formatname[-p groupname] [-f filesystem] groupname ... +      974848 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/2] [_UU
-        edquota [-rm] -P [-F formatname] [-p projectname] [-f filesystem] projectname ... +       
-        edquota [-u|g|-P] [-F formatname[-f filesystem] -t +unused devices<none>
-        edquota [-u|g|-P] [-F formatname] [-f filesystem] -T username|groupname|projectname ... +
- +
--u, --user                    edit user data +
--g, --group                   edit group data +
--P, --project                 edit project data +
--r, --remote                  edit remote quota (via RPC) +
--m, --no-mixed-pathnames      trim leading slashes from NFSv4 mountpoints +
--F, --format=formatname       edit quotas of a specific format +
--p, --prototype=name          copy data from a prototype user/group +
-    --always-resolve          always try to resolve name, even if it is +
-                              composed only of digits +
--f, --filesystem=filesystem   edit data only on a specific filesystem +
--t, --edit-period             edit grace period +
--T, --edit-times              edit grace time of a user/group +
--h, --help                    display this help text and exit +
--V, --version                 display version information and exit +
- +
-Bugs tojack@suse.cz+
 </code> </code>
  
 <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'utiliser l'option -g de la commande edquota.+Notez que le RAID a été démarré avec 2 unités au lieu de trois.
 </WRAP> </WRAP>
  
-====3.3 La Commande quotaon==== +Pour ajouter un autre disque à notre RAID afin de remplacer /dev/sda6 il convient d'utiliser l'option **--add** :
- +
-Appliquez maintenant les quotas :+
  
 <code> <code>
-root@debian11:~# quotaon -a+root@debian8:~# mdadm --manage --add /dev/md1 /dev/sda12 
 +mdadm: added /dev/sda12
 </code> </code>
  
-Les options de la commande **quotaon** sont :+L'exemen du RAID indique que /dev/sda12 a été ajouté en tant que //spare// et à l'issu de quelques secondes le RAID 5 a été reconstruite :
  
 <code> <code>
-root@debian11:~# quotaon --help +root@debian8:~# mdadm --manage --add /dev/md1 /dev/sda12 
-quotaon: Usage+mdadmadded /dev/sda12 
-        quotaon [-guPvp] [-F quotaformat] [-x state] -a +root@debian8:~# mdadm --detail /dev/md1 
-        quotaon [-guPvp] [-F quotaformat] [-x state] filesys ...+/dev/md1: 
 +        Version : 1.
 +  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               operate on user quotas + Active Devices : 3 
--g, --group              operate on group quotas +Working Devices : 3 
--P, --project            operate on project quotas + Failed Devices : 0 
--p, --print-state        print whether quotas are on or off +  Spare Devices : 0
--x, --xfs-command=cmd    perform XFS quota command +
--F, --format=formatname  operate on specific quota format +
--v, --verbose            print more messages +
--h, --help               display this help text and exit +
--V, --version            display version information and exit +
-</code>+
  
-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. +         Layout : left-symmetric 
 +     Chunk Size : 512K
  
-Quand l'utilisateur fenestros aura dépassé le quota **souple**, il recevra un message d'avertissement. Quand il dépasse le quota **stricte**, il ne pourra plus enregistrer dans /home, sauf dans le cas où il supprime des fichiers pour retomber en dessous de la limite **stricte**.+           Name : debian8: (local to host debian8) 
 +           UUID : 41b8799a:e24feb35:39e9aa3a:ec920626 
 +         Events : 40
  
-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'inodes utilisés par l'utilisateur. +    Number   Major   Minor   RaidDevice State 
- +             8       12        0      active sync   /dev/sda12 
-<WRAP center round important> +       1              9        1      active sync   /dev/sda9 
-**Important** - La commande pour désactivez les quotas est **quotaoff**.  +                   11        2      active sync   /dev/sda11
-</WRAP> +
- +
-====3.- La Commande repquota==== +
- +
-Pour visualiser les quotas utilisez la commande **repquota** : +
- +
-<code> +
-root@debian11:~# repquota /home +
-*** Report for user quotas on device /dev/sdb1 +
-Block grace time: 7days; Inode grace time: 7days +
-                        Block limits                File limits +
-User            used    soft    hard  grace    used  soft  hard  grace +
----------------------------------------------------------------------- +
-root      --  241004             0           2528                +
-trainee   -- 1409108                      86253                 +
-   +
 </code> </code>
  
-<WRAP center round important> +Naturellement, il nécessaire de renseigner le fichier **/etc/mdadm/mdadm.conf** du changement afin que le RAID soit construit à chaque démarrage :
-**Important** - Notez que l'utilisateur fenestros ne figure pas dans la liste. Le quota n'est pas visible tant que l'utilisateur ne s'est pas connecté pour la première fois. Notez aussi les période de grâce de **7** jours. +
-</WRAP> +
- +
-Les options de la commande **repquota** sont :+
  
 <code> <code>
-root@debian11:~# repquota --help +root@debian8:~# echo 'DEVICES /dev/sda12 /dev/sda9 /dev/sda11' > /etc/mdadm/mdadm.conf 
-repquota: Utility for reporting quotas+root@debian8:~# mdadm --detail --scan >> /etc/mdadm/mdadm.conf 
-Usage: +root@debian8:~# cat /etc/mdadm/mdadm.conf 
-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.name=debian8:1 UUID=41b8799a:e24feb35:39e9aa3a:ec9206260
--v, --verbose                 display also users/groups without any usage +
--u, --user                    display information about users +
--g, --group                   display information about groups +
--P, --project                 display information about projects +
--s, --human-readable[=units]  display numbers in human friendly units (MB, 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 +
--t, --truncate-names          truncate names to 9 characters +
--p, --raw-grace               print grace time in seconds since epoch +
--n, --no-names                do not translate uid/gid to name +
--i, --no-autofs               avoid autofs mountpoints +
--c, --cache                   translate big number of ids at once +
--C, --no-cache                translate ids one by one +
--F, --format=formatname       report information for specific format +
--O, --output=format           format output as xml or csv +
--a, --all                     report information for all mount points with +
-                              quotas +
--h, --help                    display this help message and exit +
--V, --version                 display version information and exit +
- +
-Bugs to jack@suse.cz+
 </code> </code>
  
-====3.5 - La Commande quota==== 
- 
-Pour visualiser les quotas d'un utilisateur spécifique, il convient d'utiliser la commande **quota** : 
- 
-<code> 
-root@debian11:~# quota fenestros 
-Disk quotas for user fenestros (uid 1001): no limited resources used 
- 
-root@debian11:~# su - fenestros 
- 
-fenestros@debian11:~$ touch test 
- 
-fenestros@debian11:~$ exit 
-logout 
- 
-root@debian11:~# quota fenestros 
-Disk quotas for user fenestros (uid 1001):  
-     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace 
-      /dev/sdb1          8000   10000                                       
-</code> 
- 
-Les options de la commande **quota** sont : 
- 
-<code> 
-root@debian11:~# quota --help 
-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                    display quota for user 
--g, --group                   display quota for group 
--P, --project                 display quota for project 
--q, --quiet                   print more terse message 
--v, --verbose                 print more verbose message 
--s, --human-readable[=units]  display numbers in human friendly units (MB, 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 
-    --always-resolve          always try to translate name to id, even if it is 
-                              composed of only digits 
--w, --no-wrap                 do not wrap long lines 
--p, --raw-grace               print grace time in seconds since epoch 
--l, --local-only              do not query NFS filesystems 
--Q, --quiet-refuse            do not print error message when NFS server does 
-                              not respond 
--i, --no-autofs               do not query autofs mountpoints 
--F, --format=formatname       display quota of a specific format 
--f, --filesystem-list         display quota information only for given 
-                              filesystems 
-    --filesystem=path         display quota information only for given 
-                              filesystem, remaining command line arguments 
-                              are still treated as user/group/project names 
--A, --all-nfs                 display quota for all NFS mountpoints 
--m, --no-mixed-pathnames      trim leading slashes from NFSv4 mountpoints 
-    --show-mntpoint           show mount point of the file system in output 
-    --hide-device             do not show file system device in output 
--h, --help                    display this help message and exit 
--V, --version                 display version information and exit 
- 
-Bugs to: jack@suse.cz 
-</code> 
- 
-====3.6 - La Commande warnquota==== 
- 
-La commande **warnquota** vérifie le ou les disques et envoie un message par mail à tout utilisateur qui a dépassé la limite soft. Elle est enrègle générale appelée par un job cron. Cependant elle peut aussi est appelée d'une manière intéractive. 
- 
-Les options de la commande **warnquota** sont : 
- 
-<code> 
-root@debian11:~# warnquota --help 
-warnquota: Usage: 
-  warnquota [-ugsid] [-F quotaformat] [-c configfile] [-q quotatabfile] [-a adminsfile] [filesystem...] 
- 
--u, --user                      warn users 
--g, --group                     warn groups 
--s, --human-readable[=units]    display numbers in human friendly units (MB, 
-                                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                 avoid autofs mountpoints 
--d, --no-details                do not send quota information itself 
--F, --format=formatname         use quotafiles of specific format 
--c, --config=config-file        non-default config file 
--q, --quota-tab=quotatab-file   non-default quotatab 
--a, --admins-file=admins-file   non-default admins file 
--I, --ignore-config-errors      ignore unknown statements in config file 
--h, --help                      display this help message and exit 
--V, --version                   display version information and exit 
- 
-warnquota: Bugs to jack@suse.cz 
-</code> 
  
 ----- -----
-Copyright © 2022 Hugh Norris.+Copyright © 2024 Hugh Norris.
Menu