1

I have a Raspberry PI at home, running Raspian and some servers like Apache, MySQL and ssh. The Raspberry is directly connected (LAN) to the home router and to a 2TB external ext4-formatted hard drive. As there is important stuff on it (backups, pictures, documents, etc.) I rsync the whole external drive every 2 weeks to another external drive. Everything worked fine up to now but lately the main drive seems to have some troubles... (gets mounted ro, fsck fixes several errors)

Because of this (and also because storage will soon run out) I'm currently looking for safer - if possible automatic - methods to have the data saved securely.

First I thought of a RAID that would save files and backups over multiple drives. Although I'm not sure how I would implement this...

Later I found glusterfs which seemed to have some advantages:

  • Gluster can split up large files (AFAIK improves access speed)
  • Gluster can save files on multiple volumes, and is able to manage a drive failure automatically

However I'm again not sure if my Raspberry Pi could act as a gluster master as well as a gluster slave; still running the other services as well.

I'd like to be able to "hot-swap" a broken drive and let the system recover itself, without having to care about data integrity. Safety and availability are more important than the access speed. Storage capacity should be beetween 2TB-4TB.

How many drives and what software configuration would I need to set up to have this comfort?

Thank you for any suggestions!

1 Answer 1

2

First off - RAID IS NOT BACKUP. RAID protects against hard drive failure, thats about it. Its worthwhile to do, but does not provide protection against data corruption, theft, accidental deletes, Cryptolocker type attacks. You do want to use RAID if you intend to do hotswap.

I'd be inclined to look at a 2 part solution - Use RAID to increase reliability of your disks and provide availability and hotswap. (Note you probably need to use RAID1, so a couple of 2TB or 4TB disks - DO NOT USE RAID 5).

In order to use RAID you would implement "Software RAID" - typically provided by "mdadmin".

I'd then look at a way of doing offsite/offline mirroring/archiving - there are a number of ways of doing this - RSnapshot is a good idea which allows incremental backups, or maybe setting up Owncloud in case your gear is nicked or you do something stupid.

10
  • Thank you, I'll have some thougts about it and share it again with you :) Due to a lack of reputation on SF I can't upvote your solution...
    – 0xpentix
    Mar 17, 2016 at 6:03
  • So am I right in the conclusion, glusterfs would not be an alternative to RAID? Doesn't it also provide the hot-swap possibility?
    – 0xpentix
    Mar 17, 2016 at 6:03
  • I have not used GlusterFS, but yes, it would be an alternative to RAID. I very much doubt it would offer hot-swap possibility, but it would allow you to continue to operate even a drive fails, and allows you to recreate the data from a backup, giving you similar functionality. I confess to being surprised that a PI is powerful enough to run GlusterFS - although it appears this is the case. You would, I believe, need more then 1 Pi to make Gluster work however.
    – davidgo
    Mar 17, 2016 at 9:12
  • Thanks again for your answer! I'm currently thinking about setting up a RAID-1 using 2x3TB, using OwnCloud as "version control" software to have the possibility to jump back to an old state of a file. As soon as I connected the two drives (A, B) and created a RAID and mounted it, is there a possibility to unmount drive (B), connect the old 2TB drive (C) to copy all the data from (C) to (A) and then unmount (C) and remount (B) to let mdadmin mirror all the files from (A) to (B)? The reason I'm asking this is because my Pi has only got 2 USB hubs...
    – 0xpentix
    Mar 18, 2016 at 0:14
  • 1
    You can do this as a one off - although you would be much better served by setting the RAID up initially as a degraded array, copy the data to it and then building the array - this will save days of building and rebuilding it . (You don't want to do this on a regular basis). zmonkey.org/blog/content/create-degraded-raid1-array shows 1 way to do this, but I typically use 2 devices and set 1 drive as missing as per accepted answer at unix.stackexchange.com/questions/63928/… and add it afterwards....cont
    – davidgo
    Mar 18, 2016 at 2:06

You must log in to answer this question.

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