RAID setups. Hardware or software?

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
IndyDev
Level 1
Level 1
Posts: 21
Joined: Wed Jan 09, 2019 4:30 pm

RAID setups. Hardware or software?

Post by IndyDev »

I will admit to not knowing a whole lot about RAID, but would like to setup a RAID 1 for booting into the system. The motherboard on the system I am working with is an old ASRock 890GX Extreme4. The BIOS lists RAID setup, but there is very little information on how to use it. The manual refers to a windows installation disk. I think I can just setup a software RAID within Linux (there are videos on how to do that with Ubuntu), but would it be better if I set it up outside the OS in the BIOS (yes it still uses BIOS)? Is there a general procedure, or is it manufacturer specific, or am I delving into a setup process no longer needed?

If someone has done this, I would like to know your thoughts on the issue. Also, can the setup be done on a system already running, or is a re-install, with backup restore needed?

TL;DR: What is the best way to setup a RAID 1 boot drive system?
Last edited by LockBot on Fri Jul 14, 2023 10:00 pm, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: RAID setups. Hardware or software?

Post by rene »

I'm typing this from a 2x2 RAID0 setup on an old MBR system (sda+sdb same 120G SSDs for system and sdc+sdd same 2T HDDs for /data) at the moment using Linux mdadm software RAID alone but until recently using Intel BIOS-RAID.

The reason I switched to using software raid was the installer of the distribution I'm currently using not supporting BIOS-RAID and that is a sense in which you may want to consider also not using BIOS-RAID: the Ubuntu/Mint installer does support most forms but even it had in my case an issue with a long-ish initramfs delay that I'm now fortunately rid of.

