What is the best way to set up RAID-1 on new Ubuntu install
I will be installing Xubuntu 24.04.3 on a newly built system having two 4TB Samsung M.2 SSDs which will be mirrored using RAID-1. My question is what is the better way to set up the mirror. I'll have 128GB of RAM and will be using a swapfile after installation.
Method #1: After the UEFI partition is created on both disks, create GPT
/boot, / and /home partitions on each SSD and then create three separate mirrors: md0: /boot md1: / md2: /home
Method #2: After the UEFI partition is created on both disks, mirror md0
using the rest of the free space. Then create GPT partitions directly on the mirror: md0p1: /boot md0p2: / md0p3: /home
This will be a straightforward desktop workstation, with no encryption or support for multiple OS installs. Are there advantages or possible pitfalls with either approach?
I'm also considering eliminating the boot and home partitions and just using a single root partition which feels strange after using UNIX for over 40 years. From a raid perspective does this also have advantages/pitfalls?
Thanks.
--
Jeffery Small
Quoted 25 lines · Jeffery Small
I will be installing Xubuntu 24.04.3 on a newly built system having two 4TB Samsung M.2 SSDs which will be mirrored using RAID-1. My question is what is the better way to set up the mirror. I'll have 128GB of RAM and will be using a swapfile after installation.
Method #1: After the UEFI partition is created on both disks, create GPT
/boot, / and /home partitions on each SSD and then create three separate mirrors: md0: /boot md1: / md2: /homeMethod #2: After the UEFI partition is created on both disks, mirror md0
using the rest of the free space. Then create GPT partitions directly on the mirror: md0p1: /boot md0p2: / md0p3: /home
Quoted 8 lines
This will be a straightforward desktop workstation, with no encryption or support for multiple OS installs. Are there advantages or possible pitfalls with either approach?
I'm also considering eliminating the boot and home partitions and just using a single root partition which feels strange after using UNIX for over 40 years. From a raid perspective does this also have advantages/pitfalls?
DON'T mirror /boot. Unless you use 0.9 layout. It just makes setting up the boot more complicated. If anything goes wrong, 0.9 allows you to boot with no raid support.
128GB of ram? Why bother with a swapfile? Okay, I would create two 128GB swap partitions and set them equal priority, but that's me.
And what are you doing about /var? Does it really belong in the / partition?
With a 4TB setup, especially with a workstation, combining /, /var. and /home might be a sensible option. As I say, keep /boot out of it, but a single 3.5TB partition for everything else makes a lot of sense. How likely are you to run out of disk space? Highly unlikely? Then go for it! Remember most of the advice about Unix partitioning stems from the fact that K&R or T or whoever it was created the initial partitioning scheme simply because they were running out of space on a (by today's standards) tiny disk drive. Why stick with what they were forced to do?
Cheers,
Wol
Quoted 52 lines · Wol
Quoted 25 lines · Jeffery Small
I will be installing Xubuntu 24.04.3 on a newly built system having two 4TB Samsung M.2 SSDs which will be mirrored using RAID-1. My question is what is the better way to set up the mirror. I'll have 128GB of RAM and will be using a swapfile after installation.
Method #1: After the UEFI partition is created on both disks, create GPT
/boot, / and /home partitions on each SSD and then create three separate mirrors: md0: /boot md1: / md2: /homeMethod #2: After the UEFI partition is created on both disks, mirror md0
using the rest of the free space. Then create GPT partitions directly on the mirror: md0p1: /boot md0p2: / md0p3: /homeQuoted 8 lines
This will be a straightforward desktop workstation, with no encryption or support for multiple OS installs. Are there advantages or possible pitfalls with either approach?
I'm also considering eliminating the boot and home partitions and just using a single root partition which feels strange after using UNIX for over 40 years. From a raid perspective does this also have advantages/pitfalls?
DON'T mirror /boot. Unless you use 0.9 layout. It just makes setting up the boot more complicated. If anything goes wrong, 0.9 allows you to boot with no raid support.
128GB of ram? Why bother with a swapfile? Okay, I would create two 128GB swap partitions and set them equal priority, but that's me.
And what are you doing about /var? Does it really belong in the / partition?
With a 4TB setup, especially with a workstation, combining /, /var. and /home might be a sensible option. As I say, keep /boot out of it, but a single 3.5TB partition for everything else makes a lot of sense. How likely are you to run out of disk space? Highly unlikely? Then go for it! Remember most of the advice about Unix partitioning stems from the fact that K&R or T or whoever it was created the initial partitioning scheme simply because they were running out of space on a (by today's standards) tiny disk drive. Why stick with what they were forced to do?
Quoted 2 lines
Cheers,
Wol
Wol, thanks for the reply. What is a 0.9 layout? I've never heard of that before. I'm confused about why to not mirror the boot partition. Other articles I've read on the subject suggest doing this. What is the problem?
Now maybe we are having a communication problem mixing up the initial UEFI partition (mounted at /boot/efi) which does get set up on each SSD independently and is definitely NOT mirrored, and the actual boot partition (mounted as /boot) which is where GRUB and kernel are installed. If I made one big mirrored / partition, /boot could just be included along with everything else.
As I say, I'm just trying to avoid future problem from something that I didn't anticipate from the start.
Regards,
--
Jeff
W dniu 3.09.2025 o 23:04, Jeffery Small pisze:
Quoted 29 lines
I will be installing Xubuntu 24.04.3 on a newly built system having two 4TB Samsung M.2 SSDs which will be mirrored using RAID-1. My question is what is the better way to set up the mirror. I'll have 128GB of RAM and will be using a swapfile after installation.
Method #1: After the UEFI partition is created on both disks, create GPT
/boot, / and /home partitions on each SSD and then create three separate mirrors: md0: /boot md1: / md2: /homeMethod #2: After the UEFI partition is created on both disks, mirror md0
using the rest of the free space. Then create GPT partitions directly on the mirror: md0p1: /boot md0p2: / md0p3: /homeThis will be a straightforward desktop workstation, with no encryption or support for multiple OS installs. Are there advantages or possible pitfalls with either approach?
Quoted 7 lines
I'm also considering eliminating the boot and home partitions and just using a single root partition which feels strange after using UNIX for over 40 years. From a raid perspective does this also have advantages/pitfalls?
Thanks.
--
Jeffery Small
What about:
sda1 and sdb1 for EFI no raid sda2 and sdb2 RAID-10 with -f2 option (diffrent offset that gives double speed of read and single speed of write)
md0: LVM and on top of LVM you can create partitions with XFS filesystem. XFS allows you to realtime grow partitons.
Signature · 3 lines
--- Thanks Adam Nieścierowicz
begin:vcard
fn;quoted-printable:Adam Nie=C5=9Bcierowicz
n;quoted-printable:Nie=C5=9Bcierowicz;Adam
email;internet:[email protected]
x-mozilla-html:TRUE
version:2.1
end:vcard
Am Donnerstag, dem 04.09.2025 um 09:41 +0200 schrieb Adam Niescierowicz:
Quoted 5 lines
What about:
sda1 and sdb1 for EFI no raid sda2 and sdb2 RAID-10 with -f2 option (diffrent offset that gives double speed of read and single speed of write)
md0: LVM and on top of LVM you can create partitions with XFS filesystem. XFS allows you to realtime grow partitons.
Depending on the user’s knowledge and experience, I’d vote for keeping simple setups simple:
Don’t use RAID-10 with far: it can make reshaping/growth complicated or impossible and mainly helps long sequential reads. Just go for "classic" RAID-1.
Don’t add LVM unless there’s a clear benefit (multiple volumes, snapshots, thin provisioning). Otherwise it’s just more moving parts.
Use Ext4 unless there’s a strong reason for XFS. Ext4 supports online grow; XFS cannot be shrunk.
regards, Michael
Signature · 4 lines
Michael Reinelt <[email protected]> Ringsiedlung 75 A-8111 Gratwein-Straßengel +43 676 3079941
Quoted 2 lines · Jeffery Small
Wol, thanks for the reply. What is a 0.9 layout? I've never heard of that before.
0.9 is an old layout. You'll notice that when raid details are posted it normally says "raid 1.2 format", which is the layout. All the raid 1.x formats have identical superblock format, the difference between the 1.0, 1.1 and 1.2 formats is simply the location of the superblock. And it's always somewhere at the start of the partition.
0.9 is the old-style format. And it's placed at the end of the partition. So if the raid gets trashed somehow, because the filesystem starts at the start of the partition you can mount it directly if you have to.
Quoted 4 lines
I'm confused about why to not mirror the boot partition. Other articles I've read on the subject suggest doing this. What is the problem?
I'm just thinking that if you do have boot trouble, this makes it easier to access your boot partition (which should be effectively read only almost all time), and might make recovering your system easier.
Quoted 7 lines
Now maybe we are having a communication problem mixing up the initial UEFI partition (mounted at
/boot/efi) which does get set up on each SSD independently and is definitely NOT mirrored, and the actual boot partition (mounted as /boot) which is where GRUB and kernel are installed. If I made one big mirrored / partition, /boot could just be included along with everything else.
Possibly. I've not got to grips with UEFI - I learnt most of my boot-fu back in the days of lilo :-)
Quoted 3 lines
As I say, I'm just trying to avoid future problem from something that I didn't anticipate from the start.
Cheers,
Wol
Am 05.09.25 um 00:55 schrieb Wol:
Quoted 8 lines
Quoted 7 lines
Now maybe we are having a communication problem mixing up the initial UEFI partition (mounted at
/boot/efi) which does get set up on each SSD independently and is definitely NOT mirrored, and the actual boot partition (mounted as /boot) which is where GRUB and kernel are installed. If I made one big mirrored / partition, /boot could just be included along with everything else.Possibly. I've not got to grips with UEFI - I learnt most of my boot-fu back in the days of lilo :-)
the UEFI partition must be FAT and can't be a RAID partition becaus eof the limitations of UEFI
Quoted 2 lines · Reindl Harald
the UEFI partition must be FAT and can't be a RAID partition becaus eof the limitations of UEFI
Good point.
Quoted 2 lines · Wol
0.9 is an old layout.
You could say "obsolete".
Quoted 1 line
the difference between the 1.0, 1.1 and 1.2 formats is simply the location of the superblock. And it's always somewhere at the start of the partition.
No, 1.0 superblock is at the end.
Quoted 2 lines
the UEFI partition must be FAT and can't be a RAID partition becaus eof the limitations of UEFI
3rd attempt, let's see if this one gets through.
It can, at least on RHEL and derivatives.
From my notes: mdadm --verbose --create --assume-clean /dev/md/r1_efi --name=r1_efi --level=1 --metadata=1.0 --raid-devices=7 /dev/nvme[0,2-3,5-8]n1p1
You have to select "EFI file system" for the file system in the installation and that was it.