How I installed Arch Linux onto my Hackintosh-2014 PC.

1. Format my disks.

512M EFI partition on my 1st SSD, then equal size on each SSD for RAID-0, and the rest is for swap (doesn’t have to be equal). I used cfdisk for that. Formatted my disks as ext4.

2. Create RAID-0 Array:

mdadm --create --verbose /dev/md0 --level=0 --raid-devices=3 /dev/sda2 /dev/sdb1 /dev/sdc1

3. Install cryptsetup:

  • don’t needed, if I booted with Arch Linux installation medium
pacman -Sy cryptsetup

4. Set Up LUKS Encryption:

cryptsetup luksFormat /dev/md0

5. Create Filesystems

  1. Format EFI System Partition (ESP):

    mkfs.fat -F32 /dev/sda1
    
  2. Format the Encrypted RAID Array:

    mkfs.ext4 /dev/mapper/cryptarray
    

6. Mount Filesystems

  1. Mount the Encrypted RAID Array:

    mount /dev/mapper/cryptarray /mnt
    
  2. Create and Mount ESP:

    mkdir /mnt/boot
    mount /dev/sda1 /mnt/boot
    

7. Install Arch Linux Base System

  1. Install Base Packages:

    pacstrap /mnt base linux linux-firmware
    
  2. Generate fstab:

    genfstab -U /mnt >> /mnt/etc/fstab
    

8. Chroot and Configure the System

  1. Chroot into the new system:

    arch-chroot /mnt
    
  2. Set Time Zone:

    ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
    hwclock --systohc
    
  3. Locale Configuration:

    echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
    locale-gen
    echo "LANG=en_US.UTF-8" > /etc/locale.conf
    
  4. Network Configuration:

    echo "myhostname" > /etc/hostname
    echo "127.0.1.1 myhostname.localdomain myhostname" >> /etc/hosts
    
  5. Set Root Password:

    passwd
    

9. Configure Initramfs for LUKS and RAID

  1. Edit /etc/mkinitcpio.conf to include block, mdadm_udev, encrypt, and filesystems hooks:

    vim /etc/mkinitcpio.conf
    

    Modify the HOOKS line:

    HOOKS="base udev autodetect modconf block mdadm_udev encrypt filesystems keyboard fsck"
    

    My current Hooks is slightly different.

  2. Rebuild initramfs:

    mkinitcpio -P
    

10. Install and Configure systemd-boot

  1. Install systemd-boot:

    bootctl install
    
  2. Create a loader configuration file:

    mkdir -p /boot/loader/
    vim /boot/loader/loader.conf
    

    Add the following lines to loader.conf:

    default arch
    timeout 1
    editor 0
    
  3. Create a boot entry:

    mkdir -p /boot/loader/entries/
    vim /boot/loader/entries/arch.conf
    

    Add the following lines to arch.conf:

    title   Arch Linux
    linux   /vmlinuz-linux
    initrd  /initramfs-linux.img
    options cryptdevice=UUID=$(blkid -s UUID -o value /dev/md0):cryptarray root=/dev/mapper/cryptarray rw
    

    The syntax is UUID=asdasd-sadasd-asd without quotes.

    Replace the UUID part with the actual UUID of /dev/md0:

    blkid /dev/md0
    

11. Reboot

  1. Exit Chroot and Unmount:

    exit
    umount -R /mnt
    reboot
    

====== Remove the USB drive and boot into your new Arch Linux installation. You should be prompted to enter your LUKS passphrase to unlock the RAID-0 array. If everything is configured correctly, systemd-boot will load Arch Linux from your encrypted RAID-0 setup.


How to chroot into my Haswelinux

Boot into a Live Environment.

Boot from your Arch Linux installation media. Press F12 during the boot process.

1. Connect to Wi-Fi

iwctl
station wlan0 scan
station wlan0 get-networks
station wlan0 connect Gorgonzola

2. Open the Encrypted RAID Array

cryptsetup open /dev/md0 cryptarray

3. Mount the Filesystems

mount /dev/mapper/cryptarray /mnt
mount /dev/sda1 /mnt/boot
arch-chroot /mnt