Set up Pop_OS version 20.04 on a RAID configuration.
Set up Pop_OS version 20.04 on a RAID configuration.
Before we get into this, I just want to point credit where credit is due, so first off, I would like to thank Wendell from Level1Techs , without his Guide and Video , I wouldn't have even know this was possible, and I would have just spend over $600 CAD on new NVMe's for no reason if I wasn't able to get this working. (I guess it pays to do your research before buying hardware) Next I would like to thank the people on /r/linuxquestions and /r/pop_os who were helping me out though this entire process start to finish. We can't forget about our very own @ jdfthetech who also just happened to be up all night and was able to give me some tips that got me back on track. And Finally, I want to thank everyone who contributes to the ArchWiki , without that place, I would have been absolutely lost and would have switched back to Windows Now, onto the Guide. First, you want to make a Pop_OS! 20.04 USB Installer Intel/AMD NVIDIA Once that's done, we want to configure your BIOS for a Linux install, if you haven't already. Change OS option if you have it to "other OS" Make sure SATA Mode is AHCI (it will not work otherwise) Disable Fastboot Save and Restart Boot to your POP_OS! 20.04 USB If you don't want to follow along with this guide, I made a tutorial video HERE (video is not finished yet, this is just a place holder) Once booted in the Pop_OS! USB Setup language, keyboard, and do not continue any further once it asks how to install. open terminal and let's elevate as root sudo -i Now check your devices to see which drives you're using. lsblk Write down the device names that you want for your RAID (you will need these a lot) sudo gdisk /dev/DEVICE_NAME First Drive You want this one to be your EFI partition and your for the RAID capacity So for the EFI partition, enter as followed as it asks n enter enter 1024M ef00 Next create the EXT4 Partition that will be used for the RAID n enter enter enter 8300 Write the changes w y Check for EFI Partition lsblk Format the EFI you just created from FAT16 to FAT32 mkfs.fat /dev/YOUR_DEVICE_PARTITION Continue partitioning every other drive as follows sudo gdisk /dev/EVERY_OTHER_DEVICE Make the Boot Partition on every drive n enter enter 1024M 8300 Make the rest of the drive capacity the EXT4 partition for your RAID n enter enter enter 8300 Write the changes w y Continue until all drives you want in your RAID are partitioned. Now we can make the RAID (0/1/5/6/10) X = RAID level Y = Number of drives total for the RAID mdadm --create /dev/md0 --verbose --level=X --raid-devices=Y /dev/YOUR_DEVICE_1_EXT4_PARTITION_2 /dev/YOUR_DEVICE_2_EXT4_PARTITION_2 Make note that you are adding the SECOND PARTITION of each drive for the RAID, not the devices itself, make sure to add the partition at the end and then continue adding to the end of that command for total number of every drive you're using in your RAID Check RAID status with cat /proc/mdstat If you selected anything other than RAID0, it will take awhile to build the volume. Keep checking with "cat /proc/mdstat" until it's done Once Completed, we can now create the partitions needed on the RAID sudo gdisk /dev/md0 We want to make a swap partition as our first partition on the new RAID volume, now keep in mind these don't need to be exact, but it's in good practice to stay with the rule of thumb for capacity needed to how much RAM you have I'm going to start this list off at 8GB of RAM, because if you have less than 8GB, you should probably be upgrading your RAM and not making a RAID boot setup lol First Number is how much RAM you HAVE, Second number is how much CAPACITY that the SWAP should be 8GB - 3GB 12GB - 3GB 16GB - 4GB 24GB - 5GB 32GB - 6GB 64GB - 8GB 128GB - 11GB For me, I have 32GB of RAM, 1GB is 1024MB, I need a 6GB SWAP, 1024 x 6, is 6144MB, so I'm going to be entering 6144MB, change your value to meet your specs n enter enter 6144M 8200 Now partition the rest of the RAID n enter enter enter 8300 Write the changes w y Now we can finally move to Pop_OS Installer and configure the partitions. Select Custom Install Select the EFI partition on FIRST drive by device number, they don't always appear in order Select /boot/efi Make sure the format is fat32 Select the BOOT partition that you made on the SECOND drive by device number, it's not always the second drive in the list) (sometimes won't be listed in order, check device number) Select Custom input into the box /boot Make sure the format is set to EXT4 Select the SMALL partition on the RAID array Select SWAP Select the LARGE partition on the RAID Array Select / (for Root) Make sure the format is EXT4 You may be able to use other formats, I have not tried and can not guarantee if it will work using this process. Now you can finally select the orange button at the bottom right and Install Pop_OS! (sometimes it will fail at the end, just ignore this) Once completed (or failed), go back into terminal and we need to mount the RAID sudo mount /dev/md0 /mnt Mount the Boot Partition sudo mount /dev/YOUR_SECOND_DEVICE_BOOT_PARTITION /boot Mount the EFI partition sudo mount /dev/YOUR_FIRST_DEVICE_EFI_PARTITION /boot/efi Now we can install mdadm on the RAID (may already be installed, but try anyway) cd /mnt sudo mount --bind /dev dev sudo mount --bind /proc proc sudo mount --bind /sys sys sudo chroot . apt install mdadm Now check mdadm configuration to make sure the RAID UUID is there /cat /etc/mdadm/mdadm.conf If it is not there, check the UUID manually mdadm --detail /dev/md0 Copy the UUID and now we can edit the mdadm.conf nano /etc/mdadm/mdadm.conf Under where it says "# definitions of existing MD arrays" Type in and paste your UUID ARRAY /dev/md/0 metadata=1.2 UUID=YOUR_RAID_UUID name=pop-os:0 CTRL X to Save Y Enter Now we need to update your changes update-initramfs -u Make sure it scans the changes mdadm --detail --scan >>/etc/mdadm/mdadm Tell the system it needs to boot the RAID (change the X to the level of RAID you are using) echo raidX >> /etc/modules Now just make sure the /boot and /boot/efi partitions are still mounted, mine unmounted at this point for some reason lsblk if you do not see anything that says /boot or /boot/efi, you need to remount them. Remount the Boot Partition sudo mount /dev/YOUR_SECOND_DEVICE_BOOT_PARTITION /boot Remount the EFI partition sudo mount /dev/YOUR_FIRST_DEVICE_EFI_PARTITION /boot/efi With /boot and /boot/efi remounted, we can finish it off lsinitramfs /boot/initrd.img |grep mdadm You need internet for this last step, so connect Wifi if you're not using Ethernet, and you should try to install grub2 in case it failed to install during the Pop_OS! Install. So the last step here is to install grub, and then update grub, even if it shows issues, it should be fine as the other files will be there from the Pop_OS! Installer apt install grub2-common -y (you may get an error, ignore this) update-grub2 Exit chroot by typing in exit Exit root by typing in exit Now reboot the computer poweroff --reboot Everything should go fine and you should now be booting into a clean install of Pop_OS! 20.04 on your new RAID Array operating just like a normal install. From this point on, you just need to remember to never touch the drives separately, if you ever have to enter commands and it's telling you to direct toward your boot drive, this will always be /dev/md0 (or whatever you called your RAID array), never use the devicenames we were using earlier to create the raid, if anything on those changes, it could corrupt the entire RAID resulting in full data loss. I hope this helps anyone who wants to setup RAID0 for a blazing fast boot drive to get the most FPS possible, or a safe and secure RAID1 for those with your mission critical files, or even a RAID5/6/10 for those who wanted a little of both. I started learning mdadm straight out of windows with very little Linux Knowledge at 6pm April 24th, it's now 6am April 26th. It has been 36 hours straight, and I slept at my desk for 4 hours, no one has any excuse for not being able to learn something. It's time I get some much needed sleep.