dual disk mdadm Ubuntu 10.04 LTS

GeX

GeX

Soldato
Joined
17 Dec 2002
Posts
6,869
Location
Manchester
Hi all. I'm restructuring my NAS. It's an HP N36L. Currently has a pair of 1TB Spinpoints in there, and they're getting on a bit so want to setup something more resilient before they start expiring.

It runs Ubuntu server 10.04 LTS. The OS has it's own drive, and the two 1TB drives are just data stores. My original intention was to replace the F1s with 3TB WD Reds and run them mirrored. This prompted me to look into software RAID solutions for Ubuntu (the onboard RAID on the N36L isn't much to write home about).

I found mdadm and have seen that it can create a RAID 5 array using only two disks. This appeals to me as it gives me the option of adding disks to the array at a later date; without having to convert from 1 to 5 (and find interim storage whilst doing so).

Does anyone use mdadm like this. Is it hassle? Is there any risk to my data. What would you do?
 
Soldato
Joined
10 Oct 2005
Posts
8,706
Location
Nottingham
I've used mdadm with pairs of mirrored disks and RAID5 arrays of 4 or 5 disks and that's worked fine but from a proper RAID 5 array you normally need 3 disks as a minimum. I would be concerned whether my data was being properly protected personally or if it was actually creating a degraded 3 disk RAID 5 array which would be knackered if a drive failed.
 
Soldato
Joined
2 Nov 2007
Posts
4,184
I gather from a Google that with two disks it will use one entirely for parity, and since you can later grow the array this isn't actually a bad idea as a way to start off if you can't afford all the drives yet.
No disadvantages unique to this approach. Just the usual cautions about RAID and software RAID in particular, especially growing it.
 

GeX

GeX

Soldato
OP
Joined
17 Dec 2002
Posts
6,869
Location
Manchester
That's the main reason I want to start the array like this. Can't afford to buy 3 drives, but want the option to grow it if required. What would those usual cautions be?
 
Soldato
Joined
2 Nov 2007
Posts
4,184
That's the main reason I want to start the array like this. Can't afford to buy 3 drives, but want the option to grow it if required. What would those usual cautions be?

RAID != backup, it's just a way of keeping your hardware running. There are lots of ways that you the array or files can become corrupted, with software RAID a power loss can bugger everything up, when you come to grow your array it will be at risk that whole time - there are lots of things to consider.

Actually, I would recommend that you forget about mdadm and look into using ZFS and RAID-Z. It has a lot of features for resilience against faults and corruption. I believe it's supported by, or possible to use in, loads of distros these days, been a few years since I last built a big NAS. I actually ditched hardware RAID 6 cards in favour of it.

Still not proof against user error of course, but at least your filesystem isn't going to mss up without you knowing.
 
Associate
Joined
17 Aug 2011
Posts
2
I know it's a bit late, but you don't actually need to start your MD array in RAID5 with a missing disk (although you can do it, by replacing the 3rd node with 'missing'). mdadm can migrate arrays from one level to the next.

Say you start with RAID1, you could even just start it with one disk by using 'missing', then add another drive, and mdadm --grow /dev/md0 --level 0 to start striping, and add another drive and mdadm --grow /dev/md0 --level 5 to add redundancy. Obviously while in RAID1 with a single disk, and RAID0, the array is vulnerable to crashing should a disk die. Adding disks to the RAID5 array is also a critical juncture where a disk loss would crash the array.

Just make sure you keep anything important regularly backed up on non-live media, as per above, RAID isn't a backup system. I have an eSATA'ed 1TB drive as a gnu tar incremental backup target in a cron job, that does me fine.
 

GeX

GeX

Soldato
OP
Joined
17 Dec 2002
Posts
6,869
Location
Manchester
Thanks for the replies guys.

I'm well aware that RAID isn't a backup; I'm not sure I even implied that anywhere in this thread, but people like to chip that in whenever RAID is mentioned it seems!

The NAS' primary purpose is to hold onto backups from other systems, ie Apple TimeMachine backups, mirrors of 'My Documents' on Windows systems etc.

What I may just do is run a pair of 3TB drives mirrored, and the old 1TB mirrored on another array (or connected to something like a pi) and rysnc to that.
 
Associate
Joined
9 Nov 2005
Posts
767
Location
places..
It won't be proper raid 5, you will need 3 disks.

And yes you are wise to backup elsewhere, perhaps think* about amazon glacier! :)
 
Last edited:
Back
Top Bottom