Reason why you may want to use BIOS-RAID is interoperability with Windows (which won't see an mdadm RAID) and don't in any case let easily found nonsense as to BIOS-RAID or "Fake RAID" scare you off since there's nothing fake about it, and is once the OS boots the basically same as any other software-based RAID.

There's a bit more information for your board here: https://download.asrock.com/Manual/RAID ... nglish.pdf

You have to read through all the Windows references but the short of it seems to be that you would be able to setup the RAID through your BIOS similarly as to how this would work with Intel BIOS-RAID. It's sort of fun to experiment with -- but I won 't be promising that you'd have no issues with Ubuntu/Mint and certainly not with anything else, given this older AMD BIOS-RAID: even my far more common Intel BIOS-RAID was/is as said not without issues.

If the system will be Linux-only and you decide to just go with mdadm Linux software RAID: you need a split off /boot and it pays to construct and format the partitions manually outside of the installer; I can advise further if you decide to do this. If you want said advise please specify drives.

For me, as described:

Code: Select all

rene@p55m:~$ lsblk
NAME      MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda         8:0    0 111,8G  0 disk  
├─sda1      8:1    0     8G  0 part  /boot
└─sda2      8:2    0 103,8G  0 part  
  └─md127   9:127  0 207,5G  0 raid0 /
sdb         8:16   0 111,8G  0 disk  
├─sdb1      8:17   0     8G  0 part  [SWAP]
└─sdb2      8:18   0 103,8G  0 part  
  └─md127   9:127  0 207,5G  0 raid0 /
sdc         8:32   0   1,8T  0 disk  
└─sdc1      8:33   0   1,8T  0 part  
  └─md126   9:126  0   3,6T  0 raid0 /data
sdd         8:48   0   1,8T  0 disk  
└─sdd1      8:49   0   1,8T  0 part  
  └─md126   9:126  0   3,6T  0 raid0 /data
sde         8:64   0   1,8T  0 disk  
├─sde1      8:65   0   100M  0 part  
├─sde2      8:66   0   100G  0 part  
└─sde3      8:67   0   1,7T  0 part  
sr0        11:0    1  1024M  0 rom   
sr1        11:1    1  1024M  0 rom   
IndyDev
Level 1
Level 1
Posts: 21
Joined: Wed Jan 09, 2019 4:30 pm

Re: RAID setups. Hardware or software?

Post by IndyDev »

Thanks so much for your information and help. I'm looking for redundancy so I can remove downtime if something happens (it did recently). Having to wait for a new drive and then restoring was a little more inconvenient than I thought. I haven't used a windows system since 7?, so that isn't a concern at all. I want to make the replacement process as painless as possible.

My thinking about going through bios was that if something happens to one of the drives and the system didn't boot, I could change the boot process to a single drive in the bios, and then be on with it whilst the replacement drive is en route.

How would that work with a software raid 1? If the raid is not on boot drives, that would not be a problem, but will the system still boot if the boot disks are riad 1? My rough thought is there is probably some way to use a usb bootable drive with mdadm on it, and just adjust it, but I still need to figure that out.

Thanks for your input. It has caused me to zero in on learning more about mdadm. If you have more thoughts on this please respond.
djcaptpln880
Level 3
Level 3
Posts: 176
Joined: Sun Jun 06, 2021 7:04 am

Re: RAID setups. Hardware or software?

Post by djcaptpln880 »

I am trying to do the same here with my Thinkcentre S20 with 2 identical 128 gb SSDs

Can someone point me in the correct direction to use software RAID? I tried hardware RAID on my S20 but it doesnt seem to recognize it on linux?

TIA
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: RAID setups. Hardware or software?

Post by rene »

It would work the same with a normal mdadm software raid1 as with a BIOS raid1: being able to lose a drive from a raid1 pair is after all basically what raid1 is. The array -- as a raided together set of drives is called -- still functions, even if in degraded mode until you rebuild with a replacement drive.

Admittedly I'm not at the moment sure if its normally and/or on Ubuntu/Mint fully invisible other than as an alert somewhere (and cant easily test) but it's easy to test/train in advance: given a raid1 array say /dev/mapper/foo consisting of /dev/sda2 and /dev/sdb2 you'd say

Code: Select all

mdadm --manage --fail /dev/mapper/foo /dev/sdb2
and find out what happens, then and/or at reboot.

I would not really advise BIOS-RAID in your case. AMD BIOS-RAID is as said relatively uncommon with Intel BIOS-RAID the norm and even that is an issue with most current tools out there. I.e., as long as you invest a bit of time in getting to know mdadm it's probably going to make for easier recovery in times of trouble; more external tools available that can deal with it. And mdadm is easier to use than you think.

As a quick sketch of setup: first of all be very aware that you should basically never raid up different drives (and that this is no different for BIOS-RAID vs Linux software RAID). Timing differences will wreak havoc on your array and cause drives to drop from it. In the sense of error-recovery time on HDD you'd in fact prefer disks intended for the purpose such as WD Red. The usual advise goes as far as having same drives with even same firmware versions, and if you don't, issues are on you...

Anyways, given two same drives say sda and sdb you partition off sda1 for /boot, sdb1 of the same size for say swap, and have sda2 and sdb2 be the same-sized RAID partitions; give those MBR-type 0xda, Non-FS data. /boot you'd want at least 8G for I'd say but YMMV.

After partitioning the really only thing there is to setting up the array is

Code: Select all

mdadm --create --level=1 --metadata=1.2 --homehost=any --chunk=16K --raid-devices=2 /dev/mapper/root /dev/sda2 /dev/sdb2
in which a 16K chunksize is generally right for a system drive. For a data drive you'd use a larger chunk of say 128K.

After this you immediately have device /dev/mapper/root available to format as e.g.

Code: Select all

mkfs -t ext4 -L root -b 4096 -E stride=4,stripe-width=8 /dev/mapper/root
The stride and stripe-width parameters are not essential but optimize things; with a (normal) 4096-byte ext4 blocksize: stride=chunksize/blocksize=16K/4K=4 and stripe-width=(stride * number-of-data-discs)=4*2=8. See https://wiki.archlinux.org/title/RAID

If you'd do this manually and on a current system you'd then say

Code: Select all

mdadm --detail --scan >>/etc/mdadm.conf
to output your current raid setup to the mdadm configuration but if you do this right before install from the Mint Live/Installer system I'll assume it'll be automatically configured on the new install. You'd of course then in the installer elect to put your root on /dev/mapper/root and would not format it again, put /boot on /dev/sda1, swap on /dev/sdb2, boot-loader simply on sda.

Hope that is useful, maybe also for djcaptpln880. It's easier than it seems.
Last edited by rene on Mon Jan 16, 2023 2:53 am, edited 2 times in total.
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: RAID setups. Hardware or software?

Post by rene »

By the way, now that he/she also uses "hardware RAID" in the seemingly wrong sense...

Please note that by "hardware RAID" is meant RAID through a dedicated RAID-controller card, i.e., where all the RAID-ing happens on that controller and where the arrays are presented to the OS as simple drives, without that OS having any idea about an underlying RAID setup. BIOS-RAID is not hardware RAID but software RAID, just with the setup happening through your BIOS and it as such knowing about that setup and being able to boot from it. Once booted, both in the case of Windows and Linux, the OS takes on all actual RAIDing.

Linux' own software RAID is configured via mdadm and for dealing with BIOS-RAID you use or used dmraid. I believe mdadm can these days also handle some types of BIOS-RAID itself but it's at the very least inconsistent how/where -- and dmraid is by and large obsolete. It's why BIOS-RAID is not a very good idea, at least not for older types of BIOS-RAID and doubly not for a relatively rare older type such as from AMD. I.e., if it works it works -- but if it breaks you get to keep both pieces...
IndyDev
Level 1
Level 1
Posts: 21
Joined: Wed Jan 09, 2019 4:30 pm

Re: RAID setups. Hardware or software?

Post by IndyDev »

Thanks for this information. I am seeing that mdadm is pretty intuitive. I will just go with this method. Your outline, along with directions I see online make this doable.
djcaptpln880
Level 3
Level 3
Posts: 176
Joined: Sun Jun 06, 2021 7:04 am

Re: RAID setups. Hardware or software?

Post by djcaptpln880 »

Does anyone think they can assist me with setting up my lenovo S20 rig with MDADM?
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: RAID setups. Hardware or software?

Post by rene »

djcaptpln880 wrote: Sun Jan 15, 2023 6:54 pm Does anyone think they can assist me with setting up my lenovo S20 rig with MDADM?
I'd have to say that I'd only in fact try this with the new Ubuntu/Mint installer if it turns out it that it's needed (since I'd need to find the time) but if the installer does not unhelpfully not enable MD support in the initramfs of the newly installed system or some such the above should really be all there is to it (for RAID1; use --level=0 for RAID0 if that's what you aim for).

I.e., you'd partition, mdadm --create and mkfs from the Live/Installer system before starting the install, then just through the Something Else choice place /boot on the for it spilt-off partition (sda1 in my example; and in case of UEFI you need to also split off the ESP), swap on sdb1, root on /dev/mapper/root as mentioned. If that doesn't work I'd need to look in detail -- but if the issue just is that the above is felt too complicated you may not want to go with an advanced setup with RAID in the first place.
rene
Level 20
Level 20
Posts: 12212
Joined: Sun Mar 27, 2016 6:58 pm

Re: RAID setups. Hardware or software?

Post by rene »

Note; I've typed up a HOWTO for Mint 21 at viewtopic.php?f=42&t=391037
Locked

Return to “Installation & Boot”