(no commit message)
[ikiwiki.git] / docs / docs / howtos / howtosoftwareraid / index.mdwn
1 *** THIS GUIDE IS INCOMPLETE ***
2
3 [[!toc  levels=2]]
4 # Scenario
5 I am running 2.11-DEVELOPMENT DragonFly 64Bit with i5 Core on an IntelĀ® Server-Mainboard S1200BT with 8GB RAM.
6 The Main System is on two Disks mirrored RAID1 with 500GB.
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 which I want to use for our Backup Fileserver.
8
9 # Pre-steps
10
11 ## Don't configure the SATA Adapter in the BIOS
12 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.
13
14 ## Identifying the disks
15 After booting up the system please check that the Adapter you are going to use is correctly found:
16 dmesg reveales:
17
18         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
19
20 also look out for the disks
21
22         sysctl kern.disks
23
24         kern.disks: ad14 ad12 ad10 ad8 da1 da0 md0
25
26
27 Perfect, there they are: ad8 .. ad14
28
29 ## Chosing the right RAID
30 You can look around in the intert for various Raid calculators 
31 A very helpful page is this one:
32 http://www.icc-usa.com/raid-calculator.asp
33 One of the best this: http://kossky.sitesled.com/tools/rcdemo_en.htm
34
35 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.
36
37 Looking at the man page of natacontrol(8) we see our software RAID options:
38
39         create   Create a type ATA RAID.  The type can be RAID0 (stripe), RAID1
40               (mirror), RAID0+1, SPAN or JBOD.  In case the RAID has a RAID0
41               component, the interleave must be specified in number of sec-
42               tors.  The RAID will be created of the individual disks named
43               disk0 ... diskN.
44
45 Dont worry, natacontrol is offering more than Spanning RAIDs and mirroring.
46
47 Looking into the source code on DragonFly's OpenGrok we find more options than the man pages lists:
48
49         lynx http://pkgbox64.dragonflybsd.org/source/xref/DragonFly-master/sys/sys/nata.h
50
51         struct ata_ioc_raid_config {
52                     int                 lun;
53                     int                 type;
54         #define AR_JBOD                         0x0001
55         #define AR_SPAN                         0x0002
56         #define AR_RAID0                        0x0004
57         #define AR_RAID1                        0x0008
58         #define AR_RAID01                       0x0010
59         #define AR_RAID3                        0x0020
60         #define AR_RAID4                        0x0040
61         #define AR_RAID5                        0x0080
62         
63 RAID5 is the most versatile RAID, and suitable for normal servers - Home and Office use - but in my opinion too inefficient for a backup space with financial and accounting data.
64
65 As I only have 4 1TB disks I think RAID0+1 is the best solution as mentioned above.
66
67 # Creating the Array
68 Let's dive into real practice:
69         natacontrol create RAID10 128 ad8 ad10 ad12 ad14
70