think tank forum

technology » software raid on freebsd

lucas's avatar
15 years ago
r1, link
lucas
i ❤ demo
hi!

i'm running freebsd 7.1 with the sil 3114 controller.

using the controller bios utility, i setup a raid 0 configuration using two identical drives.

i booted freebsd, and i set up the disklabels of the two disks (ad4, ad6) like this:

# /dev/ad4:
8 partitions:
#        size   offset    fstype   [fsize bsize bps/cpg]
  c: 488397168        0    unused        0     0         # "raw" part, don't edit
  e: 488397168        0    4.2BSD        0     0     0


# /dev/ad6:
8 partitions:
#        size   offset    fstype   [fsize bsize bps/cpg]
  c: 488397168        0    unused        0     0         # "raw" part, don't edit
  e: 488397168        0    4.2BSD        0     0     0


i then ran this:

euterpe# ccdconfig ccd0 32 0x02 /dev/ad4e /dev/ad6e


i set up the ccd0 disklabel like this:

# /dev/ccd0:
8 partitions:
#        size   offset    fstype   [fsize bsize bps/cpg]
  c: 976794304        0    unused        0     0         # "raw" part, don't edit


then i simply ran this:

euterpe# newfs /dev/ccd0c


-------
questions!

(1) the freebsd handbook suggests using /dev/ccd0c for a filesystem. is this ok to do, or should i make a label for "a" and use that instead?

(2) i set up my raid 0 array using my controller. but then when i booted freebsd, there were two separate disks, not one single striped volume. isn't the controller supposed to do this itself? if not, why should i even bother setting up the raid array with the controller? can't it all be done using the ccd utility with freebsd?
bluet's avatar
15 years ago
link
bluet
The controller probably just saves settings for a Windows driver.
lucas's avatar
15 years ago
link
lucas
i ❤ demo
they seem to be striping just fine:

euterpe% iostat -c 9999 ad0 ad4 ad6
      tty             ad0              ad4              ad6             cpu
 tin tout  KB/t tps  MB/s   KB/t tps  MB/s   KB/t tps  MB/s  us ni sy in id
   0   12  7.75   2  0.01  15.99  83  1.30  15.99  83  1.30   0  0 19  9 72
   0  231  0.00   0  0.00  16.00 324  5.06  16.00 324  5.06   2  0 68 30  0
   0   77  0.00   0  0.00  16.00 280  4.37  16.00 280  4.37   2  0 69 30  0
   0   77  0.00   0  0.00  16.00 303  4.73  16.00 303  4.73   1  0 69 30  0
   0   77  0.00   0  0.00  16.00 306  4.78  16.00 306  4.78   2  0 63 33  2
   0   77  0.00   0  0.00  16.00 391  6.11  16.00 391  6.11   3  0 66 31  0
   0   77  0.00   0  0.00  15.97 426  6.64  16.00 425  6.64   1  0 77 23  0
   0   77  7.60   5  0.04  16.00 413  6.45  16.00 413  6.45   4  0 59 38  0
   0   77 16.00   3  0.05  16.00 402  6.29  16.00 402  6.29   2  0 72 26  0
   0   77  0.00   0  0.00  16.00 418  6.53  16.00 417  6.51   2  0 69 30  0
   0   77  0.00   0  0.00  16.00 348  5.43  16.00 348  5.43   2  0 63 35  0
   0   77  0.00   0  0.00  16.00 380  5.93  16.00 380  5.93   2  0 70 29  0
   0   77  0.00   0  0.00  15.94 434  6.75  15.99 433  6.75   2  0 65 33  0
lucas's avatar
15 years ago
link
lucas
i ❤ demo
so for hardware raid, one uses atacontrol. but for software raid, one must use ccd or geom or vinum, but not atacontrol.

is this correct?
lucas's avatar
15 years ago
link
lucas
i ❤ demo
i guess atacontrol can create and manage software raid arrays, as well as manage hardware raid arrays?

http://marc.info/?l=freebsd-current&m=109 … 75&w=2
DaGr8Gatzby's avatar
15 years ago
link
DaGr8Gatzby
Drunk by Myself
Is there a reason you are doing software RAID?
lucas's avatar
15 years ago
link
lucas
i ❤ demo
because i don't want to spend the money necessary to buy a hardware raid controller.

--

more info here.
lucas's avatar
15 years ago
r4, link
lucas
i ❤ demo
i can't find any hardware raid5 cards that support pci and sata. :(
lucas's avatar
15 years ago
link
lucas
i ❤ demo
twenty-four port sata ii raid 6 controller

