Configuration idéal avec RAID 5?

Mon serveur YunoHost

Matériel:

  • Vieil ordinateur
  • SSD x3 1To
  • HDD x2 1To

qu’est-ce que vous cherchez à faire,
Optimiser au maximum la configuration initiale en RAID 5 pour un serveur stable sur la durée.


Bonjour à tous,

Depuis déjà quelques temps j’install yunohost sur de vieux ordinateurs avec un, deux, ou trois vieux disques durs de récupérations pour m’habituer et tester ses différentes fonctionnalités.
J’aimerai maintenant essayer de faire une installation “clean” qui soit durable. Cependant pour ne pas faire de bêtise je préfère demander en amont comment configurer le raid 5 et quel est le meilleur moyen d’optimiser les disques.


J’ai pas mal regardé sur le net et la plupart du temps on parle d’un disque sur lequel est enregistré la distribution et les autres sur lesquels on monte un raid pour stocker les différentes données.

  • Est ce possible avec yunohost ? Et si oui, comment gérer l’installation avec les différentes redirections (/home, /boot, /var, …)?
  • Ensuite, comment créer les différentes partitions sur chaque disque ? faut-il créer un boot sur chaque disque ou un seul sur l’un des disques ? même question pour le répertoire racine et les autres. :slight_smile:
    — “Quid de la panne disque : est ce que le remplacement initie automatiquement la reconstruction du disque ou cela doit-être fait de manière manuelle ?”
  • Enfin, existe-il une application qui permette de faire un monitoring automatique des disques en envoyant un rapport d’état par mail en choisissant la redondance ?

Bravo à toute personne qui arrivera jusqu’à cette ligne et si jamais vous avez un petit temps par ci par là pour m’aider, un grand merci par avance !! :slight_smile:

Bonne soirée à tous !!

Oui c’est possible, j’ai moi même un SSD pour / et un RAID 10 sur /home (l’endroit où il y a globalement toutes les datas)

Il faut un seul /boot, tu peux le laisser sur le même disque que ton système.
Ce que j’ai fait à l’époque où j’ai monté mon serveur:

  • Installer mon système sur mon SSD (sans monter mes HDD en RAID 10)
  • Une fois que YNH était configuré etc, j’ai créé mon RAID 10, monté dans /mnt/home, copié les datas de mon /home vers /mnt/home,
  • Remplacé mon fstab pour que mon RAID 10 soit monté sur /home

Je ne sais pas si c’est la bonne manière de faire, mais comme je n’avais jamais touché à du RAID, j’ai préféré procéder comme ça pour me faire la main et apprendre.

Je ne peux pas vraiment répondre, mais il me semble avoir vu qu’il fallait mettre des disques en spares, et qu’après c’était magique. Pas testé, mais j’ai pu trouver ça en moins de 10s de recherche.

Un bon cron? J’imagine qu’il y a mieux, mais ça doit faire le job.

Bonne soirée, bonne bidouille.

2 Likes

Hi stewhbac,

My French is not good enough, I’ll reply in English :wink:

Is RAID5 a ‘hard requirement’, or do you like to use it because it is interesting technology?

Yes. You would start with a Debian 11 (Bullseye) installation and manually partition the drives. After installing Debian, you install Yunohost. After installing, you continue with the postinstall as regular, or you use your backups from your existing Yunohost to jumpstart the server.

I used to use RAID5 (with mdadm and LVM) on my desktop/NAS. If I disconnected one of the three harddrives, there would be a line in the logs saying “this-or-that device can not be found”, and things would continue to run as they did. After connecting the cable, it continued to work as usual.

I never took the time (or courage) to wipe a disk and see if it got rebuilt. It must have reconstructed the missing data (while using the computer with a disconnected disk) in the background.

The system ran over 10 years, ‘24/7’, without a disk problem. RAID5 was fun to set up, but it turned out I never needed it. Although the system was fast enough for my needs, it was more complex and slower than it would have been without RAID5.

I recently upgraded most of the system, and chose for a non-raid setup, and use the spare disks as backup.

I still use LVM though, and a mix of HDD and SSD. If I had 3x 1TB HDD and 2x 1TB SSD, I would use

  • two HDD’s as bulk storage (maybe 300-500GB partitions as physical volumes to assign to volume groups)
  • one SSD as read/write cache for the various volume groups
  • one SSD for applications that need high I/O
  • one HDD as backup location

