open...@e-solutions.re wrote:
Hi,
I Have a machine running OpenBSD 4.7 with 4 sata hardisks (wd0,wd1...wd3)
I want to make a RAID 5 Volume with 3 disks for sftp use.
What is the best way to build what i want and keep datas safety?
you ask this as if there is one answer to all people who could ask this
question...
I think raidframe is a non-starter now, clearly the future for OpenBSD
is softraid. However, softraid's RAID5 is not quite ready for
production (unless I missed something, in which case Marco or Jason will
jump all over me).
However, assuming all four drives are equal sized, your total capacity
as you describe (three in a RAID5 config) is two drives worth of
storage. So, you could get much of the capacity of your plan by making
two RAID1 sets, and separating your data appropriately. This is better
than One Big Space, in that it forces you to think about the future when
this existing config is insufficient and needs to be supplemented or
replaced. In this case, use softraid RAID1, HOWEVER use a snapshot, not
4.7-release to save yourself some headaches in a few months...
However, if the vast majority of your data is fairly static, let me toss
your entire plan out the window, and give you another option to consider:
Rather than using RAID of any kind, consider just using them as four
separate disks. OS is on one, /altroot copies the boot stuff to the
second, you copy over other OS partitions to the other, and the Big
Block of Data for your SFTP system is sync'd between the disks
periodically using rsync. A file that is uploaded NOW is not
"protected" until the next sync, but then, if you accidentally delete or
overwrite some files, they can easily be recovered until the next sync
pass. Trading one kind of recovery for another... In many cases,
having the "lagging mirror" is better than RAID, as people do stupid
things more often than hardware fails.
Note, you are also trading OS complexity for application complexity.
That was a point AGAINST rolling your own "lagging mirror".
I wish also the possibility to repair the Volume on crash disk(1),
replacing a disk.
I think you are meaning you want to be able to come up again even if
your non-RAIDed disk blows out. If so, the "Two RAID1 sets" (and an
altroot setup) has you covered better than a RAID5 across three disks
and a fourth drive for booting (of course, you could always RAID1 an OS
slice across two (or more!) drives and RAID5 the rest).
The size that OpenBSD needs to boot and run is small enough that you can
easily stuff a complete copy of the OS in at least two, if not all four
of your disks (Why all four? Why not? What's 2G, or even 10G out of a
modern 500G disk?)
That all gets you back up and running. To keep your data safe, as you
asked, you need a backup system, not RAID.
Nick.