issue220:c_c
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue220:c_c [2025/08/24 17:10] – créée philou511 | issue220:c_c [2025/08/31 11:24] (Version actuelle) – andre_domenech | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | During a recent discussion: | + | **During a recent discussion: |
[7/5/25 5:19 AM] | [7/5/25 5:19 AM] | ||
Ligne 17: | Ligne 17: | ||
This is a discussion on that for our command and conquer for this issue. RAID - Redundant Array of Independent Disks, it used to be inexpensive disks, but I’m sure we all can agree that with SSD’s that is no longer the case. | This is a discussion on that for our command and conquer for this issue. RAID - Redundant Array of Independent Disks, it used to be inexpensive disks, but I’m sure we all can agree that with SSD’s that is no longer the case. | ||
- | Why would any home user consider RAID? RAID is a technology that is used to increase the performance and/or reliability of data storage and home users may want a piece of that. | + | Why would any home user consider RAID? RAID is a technology that is used to increase the performance and/or reliability of data storage and home users may want a piece of that. ** |
- | When RAID is mentioned, we also need to mention LVM, logical volume management. Why would we need to, you may ask, well, when you use RAID, there is more than one disk involved and other than straight mirroring, your data is split over multiple disks. LVM allows you to manage physical disks as a single pool of storage and with it, you can create logical volumes that behave like partitions. LVM creates an abstraction layer between physical storage and logical partitions, this is the important part. | + | Lors d'une discussion récente : |
+ | |||
+ | [25/05/2019 05:19] | ||
+ | Je vais construire un PC familial qui servirait de serveur de fichiers avec deux disques en RAID 1 et un PC de jeu pour nous dans le salon. | ||
+ | [25/05/2019 05:20] | ||
+ | Honnêtement, | ||
+ | À mon avis, le RAID est un gaspillage de ressources, surtout en RAID 1. | ||
+ | [25/05/2019 05:22] | ||
+ | Pourquoi ? C'est de la redondance. | ||
+ | [25/05/2019 05:25] | ||
+ | Mais un disque peut tomber en panne et mes données sont toujours en sécurité. | ||
+ | [25/05/2019 05:25] | ||
+ | Par exemple, configurer des sauvegardes incrémentielles. | ||
+ | |||
+ | Comme cette discussion était entre deux autres personnes, j'ai laissé les tags de côté. Puis, une personne qui n' | ||
+ | |||
+ | Voici une présentation de ce sujet pour le Command & Conquer de ce numéro. RAID (Redundant Array of Independent Disks - grille redondante de disques indépendants) : autrefois, les disques étaient bon marché, mais nous sommes tous d' | ||
+ | |||
+ | Pourquoi un particulier devrait-il envisager le RAID ? Le RAID est une technologie utilisée pour améliorer les performances et/ou la fiabilité du stockage de données, et les particuliers pourraient vouloir en profiter. | ||
+ | |||
+ | |||
+ | **When RAID is mentioned, we also need to mention LVM, logical volume management. Why would we need to, you may ask, well, when you use RAID, there is more than one disk involved and other than straight mirroring, your data is split over multiple disks. LVM allows you to manage physical disks as a single pool of storage and with it, you can create logical volumes that behave like partitions. LVM creates an abstraction layer between physical storage and logical partitions, this is the important part. | ||
We are not going to dive deep into this, I just want you to know enough so we can continue and you are curious enough to go look it up. This will not be a step-by-step, | We are not going to dive deep into this, I just want you to know enough so we can continue and you are curious enough to go look it up. This will not be a step-by-step, | ||
Ligne 29: | Ligne 50: | ||
root@ubuntusrv: | root@ubuntusrv: | ||
Physical volume "/ | Physical volume "/ | ||
- | Physical volume "/ | + | Physical volume "/ |
+ | |||
+ | Quand on parle de RAID, il faut aussi mentionner LVM (gestion des volumes logiques). Pourquoi ? vous demandez-vous peut-être, eh bien, avec RAID, plusieurs disques sont impliqués et, outre la mise en miroir directe, vos données sont réparties sur plusieurs disques. LVM permet de gérer les disques physiques comme un pool de stockage unique et de créer des volumes logiques qui se comportent comme des partitions. LVM crée une couche d' | ||
- | ***There are three commands you can use to display properties of physical volumes: pvs, pvdisplay, and pvscan. I’m not even discussing those, you know the drill. | + | Nous n' |
+ | |||
+ | Avec LVM, les disques ou partitions sont regroupés en volumes physiques (PV). Ces PV sont combinés en groupes de volumes (VG), et à partir de ces groupes, vous pouvez créer des volumes logiques (LV). Est-ce logique ? Parfait. Ce n'est pas sorcier. | ||
+ | |||
+ | Commençons par demander à Ubuntu de créer notre volume physique virtuel à partir de disques ou de partitions, par exemple : sudo pvcreate /dev/sda1 /dev/sdb1. Servez-vous de toutes les méthodes utilisées dans le dernier numéro pour obtenir de l'aide sur la commande pvcreate. | ||
+ | |||
+ | root@ubuntusrv: | ||
+ | Le volume physique « / | ||
+ | Le volume physique « / | ||
+ | |||
+ | |||
+ | **< | ||
Next, we need to combine the physical volumes into a volume group: | Next, we need to combine the physical volumes into a volume group: | ||
Ligne 50: | Ligne 84: | ||
Once that is done, we can go ahead and slap a filesystem on it: | Once that is done, we can go ahead and slap a filesystem on it: | ||
sudo mkfs.ext4 / | sudo mkfs.ext4 / | ||
- | Now we can just mount the beast and we can use our new volume. | + | Now we can just mount the beast and we can use our new volume. |
- | Now that we understand the steps, getting our PV down first, making a VG or many VG’s, on top of our PV, and lastly the LV. Three steps, however I cannot tell you 100% how, as each computer is different, you may be using two different partitions or multiple partitions or multiple drives. All I want you to do is visualise the order, attack the problem step by step and follow the order and you will be successful. Don’t type out my commands 100%, you may not have sdb1, for instance, you need to use your own volumes or partitions. | + | < |
+ | |||
+ | Ensuite, nous devons combiner les volumes physiques en un groupe de volumes : | ||
+ | |||
+ | sudo vgcreate new_vg /dev/sdb1 /dev/sdc1 | ||
+ | |||
+ | (Si les périphériques n'ont pas été initialisés en tant que volumes physiques avec pvcreate, vgcreate les initialisera et les transformera en volumes physiques, mais vous aurez évidemment moins de contrôle.) | ||
+ | |||
+ | Vous pouvez spécifier plusieurs volumes physiques pour créer un nouveau groupe de volumes, comme suit : | ||
+ | |||
+ | nonroot@ubuntusvr: | ||
+ | Groupe de volumes « vol_grp2 » créé avec succès | ||
+ | |||
+ | Ensuite, vous pouvez créer un volume logique à partir du volume physique. Vous pouvez spécifier la taille ou utiliser tout l' | ||
+ | |||
+ | sudo lvcreate -L 500G -n new_lv new_vg | ||
+ | |||
+ | Une fois cela fait, nous pouvons y ajouter un système de fichiers : | ||
+ | |||
+ | sudo mkfs.ext4 / | ||
+ | |||
+ | Il ne nous reste plus qu'à monter le disque et à utiliser notre nouveau volume. | ||
+ | |||
+ | |||
+ | **Now that we understand the steps, getting our PV down first, making a VG or many VG’s, on top of our PV, and lastly the LV. Three steps, however I cannot tell you 100% how, as each computer is different, you may be using two different partitions or multiple partitions or multiple drives. All I want you to do is visualise the order, attack the problem step by step and follow the order and you will be successful. Don’t type out my commands 100%, you may not have sdb1, for instance, you need to use your own volumes or partitions. | ||
RAID on the other hand is a beast on it’s own. You can have hardware and software RAID, and RAID that may require you to install drivers for Linux. If you opt for hardware RAID, it is usually an add-on card that you will plug into your PC, unless you have a server board. Here you need to follow the instructions from the supplier with care. In my case, I was lucky, the last time I needed to do this, the driver came in a convenient .deb-file, that I needed to load, but you may not be so lucky. My advice is, that if you decide to home server it, check for compatibility. The previous install I did only had drivers for old versions of Red Hat Linux. Beware of cheap RAID cards on e-bay or wherever, as some work like the old win modems, that was purely software. Do your homework! | RAID on the other hand is a beast on it’s own. You can have hardware and software RAID, and RAID that may require you to install drivers for Linux. If you opt for hardware RAID, it is usually an add-on card that you will plug into your PC, unless you have a server board. Here you need to follow the instructions from the supplier with care. In my case, I was lucky, the last time I needed to do this, the driver came in a convenient .deb-file, that I needed to load, but you may not be so lucky. My advice is, that if you decide to home server it, check for compatibility. The previous install I did only had drivers for old versions of Red Hat Linux. Beware of cheap RAID cards on e-bay or wherever, as some work like the old win modems, that was purely software. Do your homework! | ||
Ligne 64: | Ligne 122: | ||
RAID 5 – striping with parity | RAID 5 – striping with parity | ||
RAID 6 – striping with double parity | RAID 6 – striping with double parity | ||
- | RAID 10 – combining mirroring and striping | + | RAID 10 – combining mirroring and striping** |
+ | |||
+ | Maintenant que nous comprenons les étapes, nous commençons par créer notre volume virtuel, puis un ou plusieurs volumes virtuels (VG) par-dessus notre volume virtuel, et enfin le volume logique (LV). Trois étapes, mais je ne peux pas vous expliquer exactement comment, car chaque ordinateur est différent. Vous pouvez utiliser deux ou plusieurs partitions ou plusieurs disques. Il vous suffit de visualiser l' | ||
- | To envision striping, imagine a bunch of pot plants in a row. If I take a paintbrush wet with paint, and I draw a line across them, you may see the line, but each pot in the row only has a piece of the line on it. | + | Le RAID, en revanche, est un véritable casse-tête. Vous pouvez avoir du RAID matériel et du RAID logiciel, ou un RAID nécessitant l' |
+ | |||
+ | Le RAID logiciel est moins cher et plus sujet aux pannes, car il dépend de votre système d' | ||
+ | |||
+ | Le RAID est divisé en « niveaux » : | ||
+ | |||
+ | RAID 0 – répartition | ||
+ | RAID 1 – mise en miroir | ||
+ | RAID 5 – répartition avec parité | ||
+ | RAID 6 – répartition avec double parité | ||
+ | RAID 10 – combinaison de la mise en miroir et de la répartition | ||
+ | |||
+ | |||
+ | **To envision striping, imagine a bunch of pot plants in a row. If I take a paintbrush wet with paint, and I draw a line across them, you may see the line, but each pot in the row only has a piece of the line on it. | ||
Mirroring is just what it says, it writes everything twice. You can imagine that this takes longer to write, but reading will be twice* as fast. (*almost) | Mirroring is just what it says, it writes everything twice. You can imagine that this takes longer to write, but reading will be twice* as fast. (*almost) | ||
Ligne 76: | Ligne 149: | ||
OK, so here is the command syntax: | OK, so here is the command syntax: | ||
+ | |||
+ | sudo mdadm --create --verbose /dev/md0 --level=0 --raid-devices=2 /dev/sda /dev/sdb** | ||
+ | |||
+ | Pour visualiser la répartition, | ||
+ | |||
+ | La mise en miroir est exactement ce que son nom indique : elle écrit tout deux fois. Vous pouvez imaginer que l' | ||
+ | |||
+ | La parité est presque comme la réponse à une somme. Imaginez que les données que vous écrivez sont de 2 et 3 bits. La parité les additionnerait et ajouterait un « 5 » à côté des nombres, de sorte que même si l'un des deux se perd, vous saurez quel était l' | ||
+ | |||
+ | Vous pouvez désormais comprendre vous-même la signification des différents niveaux RAID, sans vous perdre dans le jargon ou les détails techniques. Si vous êtes plutôt technicien et souhaitez en savoir plus, consultez : | ||
+ | |||
+ | Le RAID logiciel nécessite mdadm, et Ubuntu n'en est pas équipé par défaut ; vous devrez donc l' | ||
+ | |||
+ | Voici la syntaxe de la commande : | ||
sudo mdadm --create --verbose /dev/md0 --level=0 --raid-devices=2 /dev/sda /dev/sdb | sudo mdadm --create --verbose /dev/md0 --level=0 --raid-devices=2 /dev/sda /dev/sdb | ||
- | You need to replace the Raid level you require, as you can see, this is RAID 0 and the devices should change to match *your devices, currently set to two. Again, these are examples, please don’t just go copying and pasting it into your working machine’s terminal. | + | **You need to replace the Raid level you require, as you can see, this is RAID 0 and the devices should change to match *your devices, currently set to two. Again, these are examples, please don’t just go copying and pasting it into your working machine’s terminal. |
Now you go have coffee, while the software “builds” the array. Once done, we format the MD not the SD, like so: sudo mkfs.ext4 /dev/md0 | Now you go have coffee, while the software “builds” the array. Once done, we format the MD not the SD, like so: sudo mkfs.ext4 /dev/md0 | ||
Ligne 86: | Ligne 173: | ||
sudo mount /dev/md0 /mnt/raid | sudo mount /dev/md0 /mnt/raid | ||
- | While I do not think that this is something for a CnC, as the variables are too diverse, I did promise to put an outline down, explaining each part. So while LVM and RAID are often used together, they can also be used apart. If you would like more on each, drop us a note on misc@fullcirclemagazine.org and I’ll see if I can whip up a step-by-step in a VM for you to test. | + | While I do not think that this is something for a CnC, as the variables are too diverse, I did promise to put an outline down, explaining each part. So while LVM and RAID are often used together, they can also be used apart. If you would like more on each, drop us a note on misc@fullcirclemagazine.org and I’ll see if I can whip up a step-by-step in a VM for you to test.** |
+ | |||
+ | Vous devez modifier le niveau de RAID requis. Comme vous pouvez le constater, il s'agit du RAID 0 et les périphériques doivent être modifiés pour correspondre à vos périphériques, | ||
+ | |||
+ | Allez prendre un café, le temps que le logiciel « construise » la matrice. Une fois terminé, formatez le disque dur (MD) et non la carte SD, comme suit : sudo mkfs.ext4 /dev/md0 | ||
+ | |||
+ | Ensuite, montez le système de la manière habituelle : | ||
+ | |||
+ | sudo mount /dev/md0 /mnt/raid | ||
+ | |||
+ | Bien que je ne pense pas que ce soit un sujet pour C & C, les variables étant trop diverses, j'ai promis de vous fournir un aperçu de chaque partie. Donc, si LVM et RAID sont souvent utilisés ensemble, ils peuvent également être utilisés séparément. Si vous souhaitez en savoir plus sur chacun d’eux, envoyez-nous un message à misc@fullcirclemagazine.org et je verrai si je peux vous préparer une procédure étape par étape dans une machine virtuelle pour que vous fassiez des tests. |
issue220/c_c.1756048205.txt.gz · Dernière modification : 2025/08/24 17:10 de philou511