Mdadm causes 1 of 2 nvme drives’ primary GPT table to corrupt

I am following the official arch Linux installation guide, and veering off to the RAID installation guide when instructed to setup my raid array with mdadm. I am using 2 2TB nvme drives. My motherboard comes with intel rapid storage technology, which I have used before to facilitate software raid in windows, not sure if that should be enabled for this or not.

The first step in partitioning is two wipe the drives and partition the free space with the type “Linux Raid”. After this I can run fdisk -l and see both drives listed as functional.

After this, I run # mdadm --create --verbose --level=0 --metadata=1.2 --raid-devices=2 /dev/md0 /dev/nvme0n1 /dev/nvme1n1

If I run fdisk -l again, nvme0n1 says “The primary GPT table is corrupt, but the backup appears ok.” I am able to continue with formatting the newly created array “/dev/md0” for arch install, and complete the installation, but after installing grub and rebooting, my motherboard screen says “GPT header corruption has been detected, please check SATA mode setting in BIOS Setup, or you can use Boot Sector Recovery item under Boot Configuration page to recovery GPT header”. Following this, the only bootable drive is the arch installer.

I have tried using Gdisk to repair the partition, but this does not work.

If I stop mdadm and remove the array, fdisk -l shows that “nvme0n1” no longer has a corrupt primary GPT table”

Any thoughts on how to successfully complete this installation?

disable Intel RST and enable AHCI Mode

2 Likes

Is the ahci mode part relevant for nvme drives? I don’t see an option for ahci mode for my nvme drives in the asus z690p bios

If you were wanting to dual boot Linux and Windows, there’s no way I know of to make them cooperate using software RAID. If you only want to use Linux then you should disable RST.

Those are entire devices, not partitions. mdadm is overwriting the primary GPT table which is the first 16kB of the device. You’d normally only want to give mdadm partitions.

What were the partition names?

I expect you’d want /dev/nvme0n1p2 and /dev/nvme1n1p2 (with /dev/nvme0n1p1 or /dev/nvme1n1p1 being a UEFI ESP)?

1 Like

sorry no, I missed that it was about NVMe, in case of NVME just disable RST

I have some interest in dual booting w a small windows partition, is there any way you know of in setting this up with rst/dmraid

Mixing RST and mdadm is certainly a bad idea, it may even be possible to get it to work somehow, but in the long run you certainly won’t get what you’re hoping for.
Not everything that can be done should be done…
I read somewhere that Ubuntu Desktop sees the RST volume, so it should work if both systems can handle RST

Why are you using Arch Linux? It’s not exactly your first stop down the Linux rabbithole.

This helped me get my install working. Thanks