Skip to content

Instantly share code, notes, and snippets.

@mikilian
Last active July 23, 2020 13:01
Show Gist options
  • Select an option

  • Save mikilian/57c1b13c0ff2ef9c177a47ed8037fac3 to your computer and use it in GitHub Desktop.

Select an option

Save mikilian/57c1b13c0ff2ef9c177a47ed8037fac3 to your computer and use it in GitHub Desktop.

Revisions

  1. mikilian revised this gist Jul 23, 2020. 1 changed file with 9 additions and 1 deletion.
    10 changes: 9 additions & 1 deletion arch-linux-uefi.md
    Original file line number Diff line number Diff line change
    @@ -46,7 +46,15 @@ Therefore my hard disk is `/dev/sda` and the hostname `arch-vm`.
    ::1 localhost
    127.0.1.1 arch-vm.localdomain arch-vm
    ```

    23. Install necessary packages: `pacman -S grub efibootmgr linux-headers linux-lts linux-lts-headers networkmanager`
    24. Enable the network manager, otherwise your internet connection won't work: `systemctl enable NetworkManager`
    25. Update the root password: `passwd`
    26. Create the directory efi directory for the bootloader: `mkdir -p /boot/efi`
    27. Mount the efi partition: `mount /dev/sda1 /boot/efi`
    28. Install grub: `grub-install --target=x86_64-efi --bootloader-id=GRUB --efi-directory=/boot/efi --recheck`
    29. Generate the configuration for grub: `grub-mkconfig -o /boot/grub/grub.cfg`
    30. Exit chroot environment: `exit`
    31. Unmount everything and reboot: `unmount -a && reboot`

    ## Configure

  2. mikilian revised this gist Jul 23, 2020. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions arch-linux-uefi.md
    Original file line number Diff line number Diff line change
    @@ -42,9 +42,9 @@ Therefore my hard disk is `/dev/sda` and the hostname `arch-vm`.
    21. Set the hostname *(required for the next step)*: `echo 'arch-vm' > /etc/hostname`
    22. Add the following code into `/etc/hosts` and change `arch-vm` into **your** hostname
    ```
    127.0.0.1 localhost
    ::1 localhost
    127.0.1.1 arch-vm.localdomain arch-vm
    127.0.0.1 localhost
    ::1 localhost
    127.0.1.1 arch-vm.localdomain arch-vm
    ```


  3. mikilian revised this gist Jul 23, 2020. 1 changed file with 24 additions and 1 deletion.
    25 changes: 24 additions & 1 deletion arch-linux-uefi.md
    Original file line number Diff line number Diff line change
    @@ -23,7 +23,30 @@ Therefore my hard disk is `/dev/sda` and the hostname `arch-vm`.
    1. enter `t` followed by `1` to select the `efi` partition and enter `1` to set the `EFI System` type
    2. enter `t` followed by `2` to select the `swap` partition and enter `19` to set the `Linux swap` type
    3. enter `t` followed by `3` to select the `root` partition and enter `24` to set the `Linux root (x86-64)` type
    6. Enter `w` to write the partitions and exit `fdisk`.
    6. Enter `w` to write the partitions and exit `fdisk`
    7. Format the EFI partition as fat32: `mkfs.vfat -n EFIBOOT /dev/sda1`
    8. Format the Linux swap: `mkswap -L swap /dev/sda2`
    9. Format the root filesystem as ext4: `mkfs.ext4 -L arch /dev/sda3`
    10. Enable the Linux swap: `spwaon /dev/sda2`
    11. Mount the root partition on `/mnt`: `mount /dev/sda3 /mnt`
    12. Create the boot mount point: `mkdir -p /mnt/boot`
    13. Mount the boot partition: `mount /dev/sda1 /mnt/boot`
    14. Install base packages: `pacstrap /mnt base-devel linux linux-firmware nano vim intel-ucode`
    15. Generate a new fstab file: `genfstab -U /mnt >>/mnt/etc/fstab`
    - Optional verify the generated fstab: `cat /mnt/etc/fstab`
    16. Enter chroot environment: `arch-chroot /mnt`
    17. Update the timezone: `ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime`
    18. Generate the `/etc/adjtime` file: `hwclock --systohc`
    19. Uncomment needed locales in `/etc/locale.gen` and generate locales: `locale-gen && echo 'LANG=en_US.UTF-8' > /etc/locale.conf`
    20. Change the default keyboard layout: `echo 'KEYMAP=de-latin1' > /etc/vconsole.conf`
    21. Set the hostname *(required for the next step)*: `echo 'arch-vm' > /etc/hostname`
    22. Add the following code into `/etc/hosts` and change `arch-vm` into **your** hostname
    ```
    127.0.0.1 localhost
    ::1 localhost
    127.0.1.1 arch-vm.localdomain arch-vm
    ```


    ## Configure

  4. mikilian revised this gist Jul 23, 2020. 1 changed file with 10 additions and 10 deletions.
    20 changes: 10 additions & 10 deletions arch-linux-uefi.md
    Original file line number Diff line number Diff line change
    @@ -11,18 +11,18 @@ Therefore my hard disk is `/dev/sda` and the hostname `arch-vm`.
    1. Change the keyboard layout temporarily: `loadkeys de-latin1`
    2. Update the system clock: `timedatectl set-ntp true`
    3. Check where your disk lives: `fdisk -l`
    - For IDE controllers: `/dev/hda`, `/dev/hdb`, `/dev/hdc`
    - For SATA controllers: `/dev/sda`, `/dev/sdb`, `/dev/sdc`
    - For NVMe controllers: `/dev/nvme0`, `/dev/nvme1`
    - For IDE controllers: `/dev/hda`, `/dev/hdb`, `/dev/hdc`
    - For SATA controllers: `/dev/sda`, `/dev/sdb`, `/dev/sdc`
    - For NVMe controllers: `/dev/nvme0`, `/dev/nvme1`
    4. Create new partitions on your target drive: `fdisk /dev/sda`
    1. enter `g` to create a new GPT partition table
    2. enter `n` for a new partition and set the last vector to: `+512M` -> efi
    3. enter `n` for a new partition and set the last vector to : `+8192M` -> swap
    4. enter `n` for a new partition and leave everything blank (default) -> root
    1. enter `g` to create a new GPT partition table
    2. enter `n` for a new partition and set the last vector to: `+512M` -> efi
    3. enter `n` for a new partition and set the last vector to : `+8192M` -> swap
    4. enter `n` for a new partition and leave everything blank (default) -> root
    5. Change the partition types
    1. enter `t` followed by `1` to select the `efi` partition and enter `1` to set the `EFI System` type
    2. enter `t` followed by `2` to select the `swap` partition and enter `19` to set the `Linux swap` type
    3. enter `t` followed by `3` to select the `root` partition and enter `24` to set the `Linux root (x86-64)` type
    1. enter `t` followed by `1` to select the `efi` partition and enter `1` to set the `EFI System` type
    2. enter `t` followed by `2` to select the `swap` partition and enter `19` to set the `Linux swap` type
    3. enter `t` followed by `3` to select the `root` partition and enter `24` to set the `Linux root (x86-64)` type
    6. Enter `w` to write the partitions and exit `fdisk`.

    ## Configure
  5. mikilian revised this gist Jul 23, 2020. 1 changed file with 13 additions and 0 deletions.
    13 changes: 13 additions & 0 deletions arch-linux-uefi.md
    Original file line number Diff line number Diff line change
    @@ -5,12 +5,25 @@
    ## Preconfigure

    I am writing this guide while installing Arch in a virtual machine.
    Therefore my hard disk is `/dev/sda` and the hostname `arch-vm`.

    1. Change the keyboard layout temporarily: `loadkeys de-latin1`
    2. Update the system clock: `timedatectl set-ntp true`
    3. Check where your disk lives: `fdisk -l`
    - For IDE controllers: `/dev/hda`, `/dev/hdb`, `/dev/hdc`
    - For SATA controllers: `/dev/sda`, `/dev/sdb`, `/dev/sdc`
    - For NVMe controllers: `/dev/nvme0`, `/dev/nvme1`
    4. Create new partitions on your target drive: `fdisk /dev/sda`
    1. enter `g` to create a new GPT partition table
    2. enter `n` for a new partition and set the last vector to: `+512M` -> efi
    3. enter `n` for a new partition and set the last vector to : `+8192M` -> swap
    4. enter `n` for a new partition and leave everything blank (default) -> root
    5. Change the partition types
    1. enter `t` followed by `1` to select the `efi` partition and enter `1` to set the `EFI System` type
    2. enter `t` followed by `2` to select the `swap` partition and enter `19` to set the `Linux swap` type
    3. enter `t` followed by `3` to select the `root` partition and enter `24` to set the `Linux root (x86-64)` type
    6. Enter `w` to write the partitions and exit `fdisk`.

    ## Configure

  6. mikilian revised this gist Jul 23, 2020. 1 changed file with 15 additions and 1 deletion.
    16 changes: 15 additions & 1 deletion arch-linux-uefi.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,17 @@
    # Arch Linus UEFI setup

    > tba
    > Since I live in germany, I set my time zone and keyboard layout to it.
    > This does **not** apply to the system language!
    ## Preconfigure

    1. Change the keyboard layout temporarily: `loadkeys de-latin1`
    2. Update the system clock: `timedatectl set-ntp true`
    3. Check where your disk lives: `fdisk -l`
    - For IDE controllers: `/dev/hda`, `/dev/hdb`, `/dev/hdc`
    - For SATA controllers: `/dev/sda`, `/dev/sdb`, `/dev/sdc`
    - For NVMe controllers: `/dev/nvme0`, `/dev/nvme1`

    ## Configure

    tba
  7. mikilian created this gist Jul 23, 2020.
    3 changes: 3 additions & 0 deletions arch-linux-uefi.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    # Arch Linus UEFI setup

    > tba