i could get real real serious with my storage solution.
lucas's avatar
15 years ago
link
lucas
i ❤ demo
i want to use zfs, but my seedbox has very little ram. :(

http://wiki.freebsd.org/ZFSTuningGuide
lucas's avatar
15 years ago
link
lucas
i ❤ demo
i guess hardware raid controller cost at least $300, and i can't find any that run on 32-bit pci.

so it's either software raid or a whole new box.
lucas's avatar
15 years ago
r2, link
lucas
i ❤ demo
cheap silicon image two-channel internal sata pci controllers:
koutech sil3112 $15
syba sil3112? $17
rosewill sil3112? $20

cheap silicon image four-channel internal sata pci controllers:
syba sil3114 $30
syba sil3124 (sata2) $39
syba sil3124 (sata2) $40
rosewill sil3114 $40
lucas's avatar
15 years ago
r1, link
lucas
i ❤ demo
so raid5 is not good enough (according to dc, and i agree with him). so i will only consider raid1 and raid6.

i guess i'll also consider raid16. :o :D

here's my current setup (with which i am very happy):

euterpe% df -h /usr/home
Filesystem          Size    Used   Avail Capacity  Mounted on
/dev/concat/gc0a    1.0T    514G    432G    54%    /usr/home
euterpe% gmirror status
      Name    Status  Components
mirror/gm2  COMPLETE  ad4
                      ad6
mirror/gm0  COMPLETE  ad12
                      ad14
mirror/gm1  COMPLETE  ad16
                      ad18
euterpe% gstripe status
      Name  Status  Components
stripe/st0      UP  mirror/gm0
                    mirror/gm1
euterpe% gconcat status
      Name  Status  Components
concat/gc0      UP  mirror/gm2
                    stripe/st0
euterpe%


(commands are bolded for readability)
lucas's avatar
15 years ago
link
lucas
i ❤ demo
what does ``Hardcode providers' names in metadata.'' mean? see man 8 gmirror, option -h.
asemisldkfj's avatar
13 years ago
link
asemisldkfj
the law is no protection
gmirror is pretty great.
lucas's avatar
13 years ago
r2, link
lucas
i ❤ demo
<3



$ df -h
Filesystem            Size    Used   Avail Capacity  Mounted on
/dev/mirror/gm9s1a    496M    329M    127M    72%    /
devfs                 1.0K    1.0K      0B   100%    /dev
/dev/mirror/gm9s1d    496M     24K    456M     0%    /tmp
/dev/mirror/gm9s1e    1.9G    371M    1.4G    20%    /var
/dev/mirror/gm9s1f    221G    2.4G    201G     1%    /usr
/dev/mirror/gm0       2.6T    992G    1.5T    40%    /usr/home
$ gmirror status
      Name    Status  Components
mirror/gm9  COMPLETE  ada0
                      ada1
mirror/gm0  COMPLETE  ada2
                      ada3
$ cat /var/run/dmesg.boot | egrep "ada[0-9]\:"
ada0: <ST3250410AS 4.AAA> ATA-7 SATA 2.x device
ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
ada0: Command Queueing enabled
ada0: 238475MB (488397168 512 byte sectors: 16H 63S/T 16383C)
ada1: <ST3250312AS JC45> ATA-8 SATA 3.x device
ada1: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
ada1: Command Queueing enabled
ada1: 238475MB (488397168 512 byte sectors: 16H 63S/T 16383C)
ada2: <Hitachi HUA723030ALA640 MKAOA580> ATA-8 SATA 3.x device
ada2: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
ada2: Command Queueing enabled
ada2: 2861588MB (5860533168 512 byte sectors: 16H 63S/T 16383C)
ada3: <Hitachi HUA723030ALA640 MKAOA580> ATA-8 SATA 3.x device
ada3: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
ada3: Command Queueing enabled
ada3: 2861588MB (5860533168 512 byte sectors: 16H 63S/T 16383C)
$
asemisldkfj's avatar
13 years ago
link
asemisldkfj
the law is no protection
Filesystem            Size    Used   Avail Capacity  Mounted on
/dev/mirror/gm0s1d    451G    2.0K    415G     0%    /backup


Geom name: gm0
State: DEGRADED
Components: 2
Balance: round-robin
Slice: 4096
Flags: NONE
GenID: 0
SyncID: 1
ID: 1281368106
Providers:
1. Name: mirror/gm0
   Mediasize: 500107861504 (466G)
   Sectorsize: 512
   Mode: r2w1e3
Consumers:
1. Name: ad4
   Mediasize: 500107862016 (466G)
   Sectorsize: 512
   Mode: r1w1e1
   State: ACTIVE
   Priority: 0
   Flags: NONE
   GenID: 0
   SyncID: 1
   ID: 3676727894
2. Name: ad5
   Mediasize: 500107862016 (466G)
   Sectorsize: 512
   Mode: r1w1e1
   State: SYNCHRONIZING
   Priority: 0
   Flags: DIRTY, SYNCHRONIZING
   GenID: 0
   SyncID: 1
   Synchronized: 15%
   ID: 2313025836
asemisldkfj's avatar
13 years ago
link
asemisldkfj
the law is no protection

lucas
what does ``Hardcode providers' names in metadata.'' mean? see man 8 gmirror, option -h.



-h hardcode the provider name (mirror0) in metadata
on the component (consumer) device (da1s1e);
without this, the mirror configuration is
effectively stored in memory and thus won't be
remembered if the mirror is torn down



from http://troysunix.blogspot.com/2010/10/creatin … -geom.html