[RndTbl] setting up RAID 1 with mdadm

Gilles Detillieux grdetil at scrc.umanitoba.ca
Thu Oct 4 10:13:58 CDT 2018


Thanks, bro! I've already started copying data onto the RAID array, so I 
don't think the lack of partitions is a big enough issue to warrant 
rebuilding. I intend to document my steps anyway to preserve my future 
sanity. :-)

Good to know I was on the right track in using mdadm rather than LVM, 
and I'll keep it in mind that I can use LVM over MD in the future. In 
this case we only wanted one big (redundant) filesystem anyway.

I'm actually setting this up remotely through a VPN on a system in 
Miami, so I preferred to stick with CLI tools as much as possible. I had 
thought of setting up a single partition on each disk using parted, as 
some tips online suggested that, but I figured why bother if the 
DigitalOcean tutorial didn't mention the need to do that. I probably 
will add in that step the next time I set up a similar array. I hadn't 
heard of gdisk before, so I'll check that out.

On 10/04/2018 09:42 AM, Gilbert E. Detillieux wrote:
> I think the tutorial is complete enough.  The only thing I'd do 
> differently is create appropriate partition tables on the raw disks 
> (GPT if the disks are >2TB or if you need to use GPT for other 
> reasons, but the older MS-DOS partition tables would be fine 
> otherwise), set up one partition on each drive and tag them with the 
> applicable partition type to indicate they're MD RAID partitions, and 
> use the device names for the partitions rather than the raw drives in 
> the mdadm commands.  While this isn't necessary, I think it would help 
> in post-mortem recovery, and in keeping your sanity when you're (or 
> someone else is) trying to figure out what you did a few years later.
>
> LVM has some nice features to offer, e.g. if you anticipate wanting to 
> add more capacity to this file system in the future, or you want to 
> split a large array into multiple file systems.  But for simple use 
> cases, I wouldn't bother.  If you do use LVM, don't use its RAID 
> features; use LVM over top of MD.
>
> If you go with GPT partition format, and don't want to deal with the 
> arcane syntax of parted commands, there are alternatives: gparted for 
> the full-GUI, Partition-Magic-like experience, or gdisk for a simple 
> fdisk-like, retro, text-menu-based interface.
>
> Gilbert
>
> On 04/10/2018 8:33 AM, Gilles Detillieux wrote:
>> Circumstances finally forced me to bite the bullet and learn 
>> something I had been putting off for too long: setting up a RAID 
>> array under Linux. I'm almost embarrassed, now that I've done it, 
>> that I waited so long because it was way simpler than I'd imagined. I 
>> thought I'd have to figure out all kinds of magic with LVM, parted, 
>> and mdadm, but I found this tutorial that showed a simple set of 
>> mdadm commands to set up RAID 1:
>>
>> https://www.digitalocean.com/community/tutorials/how-to-create-raid-arrays-with-mdadm-on-ubuntu-16-04 
>>
>>
>> This was actually one of the simplest scenarios: the system had an 
>> SSD for the root/boot partition, and two 2 TB hard drives for data 
>> storage (/dev/sdb & sdc), so I just needed to set up RAID 1 and not 
>> worry about the intricacies of booting from RAID. So, software RAID 
>> seemed like the quick & easy way to go with a minimum of fuss.
>>
>> Now the nagging question: is it really this simple, or does the 
>> tutorial above oversimplify and omit some important steps? Can 
>> someone with ample RAID and mdadm experience advise or provide tips 
>> on anything else I should do or lookout for?
>>
>> Thanks,
>> Gilles
>

-- 
Gilles R. Detillieux              E-mail: <grdetil at scrc.umanitoba.ca>
Spinal Cord Research Centre       WWW:    http://www.scrc.umanitoba.ca/
Dept. of Physiology and Pathophysiology, Rady Faculty of Health Sciences,
Univ. of Manitoba  Winnipeg, MB  R3E 0J9  (Canada)



More information about the Roundtable mailing list