RAID 1 questions

raid
v7

(Federico Ballarini) #1

NethServer Version: 7.5 (beta)
Module: RAID Software

Hello everyone.
I have a problem… my server wasn’t a mail server, but now company requires internal server mail. I have a 500 GB SSD on this server but I want to add a disk to set RAID 1.

  1. If I add an hard disk (not SSD) there are problems? Or I have to add SSD?
  2. How can I set the RAID without install NethServer?

Thank you.
Federico


(Rob Bosch) #2

What I have seen is that mixing SSD and HDD in the same RAID set is not a good idea. If you use MDADM as conttroller, you will lack things like TRIM for your SSD https://superuser.com/questions/293144/combining-ssd-and-hard-disk-in-software-raid1

I would go for 2 new HDD’s of 1 or 2 TB and mount them as /var/lib/nethserver and keep your SSD for the rest of your NethServer install. This way you will have all your data (shares, mail and homedirs) on the mirrored HDD’s and NethServer runs from the fast SSD.


(Federico Ballarini) #3

In this mode system works on SSD (Proxy, Firewall, etc…) and data are stored in two hdd in raid1?
How can I do this operation?
Sorry but I’m not too expert…


(Federico Ballarini) #4

But I think that I reinstall all on two hard disk and I will remove the SSD…
Can I install 7.4 ISO and then restore 7.5 beta backup?


(Rob Bosch) #5

MAKE SURE YOU HAVE A BACKUP!

Creating a software raid 1 set with mdadm is something that needs to be done through the terminal.
Once you have added the disks to the server, you have to find out how those disks are known to the system. There are several ways of doing this:
In the terminal (on the server itself or through SSH), either do:

  • fdisk -l
  • lsblk

Each disk will be shown as /dev/sdx. And if there are multiple partitions on a disk, they will show up as /dev/sdx1 /dev/sdx2 etc…

[root@ns7 ~]# lsblk
NAME                 MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                    8:0    0   900G  0 disk 
├─sda1                 8:1    0     1G  0 part /boot
└─sda2                 8:2    0   899G  0 part 
  ├─VolGroup-lv_root 253:0    0 895.1G  0 lvm  /
  └─VolGroup-lv_swap 253:1    0   3.9G  0 lvm  [SWAP]
sr0                   11:0    1  1024M  0 rom  

In above example you see a single disk of 900GB devided in 2 partitions sda1 and sda2

As soon you add 2 disks of (lets say 1000GB) you will see, besides the existing 500GB SSD you have on sda, 2 more disks of 1000GB on sdb and sdc

With these 2 added disks you will create a RAID1 set using mdadm.
There are many tutorials online on how to create a RAID1 set using mdadm. For example: https://www.tecmint.com/create-raid1-in-linux/

Now you have to set your raidset to mount to the desired mountpoint. I would use /var/lib/nethserver since that is the main directory where all data is put.

You will have to change fstab so the system knows that /var/lib/nethserver changed to the root of the raid1 set. Also for changing and adding mountpoints, there are a lot of tutorials online, but keep in mind this is not a very easy task. Neither is maintaining a raid1 set. You have to read a lot to understand how mdadm works!.

If you decide to reinstall, you can create the RAID1 set during install and mount it as /var/lib/nethserver. Use the manual or interactive install option.


(Federico Ballarini) #6

Another question: i have a NS 6.9 installation configured with RAID5.

Can you explain me why I see also RAID1?
Thank you.

md1 OK
Livello RAID1
Dispositivi 3/3 (sdc1,sda1,sdb1)
Riserva sdd1

md2 OK
Livello RAID5
Dispositivi 3/3 (sdc2,sda2,sdb2)
Riserva sdd2