| |||||||||
| ||||||||||||||
Author: Engys | Topic: Create a software raid on Archlinux | Last change: 2015-02-03 16:42:58 | ||||||||||||
First we create our partitions as we normally do. In this example we want to create a raid1 from the following partitions
fdisk -l
Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 2048 3774875647 3774873600 1,8T 83 Linux /dev/sdb2 3774875648 3907029167 132153520 63G 82 Linux swap / Solaris and
Device Boot Start End Sectors Size Id Type
/dev/sdc1 * 2048 3774875647 3774873600 1,8T 83 Linux /dev/sdc2 3774875648 3907029167 132153520 63G 82 Linux swap / Solaris To create a mirror we will activate the raid1 module:
modprobe raid1
In this case we create our software raid with the following command:
mdadm --create --verbose /dev/md1 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1
and
mdadm --create --verbose /dev/md2 --level=1 --raid-devices=2 /dev/sdb2 /dev/sdc2
After that we format our software raid as following:
mkfs.ext4 /dev/md1
and
mkswap /dev/md2
To check how far the synchronisation has gone we can use the following command:
cat /proc/mdstat
For our example the output will look like this:
Personalities : [raid1]
md1 : active raid1 sdc1[1] sdb1[0] 1887305728 blocks super 1.2 [2/2] [UU] [====>................] resync = 23.6% (446640320/1887305728) finish=190.4min speed=126045K/sec bitmap: 12/15 pages [48KB], 65536KB chunk md2 : active raid1 sdc2[1] sdb2[0] 66043968 blocks super 1.2 [2/2] [UU] resync=DELAYED To check the Status:
mdadm --detail /dev/md1
Just a detail output from another raid I am working on:
Version : 1.2
Creation Time : Tue Feb 3 12:23:06 2015 Raid Level : raid1 Array Size : 960010048 (915.54 GiB 983.05 GB) Used Dev Size : 960010048 (915.54 GiB 983.05 GB) Raid Devices : 2 Total Devices : 2 Persistence : Superblock is persistent Update Time : Tue Feb 3 14:30:16 2015 State : active, resyncing Active Devices : 2 Working Devices : 2 Failed Devices : 0 Spare Devices : 0 Resync Status : 24% complete Name : server:0 (local to host server) UUID : c9cc7e01:085504ad:3675a133:939cc372 Events : 24 Number Major Minor RaidDevice State 0 8 1 0 active sync /dev/sda1 1 8 17 1 active sync /dev/sdb1 | ||||||||||||||
![]() | ![]() |
|