Configurazione di device multidisk (RAID software) Se nel proprio sistema ci sono più dischi fissi In verità si può creare un device MD anche usando delle partizioni che risiedono sullo stesso disco ma in questo modo non si ottiene nulla di utile. si può usare mdcfg per configurare i dischi in modo da incrementare le prestazioni e/o migliorare l'affidabilità dei dati. Il risultato è un Multidisk Device (o almeno la sua variante più famosa, il RAID software). Un MD è un insieme di partizioni localizzate su dischi differenti e combinate insieme per formare un dispositivo logico. Questo device può quindi essere usato come una normale partizione (cioè lo si può partizionare con partman, si può assegnargli un mount point, ecc.). I benefici che è possibile ricavare dipendono dal tipo di dispositivo MD che si intende creare. Attualmente quelli supportati sono: RAID0 Is mainly aimed at performance. RAID0 splits all incoming data into stripes and distributes them equally over each disk in the array. This can increase the speed of read/write operations, but when one of the disks fails, you will loose everything (part of the information is still on the healthy disk(s), the other part was on the failed disk). Un uso tipico di RAID0 è una partizione per l'editing video. RAID1 Is suitable for setups where reliability is the first concern. It consists of several (usually two) equally sized partitions where every partition contains exactly the same data. This essentially means three things. First, if one of your disks fails, you still have the data mirrored on the remaining disks. Second, you can use only a fraction of the available capacity (more precisely, it is the size of the smallest partition in the RAID). Third, file reads are load balanced among the disks, which can improve performance on a server, such as a file server, that tends to be loaded with more disk reads than writes. Nell'array è possibile inserire anche un disco di scorta che in caso di rottura di uno degli altri dischi lo rimpiazza. RAID5 Is a good compromise between speed, reliability and data redundancy. RAID5 splits all incomming data into stripes and distributes them equally on all but one disks (similar to RAID0). Unlike RAID0, RAID5 also computes parity information, which gets written on the remaining disk. The parity disk is not static (that would be called RAID4), but is changing periodically, so the parity information is distributed equally on all disks. When one of the disks fails, the missing part of information can be computed from remaining data and its parity. RAID5 must consist of at least three active partitions. Optionally you can have a spare disk in the array which will take the place of the failed disk in the case of failure. Come si può notare il RAID5 ha un grado di affidabilità simile al RAID1 con minor richiesta di ridondanza. D'altra parte le operazioni di scrittura possono essere un po' più lente rispetto al RAID0 a causa del calcolo delle informazioni di parità. Riassumendo: Tipo Numero minimo di device Device di scorta Resiste a rotture del disco? Spazio disponibile RAID0 2 no no La dimensione della partizione più piccola moltiplicata per il numero di device in RAID. RAID1 2 optional La dimensione della partizione più piccola in RAID RAID5 3 optional La dimensione della partizione più piccola moltiplicata per il numero di device in RAID meno 1. Se si desidera conoscere tutto ciò che c'è da sapere sul RAID software si consulti il Software RAID HOWTO. To create a MD device, you need to have the desired partitions it should consist of marked for use in a RAID. (This is done in partman in the Partition settings menu where you should select Use as: physical volume for RAID .) Support for MD is a relatively new addition to the installer. You may experience problems for some RAID levels and in combination with some bootloaders if you try to use MD for the root (/) filesystem. For experienced users, it may be possible to work around some of these problems by executing some configuration or installation steps manually from a shell. Next, you should choose Configure software RAID from the main partman menu. On the first screen of mdcfg simply select Create MD device. You will be presented with a list of supported types of MD devices, from which you should choose one (e.g. RAID1). What follows depends on the type of MD you selected. RAID0 is simple — you will be issued with the list of available RAID partitions and your only task is to select the partitions which will form the MD. RAID1 is a bit more tricky. First, you will be asked to enter the number of active devices and the number of spare devices which will form the MD. Next, you need to select from the list of available RAID partitions those that will be active and then those that will be spare. The count of selected partitions must be equal to the number provided few seconds ago. Don't worry. If you make a mistake and select different number of partitions, the &d-i; won't let you continue until you correct the issue. La procedura di configurazione di RAID5 è simile a quella per RAID1 con una eccezione, è necessario usare almeno tre partizioni attive. È possibile avere diversi tipi di MD contemporaneamente. Per esempio se si dedicano al MD 3 hard disk da 200 GB, ciascun disco con due partizioni da 100 GB, si possono combinare le prime partizioni di tutti e tre i dischi in un RAID0 (partizione veloce da 300 GB per l'editing video) e usare le altre tre partizioni (2 attive e 1 di scorta) in RAID1 (come partizione da 100 GB più affidabile per la /home). Dopo aver preparato i device MD a proprio piacimento si può Terminare mdcfg e tornare a partman per creare i filesystem sui nuovi device MD e per assegnare i normali attributi, per esempio il mount point.