Jump to content

[GUIDE] Install Pop_OS! 20.04 on RAID

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.

Desktop: CASE: NZXT H510 Elite CPU: Intel i9-9900K RAM: 32GB Vengeance RGB Pro GPU: 11GB EVGA FTW3 1080ti NVMe: 3x1TB  XPG Gammix S11 HDD: 1x8TB Barracuda PSU: HX1200 OS: Windows 10 Pro b19043
Laptop: CASE: Asus Zephyrus Duo CPU: Intel i7-10875H RAM: 32GB SSD: 2x Samsung 1TB NVMe RAID 0 OS: Pop_OS 20.04 LTS

Mobile: MODEL: Galaxy S21 Ultra  SSD: 128GB RAM: 12GB OS: Unlocked One UI 3.1 Android 11

Mobile: MODEL: Nubia Red Magic 5G SSD: 256GB RAM: 12GB OS: Rooted RM5S Android 11

Link to comment
Share on other sites

Link to post
Share on other sites

  • 1 year later...

Foolishly I rebooted my machine which made this error when I attempt the step to

sudo mount /dev/md0 /mnt

I noticed that the mdstat shows it as md127. So I attempted the above with md0 replaced as md127.

 

# mount /dev/md127 /mnt
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/md127, missing codepage or helper program, or other error.
# cat /proc/mdstat
Personalities : [raid0] [linear] [multipath] [raid1] [raid6] [raid5] [raid4] [raid10] 
md127 : active raid0 nvme1n1p2[1] nvme0n1p2[0]
      3998433280 blocks super 1.2 512k chunks
      
unused devices: <none>
# lsblk
NAME          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
...
nvme0n1       259:0    0   1.9T  0 disk  
├─nvme0n1p1   259:4    0  1023M  0 part  /boot/efi
└─nvme0n1p2   259:5    0   1.9T  0 part  
  └─md127       9:127  0   3.7T  0 raid0 
    ├─md127p1 259:6    0     6G  0 part  
    └─md127p2 259:7    0   3.7T  0 part  
nvme1n1       259:1    0   1.9T  0 disk  
├─nvme1n1p1   259:2    0  1023M  0 part  
└─nvme1n1p2   259:3    0   1.9T  0 part  
  └─md127       9:127  0   3.7T  0 raid0 
    ├─md127p1 259:6    0     6G  0 part  
    └─md127p2 259:7    0   3.7T  0 part  

To me this all looks like it should. Any thoughts or help?

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×