Installing OS on a RAID system

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

pettinz

Member
May 1, 2018
42
0
6
26
Hi,
I thought to install Debian OS on a RAID 1 system. Now I read that I can install the OS making the RAID directly on the motherboard (hardware RAID I think) or during the installing process (software RAID I think), but I have a few questions...

1) What happen if a disk will fail? I think that I can’t boot more so how can I change the failed drive and rebuild it?
2) Is better to build the RAID directly on the motherboard or during the OS installing process?
Soon I will change my motherboard to a new one. So
3) Can I reuse the same RAID array on the new motherboard if I set up it on the older one (hardware RAID) ?

I’m sorry if the questions can look stupid, but I don’t have clear ideas.
 

EffrafaxOfWug

Radioactive Member
Feb 12, 2015
1,394
511
113
Depends on your motherboard/SATA controller, but it's unlikely to be proper hardware RAID on most motherboards. Most SATA chipsets expose a pseudo-hardware RAID (often referred to as "fakeraid") that's actually just software RAID implemented by an OS driver (and primarily intended for windows).

Need more info to be sure, but since you're using debian you probably want to set up mdadm software RAID within the OS install process; there are more advanced things like ZFS you can use but that sounds beyond the scope of things for now. mdadm offers a great deal of flexibility and resilience and, unlike "fakeraid", doesn't tie you into using a particular SATA controller.

To answer your other points;
1) If a disc fails, mdadm will notify you (although the specifics of this depends on how your OS will be set up). I have mdadm send me an email if a disc ever goes pop.
3) Typically "fakeraid" is tied to a manufacturer so it can be a bit of a crapshoot as to whether you can take a disc/array from one system and have it work on another. mdadm softraid on the other hand just treats the disc like a bog-standard disc, so you can plug an mdadm array into any other box running linux and have it be recognised (faults notwithstanding). Anecdote time but I've got a "grandfather's axe" of an mdadm RAID array in one of my servers - it's been on three different motherboards and four different sets of SSDs over the years (not to mention metadata and filesystem upgrades).
 
  • Like
Reactions: pettinz

pettinz

Member
May 1, 2018
42
0
6
26
Depends on your motherboard/SATA controller, but it's unlikely to be proper hardware RAID on most motherboards. Most SATA chipsets expose a pseudo-hardware RAID (often referred to as "fakeraid") that's actually just software RAID implemented by an OS driver (and primarily intended for windows).

Need more info to be sure, but since you're using debian you probably want to set up mdadm software RAID within the OS install process; there are more advanced things like ZFS you can use but that sounds beyond the scope of things for now. mdadm offers a great deal of flexibility and resilience and, unlike "fakeraid", doesn't tie you into using a particular SATA controller.

To answer your other points;
1) If a disc fails, mdadm will notify you (although the specifics of this depends on how your OS will be set up). I have mdadm send me an email if a disc ever goes pop.
3) Typically "fakeraid" is tied to a manufacturer so it can be a bit of a crapshoot as to whether you can take a disc/array from one system and have it work on another. mdadm softraid on the other hand just treats the disc like a bog-standard disc, so you can plug an mdadm array into any other box running linux and have it be recognised (faults notwithstanding). Anecdote time but I've got a "grandfather's axe" of an mdadm RAID array in one of my servers - it's been on three different motherboards and four different sets of SSDs over the years (not to mention metadata and filesystem upgrades).
Thank you for your exhaustive answer. If I have the OS setted up on a RAID 1 (of 2 SSD) that I created during the OS installation, I will able to boot the OS also if a SSD is broken?
 

EffrafaxOfWug

Radioactive Member
Feb 12, 2015
1,394
511
113
Thank you for your exhaustive answer. If I have the OS setted up on a RAID 1 (of 2 SSD) that I created during the OS installation, I will able to boot the OS also if a SSD is broken?
That can be a very big "it depends", depending on how you boot, thanks to UEFI being a not-very-well-thought-out protocol and not supporting booting from arbitrary devices.

If you do regular BIOS/CSM boot, you can boot off an mdadm RAID1 array without any problem.

UEFI boot however typically requires a FAT32 formatted DOS partition in order to boot, and mdadm doesn't present itself as such (unless you get a bit hacky), so you'll not be able to boot directly from an mdadm RAID1 under most circumstances. I've got a 512MB RAID1 array mounted at /boot and then two non-RAIDed FAT32 partitions that mount at /boot/efi (the one that's actually used for UEFI boot) and /boot/efi2. The files in /boot/efi don't change very often, but when they do you can just copy them to /boot/efi2.

The UEFI BIOS is clever enough to spot that an EFI boot partition exists on both of the specified boot drives so even if one is removed, it should be able to automatically boot from the other one.
 
  • Like
Reactions: Evan and pettinz

pettinz

Member
May 1, 2018
42
0
6
26
Talking about UEFI, what do you suggest? As I said, soon I will change my motherboard and CPU. If I install the OS in UEFI mode, what will happen if I change the motherboard?
 
Last edited:

EffrafaxOfWug

Radioactive Member
Feb 12, 2015
1,394
511
113
Same as with changing the motherboard if it's installed in BIOS/CSM mode - it's an industry standard, so any board capable of booting UEFI should be able to boot the same discs/array transplanted from another device.
 

darklight

New Member
Oct 20, 2015
16
5
3
41
I would simply install OS on an SD card or USB drive and use the main RAID for the applications or data. It is the main common scenario.
 

pettinz

Member
May 1, 2018
42
0
6
26
No I can’t I need more space for software and data and I need redundancy for this data
 

i386

Well-Known Member
Mar 18, 2016
4,241
1,546
113
34
Germany
Hi,
I thought to install Debian OS on a RAID 1 system. Now I read that I can install the OS making the RAID directly on the motherboard (hardware RAID I think) or during the installing process (software RAID I think), but I have a few questions...

1) What happen if a disk will fail? I think that I can’t boot more so how can I change the failed drive and rebuild it?
2) Is better to build the RAID directly on the motherboard or during the OS installing process?
Soon I will change my motherboard to a new one. So
3) Can I reuse the same RAID array on the new motherboard if I set up it on the older one (hardware RAID) ?

I’m sorry if the questions can look stupid, but I don’t have clear ideas.
1) With hardware raid you can boot without problems, your os doesn't know about the failed disk, but the controller knows and the alarm signal can be heard.
2.) With hardware raid you need to create before installing the os. After creating the logical volume you can move the controller to other systems and use that volume for the os.
3.) see 2.)