Raid software

lundi 29 juin 2009
par  Jerome ROBERT
popularité : 7%

A. RAID de niveau 0 et 1 ( tester sous RedHat 6.2 )

  1.  Configurez le fichier /etc/raidtab de cette manière :

    raid de niveau 0

    raid de niveau 1

    raid de niveau 5

    <table border="0">
    raiddev /dev/md0
      raid-level  0
    nr-raid-disks 2

    nr-spare-disks 0
    chunk-size 4
    persistent-superblock 1 
    device 
    /dev/hda5

    raid-disk 
    0
    device 
    /dev/hda6
    raid-disk 
    1

    raiddev /dev/md0
      raid-level  1
    nr-raid-disks 2
    nr-spare-disks 0

    chunk-size 4
    persistent-superblock 1
    device 
    /dev/hda5
    raid-disk 

    0
    device 
    /dev/hda6
    raid-disk 
    1

    raiddev /dev/md0
     raid-level 5
    nr-raid-disks 7
    nr-spare-disks 0
    persistent-superblock 1
    parity-algorithm left-symmetric
    chunk-size 32

    device /dev/sda3
    raid-disk 0
    device /dev/sdb1
    raid-disk 1
    device /dev/sdc1
    raid-disk 2

    device /dev/sdd1
    raid-disk 3
    device /dev/sde1
    raid-disk 4
    device /dev/sdf1
    raid-disk 5

    device /dev/sdg1
    raid-disk 6

Si vous souhaitez mettre un/des disques
des secours, alors il faudra ajouter :


device /dev/sdh1
spare-disk 0

  •  Formatez les partitions avec cette commande :

    /sbin/mkraid /dev/md0
    

    /sbin/mke2fs /dev/md0

  •  Création du répertoire de montage et montage du FS

    mkdir /raid0/
    

    /sbin/raidstart /dev/md0

    mount /dev/md0 /raid0

  •  Pour finir :

            Monter le périphérique raid au démarrage
            /etc/rc.d/rc.local et ne vous ennuyez pas à le mettre
            dans le fichier /etc/fstab. Ca ne marchera pas !
    

    Pour arrêter, un système raid :
    Démonter le et faire /sbin/raidstop /dev/md0

    Pour le lancer :

    /sbin/raidstart /dev/md0 (ou le périphérique ) et
    monter le device.

  • B. Divers

     cat /proc/mdstat

      inactif actif

    Raid 0

    Personalities : [raid0]
    read_ahead 1024 sectors
    unused devices : <none>
    Personalities : [raid0]
    read_ahead 1024 sectors md0 : active raid0 hda6[1] hda5[0] 104576 blocks 4k chunks
    unused devices : <none>

    Raid 1

    Personalities : [raid1]
    read_ahead 1024 sectors
    unused devices : <none>
    Personalities : [raid1]
    read_ahead 1024 sectors
    md0 : active raid1 hda6[1] hda5[0] 52288 blocks [2/2] [UU]
    unused devices : <none>

     Fichier /etc/raidtab :

    raiddev device This introduces the configuration section for the stated device.
    nr-raid-disks countNumber of raid devices in the array ; there should be count raid-disk entries later in the file. (current maximum limit for RAID devices -including spares- is 12 disks. This limit is already extended to 256 disks in experimental patches.)
    nr-spare-disks count Number of spare devices in the array ; there should be count spare-disk entries later in the file. Spare disks may only be used with RAID4 and RAID5, and allow the kernel to automatically build new RAID disks as needed. It is also possible to add/remove spares runtime via raidhotadd/raid hotremove, care has to be taken that the /etc/raidtab configuration exactly follows the actual configuration of the array. (raidho tadd/raidhotremove does not change the configuration file)
    persistent-superblock 0/1 newly created RAID arrays should use a persistent superblock. A persistent superblock is a small disk area allocated at the end of each RAID device, this helps the kernel to safely detect RAID devices even if disks have been moved between SCSI controllers. It can be used for RAID0/LINEAR arrays too, to protect against accidental disk mixups. (the kernel will either correctly reorder disks, or will refuse to start up an array if something has happened to any member disk. Of course for the ’fail-safe’ RAID variants (RAID1/RAID5) spares are activated if any disk fails.)
       
    Every member disk/partition/device has a superblock, which carries all information necessary to start up the whole array. (for autodetection to work all the ’member’ RAID partitions should be marked type 0xfd via fdisk) The superblock is not visible in the final RAID array and cannot be destroyed accidentally through usage of the md device files, all RAID data content is available for filesystem use.
       
    parity-algorithm whichThe parity-algorithm to use with RAID5. It must be one of left-asymmetric, right-asymmetric, left-symmetric, or right-symmetric. left-symmetric is the one that offers maximum performance on typical disks with rotating platters.
    chunk-size size Sets the stripe size to size bytes. Has to be a power of 2 and has a compilation-time maximum of 4M. (MAX_CHUNK_SIZE in the kernel driver) typical values are anything from 4k to 128k, the best value should be determined by experimenting on a given array, alot depends on the SCSI and disk configuration.
    device devpath Adds the device devpath to the list of devices which comprise the raid system. Note that this command must be followed by one of raid-disk, spare-disk, or parity-disk. Also note that it’s possible to recursively define RAID arrays, ie. to set up a RAID5 array of RAID5 arrays. (thus achieving two-disk failure protection, at the price of more disk space spent on RAID5 checksum blocks)
    raid-disk index The most recently defined device is inserted at position index in the raid array.
    spare-disk index The most recently defined device is inserted at position index in the spare disk array.
    parity-disk index The most recently defined device is moved to the end of the raid array, which forces it to be used for parity.
    failed-disk index The most recently defined device is inserted at position index in the raid array as a failed device. This allows you to create raid 1/4/5 devices in degraded mode - useful for installation. Don’t use the smallest device in an array for this, put this after the raid-disk definitions !

    Commentaires  forum ferme

    Navigation

    Articles de la rubrique

    Statistiques

    Dernière mise à jour

    mercredi 5 juillet 2017

    Publication

    264 Articles
    Aucun album photo
    Aucune brève
    6 Sites Web
    2 Auteurs

    Visites

    59 aujourd’hui
    217 hier
    531723 depuis le début
    2 visiteurs actuellement connectés

    Top Articles