Skip to content

Instantly share code, notes, and snippets.

@panperla
Last active November 3, 2016 14:45
Show Gist options
  • Save panperla/2b40c3664a540187b3a46fe5a0ea3209 to your computer and use it in GitHub Desktop.
Save panperla/2b40c3664a540187b3a46fe5a0ea3209 to your computer and use it in GitHub Desktop.

Setting up raid 1 using mdadm

In order to set up software raid we need to install mdadm tools (Ubuntu/Debian)

apt-get install mdadm

Now for setting up raid one using two drives for example /dev/sdd and /dev/sdc we are issuing the following command

mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/sdc /dev/sdd
mkfs.ext4 /dev/md2
mdadm --detail --scan

From the last command you will see UUID of the /dev/md2 which you have to add to /etc/mdadm/mdadm.conf for example:

echo "ARRAY /dev/md2 metadata=1.2 UUID=11fb58d4:6a2b5d32:480c88df:6ebafb16">>/etc/mdadm/mdadm.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment