Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am building myself a Linux NAS/home server. I am considering either using sw RAID-1 (mdadm) to replicate data or alternatively just rsync them periodically. What are advantages/disadvantages of both approaches. I am adding my assumption as an answer, but I'd like to make this list of pros/cons more comprehensive.

Edit: I know they are different technologies for different purposes. And I know that people have to decide which is more important: reliable backups or availability or some other property of the solution. But there will be people who will be looking at both rsync and RAID and deciding between them. I wanted a list to point them to. I guess I misunderstand when downvoting questions is supposed to be used.

share|improve this question

closed as off topic by MDMarra, Sven, Chris S Aug 29 '12 at 14:32

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

off topic but fyi I backup home server with rsync+ssh on raid1 remote disks (yes I waste a lot of space). – user130370 Aug 29 '12 at 14:18

You are comparing two different things.

Rsync is a file-copying tool. It can be used for backup purposes.

Raid arrays are used to get higher availability and prevent system down time because of HD failures. This is different from backup using any other tool.

Backup is keeping your data in a different place (preferably on different machine/location) to get them back when needed. Raid is for high availability and should keep your HD in sync to avoid data loss.

To make it clearer, you will not be able to get your file back (unless you use some specialized tools to recover deleted files) if you mistakenly deleted it and you don't have a recent backup even if you have an active raid array.

share|improve this answer
I know that but if you re-read my question I am looking for a list of pros and cons of both solutions. I know they are two different horses and my own answer already contained this (well...I wrote "corruption on filesystem level" but generic idea is the same in both cases. – Stan Aug 29 '12 at 14:17
@Stan: No, the idea is not the same. They are different things for different purposes. – Khaled Aug 29 '12 at 14:18
@Stan You need to decide which is more important. The availability of data that a RAID 1 provides or the capability to restore accidentally deleted data that rsync provides. No one can answer this for you. You can't do an apples-to-apples "pros and cons" list, since you're not comparing apples to apples. – MDMarra Aug 29 '12 at 14:20
@Stan: I am using both: raid-1 and a backup tool that eventually using rsync. Raid-1 guarantees that single HD failure will not bring my server down and backup protects me against invalid file deletion and alteration. – Khaled Aug 29 '12 at 14:25
@Khaled I agree that is the best (even if most expensive) solution. Your answer is actually correct and I like it even if I'd probably like it better if it was written more in "if you need X don't use RAID but just rsync because: [list]" – Stan Aug 29 '12 at 14:33

RAID-1 pros:

  • possibly faster reads when multiple accesses happen simultaneously
  • availability in case of failure of one drive (i.e no downtime)

RAID-1 cons:

  • corruption on filesystem level or accidental rm -rf can theoretically ruin whole raid instantly
  • more complex, will need LVM, mdadm etc.

rsync pros:

  • simple solution, once a day do a rsync of data in background
  • more flexibility. when running out of space just stop rsyncing part of data

rsync cons:

  • degraded performance of NAS during backup
  • need to monitor consistency of data at least from time to time

Possibly there could be a way to use inotify to circumvent degraded NAS performance during backup since it would be done instantly and from cache instead of reading from 1st HDD.

share|improve this answer
Performance impact of rsync can probably be prevented/reduced using ionice. – brain99 Aug 29 '12 at 14:05
"instant "backup" of data on both drives" - no no no no no. RAID is not a backup in any sense. You can restore a deleted file from a backup, you can't from RAID. – MDMarra Aug 29 '12 at 14:12
@MDMarra that part was regarding rsync not RAID – Stan Aug 29 '12 at 14:13
No it isn't. Read your own answer. "RAID-1 pros: * possibly faster reads when multiple accesses happen simultaneously * instant "backup" of data on both drives" – MDMarra Aug 29 '12 at 14:15
Ah, that's why the backup was in quotes. I'll just rewrite that statement – Stan Aug 29 '12 at 14:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.