Software-RAID configuration

Last modified: Friday December 1st, 2023

This article lists all the necessary steps for installing a software raid.

Basic information

Software RAID is when the interaction of multiple drives is organized completely by software.

  • RAID Level 1 (mirroring) achieves increased security: even if one drive fails, all the data is still stored on the second drive.
  • RAID Level 0 (striping) leads to double the capacity (with two drives) and increased reading speed compared to RAID 1. But all data will be lost if even one of the drives fails.

Our installimage, which you can use to manually install an operating system, is also useful for configuring several different RAID levels. Also, you can use it to combine software RAID with LVM.

Servers pre-installed by Beehosting are configured with RAID superblocks (version 1.2) if this is supported by the operating system. (So that applies to all systems with Grub2 as the boot loader). Therefore, if you’re doing your installation via VNC, the installers might use other metadata versions.

Email notification when a drive in a software RAID fails

  • Requirement: installed and configured mail server

Debian/Ubuntu/CentOS

Edit /etc/mdadm/mdadm.conf or /etc/mdadm.conf (CentOS) and change the following line:

MAILADDR root

Here, you can specify a destination address directly. Or, you can forward all emails sent to root to a specific email address using /etc/aliases.

You can also optionally configure the sending email address:

MAILFROM moc.e1733500179lpmax1733500179e@mda1733500179dm1733500179

For Debian and Ubuntu, it is important that you set AUTOCHECK in the file /etc/default/mdadm to true:

# grep AUTOCHECK= /etc/default/mdadm
AUTOCHECK=true

For CentOS, you must enable the check in the file /etc/sysconfig/raid-check:

# grep ENABLED /etc/sysconfig/raid-check
ENABLED=yes

openSUSE

Edit /etc/sysconfig/mdadm and add the email address that you want the notification sent to next to the variable MDADM_MAIL:

MDADM_MAIL="moc.e1733500179lpmax1733500179e@elp1733500179maxe1733500179"

Removing a software RAID

To remove a software RAID, you can issue the following commands:

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

After that, you can format the drive normally again (e.g. with ext3):

mkfs.ext3 /dev/sda
mkfs.ext3 /dev/sdb

You can check the result with:

fdisk -l

The software RAID should now be gone.

Then you can use installimage to install a new operating system.

If an OS is installed and software RAID is activated on the server, then just running installimage and installing a new OS without software RAID won’t work. The server won’t boot in this case.

Was this article helpful?
Views: 142

10 Years Beehosting!
Celebrate with 70% OFF + FREE Site Transfer.

Facebook Instagram linkedin

Beehosting.pro website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Menu