Exploring RAID

Ayush Bhat
4 min readOct 3, 2021

Hello Folks 👋👋 , In this blog, we will explore the following fields:

  • RAID
  • Kernel Services, Kernel Configuration, Kernel Modules
  • Devices and Udev

So, let’s get started

RAID

RAID stands for Redundant Array of Independent Disks, it spreads I/O over multiple disks. Its purpose is to enhance data integrity and data recoverability in case of failure and to boost performance in modern storage devices.

Advantages:

  • It increases performance by mirroring; the same data is written to more than 1 disk.
  • Used for redundancy by stripping; splitting data to more than 1 disk.

Raid devices are created by partitioning from several disks together.

RAID Levels

There are number of RAID Levels based on the specification of increasing complexity and use. Commonly used are 0,1 and 5.

  1. RAID 0
  • Uses only stripping
  • No redundancy
  • No stability and recover capability

2. RAID 1

  • At least2 disks are required
  • Only mirroring
  • Good for recovery

3. RAID 5

  • Extra data is stored to allow problem detection and repair; Rotating parity stripe
  • At least 3 disks are required
  • If a single drive failure is there, no loss of data will be there

4. RAID 6

  • Can handle the loss of 2 disks
  • Requires at least 4 disks
  • Stripped disks with dual parity

5. RAID 10

  • 4 drives needed
  • Mirrored and Stripped

General Rule : Adding more disks improve performance

Software RAID Configurations

Let’s configure the software RAID device.

  1. Create a partition on each disk: Here we have already created the partition in 2 different disks i.e. /dev/sdb and /dev/sdc . Now we are setting up the array.

Command to setup the array.

mdadm --create /dev/md0 --level=1 --raid-disks=2 /dev/sdb3 /dev/sdc2
OpenSUSE

2. Format it

3. Add to the configuration file and then mount it.

4. You can examine the RAID status by reading /proc/mdstat file

5. If you want to stop the RAID device

Kernel Services and Configuration

  • The kernel handles all connected devices using device drivers and makes the devices available for operating system use.
  • Main Responsibilities of Kernel are Bootup, Networking Control, System Initialization, Memory Management, Security Control.
  • GRUB Configuration File
# OpenSUSE
/boot/grub2/grub.cfg
  • To check what command line the system was booted with:
cat /proc/cmdline
  • Sysctl : It is the interface used to read and tune kernel parameters at run time.

The below screenshot shows how we can tune the parameters.

Kernel Modules

  • Linux Kernel makes extensive use of modules, which contain important software that can be dynamically loaded and uploaded as needed after the system starts.
  • Use lsmod : Show the status of modules in Linux Kernel
  • Module utilities : There are number of utility that can be used with kernel modules like lsmod, insmod, rmmod, modprobe, depmod and modinfo.
  • modinfo : can be used to find out information about kernel module whether they are currently loaded or not.
  • All files in /etc/modprobe.d subdirectory tree which end with .conf extension are scanned when modules are loaded and unloaded using modprobe.

Devices and Udev

  • Udev (User Device Management) : It comes with dynamic abilities. It discovers built-in hardware as well as peripheral devices during the system boot and when hot plugged.

Everything in Linux is a file

Devices Nodes

  • Character and Block devices have device nodes, network devices do not
  • Character devices : serial ports, parallel ports
  • Block Devices : Hard disks and USB Cameras

Udev Component

The three components of udev are:

  • The libudev library which allows access to information about the devices
  • The udevd or systemd-udevd daemon that manages the /dev directory
  • The udevadm utility for control and diagnostics

--

--

Ayush Bhat

AWS SAA-C02 | Certified Kubernetes Administrator | Linux Foundation Certified Sysadmin | Ex294 RedHat Certified Engineer