https://drive.google.com/file/d/1j1S21EJChu6YVWakWZuOqw9BFJQfzKLp/view?usp=sharing

1. Understanding RAID-5

Key Concepts

⚠️ Critical Limitation:

Fails completely if 2+ disks fail. Avoid RAID-5 for large disks (>2TB)—rebuild time increases risk of second failure.


2. Creating RAID-5 Array

Prepare Disks

# Create partitions on 3+ disks (e.g., /dev/sdb, /dev/sdc, /dev/sdd)
for disk in sdb sdc sdd; do
  sudo fdisk /dev/$disk <<EOF
n
p
1

t
fd
w
EOF
done

sudo partprobe    # Reload partition table
lsblk             # Verify sdb1, sdc1, sdd1

Create RAID-5

# Create RAID-5 with 3 disks
sudo mdadm --create /dev/md0 -l 5 -n 3 /dev/sdb1 /dev/sdc1 /dev/sdd1

# Verify
cat /proc/mdstat    # Shows [UUU] (all disks active)
sudo mdadm -D /dev/md0    # Detailed status (note "Active Devices: 3")

💡 Initial Sync:

RAID-5 initializes parity—check /proc/mdstat for [=>...] progress (can take hours).

Format and Mount

sudo mkfs.ext4 /dev/md0
sudo mkdir /raid5
sudo mount /dev/md0 /raid5
df -hT              # Verify mounted

# Add test data
echo "cal" | sudo tee /raid5/cal
echo "date" | sudo tee /raid5/date