#!/bin/bash
# - bof - #



<<'comment'
  See instructions below for installation.
  # -  - #
  # - Documentation - #
  https://www.oscarcp.net/blog/fixing-arch-linux
comment



# :1
# -  - #
# - Start computer with ArchIso - #
# - Ssh into that computer from another computer - #
# - Show disk block - #
lsblk -f;



# :2
# -  - #
# - Mount partitions - #
mount -o subvol=@ /dev/sda2 /mnt/
mkdir -pv /mnt/{var/log,var/cache/pacman/pkg,home,boot/efi}
mount -o subvol=@log /dev/sda2 /mnt/var/log
mount -o subvol=@home /dev/sda2 /mnt/home
mount /dev/sda1 /mnt/boot/efi;



# :3
# -  - #
# - Show disk block - #
lsblk -f;



# :3
# -  - #
# - chroot into /nt - #
cd ~/;
arch-chroot /mnt;



# :4
# -  - #
# - Install grub - #
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB --recheck;



# :5
# -  - #
# - Run mkinitcpio -P & grub-mkconfig - #
mkinitcpio -P;
grub-mkconfig -o /boot/grub/grub.cfg;



# :6
# -  - #
# - Exit & shutdown - #
exit;
shutdown now;



# :7
# -  - #
# - Remove ArchIso & restart computer  - #
<<'comment'
  This is a test.
comment


# - eof - #