How to install Ubuntu 20.04 to Linux me raid

Hi I have propebly a prety silly quastion and it should propely not be in this thread, but does the speed scale liniar to the nuber of drives I use ore is ther a point wher ading a drive does not improve the performance.

Hey Crazy person here, could you do some sort of BTRFS full disk encryption with ZSTD and TPM2 how-to?

I tried it but failed miserably.

I got to the final step and …

root@ubuntu:/# update-grub2 
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
/usr/sbin/grub-mkconfig: 269: cannot create /boot/grub/grub.cfg.new: Directory nonexistent
root@ubuntu:/#

I’m chrooted in to the / and this has the LVM inside the md0

@oO.o

Are there commands I missed in here?

1 Like

Post your lsblk -f from in the chroot

NAME                 FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT                                       
nvme1n1                                               
├─nvme1n1p1                                           
├─nvme1n1p2                                           
│ └─md0                                               
│   ├─Aorus_vg-Root                      22.1G    20% /
│   ├─Aorus_vg-Home                                   
│   └─Aorus_vg-Games                                  
└─nvme1n1p3                                           
nvme0n1                                               
├─nvme0n1p1                                           
├─nvme0n1p2                                           
│ └─md0                                               
│   ├─Aorus_vg-Root                      22.1G    20% /
│   ├─Aorus_vg-Home                                   
│   └─Aorus_vg-Games                                  
└─nvme0n1p3

Seems like your boot partition isn’t mounted, try:

sudo mount /dev/nvme1n1p1 /boot
or
sudo mount /dev/nvme0n1p1 /boot

If succesful repeat last grub install steps.

nope. Pullin ma hair out.

You said you chrooted, did you mount bind proc, sys and dev after that?
And “tree /boot” gives you list of some files?

Trying to guess where you put your /boot dir during installation.

Ya so this installation is a combonation of the mdadm installation & the LVM tutorial:

efi is on nvme0n1p1
/boot is on nvme1n1p1

Sorry I’m not gonna analyze all of your sources, to find out where you made mistake. I will just show you how to recover bootloader, because seems to me that this is your issue.

So, before you chroot to your install, first you have to mount proc sys and dev:

cd /your/broken/install
mount -t proc /proc proc/ 
mount --rbind /sys sys/ 
mount --rbind /dev dev/
chroot .

Then you have only root dir “/”.

After that you have to mount boot and efi

mount /dev/nvme1n1p1 /boot
mount /dev/nvme0n1p1 /boot/efi

then you can do

grub-install /dev/nvme0n1p1
update-grub

Then you may check efivars with efibootmgr if your installation was added and should be visible in bios.
You can also use efibootmgr to create your own custom entry in bios.

Before reboot make sure that you have entries in /etc/fstab which mount your /boot and /boot/efi.

Edit: Example fstab entry for EFI forcompletion:

PARTUUID=Xbe0450b-4ae4-4ac2-8118-4331c5e0b41c   /boot/efi   vfat        rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro    0 0

Everything worked with the grub update, no red flags.
Updated the fstab with the PARTUUID for boot and efi.

Didn’t boot. Volume Group not found.

Okay, Has anyone been able to get this working on Ubuntu?

I’ll try to setup a fresh machine with this guide, can you post your ideal part layout here for what you have in mind? I have a new video coming on doing raid z1 with those kioxia m.2 that should be killer

So my goal was to complete the LVM & LUKS tutorial you did with the mdadm component. I opted for the md raid route as i only have two slots on the mobo.

The reason for this arrangment was to learn LVM, gain speed, rolling ubuntu distro, and distro hopping. Encryption a plus but not necessary.

I’ve been trying to get it work on ubuntu but your tutorial is on arch. So there are a few things I’m probably missing because i’m not a natural with linux.

Here is the layout:
image

I was going to use the old ssd as a cache for the old rust (later data)

Thanks Wendell - greatly appreciated.

Hi, seems I had the same problem, somewhere around the chroot I got the boot partition detached from /target and got things quite messed up.

Reinstalled, checked before chrooting and now /boot was again not mounted, so I went
sudo mount /dev/… /target/boot
then chrooted, installed mdadm, rerun update_grub2–>everything ok.

System is working.
Some minor differencies in my setup:

  • I have only 2 SDD
  • Installed Ubuntu 21.10
  • I created 2 partitions in the RAID0 drive:
    - One partition with the root /
    - One encrypted partition for /home. Upon booting I am asked for the password.

Thanks for the guide, it saved me a lot of time

So, when performing these steps from a USB, where does /target go? Do you have to create it or does it get created automatically from the previous steps?

1 Like

What an amazing article! Works perfectly - Thank you so much!

@wendell On my RAID array with 8 NVMe drives it has a chunk size of 512K. I noticed you used a chunk size of 128K when you created your array. I know that chunk size depends on work load but is 128K generally more performant than 512K when using a desktop as a normal user would or is 512K fine for that?

512k is likely fine. I was using old enterprise drives

Okay, fair enough. Thank you for the response, I appreciate it.