Mar 2, 2013

How to create/remove a software RAID on Ubuntu

Creat a software RAID

First, get mdadm
apt-get install mdadm
Then, assume that we are using sdd and sdf to create a RAID0 called md0
mdadm --create --verbose /dev/md0 --level=stripe --raid-devices=2 /dev/sdd /dev/sdf

Here is a good article for more detail options.

Then, you can partition, format, and mount /dev/md0 as you do to other disks.

Remove a software RAID

Step 1. Unmount the RAID.
umount /dev/md0
Step 2. Find out what are the member disks by
mdadm --detail /dev/md0

Step 3. Stop the array
mdadm -S /dev/md0

Step 4. Zero out member disks superblock
mdadm --zero-superblock /dev/sdd
This step is important. If you don't do this, you will make system confuse about the disk settings especially when you want to use the drive to build another RAID.

Note: zero out will destroy all your data on the drive.

That's it.

Ending picture today.
Seattle night view from Space Needle

No comments:

Post a Comment