RAID 1 on 2 external HDDs

7

2

I have an Ubuntu 12.04 server on my old laptop. Its HDD (160 GB) is too small for the file storage I need, so I'd like to attach a couple of external HDDs to it (through USB ports). The data I'll keep there is rather valuable to me, so I'd like to organize a software RAID (RAID 1) on 2 external HDDs. The only solution for this problem I found on the net is described here (and it's said that using external drives is not recommended).

How should I do it then, and what is the difference compared to installing it on internal drives? Do I need external drives that are exactly the same (model), like for a hardware RAID? Or is it a really bad idea? If so, do I need not a RAID, but a backup solution or a NAS, attached to my server?

evgeny9

Posted 2012-05-20T22:52:40.357

Reputation: 205

3http://macguild.org/raid.html in theory you could do it with floppy drives as well – Journeyman Geek – 2012-05-21T09:14:01.197

Answers

7

One thing that is often overlooked on a home setup is that you usually would be better off without raid / mirroring. Unless you have a need to protect data that is less than 24 hours old, you would usually be better off using the second drive as storage for your backups of the primary drive. That way, assuming data doesn't change much (where you could get use out of incrementals), you could be protected against both physical failure and filesystem or other soft failures.

Derek Pressnall

Posted 2012-05-20T22:52:40.357

Reputation: 345

1Downvoting because I don't agree that just removing RAID from the setup helps in any way. Whether you have backups and whether you have RAID are two orthogonal questions. – Pavel Šimerda – 2014-09-15T08:46:04.693

1@Pavel Šimerda, while I agree that RAID and backups are two different things, and that the ideal setup is to have your primary data on a RAID and your backup on another RAID (along with a copy on tape, the cloud, and copies in a secure storage facility), home setup budgets put a limitation on this. So if your choice is an extra drive as a mirror OR as a backup, many are better served with the backup option. – Derek Pressnall – 2014-10-10T00:45:57.820

1I don't disagree but the wording in the answer suggest that one would be better off without raid and that's simply not true (disregarding the hidden assumption that you will perform backups on the saved drive). – Pavel Šimerda – 2014-10-12T16:57:56.793

I know this is old, but I've downvoted because a home setup is where you also want long-term protection, such as family pictures, important documents etc that you may not be able to store all on your primary drive. This is where the mirrored drives offer more protection in the long run since you have 2 backed up copies. – Dorian – 2016-06-21T22:44:34.690

@Dorian, I think you missed the point -- if you have only two drives available, and you mirror them, then you are not protected in the case of an accidental file deletion. But if you run a daily backup job to copy from drive 1 to drive 2, you will at most lose only one day's worth of data. Of course, you will still be better of yet with many drives in a RAID 6, plus many more drives in another RAID 6 on another server that holds daily/weekly/monthly backups, and a mirror to cloud storage. But this was only referring to the case where a user has budget for only two drives. – Derek Pressnall – 2016-09-16T19:18:08.987

You are incorrect. You also suggested in your answer that he make a backup drive and then a backup of the backup drive. Essentially what a mirrored array does. And when I say or hear backups, it doesn't mean copies, it means full, differential and incremental backups. And he speaks of files important to him, it's not an automated corporate setup (which I have set up many times). – Dorian – 2016-09-18T03:13:51.380

To protect from accidental deletion. You are correct in saying that raid is no use, for this, but to say that back up is the solution is also wrong. The best solution, and only solution that works (no ops I deleted it before it was backed up, or ops I only noticed that it was deleted after the backups were rotated, …), is revision control. All 3 provide a different thing. Raid for availability, backup for disaster recovery, revision control for human error recovery. – ctrl-alt-delor – 2017-04-28T18:22:11.350

3Agreed. If the data is valuable, you don't want RAID, you want backups.

RAID for (high) availability, backups for safety. – None – 2012-05-21T02:28:20.737

5

If you just want to use a bunch of disks with some form of redundancy as a single volume, you could use greyhole - which seems perfect for your useage case - it supports redundancy and lets you add and remove volumes at will.

ZFS or btrfs might also be options with raid style volume management options but neither is as simple as greyhole

Journeyman Geek

Posted 2012-05-20T22:52:40.357

Reputation: 119 122

3ah greyhole. possibly the worst named good project ever :-) – Sirex – 2012-05-21T20:19:54.647

3

I've never come across any solutions for doing this with hardware RAID, although I'm pretty certain it could be done with Software RAID as a USB HDD in Linux is treated the same as any other mounted storage device (In fact the link in the OP proves this).

The bigger issue you will run into is bandwidth, USB ports are notoriously slow and high latency when compared to internal connectors such as SATA and SAS. This will be compounded if you end up using a USB hub as suggested in the linked article. The best advice I can give here is; use USB 3.0/eSATA/Firewire if at all possible, as all of these are at-least on the same order of magnitude as SATA/SAS. If this isn't possible, try to spread the drives out amongst the different USB hubs on your PC/Laptop to alleviate any issues of shared bandwidth (on lower end chipsets, USB bandwidth tends to be shared between ports).

However, ultimately I feel like this is more of an academic exercise, the best case performance will still be poor and I personally fail to see any use cases for this that couldn't be solved using a backup solution or internal (hardware?) RAID.

Turix

Posted 2012-05-20T22:52:40.357

Reputation: 691

I'm considering software RAID over USB just to get a system running before a proper motherboard is bought. – Pavel Šimerda – 2014-09-15T08:47:47.550

2

You can do this. I've seen it done with up to 8 drives on usb 2.0. The performance is really rubbish, but with md it's perfectly doable.

It's mostly the performance issue that'll make you want to go internal.

Sirex

Posted 2012-05-20T22:52:40.357

Reputation: 10 321