1 [[!meta title="Easy Software RAID with DragonFly BSD"]]
4 I am running 2.11-DEVELOPMENT DragonFly 64Bit with i5 Core on an IntelĀ® Server-Mainboard S1200BT with 8GB RAM.
5 The Main System is on two Disks mirrored RAID1 with 500GB each.
7 I want to use dfBSD as our company fileserver for important backups. Also I found an old (not much used) Dawi controler (with Sillicon's SiL Chip) with 4 SATA Ports that I want to use for our Backup Fileserver.
10 On an already running System I want to add a cheap inexpensive pool of disks keeping mission critical data.
11 Failure tolerance is more important than speed. So here I will show you how easy it is to setup a software RAID with natacontrol(8).
17 ## Don't configure the SATA Adapter in the BIOS
18 Please make sure that the adapter is not configured (after the BIOS just before dfBSD starts) with RAID - just expose the disks individually to Dragonfly. We are going to setup a Software RAID.
20 ## Identifying the disks
21 After booting up the system please check that the Adapter you are going to use is correctly found.
25 atapci1: <SiI 3114 SATA150 controller> port 0xe100-0xe10f,0xe110-0xe113,0xe120-0xe127,0xe130-0xe133,0xe140-0xe147 mem 0xfe4a1000-0xfe4a13ff irq 21 at device 0.0 on pci1
27 ### let natacontrol look out for our possible drives
28 su-4.2# natacontrol list
30 Master: no device present
31 Slave: no device present
33 Master: no device present
34 Slave: no device present
36 Master: ad8 <WDC WD10EALX-009BA0/15.01H15> Serial ATA II
37 Slave: no device present
39 Master: ad10 <WDC WD10EALX-009BA0/15.01H15> Serial ATA II
40 Slave: no device present
42 Master: ad12 <WDC WD10EALX-009BA0/15.01H15> Serial ATA II
43 Slave: no device present
45 Master: ad14 <WDC WD10EALX-759BA1/17.01H17> Serial ATA II
46 Slave: no device present
48 Master: ad16 <WDC WD5000AADS-00S9B0/01.00A01> Serial ATA II
49 Slave: no device present
51 Master: ad18 <WDC WD5000AADS-00S9B0/01.00A01> Serial ATA II
52 Slave: no device present
54 Perfect, there they are: ad8 .. ad14 :-)
57 #### Problems finding the disks?
58 But you see the controller in the dmesg message?
59 First, maybe natacontrol doesn't find them because the ata channel is not attached.
60 So attach it first! You can operate on the channels with the following commands:
62 natacontrol info channel
63 natacontrol attach channel
64 natacontrol detach channel
65 natacontrol reinit channel
67 Do it, until natacontrol can list all single disks you are going to use.
69 For further investigation you can try out other commands to find the disks:
70 also look out for the disks
74 kern.disks: ad14 ad12 ad10 ad8 da0 da1 md0
77 You could also use the devattr command:
79 devattr -m driver:disk
81 devattr -d ad\* # for example
84 ## Chosing the right RAID
85 You can look around on the internet for various Raid calculators
86 A very helpful page for general info is this one:
88 http://www.icc-usa.com/raid-calculator.asp
90 One of the better ones: http://kossky.sitesled.com/tools/rcdemo_en.htm
93 As I want to have a Backup Fileserver I am chosing a VERY HIGH fault tolerant kind of RAID10 thing. Certainly there are other maybe better ones around, like the RAID60 or even RAID50 but we have to consider what the nata(4) driver offers and that I only have 4 disks.
95 Looking at the man page of natacontrol(8) we see our software RAID options:
97 create Create a type ATA RAID. The type can be RAID0 (stripe), RAID1
98 (mirror), RAID0+1, SPAN or JBOD. In case the RAID has a RAID0
99 component, the interleave must be specified in number of sec-
100 tors. The RAID will be created of the individual disks named
103 As I only have 4 1TB disks I think RAID0+1 is the best solution as mentioned above.
108 Let's dive into real world practice and setup the RAID with a simple command:
110 # natacontrol create RAID10 128 ad14 ad12 ad10 ad8
113 Interestingly RAID10 is accepted, I think it is just a synonym for RAID0+1.
114 The 128 is the interleave I used - which should be reasonable for this kind of setup. If you have not much space natacontrol will automatically adjust the stripe to a minor number (to 64KB a.e.)
116 Let's check what happened and look into the logs.
120 WARNING!! - not able to determine metadata format
121 WARNING!! - Using FreeBSD PseudoRAID metadata
122 If that is not what you want, use the BIOS to create the array
123 disk scheduler: set policy of ar1 to noop
124 ar1: 1907739MB <FreeBSD PseudoRAID RAID0+1 (stripe 128 KB)> status: READY
125 ar1: disk0 READY (master) using ad8 at ata4-master
126 ar1: disk1 READY (master) using ad10 at ata5-master
127 ar1: disk2 READY (mirror) using ad12 at ata6-master
128 ar1: disk3 READY (mirror) using ad14 at ata7-master
130 Ja, this is looking good ;-)
132 ## Configuring the RAID
134 This setup will allow your disk to work correctly with other operating systems that might be installed on your computer and will not confuse other operating systems' fdisk utilities. It is recommended to use this method for new disk installs.
136 Now comes business as usual:
138 ### Initializing the new pseudo disk ar1 with fdisk
142 ### Editing the disklabel
145 disklabel64 -B -w -r /dev/ar1s1 auto
146 # edit the disklabel just created and add any partitions. In this case it's perfect to uncomment slice a and substitute 4.2BSD with HAMMER ;-)
150 ### Formatting with HAMMER
152 newfs_hammer -L DATA /dev/ar1s1a
155 ### Mounting, setting up fstab
158 vi /etc/fstab # Add the appropriate entry/entries to your `/etc/fstab`
162 # Rebooting and being HAPPY :-)