I’m going to install a new home server, I’ve got two identical HD and I’m thinking on using software raid.
I’m thinking on following partitioning:
/swap -> raid 0 for betteer performance
/home -> raid 1 for security. I want to keep my data safe in case of a disk failure.
/ -> raid 0 for performance if it is a significant increase in performance over raid 0. It’s not too bad if something happen and I have to reinstall the server, I can even backup partition once a month or so and restore it in case of disk failure. But if there is no great difference of performance from raid 0 to raid 1, i would use raid 1 for / too.
fperal wrote:
> I’m going to install a new home server, I’ve got two identical HD and
> I’m thinking on using software raid.
>
> I’m thinking on following partitioning:
>
> /swap -> raid 0 for betteer performance
You’ll get much better performance by buying enough RAM that you don’t
use much swap. If swap is limiting the performance significantly, that’s
called thrashing, and it’s bad!
> /home -> raid 1 for security. I want to keep my data safe in case of a
> disk failure.
Seems a good idea. Don’t forget that you still need a backup, in case
something trashes both disks. You might also want to consider using LVM
to ease later expansion or migration of the data.
> / -> raid 0 for performance if it is a significant increase in
> performance over raid 0. It’s not too bad if something happen and I have
> to reinstall the server, I can even backup partition once a month or so
> and restore it in case of disk failure. But if there is no great
> difference of performance from raid 0 to raid 1, i would use raid 1 for
> / too.
You’ll do better using an SSD if possible. But root filesystem
performance isn’t usually that critical, because heavily used stuff gets
cached in RAM by the kernel. So unless you KNOW of a specific problem
that you KNOW you can fix, I wouldn’t over-optimise.
Using RAID 0 means that any disk failure will stop your system working
until you reinstall. It’s also likely to give you some problems booting
at some time or another IMHO. In other words, I hate RAID 0!
On Thu, 12 Dec 2013 16:11:19 +0000, Dave Howorth wrote:
>> /home -> raid 1 for security. I want to keep my data safe in case of a
>> disk failure.
>
> Seems a good idea. Don’t forget that you still need a backup, in case
> something trashes both disks. You might also want to consider using LVM
> to ease later expansion or migration of the data.
Yep. Also, duplexing (ie, using a controller per disk) can also limit
failures somewhat - if a controller hosting both disks gets fried,
there’s risk to both disks almost equal to the risk of a single disk on a
single controller.
Just depends on how much you want to spend and mitigate the risk.
Of course I will uso enough ram so as I won’t need swap, the idea about raid 0 swap is justi in case.
I think with swap there is no problem with doubling error probability risk of raid 0 and in any case there is need of swap i think the scenario may be (slightly) better with the raid partition than with a single swap partition. Right?
> /home -> raid 1 for security. I want to keep my data safe in case of a
> disk failure.
Seems a good idea. Don’t forget that you still need a backup, in case
something trashes both disks. You might also want to consider using LVM
to ease later expansion or migration of the data.
I like the idea. I’ve never used LVM but I guess It is possible to make raid partitions and over them a whole filesystem as a LVM, wich includes root partition and home partition inside. right?
I’m thinking on a cheaper system. Just using motherboard sata controller. Most of my data are sincronized with a remote system by internet three times a day and all of them are backed up to a external HD once a month.
I think most of hard disk deaths are just hard disk death, not produced by the controller… maybe i’m wrong
> I’m thinking on a cheaper system. Just using motherboard sata
> controller. Most of my data are sincronized with a remote system by
> internet three times a day and all of them are backed up to a external
> HD once a month. I think most of hard disk deaths are just hard disk
> death, not produced by the controller… maybe i’m wrong
No, you’re spot on based on my experience - controller failure is not
rare, but it’s not common, either.
Something to keep in mind, though, is that software RAID is always going
to be slower than hardware RAID, and there will be a performance hit.
You may get better performance with multiple controllers (depends on the
bus bandwidth and I/O utilization, though - if you saturate the bus
leading into the disk controllers, you’ll end up not seeing performance
benefits of multiple controllers, but you have to do a LOT of I/O to
saturate a modern PC’s bus - like be a hosting provider with multiple
virtual hosts on a single system).
For a typical desktop user, you won’t see much of a performance hit
that’s noticeable.
> I think with swap there is no problem with doubling error probability
> risk of raid 0 and in any case there is need of swap i think the
> scenario may be (slightly) better with the raid partition than with a
> single swap partition. Right?
Something you might consider is multiple swap partitions on different
devices, rather than mirroring a swap partition. Since a swap partition
is “throwaway” anyways, mirroring it isn’t really going to do much for
you. Spreading it across multiple partitions and devices, though, could
help performance, depending on bus/disk channel saturation, of course -
but even then, if you’re a typical desktop user, a single swap partition
unmirrored is more than sufficient.
Jim Henderson wrote:
> Something to keep in mind, though, is that software RAID is always going
> to be slower than hardware RAID, and there will be a performance hit.
Not really, for RAID 1. For RAID 5 or 6, definitely.
> You may get better performance with multiple controllers (depends on the
> bus bandwidth and I/O utilization, though - if you saturate the bus
> leading into the disk controllers, you’ll end up not seeing performance
> benefits of multiple controllers, but you have to do a LOT of I/O to
> saturate a modern PC’s bus - like be a hosting provider with multiple
> virtual hosts on a single system).
With two consumer disks, it’s difficult to see how you would saturate
the host bus.
Jim Henderson wrote:
> On Thu, 12 Dec 2013 17:36:01 +0000, fperal wrote:
>
>> I think with swap there is no problem with doubling error probability
>> risk of raid 0 and in any case there is need of swap i think the
>> scenario may be (slightly) better with the raid partition than with a
>> single swap partition. Right?
>
> Something you might consider is multiple swap partitions on different
> devices, rather than mirroring a swap partition.
I agree that multiple swap partitions (actually I use files) is a better
idea. The OP is not talking about mirroring swap, but striping it.
On Fri, 13 Dec 2013 11:04:15 +0000, Dave Howorth wrote:
> Jim Henderson wrote:
>> Something to keep in mind, though, is that software RAID is always
>> going to be slower than hardware RAID, and there will be a performance
>> hit.
>
> Not really, for RAID 1. For RAID 5 or 6, definitely.
Logically, if it’s implemented in software rather than hardware, the
software is writing the data twice rather than once.
It may be a negligible hit, but it’s still going to be lower performance
than doing a single write. But probably not noticible until you start
saturating the bus.
>> You may get better performance with multiple controllers (depends on
>> the bus bandwidth and I/O utilization, though - if you saturate the bus
>> leading into the disk controllers, you’ll end up not seeing performance
>> benefits of multiple controllers, but you have to do a LOT of I/O to
>> saturate a modern PC’s bus - like be a hosting provider with multiple
>> virtual hosts on a single system).
>
> With two consumer disks, it’s difficult to see how you would saturate
> the host bus.
That’s certainly true. Unless you’re doing something like writing a ton
of data over USB 2.0 (which this isn’t the case).
On Fri, 13 Dec 2013 11:05:40 +0000, Dave Howorth wrote:
> Jim Henderson wrote:
>> On Thu, 12 Dec 2013 17:36:01 +0000, fperal wrote:
>>
>>> I think with swap there is no problem with doubling error probability
>>> risk of raid 0 and in any case there is need of swap i think the
>>> scenario may be (slightly) better with the raid partition than with a
>>> single swap partition. Right?
>>
>> Something you might consider is multiple swap partitions on different
>> devices, rather than mirroring a swap partition.
>
> I agree that multiple swap partitions (actually I use files) is a better
> idea. The OP is not talking about mirroring swap, but striping it.
Oh, yes, for some reason RAID 0 wasn’t registering as that in my head.
As I recall, though RAID 0 doubles your risk, though, of losing data -
because now you’ve got the MTBF of two drives instead of the MTBF of a
single drive. If striping is what you’re going to do, then you want a
parity drive for anything critical (though clearly swap isn’t going to be
critical data)
RAID 0 is noticeably faster (I’ve used hardware RAID Controllers however) but I have also lost data. With RAID O there is no mirroring so you have to backup or synchronize because if the two disks get out of synch (they don’t have to fail), you’ve lost all of your data.
I no longer use it. Fast drives and CPUs are preferable.
I’ve been reading a lot about software and hardware raid. It’s said that software raid is not slower than hardware raid (even quicker) unless yo spend a lot of money on a good hardware raid controller.
On 2013-12-13 12:04, Dave Howorth wrote:
> Jim Henderson wrote:
>> Something to keep in mind, though, is that software RAID is always going
>> to be slower than hardware RAID, and there will be a performance hit.
>
> Not really, for RAID 1. For RAID 5 or 6, definitely.
It also depends on how busy is the CPU at the testing time.
–
Cheers / Saludos,
Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)
On 2013-12-12 19:02, Jim Henderson wrote:
> On Thu, 12 Dec 2013 17:36:01 +0000, fperal wrote:
>
>> I think with swap there is no problem with doubling error probability
>> risk of raid 0 and in any case there is need of swap i think the
>> scenario may be (slightly) better with the raid partition than with a
>> single swap partition. Right?
>
> Something you might consider is multiple swap partitions on different
> devices, rather than mirroring a swap partition. Since a swap partition
> is “throwaway” anyways, mirroring it isn’t really going to do much for
> you. Spreading it across multiple partitions and devices, though, could
> help performance, depending on bus/disk channel saturation, of course -
> but even then, if you’re a typical desktop user, a single swap partition
> unmirrored is more than sufficient.
Indeed. I was going to suggest that.
–
Cheers / Saludos,
Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)
> /home -> raid 1 for security. I want to keep my data safe in case of a
> disk failure.
If you want to keep your data safe, you definitely need backups.
Consider that you are only protecting against one issue with a RAID:
disk failure (ok, controller, disk, cable). But a software failure or a
power failure that causes filesystem corruption, breaks all the copies
on the RAID. Consider also human error, you might mistakenly erase a
file or a directory - both copies are erased.
Which means you need extra disks for the backup. If you are not going to
buy them, then you should not use RAID at all, and turn that extra disk
you have into the backup drive.
>
> / -> raid 0 for performance
Mixing both types on the same drive, means the system goes down
instantly, despite using raid1 on /home. The point on using raid 1 on a
filesystem is being able to keep using it without even rebooting even if
one disk fails completely - not your case, as that same disk has “/” and
swap on raid 0, which will fails instantly.
Raid 1 is not about “keeping data safe”, it is about keeping using it
without halting when one disk fails. For 24/7 systems.
–
Cheers / Saludos,
Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)
> hendersj;2607633 Wrote:
>> On Thu, 12 Dec 2013 17:36:01 +0000, fperal wrote:
>> Something to keep in mind, though, is that software RAID is always
>> going to be slower than hardware RAID, and there will be a performance
>> hit.
>
>
> I’ve been reading a lot about software and hardware raid. It’s said that
> software raid is not slower than hardware raid (even quicker) unless yo
> spend a lot of money on a good hardware raid controller.
Logically, I just don’t see that following. But at the level of I/O
we’re talking about, it’s going to be barely noticeable anyways.
On Fri, 13 Dec 2013 20:36:02 +0000, d hinds wrote:
> RAID 0 is noticeably faster (I’ve used hardware RAID Controllers
> however) but I have also lost data. With RAID O there is no mirroring
> so you have to backup or synchronize because if the two disks get out of
> synch (they don’t have to fail), you’ve lost all of your data.
>
> I no longer use it. Fast drives and CPUs are preferable.
Yeah, much higher risk (double) at the very least with RAID0.
Performance-wise, perhaps (I’m willing to be convinced), but at the very
least, with consumer-grade equipment it’s probably not that noticeable.
Of course you need backups, but raid 1 prevent data loss. With backups, even if they are made daily you loose data in case of a hardware failure, but with a raid you don’t (or you do if both disk crash, if the computer burns…).
I’ve had a hard disk failure on a raid 10 and i noticed it because of an alert but the system was working 100%, I shut the computer down (I have not yet tried to do such thing without shutting down, using hot plug although I assume it will work) replaced the disk turn on with the system working again 100% and rebuilt the array… awesome!
On 2013-12-13 22:34, Jim Henderson wrote:
> On Fri, 13 Dec 2013 20:36:02 +0000, fperal wrote:
>
>> hendersj;2607633 Wrote:
>>> On Thu, 12 Dec 2013 17:36:01 +0000, fperal wrote:
>>> Something to keep in mind, though, is that software RAID is always
>>> going to be slower than hardware RAID, and there will be a performance
>>> hit.
>>
>> I’ve been reading a lot about software and hardware raid. It’s said that
>> software raid is not slower than hardware raid (even quicker) unless yo
>> spend a lot of money on a good hardware raid controller.
>
> Logically, I just don’t see that following. But at the level of I/O
> we’re talking about, it’s going to be barely noticeable anyways.
It is comparable to fake hardware raid. Real hardware raid is more
expensive.
A quick speed test with “hdparm -tT”, software raid 5, and the same 3
hard disks (not the same partitions):
/dev/md0:
Timing cached reads: 11696 MB in 2.00 seconds = 5854.60 MB/sec
Timing buffered disk reads: 600 MB in 3.00 seconds = 199.76 MB/sec
/dev/sda12:
Timing cached reads: 12986 MB in 2.00 seconds = 6501.09 MB/sec
Timing buffered disk reads: 346 MB in 3.01 seconds = 115.14 MB/sec
/dev/sdb11:
Timing cached reads: 13040 MB in 2.00 seconds = 6527.98 MB/sec
Timing buffered disk reads: 352 MB in 3.01 seconds = 117.03 MB/sec
/dev/sdc14:
Timing cached reads: 11874 MB in 2.00 seconds = 5944.17 MB/sec
Timing buffered disk reads: 334 MB in 3.01 seconds = 110.89 MB/sec
See? That md0, which is raid 5, is actually faster. Of course, it is a
read test. I tried a write test with dd, but it doesn’t look right:
> Telcontar:~ # dd if=/dev/zero of=/data/raid/deleteme bs=1M count=1000 conv=sync
> 1000+0 records in
> 1000+0 records out
> 1048576000 bytes (1.0 GB) copied, 0.873377 s, 1.2 GB/s
Equivalent operation on non-raid partition (the three component disks)
go from 250MB/s to 453MB/s. But a second test raises to 1 GB/s, which is
not possible. Seems the “sync” option doesn’t do what I expected.
–
Cheers / Saludos,
Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)