My answer is only a little bit about RAID5, I hope it helps and can give some inspiration. If it raises more questions, I’ll try to answer them :slight_smile:

2 Likes

Tout d’abord merci pour la rapidité de la réponse !

Si je résume, ce que tu me conseil ce n’est pas un RAID 5 mais plutôt un RAID 10 pour ma configuration avec comme montage :

  • 1 SSD pour le système
  • 2 SSD + 2 HDD en raid 10 pour les datas

Ainsi cela me ferait 1To pour le système et 2To pour les datas.
On peut avoir un RAID 10 et que les disques ne soient pas en spares ? Il me semblait que c’était justement l’efficacité de ce RAID le fait qu’il y avait un raid 0 combiné à 2*x disques ? Le spares serait une configuration supplémentaire ?

Même si je bidouille pas mal, ça reste de la bidouille et j’avoue que la compréhension d’un cron et son utilisation reste encore obscure pour moi malgré que je vois ce terme partout, de la même manière, savoir ou chercher les logs et les résoudre c’est encore beaucoup de recherche et de patiente (mais ça va venir petit à petit :wink: )

En tout cas merci beaucoup pour tous ces éléments cela me fait déjà bien avancer dans mes idées.

Hi !
Don’t worry, i will speak in English. It will be better for your comprehension. :slight_smile:

I chose RAID 5 because it seemed to be a good ratio between stability and easy to set up. But maybe as Kayou said, the RAID 10 could be more efficient ?
Isn’t it harder to set up ?
In any case, i could change the set up if it necessary.

Your configuration is very interesting but i don’t understand how you can split your read/write cache and your other partition. You will read/write on all disk isn’t it ?

Thanks you for all of this information, I think to install first debian 11 and in a second time install yunohost. Because it seems easier to set up a RAID with graphical app. than command line. :grimacing:

Now i will have to know how to monitoring my different disk and know when i have to change them. I’m not confortable yet with cron and logs. ^^

Better for my understanding in the short term, but worse for French practice :wink: Still, thank you for taking the trouble :slight_smile:

RAID1 (mirror) is easier to set up and generally has better performance than RAID5; RAID10 (mirror+stripe) is not really an obvious choice with the disks you have available.

RAID5 does ‘cost’ less storage: it provides “(number of disks) - 1 disk” as effective storage, whereas RAID1 only provides “(number of disks) / 2” as effective storage.

The question remains: how critical is it that your server remains available every moment of the day, every day of the year? Is it acceptable to be offline for half a day to restore a backup, in case a disk crashes? If it is not acceptable to be offline for half a day, do you have a UPS, dual power supply, dual network stack and all those things needed for high availability, not even starting about a separate server to test upgrades?

What I try to say is: is RAID (any sort) worth the trouble for the benefits it gives? HDD’s and SSD’s do die, but has not happened to me personally since Maxtor was bought by Seagate.

The Debian ‘graphical installer’ is quite friendly (even though in my impression, the main difference with the text version is nicer fonts and a mouse pointer).

LVM-based installation is one of the options in the installer (maybe only system-defined in the regular installer, and manual definition in the expert installer).

In the installer you would first configure the HDD’s for use as “PV” (physical volume) (or first make partitions, and configure the partitions for use as PV).

After that, still in the installer, you configure LVM: create a “volume group” (VG) out of one or more PV.
The VG provides ‘extends’ (bit of space) that can be used to create logical volumes (LV).

The logical volumes in LVM can be compared to partitions in ‘regular’ storage. The LV’s are formatted with a filesystem, such as ext4. The benefit of /home on a LV, instead of /home on /dev/sda2, for example, is that it is very easy to make the LV larger. Partition /dev/sda2 can grow, as long as there is adjacent space on sda. LV ‘home’ can be extended easily, even on another (new) disk.

If you start with LVM on one of the HDD, it can be extended to RAID1 or RAID5 later on.

SSD cache (dm-cache) can be added later as well. It is a ‘transparant layer’ between Linux and the HDD, so to speak. When reading, if it is available in the cache, it is found faster. If not found, it is read from HDD and a copy is put in cache (if there is space).
When writing, it is done to the cache, and synchronized to HDD in the background. It is sort of a manual implementation of these HDD+SSD disks, only with much more cache.

