Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wp-statistics domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/wordpress/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wp-pagenavi domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/wordpress/wp-includes/functions.php on line 6114

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wordpress-seo domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/html/wordpress/wp-includes/functions.php on line 6114
Mettre en place un RAID1 sous Debian - Plessy

Mettre en place un RAID1 sous Debian

Pour rappel un RAID c’est CA

ATTENTION: Ce tuto est realisé en mode rescue

On commence par la traditionnel mise à jour:

apt update && apt upgrade && apt install sudo parted

On liste nos disques pour repérer les disques, leurs partitions et taille (sda, sdb, sdc, etc…)

lsblk

Mon but est de créer:

  1. un premier RAID avec sda et sdb qui sont des disques de 250Go SSD
  2. un second RAID avec sdc et sdd qui sont des disques de 2To HDD

On supprime donc les partions inutiles:

ATTENTION: Prenez bien soin et remplacer chaque $VARIABLES par vos propres paramètres
sudo parted -s /dev/sdb mklabel msdos
sudo parted -s /dev/sdc mklabel msdos
sudo parted -s /dev/sdd mklabel msdos

On clone les partitions du premier disque sur le second:

sfdisk -d /dev/sda | sfdisk --force /dev/sdb

On crée une partition sur l’ensemble du 3eme disque:

sudo parted -s /dev/sdc mkpart primary 1MiB 100%

Et la encore on clone les partitions du 3eme sur le 4eme disque:

sfdisk -d /dev/sdc | sfdisk --force /dev/sdd

On vérifie notre mise en place:

lsblk

On marque les partitions comme RAID:

parted -a optimal /dev/sda set 1 raid on
parted -a optimal /dev/sdb set 1 raid on
parted -a optimal /dev/sdc set 1 raid on
parted -a optimal /dev/sdd set 1 raid on

On supprime les montages existant:

cat /proc/mdstat
mdadm --stop /dev/md0
mdadm --stop /dev/md1
mdadm --stop /dev/md3

mdadm --remove /dev/md0
mdadm --remove /dev/md1
mdadm --remove /dev/md2

On on monte notre RAID1:

mdadm --create /dev/md0 --level=1 --raid-disks=2 /dev/sda1 /dev/sdb1
mdadm --create /dev/md1 --level=1 --raid-disks=2 /dev/sda2 /dev/sdb2
mdadm --create /dev/md2 --level=1 --raid-disks=2 /dev/sda3 /dev/sdb3
mdadm --create /dev/md3 --level=1 --raid-disks=2 /dev/sdc1 /dev/sdd1

On formate notre md3 (qui est le RAID1 des 2 disques de 2To) et on le monte dans /home:

mkfs.ext4 /dev/md3
mount /dev/md3 /home

On récupère les UUID:

blkid

On crée la conf mdadm:

mdadm --detail --scan --verbose | tee -a /etc/mdadm/mdadm.conf

Et on entre les points de montage dans fstab:

nano /etc/fstab

Et on reboot

reboot