Valid for: customizable Dedicated Servers and Bare Metal Servers with hardware RAID and Linux

If you order a customizable Dedicated Server or Bare Metal Server with hardware RAID and additional storage, a Level 1 hardware RAID is only created for the server’s primary storage.

You must set up a separate hardware RAID for the additional storage in the following case:

  • You have ordered a customizable Dedicated Server or Bare Metal Server with hardware RAID that uses HDD storage as the primary storage and HDD or SSD storage as additional storage.

You must create a separate software RAID for the additional storage in the following cases:

  • You have ordered a customizable Dedicated Server or Bare Metal Server with hardware RAID that uses HDD storage as the primary storage and NVMe storage as additional storage.

  • You have ordered a customizable Dedicated Server or Bare Metal Server with hardware RAID that uses NVMe storage as the primary storage and HDD or SSD storage as additional storage.

This article explains the advantages and disadvantages of the main RAID levels and the criteria you should consider when selecting the appropriate RAID level. It also explains how to create a separate Level 1 hardware RAID on a customizable Dedicated Server or Bare Metal Server with hardware RAID that uses HDD storage as the primary storage and HDD or SSD storage as additional storage.

Depending on your use case, you can also set up RAID systems with other RAID levels for your storage devices.

Note

You can find instructions on creating a software RAID for a customizable Dedicated Server or Bare Metal Server in the following article: Creating an additional software RAID (Linux)

Please Note

This article assumes that you have good knowledge of Linux server administration. The commands in this article must be adapted to your server’s configuration. Check and adjust them before you partition and format the storage devices and before you create the additional hardware RAID. Otherwise, data loss may occur.

Criteria for selecting the appropriate RAID level

RAID systems offer greater data security, higher speeds, or both. However, they are no substitute for regular backups. You should therefore back up your data regularly to prevent data loss.

You can determine which RAID level is suitable for your server by answering the following questions:

  • Which operating system is used on the server, and which RAID levels does it support?

  • What storage capacity is required? How much of the installed storage capacity should be usable?

  • What are the requirements for read and write speeds?

  • What are the requirements for data security?

An overview of the main RAID levels

The following table lists the main RAID levels, along with their advantages and disadvantages:

  RAID 0 RAID 1 RAID 5 RAID 6 RAID 10 (1+0)
Minimum number of storage devices (HDD, SSD, or NVMe) 2 2 3 4 4
Method used Striping Mirroring Striping and parity Striping and double parity Striping of mirrored data
Fault tolerance none failure of one drive failure of one drive failure of two drives failure of one drive per sub-array
Capacity utilization 100%
Number of storage devices × capacity
50%
Capacity of one storage device
67%
(Number of storage devices – 1) × capacity
50%
(Number of storage devices – 2) × capacity
50%
(Number of storage devices / 2) × capacity
Write speed very high low medium low medium
Read speed very high medium high high very high
Advantages Higher bandwidth than single drives

More input/output operations per second than single drives
Full redundancy

Data security and speed can optionally be increased with a suitable controller or software
Increased reliability through parity

Good price-performance ratio in terms of redundancy and storage efficiency
High reliability thanks to double parity

Slightly improved read throughput compared to single drives
Increased read speed compared to single drives

Increased reliability of the storage devices used
Disadvantages Higher probability of failure than single drives

No redundancy: if a storage device fails, a large proportion of the data is lost
The storage capacity of the array is at most as large as the capacity of the smallest storage device

High cost
Write speed is reduced compared to single drives

Only part of the total storage capacity of the storage devices can be used
Write speed is significantly reduced compared to single drives

Only part of the total storage capacity can be used, particularly in smaller arrays
Significantly reduced maximum available storage capacity

If two storage devices in the same sub-array fail, the entire array fails

Determining the hardware controller type and displaying hardware information

To check which hardware controller is installed in your server, you can use the lshw program. It displays detailed information about the hardware components.

Installing lshw

Ubuntu and Debian

sudo apt update
sudo apt install lshw

AlmaLinux 9, AlmaLinux 10, Rocky Linux 9, and Rocky Linux 10

dnf install lshw

Displaying hardware information with lshw

To display a summary of the hardware information, enter the following command:

lshw -short

To save the hardware information to a text file, enter the following command:

lshw > lshw_output.txt

Creating a separate Level 1 hardware RAID for the additional storage devices

These example instructions were created for a customizable Dedicated Server with a Broadcom RAID controller. The commands may differ depending on the hardware controller used.

If you are using a different hardware controller, the commands for listing the volumes and creating a new RAID array will differ. In this case, you can find the required commands in the manufacturer’s documentation.

Caution

