RAID, short for Redundant Array of Independent Disks, is an HDD configuration designed to provide shorter access times and system security in case of hardware errors.
The RAID concept combines multiple hard disk drives into one logical disk drive with higher storage capacity, using a hardware component or software application. Hardware solutions are designed to present the system to which they are attached as a single large hard disk with other storage features, without the operating system having to know the real physical architecture. RAID systems are a virtualized solution made of embedded hard disks. Software solutions are deployed together with the operating system, but applications use the RAID architecture as a single drive.
Here are the most common RAID configurations:
1. RAID 0
RAID 0 is used to boost the performance of a server, this solution also being called disk striping. With RAID 0, data is written on multiple HDDs. This means that the server is working to write information on multiple hard disks, not just on one, improving performance both in writing and reading. In this case, a minimum of two hard drives is required. It can configure both software and hardware on most RAID controls.
2. RAID 1
RAID 1 is a configuration known as mirroring, having two or more drives in mirror mode. With RAID 1, the data is copied perfectly and at the same time from one hard to the other, creating a copy or mirror. If a disk fails, the other can continue to work. It’s the easiest way to implement a system that resists hardware errors at a relatively low cost.
3. RAID 5
RAID 5 is by far the most common RAID configuration used for servers in the business environment, in private or state-owned firms and enterprises. This RAID level offers better performance than the mirror, as well as a hardware failure resistance. With RAID 5, information is divided into blocks of preset sizes and stores control sums on all hazards (having a good write and read rate, especially for small fractions of data).
4. RAID 10
RAID 10 is a combination of RAID 1 and 0 and is often referred to as RAID 1 + 0. It combines RAID 1 reflection with RAID 0. It is the RAID level that offers the best performance but is also costly, it requires twice more HDDs than other RAID levels, at least four. This RAID level is ideal for servers that contain databases and are widely used or for any server where many write operations are performed.
RAID 10 can be deployed as hardware or software RAID, but the overall consensus is that many of the performance benefits are lost when using RAID 10 software.
How to create a RAID 5 software on an Ubuntu server
1. Login as root
sudo su
followed by the user password
2. Install mdadm
apt-get install mdadm -y
3. View available disks
fdisk -l
in this case sda is the boot disk, and the disks available for raid5 are: sdb, sdc, sdd, sde, sdf, sdg, sdh and sdi.
4. Create Raid 5 with 6 active disks and 2 spare drives
mdadm -create -verbose / dev / md0 -level = 5 -raid-devices = 6 / dev / sdb / dev / sdc / dev / sdd / dev / sdh / dev / sdi
5. Check the order
mdadm -detail / dev / md0
6. Save configuration
mdadm -detail -scan >> /etc/mdadm/mdadm.conf
7. Open the partition manager by command
parted/dev/md0
8. In the partition manager, run the command
mklabel msdos
to create a MBR partition table;
9. In the partition manager, the p command is run to list the existing partitions;
10. Order q to exit the partition manager.
11. Create an ext4 partition by command mkfs.ext4 / dev / md0p1
12. Create the folder to which you want to mount, then make the mount
mkdir/media/storage
mount/dev/md0p1/media/storage/
13. Run the command to get the UID of the raid
blkid/dev/md0p1
14. Copy the printed UUID to the previous command and run the command to initialize and mount the raid at each boot
echo “UUID =” 000000-000000-000000-000000-000000″/ media / storage ext4 defaults 0 0″ >> / etc / fstab
15. Restart
reboot
16. Run command to check the mount after a restart
mount