Skip to content

Instantly share code, notes, and snippets.

@umpirsky
Last active April 15, 2024 00:53
Show Gist options
  • Save umpirsky/6ee1f870e759815333c8 to your computer and use it in GitHub Desktop.
Save umpirsky/6ee1f870e759815333c8 to your computer and use it in GitHub Desktop.
Install Ubuntu on RAID 0 and UEFI/GPT system
# http://askubuntu.com/questions/505446/how-to-install-ubuntu-14-04-with-raid-1-using-desktop-installer
# http://askubuntu.com/questions/660023/how-to-install-ubuntu-14-04-64-bit-with-a-dual-boot-raid-1-partition-on-an-uefi%5D
sudo -s
apt-get -y install mdadm
apt-get -y install grub-efi-amd64
sgdisk -z /dev/sda
sgdisk -z /dev/sdb
sgdisk -n 1:0:+100M -t 1:ef00 -c 1:"EFI System" /dev/sda
sgdisk -n 2:0:+8G -t 2:fd00 -c 2:"Linux RAID" /dev/sda
sgdisk -n 3:0:0 -t 3:fd00 -c 3:"Linux RAID" /dev/sda
sgdisk /dev/sda -R /dev/sdb -G
mkfs.fat -F 32 /dev/sda1
mkdir /tmp/sda1
mount /dev/sda1 /tmp/sda1
mkdir /tmp/sda1/EFI
umount /dev/sda1
mdadm --create /dev/md0 --level=0 --raid-disks=2 /dev/sd[ab]2
mdadm --create /dev/md1 --level=0 --raid-disks=2 /dev/sd[ab]3
sgdisk -z /dev/md0
sgdisk -z /dev/md1
sgdisk -N 1 -t 1:8200 -c 1:"Linux swap" /dev/md0
sgdisk -N 1 -t 1:8300 -c 1:"Linux filesystem" /dev/md1
ubiquity -b
mount /dev/md1p1 /mnt
mount -o bind /dev /mnt/dev
mount -o bind /dev/pts /mnt/dev/pts
mount -o bind /sys /mnt/sys
mount -o bind /proc /mnt/proc
cat /etc/resolv.conf >> /mnt/etc/resolv.conf
chroot /mnt
nano /etc/grub.d/10_linux
# change quick_boot and quiet_boot to 0
apt-get install -y grub-efi-amd64
apt-get install -y mdadm
nano /etc/mdadm/mdadm.conf
# remove metadata and name
update-grub
mount /dev/sda1 /boot/efi
grub-install --boot-directory=/boot --bootloader-id=Ubuntu --target=x86_64-efi --efi-directory=/boot/efi --recheck
update-grub
umount /dev/sda1
dd if=/dev/sda1 of=/dev/sdb1
efibootmgr -c -g -d /dev/sdb -p 1 -L "Ubuntu #2" -l '\EFI\Ubuntu\grubx64.efi'
exit # from chroot
exit # from sudo -s
reboot
@sparks79
Copy link

sparks79 commented Nov 6, 2022

I've been looking for how to install raid on linux for a few years now ( with the o/s as part of the bootable array ).
I tested ubuntu about vers 18 or there abouts and with the Server Vers it's possible to do it, and you can install the desktop later to get a more user friendley system.
I've also used fedora 36 and it is by far the easiest version to set up raid with ( so far from my observations ).
It's a pitty one can't swap ubuntu into fedora to get their easy raid setup.
The way that ( umpirsky ) has done it looks interesting.
And I'm sure he's put a lot of time into it ( Congrats ).
But it's a very long set of procedure ( 59 to be precise ).
And am I right in guessing that each of the 59 have to be entered Line by Line.
That's a Long Process.
I would be happy to use fedora because of it's easy raid setup.
But I'm not very conversant with linux and I just find fedora to hard use.
I am an avid windows user as for the last 27 years.
And at the age of 74 I really need a linux system in raid0 that is similar to windows.
Or at least a bit easier to use.
Has anyone got any sugestions.

@JorgeBasaure
Copy link

Me gustaría que explicaras con detalle esos comandos. Esto es por que requiero lo siguiente:

  • Instalar Ubuntu en su versión mas reciente, en los 4 SSD x 240Gb, En RAID 0, SIN SWAP. Debido, a que no tiene sentido meter SWAP en los SSD (Mi tarjeta madre lleva Intel Rapid Storage para dejar listo el Raid 0 desde la BIOS (MSI Z97 MPOWER), Y el Ubuntu no desencadena el aviso de que no se puede instalar con IRST)
  • Dejar configurado los 4 HDD x 2Tb en RAID 0, Para almacenamiento

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment