Sunday, April 17, 2005

Creating a Disk Array in Fedora

Create (mdadm --create) mode is used to create a new array. In this example I use mdadm to create a RAID-0 at /dev/md0 made up of /dev/sdb1 and /dev/sdc1:

# mdadm --create --verbose /dev/md0 --level=0 --raid-devices=2 /dev/sdb1 /dev/sdc1

mdadm: chunk size defaults to 64K

mdadm: array /dev/md0 started.
The --level option specifies which type of RAID to create in the same way that raidtools uses the raid-level configuration line. Valid choices are 0,1,4 and 5 for RAID-0, RAID-1, RAID-4, RAID-5 respectively. Linear (--level=linear) is also a valid choice for linear mode. The --raid-devices option works the same as the nr-raid-disks option when using /etc/raidtab and raidtools.


Use the --stop or -S command to stop running array:

# mdadm -S /dev/md0


mdadm --create --verbose /dev/md0 --level=0 --raid-devices=2 /dev/hdc1 /dev/hdd1


[root@localhost home]# mdadm --query /dev/md0
/dev/md0: 223.58GiB raid0 2 devices, 0 spares. Use mdadm --detail for more detail.
/dev/md0: No md super block found, not an md component.
[root@localhost home]# mdadm --detail /dev/md0
/dev/md0:
Version : 00.90.01
Creation Time : Thu Aug 19 14:49:32 2004
Raid Level : raid0
Array Size : 234436352 (223.58 GiB 240.06 GB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 0
Persistence : Superblock is persistent

Update Time : Thu Aug 19 14:49:32 2004
State : clean, no-errors
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0

Chunk Size : 64K

Number Major Minor RaidDevice State
0 22 1 0 active sync /dev/hdc1
1 22 65 1 active sync /dev/hdd1
UUID : 2f4c1a82:92bc9ece:372b0de6:c4cc65d6
Events : 0.2

No comments: