3

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.

1
  • 1
    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, 2012 at 14:18

2 Answers 2

3

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.

5
  • 1
    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, 2012 at 14:17
  • @Stan: No, the idea is not the same. They are different things for different purposes.
    – Khaled
    Aug 29, 2012 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, 2012 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, 2012 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, 2012 at 14:33
2

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.

13
  • Performance impact of rsync can probably be prevented/reduced using ionice.
    – brain99
    Aug 29, 2012 at 14:05
  • 1
    "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, 2012 at 14:12
  • @MDMarra that part was regarding rsync not RAID
    – Stan
    Aug 29, 2012 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, 2012 at 14:15
  • Ah, that's why the backup was in quotes. I'll just rewrite that statement
    – Stan
    Aug 29, 2012 at 14:19

Not the answer you're looking for? Browse other questions tagged .