I am sure this is not yet clear now, but don’t be put of by seeming complexity. LVM has been around for a long time, you’ll find lots of information (also in French) about how to configure it. Whether or not you use RAID in the end, LVM would be my choice.
This post would not be complete without at least mentioning ZFS, but that has a higher requirement to start with the same performance, and is more complex in my view.

2 Likes

:fr:
Petite clarification, j’ai dit que dans MON cas c’était du RAID 10, je ne conseil ni l’un ni l’autre, c’était juste pour apporter des points de comparaison :slight_smile:

:us:
Small clarification, I said that in MY case it was RAID 10, I do not recommend one nor the other, it was just to provide points of comparison :slight_smile:

2 Likes

Wow, Ok thank you so musch for so much information !! :star_struck:

Cleary, I don’t understand everything but, i will read and learn about all notion you mentioned.

for answer your question:

The question remains: how critical is it that your server remains available every moment of the day, every day of the year ? Is it acceptable to be offline for half a day to restore a backup, in case a disk crashes? If it is not acceptable to be offline for half a day, do you have a UPS, dual power supply, dual network stack and all those things needed for high availability, not even starting about a separate server to test upgrades?

It’s only a private server and it can be offline for a day or even for a week so It’s not necessary to have a couple of all things.

What I try to say is: is RAID (any sort) worth the trouble for the benefits it gives? HDD’s and SSD’s do die, but has not happened to me personally since Maxtor was bought by Seagate

My 3 SSD are new so i think they can works for years. but my HDD’s are recuperation stockage from an agency. So i don’t know when they will crash :grimacing:
If i understand, your advice is do not necessary make a RAID ?

LVM-based installation is one of the options in the installer (maybe only system-defined
[…]
When writing, it is done to the cache, and synchronized to HDD in the background. It is sort of a manual implementation of these HDD+SSD disks, only with much more cache.

Ok… cleary the hard parts for me ^^. But i start to configure my debian tonight so i will trying to read step by step and understand as i can. :stuck_out_tongue:

Ah yes, donc un RAID n’est pas forcément une solution adéquate à un serveur si je dois résumer un peu ce que vous me dites wbk et toi ? (ou j’imagine cela dépend des attentes du serveurs mais dans mon cas peut être pas le meilleur choix pour un serveur à usage privé?).

(@wbk for your practice :wink: ) → En tout cas un grand merci à tous les deux pour les conseils bien avisés !
Je vais essayer de suivre les conseils en créant les volume logiques dans un premier temps (enfin si j’arive à bien comprendre toutes les étapes) et en installant débian et on verra ensuite pour yunohost sur la machine debian si elle est bien configurée :smiley:

2 Likes

Did you check the SMART data ?
How old (in hours of usage + startups) is this HDD ?

1 Like

Ça dépend. À quel besoin répond le RAID pour toi ? La disponibilité ? Les sauvegardes ? etc.

1 Like

:us:
Hello ! The both HDD’s have 3 years old of usage but one of them have 14 bad sectors.
For the startups, i don’t knoow what you mean ? :grimacing:

:fr:
Bonjour ! Les deux HDD ont 3 ans d’ancienneté mais il y en a un qui a 14 secteurs endommagé. Pour le “startups” je ne vois pas comment tester cela et à quoi cela correspond :grimacing:

Dans l’idée j’aimerai pouvoir configurer mon serveur pour qu’il fonctionne 24h/24 7J/7. Après, comme dit plus haut, ce n’est pas critique au point que je ne puisse me permettre de la déconnecter le temps d’une reconstruction ou autre.
C’est juste que s’il est down pendant mes vacances, je ne pourrais pas intervenir dessus avant 1 ou 2 semaines. :slight_smile:

Donc l’enjeu est sur la perte de fichiers et la facilité à reconstruire/redémarrer direct en cas de mort d’un des disques ?

Tout à fait, j’aimerai pouvoir y stocker des photos et document perso en plus des mails donc si je dois tout reformater et réinstaller dès qu’un DD crash ce n’est pas l’idéal :confused:

Peut être je me trompe mais si je fais un LVM avec la moitié des DD et un raid 1 par dessus c’est assez safe ? (le problème étant la perte de place mais bon)
Ou je dois garder un DD pour les sauvegarde ?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.