-
-
Save zhenglaizhang/7778a29b201e3be79bb005e0a6908abc to your computer and use it in GitHub Desktop.
Install Ubuntu on RAID 0 and UEFI/GPT system
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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/nvme0n1 | |
sgdisk -z /dev/nvme1n1 | |
sgdisk -n 1:0:+300M -t 1:ef00 -c 1:"EFI System" /dev/nvme1n1 | |
sgdisk -n 2:0:0 -t 2:fd00 -c 2:"Linux RAID" /dev/nvme1n1 | |
sgdisk /dev/nvme0n1 -R /dev/nvme1n1 -G | |
mkfs.fat -F 32 /dev/nvme0n1p1 | |
mkdir /tmp/nvme0n1p1 | |
mount /dev/nvme0n1p1 /tmp/nvme0n1p1 | |
mkdir /tmp/nvme0n1p1/EFI | |
umount /dev/nvme0n1p1 | |
mdadm --create /dev/md0 --level=0 --raid-disks=2 /dev/nvme[01]n1p2 | |
sgdisk -z /dev/md0 | |
sgdisk -N 1 -t 1:8300 -c 1:"Linux filesystem" /dev/md0 | |
ubiquity -b | |
# Once ubiquity has finished press "Continue Testing" and continue with the steps. | |
mount /dev/md0p1 /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/nvme0n1p1 /boot/efi | |
grub-install --boot-directory=/boot --bootloader-id=Ubuntu --target=x86_64-efi --efi-directory=/boot/efi --recheck | |
update-grub | |
umount /dev/nvme0n1p1 | |
dd if=/dev/nvme0n1p1 of=/dev/nvme1n1p1 | |
efibootmgr -c -g -d /dev/nvme1n1 -p 1 -L "Ubuntu #2" -l '\EFI\Ubuntu\grubx64.efi' | |
exit # from chroot | |
exit # from sudo -s | |
reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you too for this fork. It works great.
However, lines 9-11 are misspelled a little:
either lines 9-10 should refer to
nvme0n1
, so it's a "source" in line 11,or line 11 should reverse
nvme0n1
andnvme1n1
, so the last is a "source".