Data Loss Prevention   «Prev  Next»

Lesson 10 Hardware vs. software RAID
Objective Compare and contrast hardware and software RAID.

Hardware versus Software RAID

It is possible to implement RAID (Redundant Array of Independent Disks) in Red Hat Linux 9.2 using both hardware and software approaches. Here's an overview of both methods:
1. Hardware RAID Hardware RAID is managed by a dedicated RAID controller card or by the motherboard if it has RAID functionality. The RAID configuration is abstracted from the operating system.
Steps for Hardware RAID:
  1. Configure the RAID Controller:
    • Access the RAID controller firmware during the boot process (usually via a key combination like Ctrl+R, Ctrl+H, or a similar key depending on the RAID controller vendor).
    • Create a RAID array by selecting the desired disks and choosing a RAID level (e.g., RAID 0, RAID 1, RAID 5, etc.).
  2. Install Red Hat Linux 9.2:
    • During the installation, the RAID array will appear as a single disk to the Red Hat Linux installer.
    • Partition and format the RAID disk as needed during the installation process.
  3. Install RAID Controller Drivers (if needed):
    • Some RAID controllers require additional drivers for Red Hat Linux. Obtain the drivers from the controller vendor and install them as per the documentation.

2. Software RAID:
Software RAID is managed by the operating system using utilities like `mdadm`.
Steps for Software RAID:
  1. Install Required Packages:
    • Ensure mdadm is installed:
      sudo dnf install mdadm
              
  2. Create RAID Devices:
    • Identify the disks using lsblk or fdisk -l.
    • Create a RAID array with mdadm:
      sudo mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sdX /dev/sdY
              
      Replace /dev/sdX and /dev/sdY with the actual disk device names.
  3. Format and Mount the RAID Array:
    • Format the RAID device:
      sudo mkfs.ext4 /dev/md0
              
    • Mount the RAID device:
      sudo mount /dev/md0 /mnt/raid
              
  4. Persist RAID Configuration:
    • Save the RAID configuration to the mdadm configuration file:
      sudo mdadm --detail --scan >> /etc/mdadm.conf
              
  5. Enable Auto-Mount:
    • Add an entry to /etc/fstab for the RAID device.
Comparison: Hardware vs. Software RAID:
|  Aspect             | Hardware RAID                       | Software RAID                 |
|---------------------|-------------------------------------|-------------------------------|
| Performance:        | Offloaded to RAID controller        | Uses CPU for RAID operations  |
| Flexibility:        | Limited to controller features      | Highly configurable           |
| Cost:               | Additional cost for RAID hardware   | No additional cost            |
| Ease of Use:        | Managed in hardware BIOS            | Requires Linux expertise      |

If your hardware supports RAID, using hardware RAID might be preferable for performance. However, software RAID offers flexibility and is an excellent choice for environments without a RAID controller.

  • Hardware RAID: Hardware RAID requires special disk arrays and controllers and thus is more expensive, but it's the simplest to implement from the OS standpoint because the kernel views the hardware RAID as a single SCSI device. Setup for the hardware RAID involves making sure the kernel has the proper driver for the RAID SCSI controller. This is basically the same setup as is required for any new SCSI controller that is added to the system. The hardware RAID controller improves processing performance by carrying out some of the RAID handling calculations and reducing the load on the CPU.
  • Software RAID: Software RAID can be used with any disks. Red Hat Linux supports software RAID at install time and post-installation. With increasing CPU-processing speeds, software RAID performance can exceed hardware RAID. For more information about software RAID and about hot-swapping SCSI devices, see the Resources page.


Question: One Logical Volume named lv1 is created under vg0. The initial aize of that logical volume is 100MB. Now you are required to increase the size to 500MB. You are required to make the size of that logical volume 500M without losing any data. In addition, you are required to increase the size online.
Answer and Explanation:
The LVM system organizes hard disks into Logical Volume (LV) groups. Essentially, physical hard disk partitions (or possibly RAID arrays) are set up in a bunch of equal sized chunks known as Physical Extents (PE). As there are several other concepts associated with the LVM system, let's start with some basic definitions:
  1. Physical Volume (PV) is the standard partition that you add to the LVM mix. Normally, a physical volume is a standard primary or logical partition. It can also be a RAID array.
  2. Physical Extent (PE) is a chunk of disk space. Every PV is divided into a number of equal sized PEs. Every PE in a LV group is the same size. Different LV groups can have different sized PEs.
  3. Logical Extent (LE) is also a chunk of disk space. Every LE is mapped to a specific PE.
  4. Logical Volume (LV) is composed of a group of LEs. You can mount a filesystem such as /home and /var on an LV.
  5. Volume Group (VG) is composed of a group of LVs. It is the organizational group for LVM. Most of the commands that you'll use apply to a specific VG.
  1. Verify the size of Logical Volume: lvdisplay /dev/vg0/lv1
  2. Verify the Size on mounted directory: df –h or df –h mounted directory name
  3. Use : lvextend –L+400M /dev/vg0/lv1
  4. resize2fs /dev/vg0/lv1 to bring extended size online.
  5. Again Verify using lvdisplay and df –h command.

The next lesson concludes this module.

SEMrush Software 10 SEMrush Banner 10