Creating a software raid of disks is quite easy in Ubuntu, I will assume the disks are attached (physically or virtually) to the guest operating system.

Currently Ubuntu supports the following raid levels:

  • RAID level 0
  • RAID level 1
  • RAID level 2
  • RAID level 3
  • RAID level 4
  • RAID level 5
  • RAID level 6
  • RAID level 10
  • RAID level 50
  • RAID level 0+1

In this example I am using sdb1 and sdc1 disks and settings the raid to a mirror (1) with a total mirrored size of 4TB (3906885440K)

  • Install mdadm (if not already installed)
apt-get update && apt-get install -y mdadm
  • Run mdadm to create the mirror
mdadm --create --verbose /dev/md0 --raid-device=2 --level=1 /dev/sdb1 /dev/sdc1
  • Run mkfs.ext3 to create a ext3 filesystem on the mirror volume
mkfs.ext3 /dev/md0
  • Mount the mirror by creating a mount point and running mount to mount the md0 volume
mkdir /mnt/raid1
mount /dev/md0 /mnt/raid1
  • Check to see if you can see the mirror
df -h
  • Check the status of the build
cat /proc/mdstat
  • Add to fstab to auto mount on startup
vi /etc/fstab
/dev/md0 /mnt/raid1 ext3 defaults 0 0

Should you have any questions, comments or suggestions, please don’t hesitate to comment below. If you like what you have read, please share it on your favourite social media medium.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.