How to create Raid 1 in Ubuntu 24.04 server setup

During the installation process, when arriving at the disk setup, select Custom storage layout

Both disks should show, and directly under each disk you should see free space. Click on each device (not on free space), and add as boot device. Do this for both disks.
Click on the free space and add a GPT partition. For format, be sure to select Leave unformatted. Do this for both disks.
Click on Create software raid (md). Leave raid level as 1 (mirrored), and select both partitions. Click on Create.
Click on the newly created md0, and click format. Select ext4, and leave the mount point as /. Click on Done.
Finally, click on Done at the bottom of the screen and then click on Continue. This completes a Raid 1 setup on Ubuntu Server 24.04.