Before creating the RAID 1 array, make sure that you are using two identical storage devices of the same size.

  • To check which storage devices are installed in your server, enter the following command:

    [root@90398B0 ~]# storcli64 /c0/eall/sall show

    This command displays all storage devices that are managed by the hardware controller. Information such as the following is displayed:

    [root@90398B0 ~]# storcli64 /c0/eall/sall show
    CLI Version = 007.2203.0000.0000 May 11, 2022
    Operating system = Linux 3.10.0-1160.83.1.el7.x86_64
    Controller = 0
    Status = Success
    Description = Show Drive Information Succeeded.


    Drive Information :
    =================

    ----------------------------------------------------------------------------------------
    EID:Slt DID State DG Size Intf Med SED PI SeSz Model Sp Type
    ----------------------------------------------------------------------------------------
    68:0 1 Onln 0 3.637 TB SATA HDD N N 512B HGST HUS726T4TALA6L4 U -
    68:1 0 Onln 0 3.637 TB SATA HDD N N 512B HGST HUS726T4TALA6L4 U -
    68:2 2 UGood - 893.750 GB SATA SSD Y N 512B SAMSUNG MZ7L3960HCJR-00A07 U -
    68:3 3 UGood - 893.750 GB SATA SSD Y N 512B SAMSUNG MZ7L3960HCJR-00A07 U -
    ----------------------------------------------------------------------------------------

    EID=Enclosure Device ID|Slt=Slot No|DID=Device ID|DG=DriveGroup
    DHS=Dedicated Hot Spare|UGood=Unconfigured Good|GHS=Global Hotspare
    UBad=Unconfigured Bad|Sntze=Sanitize|Onln=Online|Offln=Offline|Intf=Interface
    Med=Media Type|SED=Self-Encrypting Drive|PI=Protection Info
    SeSz=Sector Size|Sp=Spun|U=Up|D=Down|T=Transition|F=Foreign
    UGUnsp=UGood Unsupported|UGShld=UGood shielded|HSPShld=Hotspare shielded
    CFShld=Configured shielded|Cpybck=CopyBack|CBShld=Copyback Shielded
    UBUnsp=UBad Unsupported|Rbld=Rebuild

  • Make a note of the EID:Slt values of the storage devices with the status UGood (in this example, 68:2 and 68:3).

  • To use the additional storage devices, create a new RAID array with RAID level 1 for them. This allows you to use the additional storage space independently of the existing RAID array. To do this, adapt the command below to the information displayed in step 1 and then enter it. Replace RAID_NAME with a name for the RAID and, if necessary, replace the drive designations 68:2-3. In the command, /c0 refers to the first RAID controller and vd stands for virtual drive (the logical volume).

    storcli64 /c0 add vd type=raid1 name=RAID_NAME drives=68:2-3

    Example:

    storcli64 /c0 add vd type=raid1 name=DATA_RAID1 drives=68:2-3

    A message is then displayed confirming that the additional RAID has been created:

    [root@90398B0 ~]# storcli64 /c0 add vd type=raid1 name=DATA_RAID1 drives=68:2-3
    CLI Version = 007.2203.0000.0000 May 11, 2022
    Operating system = Linux 3.10.0-1160.83.1.el7.x86_64
    Controller = 0
    Status = Success
    Description = Add VD Succeeded.

  • To check whether the new RAID array has been recognized, enter the following command:

    storcli64 /c0/eall/sall show

    Information such as the following is displayed:

    [root@90398B0 ~]# storcli64 /c0/eall/sall show
    CLI Version = 007.2203.0000.0000 May 11, 2022
    Operating system = Linux 3.10.0-1160.83.1.el7.x86_64
    Controller = 0
    Status = Success
    Description = Show Drive Information Succeeded.


    Drive Information :
    =================

    ----------------------------------------------------------------------------------------
    EID:Slt DID State DG Size Intf Med SED PI SeSz Model Sp Type
    ----------------------------------------------------------------------------------------
    68:0 1 Onln 0 3.637 TB SATA HDD N N 512B HGST HUS726T4TALA6L4 U -
    68:1 0 Onln 0 3.637 TB SATA HDD N N 512B HGST HUS726T4TALA6L4 U -
    68:2 2 Onln 1 893.750 GB SATA SSD Y N 512B SAMSUNG MZ7L3960HCJR-00A07 U -
    68:3 3 Onln 1 893.750 GB SATA SSD Y N 512B SAMSUNG MZ7L3960HCJR-00A07 U -
    ----------------------------------------------------------------------------------------

    EID=Enclosure Device ID|Slt=Slot No|DID=Device ID|DG=DriveGroup
    DHS=Dedicated Hot Spare|UGood=Unconfigured Good|GHS=Global Hotspare
    UBad=Unconfigured Bad|Sntze=Sanitize|Onln=Online|Offln=Offline|Intf=Interface
    Med=Media Type|SED=Self-Encrypting Drive|PI=Protection Info
    SeSz=Sector Size|Sp=Spun|U=Up|D=Down|T=Transition|F=Foreign
    UGUnsp=UGood Unsupported|UGShld=UGood shielded|HSPShld=Hotspare shielded
    CFShld=Configured shielded|Cpybck=CopyBack|CBShld=Copyback Shielded
    UBUnsp=UBad Unsupported|Rbld=Rebuild

    The storage devices should now have the status Onln (Online) and be assigned to a drive group (DG).

  • To list the existing disks and partitions, enter the following command:

    root@90398B0:~# fdisk -l

    The fdisk program is a command-line tool for partitioning disks. You can use it to view, create, and delete partitions.

    A new device whose size matches your new RAID should now be displayed. In this example, this is the device /dev/sdb:

    root@90398B0:~# fdisk -l
    Disk /dev/sda: 3.7 TiB, 4000225165312 bytes, 7812939776 sectors
    Disk model: MR9440-8i
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 65536 bytes / 65536 bytes
    Disk label type: gpt
    Disk identifier: 1FEE5173-7F6E-421D-B323-E11E2C5CBECB

    Device Start End Sectors Size Type
    /dev/sda1 2048 1048575 1046528 511M EFI System
    /dev/sda2 1048576 3905535 2856960 1.4G Linux RAID
    /dev/sda3 3905536 11718655 7813120 3.7G Linux RAID
    /dev/sda4 11718656 7812937727 7801219072 3.6T Linux RAID


    Disk /dev/sdb: 893.8 GiB, 959656755200 bytes, 1874329600 sectors
    Disk model: MR9440-8i
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 65536 bytes / 65536 bytes
    Disk label type: gpt
    Disk identifier: B1590B72-4F09-4677-80A4-A1D8C6CB218F

  • Make a note of the device name of the new RAID array (in this example, /dev/sdb).

  • If you want to use the XFS file system, create the directory /xfsdrive. If you want to use the ext4 file system, create the directory /ext4drive. To do this, enter the matching command:

    XFS

    mkdir /xfsdrive

    ext4

    mkdir /ext4drive

  • To partition the additional RAID array, adapt the commands below and then enter them. The -a opt option specifies that the optimal alignment mode is used. The mkpart primary command creates a new primary partition. The values 0% and 100% specify the start and end points of the new partition, so the partition occupies all the available space.

    Create a GPT partition table:

    parted /dev/ADDITIONAL-RAID-ARRAY mklabel gpt -a opt

    Create a partition that uses 100% of the space:

    parted /dev/ADDITIONAL-RAID-ARRAY mkpart primary 0% 100%

    Example:

    parted /dev/sdb mklabel gpt -a opt
    parted /dev/sdb mkpart primary 0% 100%

  • To make sure that the kernel recognises the new partition table, enter the command below. It instructs the kernel to re-read the partition table and displays a summary of the partitions.

    partprobe -s

  • To format the partition with the XFS or ext4 file system, adapt the matching command below and then enter it. Make sure that you format the partition, not the entire device:

    XFS

    mkfs.xfs /dev/PARTITION

    Example:

    root@90398B0:~# mkfs.xfs /dev/sdb1

    ext4

    mkfs -t ext4 /dev/PARTITION

    Example:

    root@90398B0:~# mkfs -t ext4 /dev/sdb1

  • To mount the partition, adapt the matching command below and then enter it. Make sure that the directory already exists.

    XFS

    mount /dev/PARTITION /xfsdrive

    Example:

    mount /dev/sdb1 /xfsdrive

    ext4

    mount /dev/PARTITION /ext4drive

    Example:

    mount /dev/sdb1 /ext4drive

  • To check that the partition is mounted as /xfsdrive or /ext4drive, enter the matching command:

    XFS

    grep xfsdrive /proc/mounts

    ext4

    grep ext4drive /proc/mounts

  • To determine the UUID of the new partition, enter the following command:

    blkid /dev/PARTITION

    Example:

    blkid /dev/sdb1

  • To mount the partition automatically at boot time, add it to the /etc/fstab file. To do this, adapt the command below and then enter it:

    echo 'UUID=YOUR-UUID /MOUNT-DIRECTORY FILE-SYSTEM defaults 0 0' | sudo tee -a /etc/fstab

    Examples:

    ext4

    echo 'UUID=YOUR-UUID /ext4drive ext4 defaults 0 0' | sudo tee -a /etc/fstab

    XFS

    echo 'UUID=YOUR-UUID /xfsdrive xfs defaults 0 0' | sudo tee -a /etc/fstab

  • To check the /etc/fstab file for errors, enter the following command:

    mount -a

  • To check the entries in the /etc/fstab file, enter the following command:

    cat /etc/fstab

  • To check the available storage space, enter the following command:

    df -h

  • Restart the system.

  • To check whether the RAID has been mounted, enter the following command:

    mount

Troubleshooting

If the command storcli64 /c0/eall/sall show returns the status Success after you have created the RAID array, but the RAID does not appear as a new drive when you enter the command fdisk -l, the Linux kernel has not yet rescanned the storage bus (SCSI). In this case, force a rescan of the SCSI bus with the following command:

for host in /sys/class/scsi_host/*; do echo "- - -" > ${host}/scan; done

Wait a few seconds and check again with lsblk or fdisk -l. The drive should now appear. Alternatively, restarting the server with the reboot command usually helps.