Linux 101 : RAID devices - mdadm, RAID-1 -



The Raid-1 structure allows us to have two copies of the same data on two different disks.


For our example, we will use two disk partitions for our "/dev/md0" RAID device, "/dev/sdb1" and "/dev/sdb2", as we can see below:


We create our RAID-1 device "md0" using the below command:


Then,  we create an "ext4" filesystem on it, using the below command:


We create the "mountpoint" on which we are going to mount our RAID device:


Then we mount our RAID device, by running the below command:


To persist through a reboot, we would need to add an entry for our RAID device in the "/etc/fstab" file as below:


We can also add the details of our RAID device to the "/etc/mdadm.conf" file, to ensure its correct reconstruction after a reboot:


We can check our RAID device using the below command:


After we are done, we could unmount our device, stop it and remove it from the system, using the below commands:


Comments

Leave as a comment:

Archive